public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Committed: Fix all unexpected failures in gas testsuite for pdp11-aout
@ 2020-05-29 20:51 Stephen Casner
  0 siblings, 0 replies; only message in thread
From: Stephen Casner @ 2020-05-29 20:51 UTC (permalink / raw)
  To: binutils

What's the protocol here?  After committing to the master branch, send
email to this list with the log and diff?  Does that apply even when
it is somewhat redundant with the message from cvs-commit bot to
bug-binutils for commits on a PR?

                                                        -- Steve

commit 66e3eb08a52ba20d3fb468cef04952aafdf534d4
Author: Stephen Casner <casner@acm.org>
Date:   Thu May 28 10:11:59 2020 -0700

    Fix all unexpected failures in gas testsuite for pdp11-aout.

    These failures were caused by the PDP11's mix of little-endian octets
    in shorts but shorts in big endian order for long or quad so regexps
    did not match.  Also tests used addresses as values in .long which
    required BRD_RELOC_32 that was not implemented.

    * gas/config/tc-pdp11.c (md_number_to_chars): Implement .quad
    * gas/testsuite/gas/all/gas.exp: Select alternate test scripts for
    pdp11, skip octa test completely.
    * gas/testsuite/gas/all/eqv-dot-pdp11.s: Identical to eqv-dot.s
    * gas/testsuite/gas/all/eqv-dot-pdp11.d: Match different octet order.
    * gas/testsuite/gas/all/cond-pdp11.l: Match different octet order.

    * bfd/pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
    addreses in .long (used in testsuites) and .stab values.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0fe164458e..482bf81e68 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-28  Stephen Casner  <casner@acm.org>
+
+	* pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
+	addreses in .long (used in testsuites) and .stab values.
+
 2020-05-27  H.J. Lu  <hongjiu.lu@intel.com>

 	PR ld/22909
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index adcf34da1d..375fbedccf 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -255,6 +255,7 @@ reloc_howto_type howto_table_pdp11[] =
   /* type	       rs size bsz  pcrel bitpos ovrf			  sf name     part_inpl readmask  setmask    pcdone */
 HOWTO( 0,	       0,  1,  16,  FALSE, 0, complain_overflow_signed,0,"16",	TRUE, 0x0000ffff,0x0000ffff, FALSE),
 HOWTO( 1,	       0,  1,  16,  TRUE,  0, complain_overflow_signed,0,"DISP16",	TRUE, 0x0000ffff,0x0000ffff, FALSE),
+HOWTO( 2,	       0,  2,  32,  FALSE, 0, complain_overflow_signed,0,"32",	TRUE, 0x0000ffff,0x0000ffff, FALSE),
 };

 #define TABLE_SIZE(TABLE)	(sizeof(TABLE)/sizeof(TABLE[0]))
@@ -276,6 +277,8 @@ NAME (aout, reloc_type_lookup) (bfd * abfd ATTRIBUTE_UNUSED,
       return &howto_table_pdp11[0];
     case BFD_RELOC_16_PCREL:
       return &howto_table_pdp11[1];
+    case BFD_RELOC_32:
+      return &howto_table_pdp11[2];
     default:
       return NULL;
     }
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2f719e7c8c..07509cc737 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,16 @@
+2020-05-28  Stephen Casner  <casner@acm.org>
+
+	Fix unexpected failures in gas testsuite for pdp11-aout target.
+	These are caused by the PDP11's mix of little-endian octets in
+	shorts but shorts in big endian order for long or quad.
+
+	* config/tc-pdp11.c (md_number_to_chars): Implement .quad
+	* testsuite/gas/all/gas.exp: Select alternate test scripts for
+	pdp11, skip octa test completely.
+	* testsuite/gas/all/eqv-dot-pdp11.s: Identical to eqv-dot.s
+	* testsuite/gas/all/eqv-dot-pdp11.d: Match different octet order.
+	* testsuite/gas/all/cond-pdp11.l: Match different octet order.
+
 2020-05-28  Alex Coplan  <alex.coplan@arm.com>

 	* frags.c (frag_grow): Fix comment.
diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c
index 57daa0f509..7de42aea95 100644
--- a/gas/config/tc-pdp11.c
+++ b/gas/config/tc-pdp11.c
@@ -222,6 +222,16 @@ md_number_to_chars (char con[], valueT value, int nbytes)
       con[2] =  value        & 0xff;
       con[3] = (value >>  8) & 0xff;
       break;
+    case 8:
+      con[0] = (value >> 48) & 0xff;
+      con[1] = (value >> 56) & 0xff;
+      con[2] = (value >> 32) & 0xff;
+      con[3] = (value >> 40) & 0xff;
+      con[4] = (value >> 16) & 0xff;
+      con[5] = (value >> 24) & 0xff;
+      con[6] =  value        & 0xff;
+      con[7] = (value >>  8) & 0xff;
+      break;
     default:
       BAD_CASE (nbytes);
     }
