[PATCH] D72215: [AArch64] Add function attribute "patchable-function-entry" to add NOPs at function entry

Oliver Stannard (Linaro) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 07:11:04 PST 2020


ostannard added a comment.

How does this interact with the AArch64 "branch-target-enforcement" attribute? For the generated, unpatched code to be correct the function needs to start with a BTI or PAC instruction if it could be indirectly called. Presumably the code doing the patching would also need to be aware of this.

The GCC docs claim that a `__patchable_function_entries` section will be emitted containing the addresses of every run of NOPs inserted, do you plan on adding that too?



================
Comment at: llvm/lib/IR/Verifier.cpp:1862
+    unsigned N;
+    if (S.consumeInteger(10, N) || !S.consume_front(",") ||
+        S.consumeInteger(10, N) || N)
----------------
I think it would be better to use separate attributes for the size and start offset, to avoid needing to do this parsing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72215





More information about the llvm-commits mailing list