mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Store whether a symbol is a comdat signature in MCSymbolELF.
With this getBinging can now return the correct answer for all cases not involving a .symver and the elf writer doesn't need to patch it last minute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238980 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -24,10 +24,20 @@ void MCSymbolELF::setBinding(unsigned Binding) const {
|
||||
}
|
||||
|
||||
unsigned MCSymbolELF::getBinding() const {
|
||||
uint32_t Binding = (getFlags() & (0xf << ELF_STB_Shift)) >> ELF_STB_Shift;
|
||||
assert(Binding == ELF::STB_LOCAL || Binding == ELF::STB_GLOBAL ||
|
||||
Binding == ELF::STB_WEAK || Binding == ELF::STB_GNU_UNIQUE);
|
||||
return Binding;
|
||||
if (isBindingSet()) {
|
||||
uint32_t Binding = (getFlags() & (0xf << ELF_STB_Shift)) >> ELF_STB_Shift;
|
||||
assert(Binding == ELF::STB_LOCAL || Binding == ELF::STB_GLOBAL ||
|
||||
Binding == ELF::STB_WEAK || Binding == ELF::STB_GNU_UNIQUE);
|
||||
return Binding;
|
||||
}
|
||||
|
||||
if (isDefined())
|
||||
return ELF::STB_LOCAL;
|
||||
if (isUsedInReloc())
|
||||
return ELF::STB_GLOBAL;
|
||||
if (isSignature())
|
||||
return ELF::STB_LOCAL;
|
||||
return ELF::STB_GLOBAL;
|
||||
}
|
||||
|
||||
void MCSymbolELF::setType(unsigned Type) const {
|
||||
@@ -86,4 +96,7 @@ bool MCSymbolELF::isUsedInReloc() const {
|
||||
return UsedInReloc;
|
||||
}
|
||||
|
||||
void MCSymbolELF::setIsSignature() const { IsSignature = true; }
|
||||
|
||||
bool MCSymbolELF::isSignature() const { return IsSignature; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user