A BTI instruction was previously inserted at the beginning of each block
that has its address stored in a jump table. Jump tables only emit
indirect jumps in ARM or Thumb1 modes. However, PACBTI is not supported
in these modes. As a result, BTI instructions emitted by jump tables are
redundant. Removing redundant BTI instructions improves the code size
and prevents potential gadgets.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/ARM/ARMBranchTargets.cpp | ||
---|---|---|
67–68 | This comment can be removed too. | |
llvm/test/MC/AArch64/remove-redundant-bti.s | ||
1 ↗ | (On Diff #499105) | The filename for this should end in .ll, because it contains IR, not assembly. |
30 ↗ | (On Diff #499105) | These tests should also check the tbb/tbh/mov instructions which branch to these labels, to make sure that the two test cases are testing different was of implementing jump tables. |
This comment can be removed too.