@@ -52,13 +52,6 @@ static TargetJITInfo::JITCompilerFn JITCompilerFunction;
52
52
#define GETASMPREFIX (X ) GETASMPREFIX2(X)
53
53
#define ASMPREFIX GETASMPREFIX (__USER_LABEL_PREFIX__)
54
54
55
- // Check if building with -fPIC
56
- #if defined(__PIC__) && __PIC__ && defined(__linux__)
57
- #define ASMCALLSUFFIX " @PLT"
58
- #else
59
- #define ASMCALLSUFFIX
60
- #endif
61
-
62
55
// For ELF targets, use a .size and .type directive, to let tools
63
56
// know the extent of functions defined in assembler.
64
57
#if defined(__ELF__)
@@ -131,7 +124,7 @@ extern "C" {
131
124
// JIT callee
132
125
"movq %rbp, %rdi\n" // Pass prev frame and return address
133
126
"movq 8(%rbp), %rsi\n"
134
- "call " ASMPREFIX "X86CompilationCallback2" ASMCALLSUFFIX " \n"
127
+ "call " ASMPREFIX "X86CompilationCallback2\n"
135
128
// Restore all XMM arg registers
136
129
"movaps 112(%rsp), %xmm7\n"
137
130
"movaps 96(%rsp), %xmm6\n"
@@ -207,7 +200,7 @@ extern "C" {
207
200
" movl 4(%ebp), %eax\n " // Pass prev frame and return address
208
201
" movl %eax, 4(%esp)\n "
209
202
" movl %ebp, (%esp)\n "
210
- " call " ASMPREFIX " X86CompilationCallback2" ASMCALLSUFFIX " \n "
203
+ " call " ASMPREFIX " X86CompilationCallback2\n "
211
204
" movl %ebp, %esp\n " // Restore ESP
212
205
CFI (" .cfi_def_cfa_register %esp\n " )
213
206
"subl $12, %esp\n"
@@ -263,7 +256,7 @@ extern "C" {
263
256
"movl 4(%ebp), %eax\n" // Pass prev frame and return address
264
257
"movl %eax, 4(%esp)\n"
265
258
"movl %ebp, (%esp)\n"
266
- "call " ASMPREFIX "X86CompilationCallback2" ASMCALLSUFFIX " \n"
259
+ "call " ASMPREFIX "X86CompilationCallback2\n"
267
260
"addl $16, %esp\n"
268
261
"movaps 48(%esp), %xmm3\n"
269
262
CFI(" .cfi_restore %xmm3\n " )
@@ -331,7 +324,14 @@ extern "C" {
331
324
// / function stub when we did not know the real target of a call. This function
332
325
// / must locate the start of the stub or call site and pass it into the JIT
333
326
// / compiler function.
334
- extern " C" void ATTRIBUTE_USED
327
+ extern " C" {
328
+ #if !(defined (X86_64_JIT) && defined(_MSC_VER))
329
+ // the following function is called only from this translation unit,
330
+ // unless we are under 64bit Windows with MSC, where there is
331
+ // no support for inline assembly
332
+ static
333
+ #endif
334
+ void ATTRIBUTE_USED
335
335
X86CompilationCallback2 (intptr_t *StackPtr, intptr_t RetAddr) {
336
336
intptr_t *RetAddrLoc = &StackPtr[1 ];
337
337
assert (*RetAddrLoc == RetAddr &&
@@ -403,6 +403,7 @@ X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) {
403
403
*RetAddrLoc -= 5 ;
404
404
#endif
405
405
}
406
+ }
406
407
407
408
TargetJITInfo::LazyResolverFn
408
409
X86JITInfo::getLazyResolverFunction (JITCompilerFn F) {
0 commit comments