[llvm-bugs] [Bug 39104] New: LLD links incorrect ELF executable if version script contains "local: *; "

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 27 14:23:36 PDT 2018


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

            Bug ID: 39104
           Summary: LLD links incorrect ELF executable if version script
                    contains "local: *;"
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: orivej at gmx.fr
                CC: llvm-bugs at lists.llvm.org, rafael at espindo.la,
                    ruiu at google.com

Given these files:

  x.c:

    int main() { return 0; }

  x.map:

    { local: *; };

an executable linked with:

  clang x.c -o x -fuse-ld=lld -Wl,--version-script=x.map

does not run with an error:

  ./x: symbol lookup error: ./x: undefined symbol:

and "LD_DEBUG=symbols ./x" reveals that ld is looking for a symbol with
zero-length name.

(Such linker scripts are useful when an executable needs to dlopen a shared
object without exposing symbols that are supposed to be details of
implementation.)

This was introduced in https://reviews.llvm.org/D46103. LLD before r330966 and
other linkers produce an executable that runs with code 0, therefore this is a
regression in LLD 7.

-- 
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/20180927/5b9c80c0/attachment.html>


More information about the llvm-bugs mailing list