Correctly compute the relocation when it is not in the first fragment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2010-10-04 15:28:43 +00:00
parent 2e0affb428
commit 01263d35d4
2 changed files with 3 additions and 2 deletions

View File

@ -539,7 +539,7 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
const MCSymbol &SymbolB = RefB->getSymbol();
MCSymbolData &SDB = Asm.getSymbolData(SymbolB);
IsPCRel = true;
Value += Fixup.getOffset() - Layout.getSymbolAddress(&SDB);
Value += Layout.getFragmentOffset(Fragment) + Fixup.getOffset() - Layout.getSymbolAddress(&SDB);
}
// Check that this case has already been fully resolved before we get

View File

@ -19,7 +19,8 @@
// CHECK-NEXT: ),
// CHECK-NEXT: ])
.zero 4
.zero 1
.align 4
foo:
.zero 8
.long baz - foo