forked from OSchip/llvm-project
Add the symbol offset to the relocation value when we relocate against section. By Roman Divacky.
llvm-svn: 111824
This commit is contained in:
parent
bf9294fb65
commit
40f83489b4
|
@ -511,9 +511,10 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
|
|||
const MCSymbolData *Base = Asm.getAtom(Layout, &SD);
|
||||
|
||||
if (Base) {
|
||||
if (MCFragment *F = SD.getFragment())
|
||||
if (MCFragment *F = SD.getFragment()) {
|
||||
Index = F->getParent()->getOrdinal() + getNumOfLocalSymbols(Asm) + 1;
|
||||
else
|
||||
Value += Layout.getSymbolAddress(&SD);
|
||||
} else
|
||||
Index = getSymbolIndexInSymbolTable(const_cast<MCAssembler &>(Asm), Symbol);
|
||||
if (Base != &SD)
|
||||
Value += Layout.getSymbolAddress(&SD) - Layout.getSymbolAddress(Base);
|
||||
|
|
Loading…
Reference in New Issue