forked from OSchip/llvm-project
[ELF] Merge canInline into scriptDefined
They perform similar tasks and are essentially the same after
d28c26bbdd
.
This commit is contained in:
parent
eb9ac2cc14
commit
7c675923c7
|
@ -2061,8 +2061,8 @@ static std::vector<WrappedSymbol> addWrappedSymbols(opt::InputArgList &args) {
|
||||||
|
|
||||||
// We want to tell LTO not to inline symbols to be overwritten
|
// We want to tell LTO not to inline symbols to be overwritten
|
||||||
// because LTO doesn't know the final symbol contents after renaming.
|
// because LTO doesn't know the final symbol contents after renaming.
|
||||||
real->canInline = false;
|
real->scriptDefined = true;
|
||||||
sym->canInline = false;
|
sym->scriptDefined = true;
|
||||||
|
|
||||||
// Tell LTO not to eliminate these symbols.
|
// Tell LTO not to eliminate these symbols.
|
||||||
sym->isUsedInRegularObj = true;
|
sym->isUsedInRegularObj = true;
|
||||||
|
|
|
@ -273,7 +273,7 @@ void BitcodeCompiler::add(BitcodeFile &f) {
|
||||||
// We tell LTO to not apply interprocedural optimization for wrapped
|
// We tell LTO to not apply interprocedural optimization for wrapped
|
||||||
// (with --wrap) symbols because otherwise LTO would inline them while
|
// (with --wrap) symbols because otherwise LTO would inline them while
|
||||||
// their values are still not final.
|
// their values are still not final.
|
||||||
r.LinkerRedefined = !sym->canInline;
|
r.LinkerRedefined = sym->scriptDefined;
|
||||||
}
|
}
|
||||||
checkError(ltoObj->add(std::move(f.obj), resols));
|
checkError(ltoObj->add(std::move(f.obj), resols));
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,6 @@ Symbol *SymbolTable::insert(StringRef name) {
|
||||||
sym->isUsedInRegularObj = false;
|
sym->isUsedInRegularObj = false;
|
||||||
sym->exportDynamic = false;
|
sym->exportDynamic = false;
|
||||||
sym->inDynamicList = false;
|
sym->inDynamicList = false;
|
||||||
sym->canInline = true;
|
|
||||||
sym->referenced = false;
|
sym->referenced = false;
|
||||||
sym->traced = false;
|
sym->traced = false;
|
||||||
sym->scriptDefined = false;
|
sym->scriptDefined = false;
|
||||||
|
|
|
@ -126,11 +126,6 @@ public:
|
||||||
// exported into .dynsym.
|
// exported into .dynsym.
|
||||||
uint8_t inDynamicList : 1;
|
uint8_t inDynamicList : 1;
|
||||||
|
|
||||||
// False if LTO shouldn't inline whatever this symbol points to. If a symbol
|
|
||||||
// is overwritten after LTO, LTO shouldn't inline the symbol because it
|
|
||||||
// doesn't know the final contents of the symbol.
|
|
||||||
uint8_t canInline : 1;
|
|
||||||
|
|
||||||
// Used to track if there has been at least one undefined reference to the
|
// Used to track if there has been at least one undefined reference to the
|
||||||
// symbol. For Undefined and SharedSymbol, the binding may change to STB_WEAK
|
// symbol. For Undefined and SharedSymbol, the binding may change to STB_WEAK
|
||||||
// if the first undefined reference from a non-shared object is weak.
|
// if the first undefined reference from a non-shared object is weak.
|
||||||
|
@ -246,11 +241,11 @@ protected:
|
||||||
binding(binding), type(type), stOther(stOther), symbolKind(k),
|
binding(binding), type(type), stOther(stOther), symbolKind(k),
|
||||||
visibility(stOther & 3),
|
visibility(stOther & 3),
|
||||||
isUsedInRegularObj(!file || file->kind() == InputFile::ObjKind),
|
isUsedInRegularObj(!file || file->kind() == InputFile::ObjKind),
|
||||||
exportDynamic(false), inDynamicList(false), canInline(false),
|
exportDynamic(false), inDynamicList(false), referenced(false),
|
||||||
referenced(false), traced(false), hasVersionSuffix(false),
|
traced(false), hasVersionSuffix(false), isInIplt(false),
|
||||||
isInIplt(false), gotInIgot(false), isPreemptible(false), used(false),
|
gotInIgot(false), isPreemptible(false), used(false), folded(false),
|
||||||
folded(false), needsTocRestore(false), scriptDefined(false),
|
needsTocRestore(false), scriptDefined(false), needsCopy(false),
|
||||||
needsCopy(false), needsGot(false), needsPlt(false), needsTlsDesc(false),
|
needsGot(false), needsPlt(false), needsTlsDesc(false),
|
||||||
needsTlsGd(false), needsTlsGdToIe(false), needsTlsLd(false),
|
needsTlsGd(false), needsTlsGdToIe(false), needsTlsLd(false),
|
||||||
needsGotDtprel(false), needsTlsIe(false), hasDirectReloc(false) {}
|
needsGotDtprel(false), needsTlsIe(false), hasDirectReloc(false) {}
|
||||||
|
|
||||||
|
@ -279,7 +274,10 @@ public:
|
||||||
// PPC64 toc pointer.
|
// PPC64 toc pointer.
|
||||||
uint8_t needsTocRestore : 1;
|
uint8_t needsTocRestore : 1;
|
||||||
|
|
||||||
// True if this symbol is defined by a linker script.
|
// True if this symbol is defined by a symbol assignment or wrapped by --wrap.
|
||||||
|
//
|
||||||
|
// LTO shouldn't inline the symbol because it doesn't know the final content
|
||||||
|
// of the symbol.
|
||||||
uint8_t scriptDefined : 1;
|
uint8_t scriptDefined : 1;
|
||||||
|
|
||||||
// True if this symbol needs a canonical PLT entry, or (during
|
// True if this symbol needs a canonical PLT entry, or (during
|
||||||
|
@ -588,7 +586,6 @@ void Symbol::replace(const Symbol &newSym) {
|
||||||
isUsedInRegularObj = old.isUsedInRegularObj;
|
isUsedInRegularObj = old.isUsedInRegularObj;
|
||||||
exportDynamic = old.exportDynamic;
|
exportDynamic = old.exportDynamic;
|
||||||
inDynamicList = old.inDynamicList;
|
inDynamicList = old.inDynamicList;
|
||||||
canInline = old.canInline;
|
|
||||||
referenced = old.referenced;
|
referenced = old.referenced;
|
||||||
traced = old.traced;
|
traced = old.traced;
|
||||||
hasVersionSuffix = old.hasVersionSuffix;
|
hasVersionSuffix = old.hasVersionSuffix;
|
||||||
|
|
Loading…
Reference in New Issue