[llvm-bugs] [Bug 26923] New: [lld] Support -pie

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 11 20:29:36 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26923

            Bug ID: 26923
           Summary: [lld] Support -pie
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: chisophugis at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I ran into this with LTO. In:
http://llvm.org/klaus/lld/blob/master/ELF/SymbolTable.cpp#L-125
We set the reloc model to PIC or Static depending just on Config->Shared. On
platforms requiring pie, we will incorrectly codegen the combined LTO object as
static, resulting in failures during dynamic linking.

I haven't looked at where else in the linker needs to be updated for -pie, but
at the very least LTO needs to be aware of it.

       -pie
       --pic-executable
           Create a position independent executable.  This is currently only
           supported on ELF platforms.  Position independent executables are
           similar to shared libraries in that they are relocated by the
           dynamic linker to the virtual address the OS chooses for them
           (which can vary between invocations).  Like normal dynamically
           linked executables they can be executed and symbols defined in the
           executable cannot be overridden by shared libraries.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160312/8b1a1ae3/attachment-0001.html>


More information about the llvm-bugs mailing list