[PATCH] D33680: [ELF] - Resolve references properly when using .symver directive
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 12 13:46:29 PDT 2017
George Rimar via Phabricator <reviews at reviews.llvm.org> writes:
> - if (!Config->VersionDefinitions.empty())
> - for (Symbol *Sym : SymVector)
> - Sym->body()->parseSymbolVersion();
> + std::vector<Symbol *> DefaultV;
Why do you need the temporary vector?
> + for (Symbol *Sym : SymVector)
> + if (Sym->body()->parseSymbolVersion())
> + DefaultV.push_back(Sym);
> +
> + // <name>@@<version> means symbol has 'default' version. We should use it to
> + // resolve references to <name>.
> + for (Symbol *Sym : DefaultV) {
> + SymbolBody *Body = find(Sym->body()->getName());
> + if (!Body)
> + continue;
When is this returnig null?
> + DefinedRegular *D = cast<DefinedRegular>(Sym->body());
> + addRegular(D->getName(), D->StOther, D->Type, D->Value, D->Size,
> + Sym->Binding, D->Section, D->File);
> + }
>
> // Handle edge cases first.
> handleAnonymousVersion();
More information about the llvm-commits
mailing list