]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld testsuite alpha_ld_flags
authorAlan Modra <amodra@gmail.com>
Tue, 30 Jun 2026 02:56:46 +0000 (12:26 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 30 Jun 2026 03:08:25 +0000 (12:38 +0930)
This is how alpha can use -Ttext-segment on just those tests that need
it.  And since the way run_dump_test uses $opts(ld) allows tcl procs to
be embedded, there is no need to specially expand [big_or_little_endian].

binutils/
* testsuite/lib/binutils-common.exp (run_dump_test <opts(ld)>): No
need to handle big_or_little_endian specially.
ld/
* testsuite/ld-elf/elf.exp (alpha_ld_flags): New proc.
(LDFLAGS): Don't set -Ttext-segment for alpha globally.
* testsuite/ld-elf/compress1a.d: Add alpha_ld_flags.
* testsuite/ld-elf/compressed1a.d: Likewise.
* testsuite/ld-elf/eh5.d: Likewise.

binutils/testsuite/lib/binutils-common.exp
ld/testsuite/ld-elf/compress1a.d
ld/testsuite/ld-elf/compressed1a.d
ld/testsuite/ld-elf/eh5.d
ld/testsuite/ld-elf/elf.exp

index 8a484454e6560b8137fa81807da60e32e9f34ffb..48c6f46bd1cdaa965390b5810afbe33675bf0ac7 100644 (file)
@@ -1242,9 +1242,6 @@ proc run_dump_test { name {extra_options {}} } {
        lappend as_final_flags $x
     }
 
-    regsub {\[big_or_little_endian\]} $opts(ld) \
-       [big_or_little_endian] opts(ld)
-
     if { $opts(name) == "" } {
        set base_testname "$subdir/$name"
     } else {
index 44f35aacf151dd7364f90ebad2955fe5c0460799..8e29d01f20bddbac8f0b20b9645b9380cc94c226 100644 (file)
@@ -1,6 +1,6 @@
 #source: compress1.s
 #as: --compress-debug-sections
-#ld: -e func_cu2
+#ld: -e func_cu2 [alpha_ld_flags]
 #readelf: -S --wide
 #xfail: alpha-*-*ecoff
 # PR ld/25802
index e9a7e3b842fbfe7b492ab08f41fa8cbafc121e9b..2ffe9413db3145a5096155edc367fe198f85de36 100644 (file)
@@ -1,6 +1,6 @@
 #source: compress1.s
 #as: --compress-debug-sections=zlib-gabi
-#ld: -e func_cu2
+#ld: -e func_cu2 [alpha_ld_flags]
 #readelf: -t
 #xfail: alpha-*-*ecoff
 # PR ld/25802
index 48109d38310348ad6fc59a95f6c3b13ceecd8255..266e6f31621b938a2d659f4649f7edd6a0727639 100644 (file)
@@ -1,7 +1,7 @@
 #source: eh5.s
 #source: eh5a.s
 #source: eh5b.s
-#ld:
+#ld: [alpha_ld_flags]
 #readelf: -wf
 #target: [check_as_cfi]
 #xfail: alpha-*-*ecoff tile*-*-* visium-*-*
index 51b8c942648cddfed9deae3208f626e2a1f6a7ca..337206318abb3455a9969aeaf5f1eff421c8bd86 100644 (file)
@@ -51,11 +51,15 @@ if [istarget "*-*-hpux*"] {
     set ASFLAGS "$ASFLAGS --defsym HPUX=1"
 }
 
+# Some tests expect 32-bit addresses.  Force the executable to low addresses.
+proc alpha_ld_flags { } {
+    if { [istarget alpha*-*-* ] } {
+       return "-Ttext-segment 0x1000000"
+    }
+    return ""
+}
+
 if { [istarget alpha*-*-* ] } {
-    # The compress1 test is written expecting 32-bit addresses; force the
-    # executable down into the low address space to match.
-    # ??? How can we adjust just the one testcase?
-    set LDFLAGS "$LDFLAGS -Ttext-segment 0x1000000"
     set ASFLAGS "$ASFLAGS --defsym NO_SET=1"
 }