public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] GAS/MIPS: Add mips16-e-irix.d testcase
@ 2023-10-09  7:09 YunQiang Su
  2023-11-10 14:21 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: YunQiang Su @ 2023-10-09  7:09 UTC (permalink / raw)
  To: macro; +Cc: binutils, YunQiang Su

The Irix 5 and 6 assemblers set the type of any common symbol and
any undefined non-function symbol to STT_OBJECT.  The symbol "g1"
in the testcase 'mips16-e' is an example.

We add this testcase with helping of ${imips} variable,  so that
we can run this test for Irix triples, and run mips16-e on other
mips platforms.

gas/ChangeLog:
	* testsuite/gas/mips/mips.exp: Add imips to mips16-e,
	so that Irix can use different testcase.
	* gas/mips/mips16-e-irix.d: New file.
---
 gas/testsuite/gas/mips/mips.exp        |  2 +-
 gas/testsuite/gas/mips/mips16-e-irix.d | 50 ++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 gas/testsuite/gas/mips/mips16-e-irix.d

diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 91cf8b11077..96f7c554eeb 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1242,7 +1242,7 @@ if { [istarget mips*-*-vxworks*] } {
 
     run_dump_test "comdat-reloc"
 
-    run_dump_test "${tmips}mips${el}16-e"
+    run_dump_test "${tmips}mips${el}16-e${imips}"
     run_dump_test "${tmips}mips${el}16-f"
 
     run_dump_test "elf-consthilo"
diff --git a/gas/testsuite/gas/mips/mips16-e-irix.d b/gas/testsuite/gas/mips/mips16-e-irix.d
new file mode 100644
index 00000000000..52459cb97f7
--- /dev/null
+++ b/gas/testsuite/gas/mips/mips16-e-irix.d
@@ -0,0 +1,50 @@
+#objdump: -rst --special-syms -mips16
+#name: MIPS16 reloc
+#as: -32 -mips16
+#source: mips16-e.s
+
+# The Irix 5 and 6 assemblers set the type of any common symbol and
+# any undefined non-function symbol to STT_OBJECT, 'g1' here.
+# See `mips_frob_symbol` in tc-mips.c.
+
+# Check MIPS16 reloc processing
+
+.*: +file format elf32-bigmips
+
+SYMBOL TABLE:
+0+0000000 l    d  \.text	0+0000000 \.text
+0+0000000 l    d  \.data	0+0000000 \.data
+0+0000000 l    d  \.bss	0+0000000 \.bss
+0+0000000 l    d  foo	0+0000000 foo
+0+0000000 l    d  \.reginfo	0+0000000 \.reginfo
+0+0000000 l    d  \.MIPS\.abiflags	0+0000000 \.MIPS\.abiflags
+0+0000000 l    d  \.(mdebug|pdr)	0+0000000 \.mdebug|\.pdr
+0+0000000 l    d  \.gnu\.attributes	0+0000000 \.gnu\.attributes
+0+0000002 l       \.text	0+0000000 0xf0 l1
+0+0000004 l       \.text	0+0000000 0xf0 \.L11
+0+0000000       O \*UND\*	0+0000000 g1
+
+
+RELOCATION RECORDS FOR \[foo\]:
+OFFSET +TYPE +VALUE
+0+0000000 R_MIPS_32         l1
+0+0000004 R_MIPS_32         l1
+0+0000008 R_MIPS_32         \.L1.*1
+0+000000c R_MIPS_32         \.L1.*1
+0+0000010 R_MIPS_32         g1
+0+0000014 R_MIPS_32         g1
+
+
+Contents of section \.text:
+ 0000 65006500 65006500 65006500 65006500  .*
+Contents of section \.reginfo:
+ 0000 00010000 00000000 00000000 00000000  .*
+ 0010 00000000 00000000                    .*
+Contents of section \.MIPS\.abiflags:
+ .*
+ .*
+Contents of section foo:
+ 0000 00000000 00000008 00000000 00000003  .*
+ 0010 00000000 00000008 00000000 00000000  .*
+Contents of section \.gnu\.attributes:
+ .*
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] GAS/MIPS: Add mips16-e-irix.d testcase
  2023-10-09  7:09 [PATCH v2] GAS/MIPS: Add mips16-e-irix.d testcase YunQiang Su
@ 2023-11-10 14:21 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2023-11-10 14:21 UTC (permalink / raw)
  To: YunQiang Su, macro; +Cc: binutils

Hi YunQiang Su,

> The Irix 5 and 6 assemblers set the type of any common symbol and
> any undefined non-function symbol to STT_OBJECT.  The symbol "g1"
> in the testcase 'mips16-e' is an example.
> 
> We add this testcase with helping of ${imips} variable,  so that
> we can run this test for Irix triples, and run mips16-e on other
> mips platforms.
> 
> gas/ChangeLog:
> 	* testsuite/gas/mips/mips.exp: Add imips to mips16-e,
> 	so that Irix can use different testcase.
> 	* gas/mips/mips16-e-irix.d: New file.
  Approved and applied.  Thank you for submitting this patch.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-10 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-09  7:09 [PATCH v2] GAS/MIPS: Add mips16-e-irix.d testcase YunQiang Su
2023-11-10 14:21 ` Nick Clifton

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).