mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-12 06:31:14 +00:00
Thumb2 only force the fixup thumb bit for data relocations.
rdar://10493453 llvm-svn: 145318
This commit is contained in:
parent
bc47555417
commit
ea721eb4b3
@ -273,13 +273,17 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout,
|
|||||||
|
|
||||||
Value = Target.getConstant();
|
Value = Target.getConstant();
|
||||||
|
|
||||||
bool IsThumb = false;
|
bool SetThumbBit = false;
|
||||||
if (const MCSymbolRefExpr *A = Target.getSymA()) {
|
if (const MCSymbolRefExpr *A = Target.getSymA()) {
|
||||||
const MCSymbol &Sym = A->getSymbol().AliasedSymbol();
|
const MCSymbol &Sym = A->getSymbol().AliasedSymbol();
|
||||||
if (Sym.isDefined())
|
if (Sym.isDefined())
|
||||||
Value += Layout.getSymbolOffset(&getSymbolData(Sym));
|
Value += Layout.getSymbolOffset(&getSymbolData(Sym));
|
||||||
if (isThumbFunc(&Sym))
|
// ARM data fixups based from a thumb function address need to have the low
|
||||||
IsThumb = true;
|
// 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()) {
|
if (const MCSymbolRefExpr *B = Target.getSymB()) {
|
||||||
const MCSymbol &Sym = B->getSymbol().AliasedSymbol();
|
const MCSymbol &Sym = B->getSymbol().AliasedSymbol();
|
||||||
@ -302,11 +306,7 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout,
|
|||||||
Value -= Offset;
|
Value -= Offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ARM fixups based from a thumb function address need to have the low
|
if (SetThumbBit)
|
||||||
// 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;
|
Value |= 1;
|
||||||
|
|
||||||
return IsResolved;
|
return IsResolved;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user