From 2ee6c9b8c98cf224e15a0e75128ad1f4e331d5c5 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 17 Dec 2010 05:50:29 +0000 Subject: MC/Mach-O: On second thought, use a custom hook for enabling aggressive IsSymbolRefDifferenceFullyResolved, it turns out this does change behavior on enough cases for x86-32 that I would rather wait a bit on it. - In practice, we will want to change this eventually because it only means we generate less relocations (it also eliminates the need for the horrible '.set' hack that Darwin requires in some places). llvm-svn: 122042 --- llvm/lib/MC/MachObjectWriter.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/MC/MachObjectWriter.cpp') diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index 17615eef697..6ebc782c8e2 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/lib/MC/MachObjectWriter.cpp @@ -1126,6 +1126,9 @@ public: bool IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm, const MCSymbolRefExpr *A, const MCSymbolRefExpr *B) const { + if (!TargetObjectWriter->useAggressiveSymbolFolding()) + return false; + // The effective address is // addr(atom(A)) + offset(A) // - addr(atom(B)) - offset(B) -- cgit v1.2.3