[lld] [LLD][COFF] Add support for MinGW auto-export on ARM64X (PR #125862)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 04:54:36 PST 2025


================
@@ -0,0 +1,93 @@
+// REQUIRES: aarch64
+
+// RUN: llvm-mc -filetype=obj -triple=aarch64-windows %s -o %t.arm64.obj
+// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %s -o %t.arm64ec.obj
+// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o %t-loadconfig-arm64ec.obj
+// RUN: llvm-mc -filetype=obj -triple=aarch64-windows %S/Inputs/loadconfig-arm64.s -o %t-loadconfig-arm64.obj
+
+// Check that all symbols are exported in both EC and native views.
+
+// RUN: lld-link -machine:arm64x -lldmingw -dll -noentry -out:%t.dll %t.arm64.obj %t.arm64ec.obj %t-loadconfig-arm64.obj %t-loadconfig-arm64ec.obj
+
+// RUN: llvm-readobj --coff-exports %t.dll | FileCheck --check-prefix=EXP %s
+// EXP:      Format: COFF-ARM64X
+// EXP-NEXT: Arch: aarch64
+// EXP-NEXT: AddressSize: 64bit
+// EXP-NEXT: Export {
+// EXP-NEXT:   Ordinal: 1
+// EXP-NEXT:   Name: _load_config_used
+// EXP-NEXT:   RVA:
+// EXP-NEXT: }
+// EXP-NEXT: Export {
+// EXP-NEXT:   Ordinal: 2
+// EXP-NEXT:   Name: sym
+// EXP-NEXT:   RVA: 0x2000
+// EXP-NEXT: }
+// EXP-NEXT: Export {
+// EXP-NEXT:   Ordinal: 3
+// EXP-NEXT:   Name: sym2
+// EXP-NEXT:   RVA: 0x2004
+// EXP-NEXT: }
+// EXP-NEXT: HybridObject {
+// EXP-NEXT:   Format: COFF-ARM64EC
+// EXP-NEXT:   Arch: aarch64
+// EXP-NEXT:   AddressSize: 64bit
+// EXP-NEXT:   Export {
+// EXP-NEXT:     Ordinal: 1
+// EXP-NEXT:     Name: __chpe_metadata
+// EXP-NEXT:     RVA:
+// EXP-NEXT:   }
+// EXP-NEXT:   Export {
+// EXP-NEXT:     Ordinal: 2
+// EXP-NEXT:     Name: __os_arm64x_dispatch_icall
+// EXP-NEXT:     RVA: 0x12B0
+// EXP-NEXT:   }
+// EXP-NEXT:   Export {
+// EXP-NEXT:     Ordinal: 3
+// EXP-NEXT:     Name: __os_arm64x_dispatch_ret
----------------
mstorsjo wrote:

Same for all these arm64ec internals - we probably don't want to export them. But that's a difference concern from this PR anyway.

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


More information about the llvm-commits mailing list