mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-18 17:39:04 +00:00
Add the symbol offset to the relocation value when we relocate against section. By Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111824 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
baf2883e0a
commit
bcf2db60dd
@ -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
Block a user