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

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 13:12:53 PST 2016


Peter Collingbourne <peter at pcc.me.uk> writes:

> 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.

I get it. I missed the fact that bar was also in the .so.

I will try to implement that (always export a symbol that is needed for
preepmtion, regardless of --version-script or --dynamic-list).

Cheers,
Rafael


More information about the llvm-commits mailing list