diff --git a/gas/testsuite/gas/all/cond-pdp11.l b/gas/testsuite/gas/all/cond-pdp11.l
new file mode 100644
index 0000000000..d722a0cc66
--- /dev/null
+++ b/gas/testsuite/gas/all/cond-pdp11.l
@@ -0,0 +1,74 @@
+# This should match the output of gas -alc cond.s.
+
+.*cond.s.*
+
+
+   1[ 	]+.if	0
+   8[ 	]+.else
+   9[ 	]+.if	1
+  10[ 	]+.endc
+  11 0000 00 ?00 ?02 ?00[ 	]+.long[ 	]+2
+  12[ 	]+.if	0
+  14[ 	]+.else
+  15 0004 00 ?00 ?04 ?00[ 	]+.long[ 	]+4
+  16[ 	]+.endc
+  17[ 	]+.endc
+  18[ 	]+
+  19[ 	]+.if	0
+  21[ 	]+.elseif	1
+  22[ 	]+.if	0
+  24[ 	]+.elseif	1
+  25 0008 00 ?00 ?07 ?00[ 	]+.long[ 	]+7
+  26[ 	]+.endif
+  27[ 	]+.elseif	1
+  29[ 	]+.else
+  31[ 	]+.endif
+[ 	]*[1-9][0-9]*[ 	]+
+[ 	]*[1-9][0-9]*[ 	]+\.comm[ 	]+v_c,[ 	]*1[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+\.ifndef[ 	]+v_c[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+\.endif[ 	]*
+[ 	]*[1-9][0-9]*[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+\.if[ 	]+x[ 	]*<>[ 	]*x[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+\.endif[ 	]*
+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	]+y[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+\.elseif[ 	]+y[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+\.endif[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+
+[ 	]*[1-9][0-9]*[ 	]+\.macro[ 	]+m[ 	]+x,[ 	]*y[ 	]*
+#...
+[ 	]*[1-9][0-9]*[ 	]+\.endm[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+[0-9a-f]+[048c] FF ?FF ?FF ?FF[ 	]+m[ 	]+,[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+FF ?FF ?FF ?FF[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+[0-9a-f]+[048c] FF ?FF ?FF ?FF[ 	]+m[ 	]+,[ 	]*10[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+00 ?00 ?0A ?00[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+[0-9a-f]+[048c] 00 ?00 ?0B ?00[ 	]+m[ 	]+11,[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+FF ?FF ?FF ?FF[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+[0-9a-f]+[048c] 00 ?00 ?0C ?00[ 	]+m[ 	]+12,[ 	]*13[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+00 ?00 ?0D ?00[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+
+[ 	]*[1-9][0-9]*[ 	]+\.if[ 	]+0[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+\.endif[ 	]*
+[ 	]*[1-9][0-9]*[ 	]+
+[ 	]*[1-9][0-9]*[ 	]+.*\.p2align 5,0
+#pass
diff --git a/gas/testsuite/gas/all/eqv-dot-pdp11.d b/gas/testsuite/gas/all/eqv-dot-pdp11.d
new file mode 100644
index 0000000000..0e2ddcdbcf
--- /dev/null
+++ b/gas/testsuite/gas/all/eqv-dot-pdp11.d
@@ -0,0 +1,12 @@
+#objdump: -s -j .data
+#name: eqv involving dot (PDP11)
+# Special for PDP11 which is little-endian for octets in shorts
+# but big-endian for shorts in longs per register assignments for
+# mul/div and in by convention in memory (at least for Unix).
+
+.*: .*
+
+Contents of section \.data:
+ 0000 0+0000 0+0100 0+0200 0+0c00  .*
+ 0010 0+1000 140+ 0+1000 1c0+  .*
+#pass
diff --git a/gas/testsuite/gas/all/eqv-dot-pdp11.s b/gas/testsuite/gas/all/eqv-dot-pdp11.s
new file mode 100644
index 0000000000..cd8cb9198b
--- /dev/null
+++ b/gas/testsuite/gas/all/eqv-dot-pdp11.s
@@ -0,0 +1,8 @@
+	.data
+x:	.long 0, 1, 2, . - x
+ y = . - x
+ z == . - x
+	.long y
+	.long z
+	.long y
+	.long z
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index 1664018c0f..c782955370 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -91,7 +91,11 @@ switch -glob $target_triplet {

 gas_test "eqv-ok.s" "" "" ".eqv support"
 gas_test_error "eqv-bad.s" "" ".eqv for symbol already set"
-run_dump_test eqv-dot
+if { [istarget "pdp11-*-*"] } then {
+    run_dump_test eqv-dot-pdp11
+} else {
+    run_dump_test eqv-dot
+}

 if { ![istarget "bfin-*-*"] } then {
     gas_test "assign-ok.s" "" "" "== assignment support"
@@ -326,12 +330,17 @@ proc test_cond {} {
     global subdir

     set testname "conditional listings"
+    if { [istarget "pdp11-*-*"] } then {
+	set listing "cond-pdp11.l"
+    } else {
+	set listing "cond.l"
+    }
     gas_run cond.s "-alc" ">dump.out"
     if ![string match "" $comp_output] {
 	send_log "$comp_output\n"
 	fail $testname
     } else {
-	if { [regexp_diff dump.out $srcdir/$subdir/cond.l] } {
+	if { [regexp_diff dump.out $srcdir/$subdir/$listing] } {
 	    fail $testname
 	} else {
 	    pass $testname
@@ -392,7 +401,11 @@ if { ![istarget "powerpc*-*-*"] && ![istarget "rs6000*-*-*"] && ![istarget "s390
 }

 run_dump_test quad
-run_dump_test octa
+
+# poor little PDP-11 can't handle 16-byte values
+if { ![istarget "pdp11-*-*"] } {
+    run_dump_test octa
+}

 # .set works differently on some targets.
 switch -glob $target_triplet {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-29 20:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 20:51 Committed: Fix all unexpected failures in gas testsuite for pdp11-aout Stephen Casner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).