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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to