diff options
| author | Owen Anderson <resistor@mac.com> | 2011-03-21 23:13:43 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2011-03-21 23:13:43 +0000 |
| commit | 9746286beca2539438e0a6b783e106bc359036ca (patch) | |
| tree | 144926c2c9f2368b632d0cb7c0dc11859e66e42c | |
| parent | dddce99f028ef7e005ac69a20756f6a8c73eb664 (diff) | |
| download | bcm5719-llvm-9746286beca2539438e0a6b783e106bc359036ca.tar.gz bcm5719-llvm-9746286beca2539438e0a6b783e106bc359036ca.zip | |
Add support for Thumb interworking addresses for symbol offsets that get constant folded very early.
This fixes SPASS with -integrated-as. <rdar://problem/9165399>
llvm-svn: 128037
| -rw-r--r-- | llvm/lib/MC/MCExpr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp index 54d3743e68e..2debe18bfb2 100644 --- a/llvm/lib/MC/MCExpr.cpp +++ b/llvm/lib/MC/MCExpr.cpp @@ -310,6 +310,11 @@ static void AttemptToFoldSymbolOffsetDifference(const MCAssembler *Asm, if (AD.getFragment() == BD.getFragment()) { Addend += (AD.getOffset() - BD.getOffset()); + // Pointers to Thumb symbols need to have their low-bit set to allow + // for interworking. + if (Asm->isThumbFunc(&SA)) + Addend |= 1; + // Clear the symbol expr pointers to indicate we have folded these // operands. A = B = 0; |

