[PATCH] D27578: Change the implementation of --dynamic-list to use linker script parsing

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 12:27:18 PST 2016


On Thu, Dec 8, 2016 at 12:05 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Peter Collingbourne via Phabricator <reviews at reviews.llvm.org> writes:
>
> > pcc added a comment.
> >
> > 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.
>
> Not sure I follow. The command line is only asking for foo to be in the
> dynamic symbol list. We need bar2 because it is undefined, but why do we
> need to export bar? Should the same happen with version scripts? If not,
> why the difference?
>

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.

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.

Thanks,
-- 
-- 
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161208/d0da6f9d/attachment-0001.html>


More information about the llvm-commits mailing list