From bdbe5a712dd0626bb8bb81db27bb11f0aa06c609 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 7 Dec 2010 05:57:28 +0000 Subject: Fix relocations with weak definitions. llvm-svn: 121114 --- llvm/lib/MC/MachObjectWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index 6e0c4d20d32..d31ecef27a8 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/lib/MC/MachObjectWriter.cpp @@ -893,7 +893,7 @@ public: // compensate for the addend of the symbol address, if it was // undefined. This occurs with weak definitions, for example. if (!SD->Symbol->isUndefined()) - FixedValue -= getSymbolAddress(SD, Layout); + FixedValue -= Layout.getSymbolOffset(SD); } else { // The index is the section ordinal (1-based). Index = SD->getFragment()->getParent()->getOrdinal() + 1; -- cgit v1.2.3