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

Daniel Kiss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 07:53:23 PDT 2020


danielkiss added a comment.

>> it is not useful to have a bti annotated function unless everything else is bti compatible too: it is all or nothing per elf module.
>
> This is false. Some functions in an elf module could be in a guarded region, some in a non-guarded region. Some function may always
> be called in a "BTI-safe" way, which may be unknown to the compiler.

Right now the elf and all of the `text` sections considered BTI enabled or not. The dynamic linkers/loaders can't support this use case without additional information to be encoded somewhere (and specified). To support such we need to consider grouping/align to page boundaries these functions in the linker because BTI could be controlled by flags in PTE.
With the current spec this usecase is not supported in this way. The user have to link the BTI protected code into another elf.
Side note: The `force-bti` linker option can't work with half BTI enabled objects.


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

https://reviews.llvm.org/D80791



More information about the llvm-commits mailing list