llvm.org GIT mirror llvm / 84bda21
Merge 81132 from mainline. Do not create calls via PLT in compilation callback - this is higly platform dependent. Hopefully, this will fix PR3801. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_26@81691 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
1 changed file(s) with 12 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
5050 #define GETASMPREFIX2(X) #X
5151 #define GETASMPREFIX(X) GETASMPREFIX2(X)
5252 #define ASMPREFIX GETASMPREFIX(__USER_LABEL_PREFIX__)
53
54 // Check if building with -fPIC
55 #if defined(__PIC__) && __PIC__ && defined(__linux__)
56 #define ASMCALLSUFFIX "@PLT"
57 #else
58 #define ASMCALLSUFFIX
59 #endif
6053
6154 // For ELF targets, use a .size and .type directive, to let tools
6255 // know the extent of functions defined in assembler.
130123 // JIT callee
131124 "movq %rbp, %rdi\n" // Pass prev frame and return address
132125 "movq 8(%rbp), %rsi\n"
133 "call " ASMPREFIX "X86CompilationCallback2" ASMCALLSUFFIX "\n"
126 "call " ASMPREFIX "X86CompilationCallback2\n"
134127 // Restore all XMM arg registers
135128 "movaps 112(%rsp), %xmm7\n"
136129 "movaps 96(%rsp), %xmm6\n"
206199 "movl 4(%ebp), %eax\n" // Pass prev frame and return address
207200 "movl %eax, 4(%esp)\n"
208201 "movl %ebp, (%esp)\n"
209 "call " ASMPREFIX "X86CompilationCallback2" ASMCALLSUFFIX "\n"
202 "call " ASMPREFIX "X86CompilationCallback2\n"
210203 "movl %ebp, %esp\n" // Restore ESP
211204 CFI(".cfi_def_cfa_register %esp\n")
212205 "subl $12, %esp\n"
262255 "movl 4(%ebp), %eax\n" // Pass prev frame and return address
263256 "movl %eax, 4(%esp)\n"
264257 "movl %ebp, (%esp)\n"
265 "call " ASMPREFIX "X86CompilationCallback2" ASMCALLSUFFIX "\n"
258 "call " ASMPREFIX "X86CompilationCallback2\n"
266259 "addl $16, %esp\n"
267260 "movaps 48(%esp), %xmm3\n"
268261 CFI(".cfi_restore %xmm3\n")
330323 /// function stub when we did not know the real target of a call. This function
331324 /// must locate the start of the stub or call site and pass it into the JIT
332325 /// compiler function.
333 extern "C" void ATTRIBUTE_USED
326 extern "C" {
327 #if !(defined (X86_64_JIT) && defined(_MSC_VER))
328 // the following function is called only from this translation unit,
329 // unless we are under 64bit Windows with MSC, where there is
330 // no support for inline assembly
331 static
332 #endif
333 void ATTRIBUTE_USED
334334 X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) {
335335 intptr_t *RetAddrLoc = &StackPtr[1];
336336 assert(*RetAddrLoc == RetAddr &&
401401 #else
402402 *RetAddrLoc -= 5;
403403 #endif
404 }
404405 }
405406
406407 TargetJITInfo::LazyResolverFn