From 34b8e553ea241c57daf9e740b199ec2f526fdce8 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 13 Mar 2010 02:38:00 +0000 Subject: 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. llvm-svn: 98420 --- llvm/lib/MC/MCAssembler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/MC') diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp index 88be99cffdd..29ac8684bde 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/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; } -- cgit v1.2.3