diff options
| author | Jim Grosbach <grosbach@apple.com> | 2011-11-28 23:39:00 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2011-11-28 23:39:00 +0000 |
| commit | 30168fbde58fb74da4d0858db2e4e784e1415056 (patch) | |
| tree | d02f90d18e41bd755b18e40d01699775ece7b522 /llvm/lib/MC | |
| parent | 0e8f5c7e9be4c93602289693e91412b7ea701281 (diff) | |
| download | bcm5719-llvm-30168fbde58fb74da4d0858db2e4e784e1415056.tar.gz bcm5719-llvm-30168fbde58fb74da4d0858db2e4e784e1415056.zip | |
Thumb2 only force the fixup thumb bit for data relocations.
rdar://10493453
llvm-svn: 145318
Diffstat (limited to 'llvm/lib/MC')
| -rw-r--r-- | llvm/lib/MC/MCAssembler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp index 29adbcbc7ff..802bb8e74b6 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/lib/MC/MCAssembler.cpp @@ -273,13 +273,17 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout, Value = Target.getConstant(); - bool IsThumb = false; + bool SetThumbBit = false; if (const MCSymbolRefExpr *A = Target.getSymA()) { const MCSymbol &Sym = A->getSymbol().AliasedSymbol(); if (Sym.isDefined()) Value += Layout.getSymbolOffset(&getSymbolData(Sym)); - if (isThumbFunc(&Sym)) - IsThumb = true; + // ARM data fixups based from a thumb function address need to have the low + // bit set. The actual value is always at least 16-bit aligned, so the + // low bit is normally clear and available for use as an ISA flag for + // interworking. + if (Fixup.getKind() == FK_Data_4 && isThumbFunc(&Sym)) + SetThumbBit = true; } if (const MCSymbolRefExpr *B = Target.getSymB()) { const MCSymbol &Sym = B->getSymbol().AliasedSymbol(); @@ -302,11 +306,7 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout, Value -= Offset; } - // ARM fixups based from a thumb function address need to have the low - // bit set. The actual value is always at least 16-bit aligned, so the - // low bit is normally clear and available for use as an ISA flag for - // interworking. - if (IsThumb) + if (SetThumbBit) Value |= 1; return IsResolved; |

