[lld] r267314 - ELF: Always include undefined DSO symbols in the symbol table.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 24 16:27:52 PDT 2016


On Sun, Apr 24, 2016 at 3:32 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> > --- lld/trunk/test/ELF/undef-version-script.s (added)
> > +++ lld/trunk/test/ELF/undef-version-script.s Sat Apr 23 21:31:02 2016
> > @@ -0,0 +1,37 @@
> > +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
> > +# RUN: echo "{ local: *; };" > %t.script
> > +# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
> > +# RUN: llvm-readobj -dyn-symbols %t.so | FileCheck %s
>
> This matches the behaviour of bfd, but not gold, so it was probably
> not this change that fixed the check-llvm run. With gold neither foo
> nor bar are in the dynamic symbol table.
>

If I append these lines to the test case:

 .text
call foo at PLT
call bar at PLT

I see the same behaviour in bfd and gold. It seems that gold will only
include the symbols if the object file contains an appropriate relocation
for them.

Please add a note to the test saying that. Please also open a bug. At
> some point we should explicitly decide which behaviour is preferred.
>

I'll add a note to the test, but do we care much about object files
containing an undefined symbol with no relocations? I wouldn't have
expected that to happen much outside of tests.

Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160424/f7b631e0/attachment.html>


More information about the llvm-commits mailing list