[lld] [LLD] Add flag to force PLT entries to have a BTI (PR #168365)
Gergely Bálint via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 17 06:42:56 PST 2025
bgergely0 wrote:
Thanks for the feedback Peter!
> how much effect on security this would have in practice. Given that on most systems using BTI, the whole program (executable and shared-objects) are likely to have BTI enabled, I suspect not much.
Yes, this is in line with what I imagined.
> on the simplest in-order implementations like the A320 it may be noticeable if loops are involved
thanks, good point to consider!
> how much tool implementation detail BOLT is willing to depend on
We can easily check if the PLTs are generated according to expectations in BOLT, so it wouldn't create binaries with incorrect BTI property.
As of writing it into the ELF conventions, I'm not sure if that would be necessary. I believe this problem (patching PLTs) _could_ be solved in BOLT, and if so, changing the ABI would be overkill. (Does it even make sense to add non-default behaviours in the ABI?)
The reason I still opened this PR is that while _technically speaking_ this should be solvable in BOLT, it would definately be a much more involved change than this (+7 line code change, and +6 line test).
https://github.com/llvm/llvm-project/pull/168365
More information about the llvm-commits
mailing list