[llvm] [PAC][CodeGen][ELF][AArch64] Support signed GOT (PR #96164)

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 08:59:24 PDT 2024


kovdan01 wrote:

Latest commit 436a23f045bc9fd795ddc224d859f2252364de84 implements logic for previously unhandled case like this:

```
@var = global i32 0
define ptr @resign_globalvar() {
  ret ptr ptrauth (ptr @var, i32 3, i64 43)
}
```

It results in `LOADgotPAC` pseudo. If ELF signed GOT is enabled, lower GOT load similarly to `LOADgotAUTH`, and then proceed to regular `LOADgotPAC` stuff (add offset if needed and then sign).

Example output (see tests for more):

```
resign_globalvar:
  adrp     x17, :got_auth:var
  add      x17, x17, :got_auth_lo12:var
  ldr      x16, [x17]
  autda    x16, x17
  mov x17, #43
  pacdb    x16, x17
  mov      x0, x16
  ret
```


https://github.com/llvm/llvm-project/pull/96164


More information about the llvm-commits mailing list