diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-01-20 18:57:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-01-20 18:57:48 +0000 |
commit | b718237dfc05aa4c0c8c284f79fe41a2a4a14574 (patch) | |
tree | dab809b308668c6811b8d9ee1c9325ef89c52c00 /llvm/lib/MC/ELFObjectWriter.cpp | |
parent | 18b1de3ec6b33199d168807276db95c50f6faab8 (diff) | |
download | bcm5719-llvm-b718237dfc05aa4c0c8c284f79fe41a2a4a14574.tar.gz bcm5719-llvm-b718237dfc05aa4c0c8c284f79fe41a2a4a14574.zip |
Accept subtractions involving a weak symbol.
When a symbol S shows up in an expression in assembly there are two
possible interpretations
* The expression is referring to the value of S in this file.
* The expression is referring to the value after symbol resolution.
In the first case the assembler can reason about the value and try to
produce a relocation.
In the second case, that is only possible if the symbol cannot be
preempted.
Assemblers are not very consistent about which interpretation gets used.
This changes MC to agree with GAS in the case of an expression of the
form "Sym - WeakSym".
llvm-svn: 258329
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 23d0e28324c..20ad41659f4 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -655,12 +655,6 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm, return; } - if (::isWeak(SymB)) { - Ctx.reportError(Fixup.getLoc(), - "Cannot represent a subtraction with a weak symbol"); - return; - } - uint64_t SymBOffset = Layout.getSymbolOffset(SymB); uint64_t K = SymBOffset - FixupOffset; IsPCRel = true; |