summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit53ce0e12d89ed249e413da244c8073951baf258f (patch)
tree6c8f9de597afef70aadf67ae8ac402825cf26cc0 /llvm/lib
parent7c6f0e382720adabd2805692d1daf1583f8b2933 (diff)
downloadbcm5719-llvm-53ce0e12d89ed249e413da244c8073951baf258f.tar.gz
bcm5719-llvm-53ce0e12d89ed249e413da244c8073951baf258f.zip
MC/Mach-O/x86_64: Fix PCrel adjustment for x86_64, which was using the fixup
offset instead of the fixup address as intended. llvm-svn: 103527
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index a0f708244d7..3ca67080053 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/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() + "'");
OpenPOWER on IntegriCloud