llvm-project
f05ec3c1 - [AArch64] Classify global references on UEFI like Windows COFF (#232703)

Commit
1 day ago
[AArch64] Classify global references on UEFI like Windows COFF (#232703) Apply the Windows COFF rules for global references to aarch64-unknown-uefi, which produces the same PE/COFF images: * classify dllimport and non-dso-local globals with MO_DLLIMPORT / MO_COFFSTUB, so extern_weak symbols are referenced through a stub that can be resolved to zero by the linker, * keep the existing SelectionDAG, FastISel and GlobalISel handling of calls and tail calls to extern_weak functions in sync with that, * default to the PIC relocation model, so jump tables and other references stay position independent in relocatable PE images, * lower ifuncs on UEFI as COFF has no support for them. The extern weak and jump table tests gain aarch64-unknown-uefi run lines, and a new test checks that the default pipelines lower ifuncs for both Windows and UEFI. Tested with the full `check-llvm` / `check-clang` suites and by building Fuchsia's arm64 EFI binaries (physboot EFI shim, boot tests, gigaboot) with a toolchain built from this series. Assisted-by: Claude
Author
Parents
Loading