ARM stores the Thumb state in the least significant bit of the
function pointers. When compiling for ARM or Thumb, as all
instructions are at least 16-bit aligned, ignore the LSB when
computing the prefix hash location, so we can support both
pure Thumb and mixed ARM/Thumb binaries.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Thanks! This should fix https://github.com/llvm/llvm-project/issues/62936.
I agree that it's better to do the fix here, instead of adding dedicated support in the backend the way AArch64 does it, because as far as I can see backend KCFI checks are inserted after register allocation and have to use registers that are already dead. And in at least one Arm situation (namely Armv6-M) no such registers are conveniently available, so the check would become more expensive.