[PATCH] D30193: [ELF] - Scan lazy linkerscipt symbols early.

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 12:34:13 PST 2017


I can add a ReportDuplicate=true default argument to
SymbolTable::addRegular after which it's possible to use it here instead of
addUndefine+replaceBody. Would that be fine with you? Alternatively, I
could add a separate method.

On Tue, Feb 21, 2017 at 10:15 AM Rui Ueyama via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Tue, Feb 21, 2017 at 9:37 AM, Rafael Avila de Espindola <
> rafael.espindola at gmail.com> wrote:
>
> I think the real problem is at
>
> template <class ELFT> static SymbolBody *addRegular(SymbolAssignment *Cmd)
> {
>   uint8_t Visibility = Cmd->Hidden ? STV_HIDDEN : STV_DEFAULT;
>   Symbol *Sym = Symtab<ELFT>::X->addUndefined(
>       Cmd->Name, /*IsLocal=*/false, STB_GLOBAL, Visibility,
>       /*Type*/ 0,
>       /*CanOmitFromDynSym*/ false, /*File*/ nullptr);
>
>   replaceBody<DefinedRegular<ELFT>>(Sym, Cmd->Name, /*IsLocal=*/false,
>                                     Visibility, STT_NOTYPE, 0, 0, nullptr,
>                                     nullptr);
>   return Sym->body();
> }
>
> We add an undefined just to replace it, which has the side effect of
> fetching the archive member. We should probably just have it as a single
> step in Symtab.
>
>
> You can probably just use insert() instead of addUndefined().
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170221/18179f99/attachment.html>


More information about the llvm-commits mailing list