public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* sparc-sun-solaris2 and sparc64-sun-solaris2 config
@ 2021-01-06 10:51 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2021-01-06 10:51 UTC (permalink / raw)
  To: binutils

A bunch of ld tests fail on these targets due to the test specifying
-melf32_sparc or -melf64_sparc, which according to ld/configure.tgt
are valid.  However, config.bfd lacks the corresponding bfd target
resulting in an error.  Fix that by adding target_selvecs.

bfd/
	* config.bfd (sparc-*-solaris2*): Add sparc_elf32_vec.
	(sparc64-*-solaris2*): Add sparc_elf64_vec and
	sparc_elf32_vec.
ld/
	* testsuite/ld-sparc/sparc.exp (sparc64tests): Set text-segment
	base for some tests.
	* testsuite/ld-sparc/gotop32.dd: Match solaris output.
	* testsuite/ld-sparc/gotop32.sd: Likewise.
	* testsuite/ld-sparc/gotop32.td: Likewise.
	* testsuite/ld-sparc/gotop64.dd: Likewise.
	* testsuite/ld-sparc/gotop64.sd: Likewise.
	* testsuite/ld-sparc/gotop64.td: Likewise.
	* testsuite/ld-sparc/tlsg32.sd: Likewise.
	* testsuite/ld-sparc/tlsg64.sd: Likewise.
	* testsuite/ld-sparc/tlspie32.dd: Likewise.
	* testsuite/ld-sparc/tlspie64.dd: Likewise.
	* testsuite/ld-sparc/tlssunbin32.dd: Likewise.
	* testsuite/ld-sparc/tlssunbin32.sd: Likewise.
	* testsuite/ld-sparc/tlssunbin32.td: Likewise.
	* testsuite/ld-sparc/tlssunbin64.dd: Likewise.
	* testsuite/ld-sparc/tlssunbin64.sd: Likewise.
	* testsuite/ld-sparc/tlssunbin64.td: Likewise.
	* testsuite/ld-sparc/tlssunnopic32.dd: Likewise.
	* testsuite/ld-sparc/tlssunnopic32.sd: Likewise.
	* testsuite/ld-sparc/tlssunnopic64.dd: Likewise.
	* testsuite/ld-sparc/tlssunnopic64.sd: Likewise.
	* testsuite/ld-sparc/tlssunpic32.dd: Likewise.
	* testsuite/ld-sparc/tlssunpic32.sd: Likewise.
	* testsuite/ld-sparc/tlssunpic32.td: Likewise.
	* testsuite/ld-sparc/tlssunpic64.dd: Likewise.
	* testsuite/ld-sparc/tlssunpic64.sd: Likewise.
	* testsuite/ld-sparc/tlssunpic64.td: Likewise.
	* testsuite/ld-sparc/wdispcall.dd: Likewise.

diff --git a/bfd/config.bfd b/bfd/config.bfd
index f276386d85..56a080d239 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -1275,11 +1275,12 @@ case "${targ}" in
 
   sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
     targ_defvec=sparc_elf32_sol2_vec
+    targ_selvecs=sparc_elf32_vec
     ;;
 #ifdef BFD64
   sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
     targ_defvec=sparc_elf32_sol2_vec
-    targ_selvecs="sparc_elf64_sol2_vec"
+    targ_selvecs="sparc_elf64_sol2_vec sparc_elf32_vec sparc_elf64_vec"
     want64=true
     ;;
   sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu)
diff --git a/ld/testsuite/ld-sparc/gotop32.dd b/ld/testsuite/ld-sparc/gotop32.dd
index 28dd942ce2..ea1ca13ff8 100644
--- a/ld/testsuite/ld-sparc/gotop32.dd
+++ b/ld/testsuite/ld-sparc/gotop32.dd
@@ -4,7 +4,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Disassembly of section .text:
 00001000 <foo-0x8>:
diff --git a/ld/testsuite/ld-sparc/gotop32.sd b/ld/testsuite/ld-sparc/gotop32.sd
index fc167560da..85f4c193fb 100644
--- a/ld/testsuite/ld-sparc/gotop32.sd
+++ b/ld/testsuite/ld-sparc/gotop32.sd
@@ -4,7 +4,7 @@
 #objdump: -sj.got
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Contents of section .got:
  12070 00012000 00000000                    .*
