forked from OSchip/llvm-project
[ELF] Replace two addSymbol() call sites with Symbol::resolve(). NFC
If we have a handle of the symbol, insert() called by addSymbol() is redundant. Just call resolve(). llvm-svn: 361802
This commit is contained in:
parent
f57bd6bd23
commit
173a68f1fb
|
|
@ -180,9 +180,9 @@ static Defined *addOptionalRegular(StringRef Name, SectionBase *Sec,
|
|||
if (!S || S->isDefined())
|
||||
return nullptr;
|
||||
|
||||
return cast<Defined>(Symtab->addSymbol(
|
||||
Defined{/*File=*/nullptr, Name, Binding, StOther, STT_NOTYPE, Val,
|
||||
/*Size=*/0, Sec}));
|
||||
S->resolve(Defined{/*File=*/nullptr, Name, Binding, StOther, STT_NOTYPE, Val,
|
||||
/*Size=*/0, Sec});
|
||||
return cast<Defined>(S);
|
||||
}
|
||||
|
||||
static Defined *addAbsolute(StringRef Name) {
|
||||
|
|
@ -239,9 +239,8 @@ void elf::addReservedSymbols() {
|
|||
if (Config->EMachine == EM_PPC || Config->EMachine == EM_PPC64)
|
||||
GotOff = 0x8000;
|
||||
|
||||
Symtab->addSymbol(Defined{/*File=*/nullptr, GotSymName, STB_GLOBAL,
|
||||
STV_HIDDEN, STT_NOTYPE, GotOff, /*Size=*/0,
|
||||
Out::ElfHeader});
|
||||
S->resolve(Defined{/*File=*/nullptr, GotSymName, STB_GLOBAL, STV_HIDDEN,
|
||||
STT_NOTYPE, GotOff, /*Size=*/0, Out::ElfHeader});
|
||||
ElfSym::GlobalOffsetTable = cast<Defined>(S);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue