if (!Symbol.isInSection())
return 0;
- if (MCFragment *FF = Data.getFragment())
- return Layout.getSymbolAddress(&Data) -
- Layout.getSectionAddress(FF->getParent());
+ if (Data.getFragment())
+ return Layout.getSymbolOffset(&Data);
return 0;
}
const MCSymbol &SymbolB = RefB->getSymbol();
MCSymbolData &SDB = Asm.getSymbolData(SymbolB);
IsPCRel = true;
- MCSectionData *Sec = Fragment->getParent();
// Offset of the symbol in the section
- int64_t a = Layout.getSymbolAddress(&SDB) - Layout.getSectionAddress(Sec);
+ int64_t a = Layout.getSymbolOffset(&SDB);
// Ofeset of the relocation in the section
int64_t b = Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
Index = F->getParent()->getOrdinal() + 1;
- MCSectionData *FSD = F->getParent();
// Offset of the symbol in the section
- Value += Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD);
+ Value += Layout.getSymbolOffset(&SD);
} else {
if (Asm.getSymbolData(Symbol).getFlags() & ELF_Other_Weakref)
WeakrefUsedInReloc.insert(RelocSymbol);
const MCSymbol &SymbolB = RefB->getSymbol();
MCSymbolData &SDB = Asm.getSymbolData(SymbolB);
IsPCRel = true;
- MCSectionData *Sec = Fragment->getParent();
// Offset of the symbol in the section
- int64_t a = Layout.getSymbolAddress(&SDB) - Layout.getSectionAddress(Sec);
+ int64_t a = Layout.getSymbolOffset(&SDB);
// Ofeset of the relocation in the section
int64_t b = Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
Index = F->getParent()->getOrdinal();
- MCSectionData *FSD = F->getParent();
// Offset of the symbol in the section
- Value += Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD);
+ Value += Layout.getSymbolOffset(&SD);
} else {
if (Asm.getSymbolData(Symbol).getFlags() & ELF_Other_Weakref)
WeakrefUsedInReloc.insert(RelocSymbol);
const MCSymbol &SymbolB = RefB->getSymbol();
MCSymbolData &SDB = Asm.getSymbolData(SymbolB);
IsPCRel = true;
- MCSectionData *Sec = Fragment->getParent();
// Offset of the symbol in the section
- int64_t a = Layout.getSymbolAddress(&SDB) - Layout.getSectionAddress(Sec);
+ int64_t a = Layout.getSymbolOffset(&SDB);
// Ofeset of the relocation in the section
int64_t b = Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
Index = F->getParent()->getOrdinal() + 1;
- MCSectionData *FSD = F->getParent();
// Offset of the symbol in the section
- Value += Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD);
+ Value += Layout.getSymbolOffset(&SD);
} else {
if (Asm.getSymbolData(Symbol).getFlags() & ELF_Other_Weakref)
WeakrefUsedInReloc.insert(RelocSymbol);