aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCAssembler.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-13 02:38:00 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-13 02:38:00 +0000
commit1b90fb8dc371d0781ccee544792997b1c8768c31 (patch)
tree3da1536ebe72c69d6f21f7d57082073e7bbd863f /lib/MC/MCAssembler.cpp
parent3881f91149d19956cfaadf0c7d767981a789cce7 (diff)
downloadexternal_llvm-1b90fb8dc371d0781ccee544792997b1c8768c31.zip
external_llvm-1b90fb8dc371d0781ccee544792997b1c8768c31.tar.gz
external_llvm-1b90fb8dc371d0781ccee544792997b1c8768c31.tar.bz2
MC/Mach-O: PCrel relocations weren't using the right base address, they are
relative to the fragment address, not its offset. This was masked by the text section normally being at address 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r--lib/MC/MCAssembler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 88be99c..29ac868 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -1024,7 +1024,7 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout, MCAsmFixup &Fixup,
}
if (IsPCRel)
- Value -= DF->getOffset() + Fixup.Offset;
+ Value -= DF->getAddress() + Fixup.Offset;
return IsResolved;
}