[LLVMbugs] [Bug 5116] New: x86-64 JIT omits stubs in some cases they're needed

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Oct 1 15:11:56 PDT 2009


           Summary: x86-64 JIT omits stubs in some cases they're needed
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jyasskin at google.com
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=3598)
 --> (http://llvm.org/bugs/attachment.cgi?id=3598)
JITTest.cpp addition to provoke the bug

The attached unit test generates the following assembly:

0x00007ffff7f45010 <test+0>:    sub    $0x8,%rsp
0x00007ffff7f45014 <test+4>:    mov    $0x7,%edi                                
0x00007ffff7f45019 <test+9>:    callq  0x800000427cd8
0x00007ffff7f4501e <test+14>:   add    $0x8,%rsp                                
0x00007ffff7f45022 <test+18>:   retq

where the intended target function is actually at address 0x427cd8. This
appears to be happening because the actual 64-bit offset gets truncated to 32
bits when it's stored into the callq instruction.  This will only happen on
x86-64 systems when JIT code is allocated into memory far away from the
pre-compiled code segment.  If lazy compilation is enabled, or the function is
looked up via dlsym instead of addGlobalMapping, the error doesn't happen.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list