From 2eabaae45970af24de2c3ada4fec314a8ecc97d5 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 7 Dec 2010 03:50:14 +0000 Subject: Fix pcrel relocations that cross sections. llvm-svn: 121107 --- llvm/lib/MC/MachObjectWriter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/MC/MachObjectWriter.cpp') diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index fa3b4dce688..6e0c4d20d32 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/lib/MC/MachObjectWriter.cpp @@ -898,9 +898,9 @@ public: // The index is the section ordinal (1-based). Index = SD->getFragment()->getParent()->getOrdinal() + 1; FixedValue += getSectionAddress(SD->getFragment()->getParent()); - if (IsPCRel) - FixedValue -= getSectionAddress(Fragment->getParent()); } + if (IsPCRel) + FixedValue -= getSectionAddress(Fragment->getParent()); Type = macho::RIT_Vanilla; } -- cgit v1.2.3