mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-23 20:34:58 +00:00
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
602bb31883
commit
be1f37f512
@ -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…
x
Reference in New Issue
Block a user