[PATCH] D80791: [AArch64] Generate .note.gnu.property based on module flags.

Daniel Kiss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 13:01:47 PDT 2020


danielkiss added a comment.

In D80791#2120755 <https://reviews.llvm.org/D80791#2120755>, @kees wrote:

> In D80791#2120503 <https://reviews.llvm.org/D80791#2120503>, @nickdesaulniers wrote:
>
> > Might someone wish to disable PAC/BTI on an individual function, while having it on for the rest?  I guess that would mean you can't call that function indirectly?
>
>
> It would mean you can't call it _at all_, not just indirectly. :) Which is why I still think the warning is useful. Perhaps don't warn for the functions with the attribute?


BTI landing pad is needed only when the previous instructions was an indirect branch/jump  `bl x16`. 
With a direct branch `bl foo` no landing pad is needed at all. Rational is that direct branches can't be hijacked, they always land at the same location. 
Landing pads emitted only when indirect branch is possible to a function.[1]

[1] https://github.com/llvm/llvm-project/blob/f45b41348ba49c4a76baab1e3e302ef8e2bb992b/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp#L94


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80791





More information about the llvm-commits mailing list