mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-01 08:28:19 +00:00
Static relocation model Thumb jump table interworking.
Make sure the low bit of the PC is set when loading an address directly for jump tables in static relocation model. llvm-svn: 138912
This commit is contained in:
parent
dd71d9efb9
commit
1af1d2dfda
@ -923,6 +923,11 @@ void ARMAsmPrinter::EmitJumpTable(const MachineInstr *MI) {
|
|||||||
Expr = MCBinaryExpr::CreateSub(Expr, MCSymbolRefExpr::Create(JTISymbol,
|
Expr = MCBinaryExpr::CreateSub(Expr, MCSymbolRefExpr::Create(JTISymbol,
|
||||||
OutContext),
|
OutContext),
|
||||||
OutContext);
|
OutContext);
|
||||||
|
// If we're generating a table of Thumb addresses in static relocation
|
||||||
|
// model, we need to add one to keep interworking correctly.
|
||||||
|
else if (AFI->isThumbFunction())
|
||||||
|
Expr = MCBinaryExpr::CreateAdd(Expr, MCConstantExpr::Create(1,OutContext),
|
||||||
|
OutContext);
|
||||||
OutStreamer.EmitValue(Expr, 4);
|
OutStreamer.EmitValue(Expr, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user