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

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 02:02:29 PST 2020


peter.smith added a comment.

In D72215#1809576 <https://reviews.llvm.org/D72215#1809576>, @MaskRay wrote:

> I think GCC's __patchable_function_entries has severe design flaws. https://gcc.gnu.org/ml/gcc/2020-01/msg00067.html
>
> I have tried a different design in this patch, temporarily naming it `__patchable_function_entry`.


FWIW I think that this is definitely an improvement over the original. This should permit the patchable_function_entries to be read-only even when compiled position independent and should deal with dangling entries caused by GC and comdat entries. We may need an option to emit in the old format for compatibility, but I guess we'll need to see how the GCC community reacts.



================
Comment at: llvm/test/CodeGen/AArch64/patchable-function-entry.ll:20
+; CHECK-NEXT:  mov w0, wzr
+; CHECK:       .section __patchable_function_entry,"ao", at progbits,f0,unique,0
+; CHECK-NEXT:  .p2align 3
----------------
It might be worth a run of llc with -ffunction-sections where we'd expect to see f1, unique, 0.


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