[llvm-bugs] [Bug 31495] New: LLD fails to link object file with version-extended symbol

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 29 10:00:42 PST 2016


            Bug ID: 31495
           Summary: LLD fails to link object file with version-extended
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: emaste at freebsd.org
                CC: llvm-bugs at lists.llvm.org
            Blocks: 23214
    Classification: Unclassified

FreeBSD's "pkg" package management tool is currently building an object file
that depends on a compatibility symbol. I think this needs to be addressed in
pkg itself, but GNU ld is able to link such an object.

LLD reports:

% ld.lld $(cat response.txt)                                
/tank/emaste/src/llvm/build-nodebug/bin/ld.lld: error:
symbol basename at FBSD_1.0 has undefined version FBSD_1.0
/tank/emaste/src/llvm/build-nodebug/bin/ld.lld: error:
symbol dirname at FBSD_1.0 has undefined version FBSD_1.0

ld.bfd has no complaints:
% ld.bfd $(cat response.txt)

The offending symbol is basename at FBSD_1.0:

% readelf -s libbsd_compat_la-basename.o

Symbol table '.symtab' contains 5 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS basename.c
     2: 0000000000000000     0 SECTION LOCAL  DEFAULT    2 
     3: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND basename at FBSD_1.0
     4: 0000000000000000    10 FUNC    GLOBAL DEFAULT    2 bsd_basename

And indeed, a .o file has no symver information:

% readelf -V libbsd_compat_la-basename.o

No version information found in this file.

I suspect we should accept version-extended symbols from object files.
Reprodcer available at

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/20161229/70d7711f/attachment.html>

More information about the llvm-bugs mailing list