mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 17:28:30 +08:00
ELF: Move Visibility, IsUsedInRegularObj and MustBeInDynSym flags to Symbol.
These are properties of a symbol name, rather than a particular instance of a symbol in an object file. We can simplify the code by collecting these properties in Symbol. The MustBeInDynSym flag has been renamed ExportDynamic, as its semantics have been changed to be the same as those of --dynamic-list and --export-dynamic-symbol, which do not cause hidden symbols to be exported. Differential Revision: http://reviews.llvm.org/D19400 llvm-svn: 267183
This commit is contained in:
@@ -977,8 +977,7 @@ void Writer<ELFT>::addCopyRelSymbol(SharedSymbol<ELFT> *SS) {
|
||||
continue;
|
||||
S.OffsetInBss = Off;
|
||||
S.NeedsCopyOrPltAddr = true;
|
||||
S.setUsedInRegularObj();
|
||||
S.MustBeInDynSym = true;
|
||||
S.Backref->IsUsedInRegularObj = true;
|
||||
}
|
||||
Out<ELFT>::RelaDyn->addReloc(
|
||||
{Target->CopyRel, Out<ELFT>::Bss, SS->OffsetInBss, false, SS, 0});
|
||||
@@ -1042,7 +1041,7 @@ template <class ELFT> void Writer<ELFT>::addRelIpltSymbols() {
|
||||
}
|
||||
|
||||
template <class ELFT> static bool includeInSymtab(const SymbolBody &B) {
|
||||
if (!B.isUsedInRegularObj())
|
||||
if (!B.Backref->IsUsedInRegularObj)
|
||||
return false;
|
||||
|
||||
if (auto *D = dyn_cast<DefinedRegular<ELFT>>(&B)) {
|
||||
@@ -1326,7 +1325,7 @@ template <class ELFT> void Writer<ELFT>::createSections() {
|
||||
if (Out<ELFT>::SymTab)
|
||||
Out<ELFT>::SymTab->addSymbol(Body);
|
||||
|
||||
if (isOutputDynamic() && Body->includeInDynsym())
|
||||
if (isOutputDynamic() && S->includeInDynsym())
|
||||
Out<ELFT>::DynSymTab->addSymbol(Body);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user