oskarwirga wrote:

Turns out there _is_ a fundamental reason NonLazyBind can't work on arm64e 
today: the MachO ABI has no relocation type for compiler-emitted auth GOT 
loads. `__auth_got` is entirely linker-internal; only linker-generated stubs 
reference it. Apple hasn't made this relocation available, so getting 
`NonLazyBind` working on arm64e would require an ABI extension that Apple 
controls.

Apple's own toolchain actually has this same bug! Xcode emits unsigned GOT 
loads on arm64e which is the same issue. Reproducible with:

```c
// repro.c
void external(void);
void caller(void) { external(); }
$ xcrun --sdk iphoneos clang -fno-plt -target arm64e-apple-ios16 -S -o - 
repro.c | grep grep -A3 blr -B3
        .cfi_offset w29, -16
        adrp    x8, _external@GOTPAGE
        ldr     x8, [x8, _external@GOTPAGEOFF]
        blr     x8     <----- This is bad
        ldp     x29, x30, [sp], #16             ; 16-byte Folded Reload
        retab
        .cfi_endproc
```

I think we keep this PR which suppresses NonLazyBind on arm64e. I've also 
updated the tests and gating to use arm64e naming.

https://github.com/llvm/llvm-project/pull/188638
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to