[lld] [LLD][COFF] Add support for autoimports on ARM64X (PR #129282)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 1 13:07:35 PST 2025
================
@@ -0,0 +1,75 @@
+# REQUIRES: aarch64
+RUN: split-file %s %t.dir && cd %t.dir
+
+RUN: llvm-lib -machine:arm64x -out:libtest.a -defArm64Native:test.def -def:test.def
+RUN: llvm-mc -triple=arm64ec-windows-gnu arm64ec.s -filetype=obj -o arm64ec.obj
+RUN: llvm-mc -triple=aarch64-windows-gnu aarch64.s -filetype=obj -o aarch64.obj
+RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj
+RUN: llvm-mc -filetype=obj -triple=aarch64-windows %S/Inputs/loadconfig-arm64.s -o loadconfig-arm64.obj
+
+RUN: lld-link -machine:arm64x -out:out.dll -dll -noentry arm64ec.obj aarch64.obj libtest.a loadconfig-arm64.obj loadconfig-arm64ec.obj -lldmingw
+
+RUN: llvm-readobj --coff-imports out.dll | FileCheck -check-prefix=IMPORTS %s
+RUN: llvm-objdump -s out.dll | FileCheck --check-prefix=CONTENTS %s
+
+IMPORTS: Import {
+IMPORTS-NEXT: Name: test.dll
+IMPORTS-NEXT: ImportLookupTableRVA: 0x5{{.*}}
+IMPORTS-NEXT: ImportAddressTableRVA: 0x4000
+IMPORTS-NEXT: Symbol: variable (0)
+IMPORTS-NEXT: }
+IMPORTS-NEXT: HybridObject {
+IMPORTS: Import {
+IMPORTS-NEXT: Name: test.dll
+IMPORTS-NEXT: ImportLookupTableRVA: 0x5{{.*}}
+IMPORTS-NEXT: ImportAddressTableRVA: 0x4000
+IMPORTS-NEXT: Symbol: variable (0)
+IMPORTS-NEXT: }
+IMPORTS-NEXT: }
+
+Native ARM64 runtime pseudo relocation list header at 0x5164, consisting of 0x0, 0x0, 0x1.
+The runtime pseudo relocation is from an aarch64.obj object file, with import from 0x4000,
+applied at 0x9018 with a size of 32 bits. ARM64EC runtime pseudo relocation list header at
----------------
mstorsjo wrote:
Is the size really 32 bit? 32 bit pseudo relocations in 64 bit images usually is a problem (and we warn about them nowadays too); as the reference is a `.quad` I presume that it is 64 bit?
https://github.com/llvm/llvm-project/pull/129282
More information about the llvm-commits
mailing list