[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 05:40:25 PDT 2024
kovdan01 wrote:
The PR no longer depends on #96477. For signed ctors/dtors we now have special address discrimination handling so we don't need to use self-references to `llvm.global_{c|d}tors` with giant `getelementptr` expressions - such references are disallowed and, as discussed in #96477, allowing them just for ptrauth purposes has significant drawbacks.
Instead, just use `ptr inttoptr (i64 1 to ptr)`, like this:
```
@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr ptrauth (ptr @foo, i32 0, i64 55764, ptr inttoptr (i64 1 to ptr)), ptr null }]
```
This is the same approach which is used in Apple's downstream for coroutines, and we share some code with that - see https://github.com/ahmedbougacha/llvm-project/commit/2a5528ea2cb223fca0b47f0a4833bbb938cf0748. Also tagging @ahmedbougacha.
https://github.com/llvm/llvm-project/pull/96478
More information about the llvm-commits
mailing list