[PATCH] D33680: [ELF] - Resolve references properly when using .symver directive

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 09:40:22 PDT 2017


George Rimar via Phabricator <reviews at reviews.llvm.org> writes:

> grimar added a comment.
>
> In https://reviews.llvm.org/D33680#772682, @ruiu wrote:
>
>> I don't think we want to add a new function `resolve` for this feature. That function seems a bit too ad-hoc. You probably should resolve any symbol whose name is "foo@@bar" as "foo" from the beginning, by stripping "@@" and any characters that follows double-atsign before inserting symbols to the symbol table.
>
>
> I afraid I do not know how to implement your idea right now then. We add symbols at SymbolTable<ELFT>::insert(StringRef Name). There we are unable to assign symbol
> versions, because we do not know if this symbol undefined or not shared may be (that means it is not a definition). At this place we have only name. And still need to parse it somehow
> to assign proper version definition. This patch allows to do that in easy and clear way.

We used to parse the names there, but parsing at the current location is
better IMHO.

Instead of resolve, can you just call SymbolTable<ELFT>::addRegular? The
symbol with a default version is always a DefinedRegular, no?

Cheers,
Rafael


More information about the llvm-commits mailing list