Fix pr19645.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 3 May 2014 19:57:04 +0000 (19:57 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 3 May 2014 19:57:04 +0000 (19:57 +0000)
commit930ca9843331c2cdce2a49517f661d60bfe61204
treef434a95534279e21354ed733a6a6cbd95bfa4da5
parent72e96a51bffcda773a9b8c11789a7018ea72c768
Fix pr19645.

The fix itself is fairly simple: move getAccessVariant to MCValue so that we
replace the old weak expression evaluation with the far more general
EvaluateAsRelocatable.

This then requires that EvaluateAsRelocatable stop when it finds a non
trivial reference kind. And that in turn requires the ELF writer to look
harder for weak references.

Last but not least, this found a case where we were being bug by bug
compatible with gas and accepting an invalid input. I reported pr19647
to track it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207920 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/llvm/MC/MCFixup.h
include/llvm/MC/MCValue.h
lib/MC/CMakeLists.txt
lib/MC/ELFObjectWriter.cpp
lib/MC/MCExpr.cpp
lib/MC/MCFixup.cpp [deleted file]
lib/MC/MCValue.cpp
lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp
lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
test/MC/ELF/relocation-386.s
test/MC/ELF/relocation.s