[llvm-bugs] [Bug 33820] New: After r307364, some versioned symbols do not appear in .so files

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 17 10:46:50 PDT 2017


            Bug ID: 33820
           Summary: After r307364, some versioned symbols do not appear in
                    .so files
           Product: lld
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: dimitry at andric.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18806
  --> https://bugs.llvm.org/attachment.cgi?id=18806&action=edit
Minimized test case for symbol versioning problem

As reported on https://reviews.llvm.org/rL307364, after this change I got
errors while linking the FreeBSD base system, similar to:

ld.lld: error: undefined symbol: openat
>>> referenced by dma-mbox-create.c:175 (/home/dim/src/clang500-import/contrib/dma/dma-mbox-create.c:175)
>>>               dma-mbox-create.o:(main)

It turns out openat is a versioned symbol, which appears twice in libc.so.7:

$ readelf -sW /lib/libc.so.7 | grep -w openat
  3087: 000000000004e2e0   203 FUNC    WEAK   DEFAULT   11 openat at FBSD_1.1
  3088: 000000000004e2e0   203 FUNC    WEAK   DEFAULT   11 openat@@FBSD_1.2

When doing the link with lld, on aarch64, the openat@@FBSD_1.2 version
disappears, for some reason.

I've attached a minimized test case in a tarball.  There is a Makefile in the
extracted directory, which links with both ld.bfd and ld.ldd, and shows the
difference in output.

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/20170717/6d04cd54/attachment.html>

More information about the llvm-bugs mailing list