mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
Rename IsUsedInDynamicReloc to MustBeInDynSym.
The variable was marking various cases where a symbol must be included in the dynamic symbol table. Being used by a dynamic relocation was only one of them. llvm-svn: 259889
This commit is contained in:
@@ -219,7 +219,7 @@ template <class ELFT>
|
||||
void RelocationSection<ELFT>::addReloc(const DynamicReloc<ELFT> &Reloc) {
|
||||
SymbolBody *Sym = Reloc.Sym;
|
||||
if (!Reloc.UseSymVA && Sym)
|
||||
Sym->setUsedInDynamicReloc();
|
||||
Sym->MustBeInDynSym = true;
|
||||
Relocs.push_back(Reloc);
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ template <class ELFT> void SymbolTable<ELFT>::scanShlibUndefined() {
|
||||
for (StringRef U : File->getUndefinedSymbols())
|
||||
if (SymbolBody *Sym = find(U))
|
||||
if (Sym->isDefined())
|
||||
Sym->setUsedInDynamicReloc();
|
||||
Sym->MustBeInDynSym = true;
|
||||
}
|
||||
|
||||
template class elf2::SymbolTable<ELF32LE>;
|
||||
|
||||
@@ -128,7 +128,7 @@ template <class ELFT> int SymbolBody::compare(SymbolBody *Other) {
|
||||
// symbols in the DSO at runtime.
|
||||
if (isShared() != Other->isShared())
|
||||
if (isa<DefinedRegular<ELFT>>(isShared() ? Other : this))
|
||||
IsUsedInDynamicReloc = Other->IsUsedInDynamicReloc = true;
|
||||
MustBeInDynSym = Other->MustBeInDynSym = true;
|
||||
|
||||
if (L != R)
|
||||
return -1;
|
||||
|
||||
@@ -83,8 +83,6 @@ public:
|
||||
bool isLazy() const { return SymbolKind == LazyKind; }
|
||||
bool isShared() const { return SymbolKind == SharedKind; }
|
||||
bool isUsedInRegularObj() const { return IsUsedInRegularObj; }
|
||||
bool isUsedInDynamicReloc() const { return IsUsedInDynamicReloc; }
|
||||
void setUsedInDynamicReloc() { IsUsedInDynamicReloc = true; }
|
||||
bool isTls() const { return IsTls; }
|
||||
bool isFunc() const { return IsFunc; }
|
||||
|
||||
@@ -131,10 +129,9 @@ public:
|
||||
protected:
|
||||
SymbolBody(Kind K, StringRef Name, bool IsWeak, uint8_t Visibility,
|
||||
bool IsTls, bool IsFunc)
|
||||
: SymbolKind(K), IsWeak(IsWeak), Visibility(Visibility), IsTls(IsTls),
|
||||
IsFunc(IsFunc), Name(Name) {
|
||||
: SymbolKind(K), IsWeak(IsWeak), Visibility(Visibility),
|
||||
MustBeInDynSym(false), IsTls(IsTls), IsFunc(IsFunc), Name(Name) {
|
||||
IsUsedInRegularObj = K != SharedKind && K != LazyKind;
|
||||
IsUsedInDynamicReloc = 0;
|
||||
}
|
||||
|
||||
const unsigned SymbolKind : 8;
|
||||
@@ -147,9 +144,11 @@ protected:
|
||||
// it can be false.
|
||||
unsigned IsUsedInRegularObj : 1;
|
||||
|
||||
public:
|
||||
// If true, the symbol is added to .dynsym symbol table.
|
||||
unsigned IsUsedInDynamicReloc : 1;
|
||||
unsigned MustBeInDynSym : 1;
|
||||
|
||||
protected:
|
||||
unsigned IsTls : 1;
|
||||
unsigned IsFunc : 1;
|
||||
StringRef Name;
|
||||
|
||||
@@ -366,8 +366,7 @@ void Writer<ELFT>::scanRelocs(
|
||||
// See "Global Offset Table" in Chapter 5 in the following document
|
||||
// for detailed description:
|
||||
// ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
|
||||
// FIXME: Why do we need to set this here?
|
||||
Body->setUsedInDynamicReloc();
|
||||
Body->MustBeInDynSym = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -778,7 +777,7 @@ static bool includeInDynsym(const SymbolBody &B) {
|
||||
return false;
|
||||
if (Config->ExportDynamic || Config->Shared)
|
||||
return true;
|
||||
return B.isUsedInDynamicReloc();
|
||||
return B.MustBeInDynSym;
|
||||
}
|
||||
|
||||
// This class knows how to create an output section for a given
|
||||
|
||||
Reference in New Issue
Block a user