mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
Get the addend correct for i386 pic.
Thanks Daniel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106608 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -747,7 +747,6 @@ public:
|
|||||||
!Is64Bit &&
|
!Is64Bit &&
|
||||||
"Should only be called with a 32-bit TLVP relocation!");
|
"Should only be called with a 32-bit TLVP relocation!");
|
||||||
|
|
||||||
// If this is a subtraction then we're pcrel.
|
|
||||||
unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind());
|
unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind());
|
||||||
uint32_t Value = Layout.getFragmentOffset(Fragment)+Fixup.getOffset();
|
uint32_t Value = Layout.getFragmentOffset(Fragment)+Fixup.getOffset();
|
||||||
unsigned IsPCRel = 0;
|
unsigned IsPCRel = 0;
|
||||||
@@ -761,7 +760,14 @@ public:
|
|||||||
// between the picbase and the next address. For 32-bit static the addend
|
// between the picbase and the next address. For 32-bit static the addend
|
||||||
// is zero.
|
// is zero.
|
||||||
if (Target.getSymB()) {
|
if (Target.getSymB()) {
|
||||||
|
// If this is a subtraction then we're pcrel.
|
||||||
|
uint32_t FixupAddress =
|
||||||
|
Layout.getFragmentAddress(Fragment) + Fixup.getOffset();
|
||||||
|
MCSymbolData *SD_B = &Asm.getSymbolData(Target.getSymB()->getSymbol());
|
||||||
IsPCRel = 1;
|
IsPCRel = 1;
|
||||||
|
FixedValue = (FixupAddress - Layout.getSymbolAddress(SD_B) +
|
||||||
|
Target.getConstant());
|
||||||
|
FixedValue += 1 << Log2Size;
|
||||||
} else {
|
} else {
|
||||||
FixedValue = 0;
|
FixedValue = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user