<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Apr 24, 2016 at 3:32 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">> --- lld/trunk/test/ELF/undef-version-script.s (added)<br>
> +++ lld/trunk/test/ELF/undef-version-script.s Sat Apr 23 21:31:02 2016<br>
> @@ -0,0 +1,37 @@<br>
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o<br>
> +# RUN: echo "{ local: *; };" > %t.script<br>
> +# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so<br>
> +# RUN: llvm-readobj -dyn-symbols %t.so | FileCheck %s<br>
<br>
</span>This matches the behaviour of bfd, but not gold, so it was probably<br>
not this change that fixed the check-llvm run. With gold neither foo<br>
nor bar are in the dynamic symbol table.<br></blockquote><div><br></div><div>If I append these lines to the test case:</div><div><br></div><div> .text</div><div>call foo@PLT</div><div>call bar@PLT</div><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Please add a note to the test saying that. Please also open a bug. At<br>
some point we should explicitly decide which behaviour is preferred.<br></blockquote><div><div><br></div><div>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.</div></div><div><br></div><div>Peter</div></div>
</div></div>