From f275ad8af13d2e539dfa6ee882ef89a885e4164a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 25 Mar 2015 13:16:53 +0000 Subject: Fix fixup evaluation when deciding what to relocate with. The previous logic was to first try without relocations at all and failing that stop on the first defined symbol. That was inefficient and incorrect in the case part of the expression could be simplified and another part could not (see included test). We now stop the evaluation when we get to a variable whose value can change (i.e. is weak). llvm-svn: 233187 --- llvm/lib/MC/MCObjectWriter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/MC/MCObjectWriter.cpp') diff --git a/llvm/lib/MC/MCObjectWriter.cpp b/llvm/lib/MC/MCObjectWriter.cpp index 94d7cd6fd4f..55bdd0b8439 100644 --- a/llvm/lib/MC/MCObjectWriter.cpp +++ b/llvm/lib/MC/MCObjectWriter.cpp @@ -54,3 +54,5 @@ MCObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm, // On ELF and COFF A - B is absolute if A and B are in the same section. return &SecA == &SecB; } + +bool MCObjectWriter::isWeak(const MCSymbolData &SD) const { return false; } -- cgit v1.2.3