[PATCH 2/2] ld, gas: run the AArch64 PE tests for aarch64-pc-cygwin

Dennis Ameling dennis@dennisameling.com
Mon Sep 7 08:19:41 GMT 2026


Several AArch64 PE tests are gated on aarch64-*-pe* and aarch64-*-mingw*,
or on *-*-mingw* and *-*-pe*, so they are skipped entirely for
aarch64-pc-cygwin even though the target uses the same aarch64pe emulation
and the same object format.

Add the target to those gates.  This runs existing coverage rather than
adding new tests: the image base, .secrel32 and .secidx link tests, the
PDB tests, which this target supports, the gas PE and SEH tests, and the
CodeView tests, CodeView being a PE debug format that the PDB support
consumes.

pe-aarch64 in ld is deliberately left out.  It matches absolute addresses
and so is specific to the 0x140000000 image base, whereas Cygwin targets
set move_default_addr_high and default to 0x100400000.  That is long
standing Cygwin behaviour rather than anything specific to AArch64, so the
gate for that one test is split out rather than the test being changed.
---
 gas/testsuite/gas/aarch64/codeview.exp | 3 ++-
 gas/testsuite/gas/pe/pe.exp            | 3 ++-
 ld/testsuite/ld-pe/pdb.exp             | 3 ++-
 ld/testsuite/ld-pe/pe.exp              | 6 ++++++
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gas/testsuite/gas/aarch64/codeview.exp b/gas/testsuite/gas/aarch64/codeview.exp
index efa399a6c..e87ee44b3 100644
--- a/gas/testsuite/gas/aarch64/codeview.exp
+++ b/gas/testsuite/gas/aarch64/codeview.exp
@@ -18,7 +18,8 @@ if { ![istarget "aarch64-*-*"] } then {
     return
 }
 
-if { ![istarget "*-*-mingw*"] && ![istarget "*-*-pe*"] } then {
+if { ![istarget "*-*-mingw*"] && ![istarget "*-*-pe*"]
+     && ![istarget "*-*-cygwin*"] } then {
     return
 }
 
diff --git a/gas/testsuite/gas/pe/pe.exp b/gas/testsuite/gas/pe/pe.exp
index f1c1d18f4..ffd584633 100644
--- a/gas/testsuite/gas/pe/pe.exp
+++ b/gas/testsuite/gas/pe/pe.exp
@@ -61,7 +61,8 @@ if ([istarget "x86_64-*-mingw*"]) then {
 
 
 # This test is only for AArch64
-if {[istarget "aarch64-*-pe*"] || [istarget "aarch64-*-mingw*"]} {
+if {[istarget "aarch64-*-pe*"] || [istarget "aarch64-*-mingw*"]
+    || [istarget "aarch64-*-cygwin*"]} {
 	run_dump_test "pe-aarch64"
 	run_dump_test "seh-aarch64"
 	run_dump_test "seh-aarch64-large-func"
diff --git a/ld/testsuite/ld-pe/pdb.exp b/ld/testsuite/ld-pe/pdb.exp
index 11e950f0e..9706fc943 100644
--- a/ld/testsuite/ld-pe/pdb.exp
+++ b/ld/testsuite/ld-pe/pdb.exp
@@ -26,7 +26,8 @@ if {![istarget i*86-*-mingw*]
   && ![istarget x86_64-*-pe*]
   && ![istarget x86_64-*-cygwin]
   && ![istarget aarch64-*-mingw*]
-  && ![istarget aarch64-*-pe*]} {
+  && ![istarget aarch64-*-pe*]
+  && ![istarget aarch64-*-cygwin*]} {
     return
 }
 
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index b95f61b85..897bb24f4 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -109,8 +109,14 @@ if {[istarget i*86-*-cygwin*]
 }
 
 if {[istarget "aarch64-*-pe*"] || [istarget "aarch64-*-mingw*"]} {
+    # pe-aarch64 checks absolute addresses, so it is specific to the
+    # 0x140000000 image base.  Cygwin targets default the base high, to
+    # 0x100400000, and so are excluded here.
     run_dump_test "pe-aarch64"
+}
 
+if {[istarget "aarch64-*-pe*"] || [istarget "aarch64-*-mingw*"]
+    || [istarget "aarch64-*-cygwin*"]} {
     set pe_tests {
       {"aarch64" "--image-base 0x1000" "" "" {aarch64a.s aarch64b.s}
 	{{objdump -dr aarch64.d}} "aarch64.x"}
-- 
2.43.0



More information about the Binutils mailing list