uint64_t ELFObjectWriter::SymbolValue(const MCSymbol &Sym,
const MCAsmLayout &Layout) {
uint64_t ELFObjectWriter::SymbolValue(const MCSymbol &Sym,
const MCAsmLayout &Layout) {
// Aliases defined with .symvar copy the binding from the symbol they alias.
// This is the first place we are able to copy this information.
// Aliases defined with .symvar copy the binding from the symbol they alias.
// This is the first place we are able to copy this information.
MCELF::SetBinding(Alias, MCELF::GetBinding(Symbol));
StringRef Rest = AliasName.substr(Pos);
MCELF::SetBinding(Alias, MCELF::GetBinding(Symbol));
StringRef Rest = AliasName.substr(Pos);
void ELFObjectWriter::writeSymbol(SymbolTableWriter &Writer,
uint32_t StringIndex, ELFSymbolData &MSD,
const MCAsmLayout &Layout) {
void ELFObjectWriter::writeSymbol(SymbolTableWriter &Writer,
uint32_t StringIndex, ELFSymbolData &MSD,
const MCAsmLayout &Layout) {
-#ifndef NDEBUG
- MCSymbol &OrigData = MSD.Symbol->getData();
- assert((!OrigData.getFragment() ||
- (OrigData.getFragment()->getParent() == &MSD.Symbol->getSection())) &&
+ const MCSymbol &Symbol = *MSD.Symbol;
+ assert((!Symbol.getFragment() ||
+ (Symbol.getFragment()->getParent() == &Symbol.getSection())) &&
- uint8_t Binding = MCELF::GetBinding(*MSD.Symbol);
- uint8_t Type = MCELF::GetType(*MSD.Symbol);
- MCSymbol *BaseSD = nullptr;
+ uint8_t Binding = MCELF::GetBinding(Symbol);
+ uint8_t Type = MCELF::GetType(Symbol);
Type = mergeTypeForSet(Type, MCELF::GetType(*Base));
}
uint8_t Info = (Binding << ELF_STB_Shift) | (Type << ELF_STT_Shift);
// Other and Visibility share the same byte with Visibility using the lower
// 2 bits
Type = mergeTypeForSet(Type, MCELF::GetType(*Base));
}
uint8_t Info = (Binding << ELF_STB_Shift) | (Type << ELF_STT_Shift);
// Other and Visibility share the same byte with Visibility using the lower
// 2 bits
- uint8_t Visibility = MCELF::GetVisibility(*MSD.Symbol);
- uint8_t Other = MCELF::getOther(*MSD.Symbol)
- << (ELF_STO_Shift - ELF_STV_Shift);
+ uint8_t Visibility = MCELF::GetVisibility(Symbol);
+ uint8_t Other = MCELF::getOther(Symbol) << (ELF_STO_Shift - ELF_STV_Shift);