diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-11-29 01:15:25 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-11-29 01:15:25 +0000 |
commit | ae9132207fc4783ce66caf56c932055424975f15 (patch) | |
tree | 594329541cfd4856aa9bdc8e52b3186542561d85 /llvm/lib/MC/MCAssembler.cpp | |
parent | 62212f0e62e42bd3f9be4ff310380780602273fc (diff) | |
download | bcm5719-llvm-ae9132207fc4783ce66caf56c932055424975f15.tar.gz bcm5719-llvm-ae9132207fc4783ce66caf56c932055424975f15.zip |
Better fix for ARM MOVT relocation encoding of thumb bit.
Replaces r145318 with a more targetted fix for the relocation handling.
llvm-svn: 145346
Diffstat (limited to 'llvm/lib/MC/MCAssembler.cpp')
-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 802bb8e74b6..29adbcbc7ff 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/lib/MC/MCAssembler.cpp @@ -273,17 +273,13 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout, Value = Target.getConstant(); - bool SetThumbBit = false; + bool IsThumb = false; if (const MCSymbolRefExpr *A = Target.getSymA()) { const MCSymbol &Sym = A->getSymbol().AliasedSymbol(); if (Sym.isDefined()) Value += Layout.getSymbolOffset(&getSymbolData(Sym)); - // 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 (isThumbFunc(&Sym)) + IsThumb = true; } if (const MCSymbolRefExpr *B = Target.getSymB()) { const MCSymbol &Sym = B->getSymbol().AliasedSymbol(); @@ -306,7 +302,11 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout, Value -= Offset; } - if (SetThumbBit) + // 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) Value |= 1; return IsResolved; |