diff --git a/ld/testsuite/ld-sparc/gotop32.td b/ld/testsuite/ld-sparc/gotop32.td
index d933b71f98..74bc41f6ee 100644
--- a/ld/testsuite/ld-sparc/gotop32.td
+++ b/ld/testsuite/ld-sparc/gotop32.td
@@ -4,7 +4,7 @@
 #objdump: -sj.data
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Contents of section .data:
  13000 12345678 deadbeef                    .*
diff --git a/ld/testsuite/ld-sparc/gotop64.dd b/ld/testsuite/ld-sparc/gotop64.dd
index e3c59c2367..fc6d3a4c88 100644
--- a/ld/testsuite/ld-sparc/gotop64.dd
+++ b/ld/testsuite/ld-sparc/gotop64.dd
@@ -4,7 +4,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Disassembly of section .text:
 0000000000001000 <foo-0x8>:
diff --git a/ld/testsuite/ld-sparc/gotop64.sd b/ld/testsuite/ld-sparc/gotop64.sd
index 9ab0f619ec..316a66b805 100644
--- a/ld/testsuite/ld-sparc/gotop64.sd
+++ b/ld/testsuite/ld-sparc/gotop64.sd
@@ -4,7 +4,7 @@
 #objdump: -sj.got
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Contents of section .got:
  1020e0 00000000 00102000 00000000 00000000  .*
diff --git a/ld/testsuite/ld-sparc/gotop64.td b/ld/testsuite/ld-sparc/gotop64.td
index 303cdfee01..1e9412ff4c 100644
--- a/ld/testsuite/ld-sparc/gotop64.td
+++ b/ld/testsuite/ld-sparc/gotop64.td
@@ -4,7 +4,7 @@
 #objdump: -sj.data
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Contents of section .data:
  103000 12345678 deadbeef                    .*
