[LLVMbugs] [Bug 4275] New: Wrong code generated by JIT with --enable-pic on Linux x86

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed May 27 01:16:10 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4275

           Summary: Wrong code generated by JIT with --enable-pic on Linux
                    x86
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: Dr.Graef at t-online.de
                CC: llvmbugs at cs.uiuc.edu


If LLVM is compiled with --enable-pic (as is the default with current svn
sources), the JIT creates an improper call sequence via PLT. This only affects
Linux x86 systems, x86-64 works fine.

The symptom is a segfault in X86CompilationCallback2 at plt(), see, e.g.,
http://code.google.com/p/pure-lang/issues/detail?id=9 for a detailed bug report
related to this issue.

Remark by Anton Korobeynikov on the llvmdev mailing list:

<quote>
The problem is pretty easy: nobody cared about loading GOT pointer to
ebx before doing a call via PLT. The initial patch for this was x86-64
only (and I explicitly mentioned that it won't work on x86-32 due to
this issue). Unfortunately, it was commited as-is and later when PIC
was enabled by default this subtle bug appeared...

The proper solution will be to conditionalize for x86-32 linux and
assemble a proper call sequence via PLT.
</quote>

Anton suggested that I should file a bug report, so there.


-- 
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