[PATCH] D81251: [AArch64] Add BTI to CFI jumptables.
Daniel Kiss via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 02:40:55 PDT 2020
danielkiss marked 2 inline comments as done.
danielkiss added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:1211
+ if (M.getModuleFlag("branch-target-enforcement"))
+ return 4 + kARMJumpTableEntrySize; // bti c; b label;
return kARMJumpTableEntrySize;
----------------
eugenis wrote:
> I'd rather this was a named constant.
I'll update it.
================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:1233
+ } else if (JumpTableArch == Triple::aarch64) {
+ if (Dest->getParent()->getModuleFlag("branch-target-enforcement"))
+ AsmOS << "hint #34\n"; // BTI C
----------------
eugenis wrote:
> Do we need to check the function attribute here as well? What happens if a function opts out of BTI?
No, direct jump does not need a landing pad. So this jump will be fine even that target function opted out.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81251/new/
https://reviews.llvm.org/D81251
More information about the llvm-commits
mailing list