Fix fixup evaluation when deciding what to relocate with.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 25 Mar 2015 13:16:53 +0000 (13:16 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 25 Mar 2015 13:16:53 +0000 (13:16 +0000)
commitd033c4b57607540e8c70d5c7aa4003a795d52f6e
treeb0b42491476df8aeee0cef3614ecf15204570066
parent34676181c9e9e2347f254262acb717bcff5bc7ab
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233187 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCExpr.h
include/llvm/MC/MCObjectWriter.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MCAssembler.cpp
lib/MC/MCExpr.cpp
lib/MC/MCObjectWriter.cpp
test/MC/X86/expand-var.s [new file with mode: 0644]