[llvm-commits] [llvm] r115506 - in /llvm/trunk: lib/MC/ELFObjectWriter.cpp test/MC/ELF/pic-diff.s
Rafael Espindola
rafael.espindola at gmail.com
Mon Oct 4 08:28:43 PDT 2010
Author: rafael
Date: Mon Oct 4 10:28:43 2010
New Revision: 115506
URL: http://llvm.org/viewvc/llvm-project?rev=115506&view=rev
Log:
Correctly compute the relocation when it is not in the first fragment.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
llvm/trunk/test/MC/ELF/pic-diff.s
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=115506&r1=115505&r2=115506&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 4 10:28:43 2010
@@ -539,7 +539,7 @@
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
Modified: llvm/trunk/test/MC/ELF/pic-diff.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/pic-diff.s?rev=115506&r1=115505&r2=115506&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/pic-diff.s (original)
+++ llvm/trunk/test/MC/ELF/pic-diff.s Mon Oct 4 10:28:43 2010
@@ -19,7 +19,8 @@
// CHECK-NEXT: ),
// CHECK-NEXT: ])
-.zero 4
+.zero 1
+.align 4
foo:
.zero 8
.long baz - foo
More information about the llvm-commits
mailing list