aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-11 23:53:11 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-11 23:53:11 +0000
commitdb4c7e606f6bcc42ed8d853be5d67dfb9fa0edee (patch)
tree96bac3249b0e50e0de7a197fdcb57222787291bf /lib/MC/MachObjectWriter.cpp
parent640e948f09c56419b57dfb276d41e03060db6ad8 (diff)
MC/Mach-O/x86_64: Fix PCrel adjustment for x86_64, which was using the fixup
offset instead of the fixup address as intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103527 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MachObjectWriter.cpp')
-rw-r--r--lib/MC/MachObjectWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp
index a0f708244d..3ca6708005 100644
--- a/lib/MC/MachObjectWriter.cpp
+++ b/lib/MC/MachObjectWriter.cpp
@@ -479,6 +479,7 @@ public:
// See <reloc.h>.
uint32_t FixupOffset = Layout.getFragmentOffset(Fragment) + Fixup.Offset;
+ uint32_t FixupAddress = Layout.getFragmentAddress(Fragment) + Fixup.Offset;
int64_t Value = 0;
unsigned Index = 0;
unsigned IsExtern = 0;
@@ -591,7 +592,7 @@ public:
Value += Layout.getSymbolAddress(&SD);
if (IsPCRel)
- Value -= FixupOffset + (1 << Log2Size);
+ Value -= FixupAddress + (1 << Log2Size);
} else {
report_fatal_error("unsupported relocation of undefined symbol '" +
Symbol->getName() + "'");