[PATCH] D81251: [AArch64] Add BTI to CFI jumptables.

Daniel Kiss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 04:59:42 PDT 2020


danielkiss added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:1398
+  if (JumpTableArch == Triple::aarch64) {
+    F->addFnAttr("ignore-branch-target-enforcement");
+    F->addFnAttr("ignore-sign-return-address");
----------------
chill wrote:
> Why are we disabling BTI here?
This function is a jump table and each entry will have a landing pad ( see line 1235).
If it is not disabled then the entry will get an additional landing pad that miss-aligns the table. 

Worst case we could add special condition for the first entry but IMHO that would be ugly.


================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:1399
+    F->addFnAttr("ignore-branch-target-enforcement");
+    F->addFnAttr("ignore-sign-return-address");
+  }
----------------
chill wrote:
> Here we should use `sign-return-address=none`, and, if needed, I suggest (re-)introducing `branch-target-enforcement=true|false` ?
> 
Agree , I will update once the D85649 is updated as proposed there. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81251/new/

https://reviews.llvm.org/D81251



More information about the llvm-commits mailing list