[PATCH] D138337: Add support for kcfi-seal optimization with LTO

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 15:22:59 PST 2022


pcc added a comment.

In D138337#3972138 <https://reviews.llvm.org/D138337#3972138>, @samitolvanen wrote:

> In D138337#3972009 <https://reviews.llvm.org/D138337#3972009>, @pcc wrote:
>
>> Can't this be implicit if LTO is being used?
>
> I would prefer to keep this behind a flag (similarly to `-mibt-seal`), so we can better control when and where the optimization enabled. For example, enabling this implicitly would currently break LTO+KCFI kernel builds as the kernel has global functions that are not address-taken in C code, but still end up being indirectly called because their addresses were taken in assembly code that wasn't visible to LTO (e.g. arm64's `alternative_cb` mechanism).

Isn't that just a bug in the optimization? It shouldn't be applying this to symbols where `VisibleToRegularObj` is set.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138337



More information about the llvm-commits mailing list