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
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 @@
}
if (IsPCRel)
- Value -= DF->getOffset() + Fixup.Offset;
+ Value -= DF->getAddress() + Fixup.Offset;
return IsResolved;
}