]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
"eqv involving dot" gas test and pdp11
authorAlan Modra <amodra@gmail.com>
Sun, 24 May 2026 04:55:10 +0000 (14:25 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 24 May 2026 04:55:10 +0000 (14:25 +0930)
This changes the eqv-dot test to make 'x' non-zero, so targets
(eg. i386-darwin) that silently ignore the value of fx_subsy in fixups
will fail the test.

When updating the test I noticed seriously odd expected output for
pdp11.  Why should .long write in different byte order when needing
fixups (".long z")?  That appears to be a bug in the pdp11
md_apply_fix, which reads section contents using pdp-endian but writes
them little-endian.  Fix that too.

gas/
* config/tc-pdp11.c (md_apply_fix): Use md_mumber_to_chars.
* testsuite/gas/all/eqv-dot.s: Move x to second .long.
* testsuite/gas/all/eqv-dot.d: Update expected result.
* testsuite/gas/all/eqv-dot-pdp11.d: Likewise, and use
source directive.
* testsuite/gas/all/eqv-dot-pdp11.s: Delete.
* testsuite/gas/all/gas.exp (do_930509a): Support pdp11.
* testsuite/gas/all/simple-forward.d: Likewise.

gas/config/tc-pdp11.c
gas/testsuite/gas/all/eqv-dot-pdp11.d
gas/testsuite/gas/all/eqv-dot-pdp11.s [deleted file]
gas/testsuite/gas/all/eqv-dot.d
gas/testsuite/gas/all/eqv-dot.s
gas/testsuite/gas/all/gas.exp
gas/testsuite/gas/all/simple-forward.d

index ed703bf227abe6eea3c84de7972f3457ede6b1b5..d017d341fd8fdc84caba15c264dbafbc0ce045e8 100644 (file)
@@ -287,7 +287,7 @@ md_apply_fix (fixS *fixP,
 
   code &= ~mask;
   code |= (val >> shift) & mask;
-  number_to_chars_littleendian (buf, code, size);
+  md_number_to_chars (buf, code, size);
 
   if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0)
     fixP->fx_done = 1;
index 0e2ddcdbcf95c4c14ec362d19b357c2e73a52736..97036432b3a8d86f8af9d15b52c767d39ca334c7 100644 (file)
@@ -1,3 +1,4 @@
+#source: eqv-dot.s
 #objdump: -s -j .data
 #name: eqv involving dot (PDP11)
 # Special for PDP11 which is little-endian for octets in shorts
@@ -7,6 +8,6 @@
 .*: .*
 
 Contents of section \.data:
- 0000 0+0000 0+0100 0+0200 0+0c00  .*
- 0010 0+1000 140+ 0+1000 1c0+  .*
+ 0000 0+0000 0+0100 0+0200 0+0800  .*
+ 0010 0+0c00 0+1000 0+0c00 0+1800  .*
 #pass
diff --git a/gas/testsuite/gas/all/eqv-dot-pdp11.s b/gas/testsuite/gas/all/eqv-dot-pdp11.s
deleted file mode 100644 (file)
index cd8cb91..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-       .data
-x:     .long 0, 1, 2, . - x
- y = . - x
- z == . - x
-       .long y
-       .long z
-       .long y
-       .long z
index fc40b09f217923ca1ea61b6fdebaa2674ecd58bd..e99d503cb1be393f9bf35c995d84f04e65473d5f 100644 (file)
@@ -10,6 +10,6 @@
 .*: .*
 
 Contents of section \.data:
- 0000 (0+00 0+01 0+02 0+0c|000+ 010+ 020+ 0c0+) .*
- 0010 (0+10 0+14 0+10 0+1c|100+ 140+ 100+ 1c0+) .*
+ 0000 (0+00 0+01 0+02 0+08|000+ 010+ 020+ 080+) .*
+ 0010 (0+0c 0+10 0+0c 0+18|0c0+ 100+ 0c0+ 180+) .*
 #pass
index cd8cb9198b036cc7d3ac7cf79bcdafd11018d8e5..6a63670dec78c62debd382a38eb8a769e5f97c57 100644 (file)
@@ -1,5 +1,6 @@
        .data
-x:     .long 0, 1, 2, . - x
+       .long 0
+x:     .long 1, 2, . - x
  y = . - x
  z == . - x
        .long y
index b99ecdba241cc6abc05e425828492c8d520b6060..940df9011678994e7643ef69fd3b557463dbb2b8 100644 (file)
@@ -262,13 +262,14 @@ proc do_930509a {} {
     set x 0
     gas_start "x930509.s" "-al"
     while 1 {
-# We need to accommodate both byte orders here.
+# We need to accommodate little, big and pdp endian here.
 # If ".long" means an 8-byte value on some target someday, this test will have
 # to be fixed.
        expect {
            -re "^ +1 .... 00 ?00 ?00 ?00" { fail $testname; set x 1 }
            -re "^ +1 .... 04 ?00 ?00 ?00" { pass $testname; set x 1 }
            -re "^ +1 .... 00 ?00 ?00 ?04" { pass $testname; set x 1 }
+           -re "^ +1 .... 00 ?00 ?04 ?00" { pass $testname; set x 1 }
            -re "\[^\n\]*\n" { }
            timeout { perror "timeout\n"; break }
            eof { break }
index 63b4077c1cb3b35dc1d3422fadaeb057610faef2..33388be015baff675ce43504eb075c4723c1b6e3 100644 (file)
@@ -10,5 +10,5 @@
 .*: .*
 
 Contents of section \.data:
- 0000 0c000000 (0c000000 0c000000|000c0000 0000000c) .*
+ 0000 0c000000 (0c000000 0c000000|000c0000 0000000c|0c000000 00000c00) .*
 #pass