static uint64_t SymbolValue(const MCSymbol &Sym, const MCAsmLayout &Layout);
static bool isInSymtab(const MCAsmLayout &Layout, const MCSymbol &Symbol,
bool Used, bool Renamed);
- static bool isLocal(const MCSymbol &Symbol, bool isUsedInReloc);
+ static bool isLocal(const MCSymbol &Symbol, bool IsUsedInReloc,
+ bool IsSignature);
/// Helper struct for containing some precomputed information on symbols.
struct ELFSymbolData {
return true;
}
-bool ELFObjectWriter::isLocal(const MCSymbol &Symbol, bool isUsedInReloc) {
+bool ELFObjectWriter::isLocal(const MCSymbol &Symbol, bool IsUsedInReloc,
+ bool IsSignature) {
const MCSymbolData &Data = Symbol.getData();
if (Data.isExternal())
return false;
if (Symbol.isDefined())
return true;
- if (isUsedInReloc)
+ if (IsUsedInReloc)
return false;
- return true;
+ return IsSignature;
}
void ELFObjectWriter::computeSymbolTable(
// Undefined symbols are global, but this is the first place we
// are able to set it.
- bool Local = isLocal(Symbol, Used);
+ bool Local = isLocal(Symbol, Used, isSignature);
if (!Local && MCELF::GetBinding(SD) == ELF::STB_LOCAL) {
assert(BaseSymbol);
MCSymbolData &BaseData = BaseSymbol->getData();
if (MCELF::GetType(SD) != ELF::STT_SECTION)
MSD.Name = StrTabBuilder.add(Name);
- if (MSD.SectionIndex == ELF::SHN_UNDEF)
- ExternalSymbolData.push_back(MSD);
- else if (Local)
+ if (Local)
LocalSymbolData.push_back(MSD);
else
ExternalSymbolData.push_back(MSD);