mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-23 19:59:57 +00:00
Simplify the logic in ELFObjectWriter::isInSymtab. NFC.
_GLOBAL_OFFSET_TABLE_ is not magical and we can now directly check for a symbol never getting an explicit binding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
96fdaa4f50
commit
a41438c5d8
@ -740,17 +740,13 @@ bool ELFObjectWriter::isInSymtab(const MCAsmLayout &Layout,
|
||||
if (Renamed)
|
||||
return false;
|
||||
|
||||
if (Symbol.getName() == "_GLOBAL_OFFSET_TABLE_")
|
||||
return true;
|
||||
|
||||
if (Symbol.isVariable()) {
|
||||
const MCSymbol *Base = Layout.getBaseSymbol(Symbol);
|
||||
if (Base && Base->isUndefined())
|
||||
if (Symbol.isVariable() && Symbol.isUndefined()) {
|
||||
// FIXME: this is here just to diagnose the case of a var = commmon_sym.
|
||||
Layout.getBaseSymbol(Symbol);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsGlobal = Symbol.getBinding() == ELF::STB_GLOBAL;
|
||||
if (!Symbol.isVariable() && Symbol.isUndefined() && !IsGlobal)
|
||||
if (Symbol.isUndefined() && !Symbol.isBindingSet())
|
||||
return false;
|
||||
|
||||
if (Symbol.getType() == ELF::STT_SECTION)
|
||||
|
Loading…
Reference in New Issue
Block a user