diff --git a/ld/testsuite/ld-sparc/sparc.exp b/ld/testsuite/ld-sparc/sparc.exp
index 7bdf676a7f..5621d07736 100644
--- a/ld/testsuite/ld-sparc/sparc.exp
+++ b/ld/testsuite/ld-sparc/sparc.exp
@@ -117,7 +117,7 @@ set sparc64tests {
     {"64-bit: Another helper shared library" "-shared -melf64_sparc" ""
      "--64 -Av9 -K PIC" {tlssunbinpic64.s} {} "libtlssunbinpic64.so"}
     {"64-bit: TLS -fpic and -fno-pic exec transitions"
-     "-melf64_sparc --hash-style=sysv tmpdir/libtlslib64.so tmpdir/tlssunbinpic64.o" ""
+     "-melf64_sparc -Ttext-segment=0x100000 --hash-style=sysv tmpdir/libtlslib64.so tmpdir/tlssunbinpic64.o" ""
      "--64 -Av9" {tlssunbin64.s}
      {{readelf -WSsrl tlssunbin64.rd} {objdump -drj.text tlssunbin64.dd}
       {objdump -sj.got tlssunbin64.sd} {objdump -sj.tdata tlssunbin64.td}}
@@ -130,7 +130,8 @@ set sparc64tests {
     {"64-bit: TLS in debug sections" "-melf64_sparc" ""
      "--64 -Av9" {tlsg64.s}
      {{objdump -sj.debug_foobar tlsg64.sd}} "tlsg64"}
-    {"64-bit: TLS -fpie" "-melf64_sparc -pie tmpdir/libtlslib64.so" ""
+    {"64-bit: TLS -fpie"
+     "-melf64_sparc -pie -Ttext-segment=0x100000 tmpdir/libtlslib64.so" ""
      "--64 -Av9 -K PIC" {tlspie64.s}
      {{objdump -drj.text tlspie64.dd}} "tlspie64"}
     {"64-bit: GOTDATA relocations"
diff --git a/ld/testsuite/ld-sparc/tlsg32.sd b/ld/testsuite/ld-sparc/tlsg32.sd
index 861ac2eb43..307955d701 100644
--- a/ld/testsuite/ld-sparc/tlsg32.sd
+++ b/ld/testsuite/ld-sparc/tlsg32.sd
@@ -4,7 +4,7 @@
 #objdump: -sj.debug_foobar
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Contents of section .debug_foobar:
  0+ 0+18  .*
diff --git a/ld/testsuite/ld-sparc/tlsg64.sd b/ld/testsuite/ld-sparc/tlsg64.sd
index 4181dde432..e38387d426 100644
--- a/ld/testsuite/ld-sparc/tlsg64.sd
+++ b/ld/testsuite/ld-sparc/tlsg64.sd
@@ -4,7 +4,7 @@
 #objdump: -sj.debug_foobar
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Contents of section .debug_foobar:
  0+ 0+ 0+18  .*
diff --git a/ld/testsuite/ld-sparc/tlspie32.dd b/ld/testsuite/ld-sparc/tlspie32.dd
index a31e11a074..a0a1f84415 100644
--- a/ld/testsuite/ld-sparc/tlspie32.dd
+++ b/ld/testsuite/ld-sparc/tlspie32.dd
@@ -5,8 +5,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
-
+.*: +file format elf32-sparc.*
 
 Disassembly of section .text:
 
@@ -18,7 +17,7 @@ Disassembly of section .text:
  +[0-9a-f]+:	9d e3 bf 98 	save  %sp, -104, %sp
  +[0-9a-f]+:	2f 00 00 40 	sethi  %hi\(0x10000\), %l7
  +[0-9a-f]+:	7f ff ff fc 	call  [0-9a-f]+ <.*>
- +[0-9a-f]+:	ae 05 e1 60 	add  %l7, 0x160, %l7	! 10160 <.*>
+ +[0-9a-f]+:	ae 05 e1 (58|60) 	add  %l7, 0x(158|160), %l7	! 10(158|160) <.*>
  +[0-9a-f]+:	01 00 00 00 	nop 
  +[0-9a-f]+:	01 00 00 00 	nop 
  +[0-9a-f]+:	01 00 00 00 	nop 
diff --git a/ld/testsuite/ld-sparc/tlspie64.dd b/ld/testsuite/ld-sparc/tlspie64.dd
index 6c8aea9288..c067575d20 100644
--- a/ld/testsuite/ld-sparc/tlspie64.dd
+++ b/ld/testsuite/ld-sparc/tlspie64.dd
@@ -5,8 +5,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
-
+.*: +file format elf64-sparc.*
 
 Disassembly of section .text:
 
@@ -18,7 +17,7 @@ Disassembly of section .text:
  +[0-9a-f]+:	9d e3 bf 60 	save  %sp, -160, %sp
  +[0-9a-f]+:	2f 00 04 00 	sethi  %hi\(0x100000\), %l7
  +[0-9a-f]+:	7f ff ff fc 	call  [0-9a-f]+ <.*>
- +[0-9a-f]+:	ae 05 e2 08 	add  %l7, 0x208, %l7	! 100208 <.*>
+ +[0-9a-f]+:	ae 05 (e1 f8|e2 08) 	add  %l7, 0x(1f8|208), %l7	! 100(1f8|208) <.*>
  +[0-9a-f]+:	01 00 00 00 	nop 
  +[0-9a-f]+:	01 00 00 00 	nop 
  +[0-9a-f]+:	01 00 00 00 	nop 
diff --git a/ld/testsuite/ld-sparc/tlssunbin32.dd b/ld/testsuite/ld-sparc/tlssunbin32.dd
index ce8b174c17..502b11eaf3 100644
--- a/ld/testsuite/ld-sparc/tlssunbin32.dd
+++ b/ld/testsuite/ld-sparc/tlssunbin32.dd
@@ -4,7 +4,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Disassembly of section .text:
 
diff --git a/ld/testsuite/ld-sparc/tlssunbin32.sd b/ld/testsuite/ld-sparc/tlssunbin32.sd
index 6c5509eb03..1d5112fa3f 100644
--- a/ld/testsuite/ld-sparc/tlssunbin32.sd
+++ b/ld/testsuite/ld-sparc/tlssunbin32.sd
@@ -4,7 +4,7 @@
 #objdump: -sj.got
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Contents of section .got:
  2328c 000231f4 0+ 0+ 0+  .*
diff --git a/ld/testsuite/ld-sparc/tlssunbin32.td b/ld/testsuite/ld-sparc/tlssunbin32.td
index f5974e7554..943f24c803 100644
--- a/ld/testsuite/ld-sparc/tlssunbin32.td
+++ b/ld/testsuite/ld-sparc/tlssunbin32.td
@@ -4,7 +4,7 @@
 #objdump: -sj.tdata
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Contents of section .tdata:
  22194 00000011 00000000 00000000 00000000  .*
diff --git a/ld/testsuite/ld-sparc/tlssunbin64.dd b/ld/testsuite/ld-sparc/tlssunbin64.dd
index 58935564ec..c3188463b0 100644
--- a/ld/testsuite/ld-sparc/tlssunbin64.dd
+++ b/ld/testsuite/ld-sparc/tlssunbin64.dd
@@ -4,7 +4,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Disassembly of section .text:
 
diff --git a/ld/testsuite/ld-sparc/tlssunbin64.sd b/ld/testsuite/ld-sparc/tlssunbin64.sd
index 68e0d97ff3..28e176596a 100644
--- a/ld/testsuite/ld-sparc/tlssunbin64.sd
+++ b/ld/testsuite/ld-sparc/tlssunbin64.sd
@@ -4,7 +4,7 @@
 #objdump: -sj.got
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Contents of section .got:
  202338 0+ 0+202208 0+ 0+  .*
diff --git a/ld/testsuite/ld-sparc/tlssunbin64.td b/ld/testsuite/ld-sparc/tlssunbin64.td
index f7eef833b5..0fddf32dd0 100644
--- a/ld/testsuite/ld-sparc/tlssunbin64.td
+++ b/ld/testsuite/ld-sparc/tlssunbin64.td
@@ -4,7 +4,7 @@
 #objdump: -sj.tdata
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Contents of section .tdata:
  2021a4 00000011 00000012 00000013 00000014  .*
diff --git a/ld/testsuite/ld-sparc/tlssunnopic32.dd b/ld/testsuite/ld-sparc/tlssunnopic32.dd
index 4f47c7a308..3074dfd38b 100644
--- a/ld/testsuite/ld-sparc/tlssunnopic32.dd
+++ b/ld/testsuite/ld-sparc/tlssunnopic32.dd
@@ -5,7 +5,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Disassembly of section .text:
 
diff --git a/ld/testsuite/ld-sparc/tlssunnopic32.sd b/ld/testsuite/ld-sparc/tlssunnopic32.sd
index 0d1beac8a1..738b43a2be 100644
--- a/ld/testsuite/ld-sparc/tlssunnopic32.sd
+++ b/ld/testsuite/ld-sparc/tlssunnopic32.sd
@@ -5,7 +5,7 @@
 #objdump: -sj.got
 #target: sparc*-*-*
 
-.*:     file format elf32-sparc
+.*:     file format elf32-sparc.*
 
 Contents of section \.got:
  12080 0+12000 0+ 0+ 0+  .*
diff --git a/ld/testsuite/ld-sparc/tlssunnopic64.dd b/ld/testsuite/ld-sparc/tlssunnopic64.dd
index cd872f2df3..d8712e3adc 100644
--- a/ld/testsuite/ld-sparc/tlssunnopic64.dd
+++ b/ld/testsuite/ld-sparc/tlssunnopic64.dd
@@ -5,7 +5,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Disassembly of section .text:
 
diff --git a/ld/testsuite/ld-sparc/tlssunnopic64.sd b/ld/testsuite/ld-sparc/tlssunnopic64.sd
index 45c77e783a..e2d67486e7 100644
--- a/ld/testsuite/ld-sparc/tlssunnopic64.sd
+++ b/ld/testsuite/ld-sparc/tlssunnopic64.sd
@@ -5,7 +5,7 @@
 #objdump: -sj.got
 #target: sparc*-*-*
 
-.*:     file format elf64-sparc
+.*:     file format elf64-sparc.*
 
 Contents of section \.got:
  102100 0+ 0+102000 0+ 0+  .*
diff --git a/ld/testsuite/ld-sparc/tlssunpic32.dd b/ld/testsuite/ld-sparc/tlssunpic32.dd
index 558977114d..c0dc03599d 100644
--- a/ld/testsuite/ld-sparc/tlssunpic32.dd
+++ b/ld/testsuite/ld-sparc/tlssunpic32.dd
@@ -5,7 +5,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Disassembly of section .text:
 
diff --git a/ld/testsuite/ld-sparc/tlssunpic32.sd b/ld/testsuite/ld-sparc/tlssunpic32.sd
index 4aecfd7d19..8503487b0a 100644
--- a/ld/testsuite/ld-sparc/tlssunpic32.sd
+++ b/ld/testsuite/ld-sparc/tlssunpic32.sd
@@ -5,7 +5,7 @@
 #objdump: -sj.got
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Contents of section .got:
  120f8 00012060 00000000 00000020 00000000  .*
diff --git a/ld/testsuite/ld-sparc/tlssunpic32.td b/ld/testsuite/ld-sparc/tlssunpic32.td
index eb4e3445cd..d916d94058 100644
--- a/ld/testsuite/ld-sparc/tlssunpic32.td
+++ b/ld/testsuite/ld-sparc/tlssunpic32.td
@@ -5,7 +5,7 @@
 #objdump: -sj.tdata
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Contents of section .tdata:
  12000 00000011 00000012 00000013 00000014  .*
diff --git a/ld/testsuite/ld-sparc/tlssunpic64.dd b/ld/testsuite/ld-sparc/tlssunpic64.dd
index 00dbc20c84..e08dc465a1 100644
--- a/ld/testsuite/ld-sparc/tlssunpic64.dd
+++ b/ld/testsuite/ld-sparc/tlssunpic64.dd
@@ -5,7 +5,7 @@
 #objdump: -drj.text
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Disassembly of section .text:
 
diff --git a/ld/testsuite/ld-sparc/tlssunpic64.sd b/ld/testsuite/ld-sparc/tlssunpic64.sd
index 9061c2efce..60110bed46 100644
--- a/ld/testsuite/ld-sparc/tlssunpic64.sd
+++ b/ld/testsuite/ld-sparc/tlssunpic64.sd
@@ -5,7 +5,7 @@
 #objdump: -sj.got
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Contents of section .got:
  102190 00000000 00102060 00000000 00000000  .*
diff --git a/ld/testsuite/ld-sparc/tlssunpic64.td b/ld/testsuite/ld-sparc/tlssunpic64.td
index 1e82d2b42f..f06909bbeb 100644
--- a/ld/testsuite/ld-sparc/tlssunpic64.td
+++ b/ld/testsuite/ld-sparc/tlssunpic64.td
@@ -5,7 +5,7 @@
 #objdump: -sj.tdata
 #target: sparc*-*-*
 
-.*: +file format elf64-sparc
+.*: +file format elf64-sparc.*
 
 Contents of section .tdata:
  102000 00000011 00000012 00000013 00000014  .*
diff --git a/ld/testsuite/ld-sparc/wdispcall.dd b/ld/testsuite/ld-sparc/wdispcall.dd
index ab06a567d9..1dd1282431 100644
--- a/ld/testsuite/ld-sparc/wdispcall.dd
+++ b/ld/testsuite/ld-sparc/wdispcall.dd
@@ -4,7 +4,7 @@
 #objdump: -dj.wdispcall
 #target: sparc*-*-*
 
-.*: +file format elf32-sparc
+.*: +file format elf32-sparc.*
 
 Disassembly of section .wdispcall:
 

-- 
Alan Modra
Australia Development Lab, IBM

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

only message in thread, other threads:[~2021-01-06 10:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 10:51 sparc-sun-solaris2 and sparc64-sun-solaris2 config Alan Modra

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