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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 16:39:55 PST 2020


MaskRay added a comment.

In D72215#1807839 <https://reviews.llvm.org/D72215#1807839>, @peter.smith wrote:

> In D72215#1807110 <https://reviews.llvm.org/D72215#1807110>, @MaskRay wrote:
>
> > Address comments.
> >
> > The section __patchable_function_entries needs more thoughts so it is not
> >  implemented. I'll probably use SHF_LINK_ORDER when -ffunction-sections, and add
> >  SHF_WRITE (to prevent text relocations; apparently GCC does not consider these
> >  issues).
>
>
> It looks like we'll need to co-design this with GCC, binutils and the kernel to get something that works across the toolchains, it looks like this has already started https://www.mail-archive.com/gcc@gcc.gnu.org/msg90391.html. I think SHF_LINK_ORDER would work in LLD, but I'm not sure it would have the desired behaviour under garbage collection in ld.bfd. In any case I think that this could be implemented in a follow up patch.


I only got two issues with GCC's `__patchable_function_entries` now: (1) it does not have the `SHF_WRITE` flag (2) sh_addralign=1 (instead of pointer-size). This patch is otherwise identical to my observable effects of GCC.

> I think N,M support could be potentially added in a later patch as well, given Mark's comment. I think that if the N, M support isn't initially implemented it will be worth giving a "not-supported error message".

Yes. I think clangDriver is a better a place to error "unsupported". See D72222 <https://reviews.llvm.org/D72222>. I also mark -fxray-instrument incompatible there.


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