<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 8, 2016 at 12:05 PM, Rafael Avila de Espindola <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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Peter Collingbourne via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> writes:<br>
<br>
> pcc added a comment.<br>
><br>
> In gc-sections-shared.s don't we need to keep bar to maintain function pointer identity? In fact, this is what both bfd and gold do on my machine.<br>
<br>
</span>Not sure I follow. The command line is only asking for foo to be in the<br>
dynamic symbol list. We need bar2 because it is undefined, but why do we<br>
need to export bar? Should the same happen with version scripts? If not,<br>
why the difference?<br></blockquote><div><br></div><div>As I understand it, the semantics of --dynamic-list/--export-dynamic-symbol are to add symbols to the dynsym, not to replace it entirely. Without the --export-dynamic-symbol we would need to export bar so that it will preempt the definition in %t2.so.</div><div><br></div><div>I actually can't think of a good reason why version scripts should be treated differently, so maybe we should also export preempting symbols if there is a version script.</div><div><br></div><div>Thanks,</div></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div></div>