diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp index fd81d5498682..1f553b87ce1f 100644 --- a/lld/ELF/Symbols.cpp +++ b/lld/ELF/Symbols.cpp @@ -121,7 +121,7 @@ static uint64_t getSymVA(const SymbolBody &Body, int64_t &Addend) { SymbolBody::SymbolBody(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther, uint8_t Type) - : SymbolKind(K), NeedsPltAddr(false), IsLocal(IsLocal), + : SymbolKind(K), IsLocal(IsLocal), NeedsPltAddr(false), IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false), IsInIgot(false), IsPreemptible(false), Type(Type), StOther(StOther), Name(Name) {} diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h index 1516d25a8396..281ce63bd95b 100644 --- a/lld/ELF/Symbols.h +++ b/lld/ELF/Symbols.h @@ -108,14 +108,13 @@ protected: const unsigned SymbolKind : 8; + // True if this is a local symbol. + unsigned IsLocal : 1; + public: // True the symbol should point to its PLT entry. // For SharedSymbol only. unsigned NeedsPltAddr : 1; - - // True if this is a local symbol. - unsigned IsLocal : 1; - // True if this symbol has an entry in the global part of MIPS GOT. unsigned IsInGlobalMipsGot : 1; diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 17f0fb0bab5a..ec614d6e2369 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -75,7 +75,7 @@ template void elf::createCommonSections() { // Replace all DefinedCommon symbols with DefinedRegular symbols so that we // don't have to care about DefinedCommon symbols beyond this point. replaceBody(S, Sym->getFile(), Sym->getName(), - static_cast(Sym->IsLocal), Sym->StOther, + static_cast(Sym->isLocal()), Sym->StOther, Sym->Type, 0, Sym->getSize(), Section); } } diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index e7e880d07023..ebb042e05aaa 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -444,7 +444,7 @@ template void Writer::copyLocalSymbols() { for (InputFile *File : ObjectFiles) { ObjFile *F = cast>(File); for (SymbolBody *B : F->getLocalSymbols()) { - if (!B->IsLocal) + if (!B->isLocal()) fatal(toString(F) + ": broken object: getLocalSymbols returns a non-local symbol"); auto *DR = dyn_cast(B);