PowerPC: Don't generate unused section symbols

Alan Modra amodra@gmail.com
Wed Jan 20 12:16:23 GMT 2021
PowerPC version of git commit d1bcae833b.

bfd/
	* elf32-ppc.c: Delete outdated comment.
	(TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define.
	* elf64-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define.
gas/
	* testsuite/gas/ppc/power4.d: Adjust for removal of section sym.
	* testsuite/gas/ppc/test1elf32.d: Likewise.
	* testsuite/gas/ppc/test1elf64.d: Likewise.
ld/
	* testsuite/ld-powerpc/relbrlt.s: Make symbols global.
	* testsuite/ld-powerpc/relbrlt.d: Adjust to suit.
	* testsuite/ld-powerpc/tlsget.d: Adjust for reordered stubs.
	* testsuite/ld-powerpc/tlsget.wf: Likewise.
	* testsuite/ld-powerpc/tlsget2.d: Likewise.
	* testsuite/ld-powerpc/tlsget2.wf: Likewise.
	* testsuite/ld-powerpc/tlsexe.r: Adjust for removed section syms.
	* testsuite/ld-powerpc/tlsexe32.r: Likewise.
	* testsuite/ld-powerpc/tlsexe32no.r: Likewise.
	* testsuite/ld-powerpc/tlsexeno.r: Likewise.
	* testsuite/ld-powerpc/tlsexenors.r: Likewise.
	* testsuite/ld-powerpc/tlsexers.r: Likewise.
	* testsuite/ld-powerpc/tlsexetoc.r: Likewise.
	* testsuite/ld-powerpc/tlsexetocrs.r: Likewise.
	* testsuite/ld-powerpc/tlsso.r: Likewise.
	* testsuite/ld-powerpc/tlsso32.r: Likewise.
	* testsuite/ld-powerpc/tlstocso.r: Likewise.

diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index a8da3049986..65f59a39d25 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -19,11 +19,8 @@
    Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
-
-/* This file is based on a preliminary PowerPC ELF ABI.  The
-   information may not match the final PowerPC ELF ABI.  It includes
-   suggestions from the in-progress Embedded PowerPC ABI, and that
-   information may also not match.  */
+/* Don't generate unused section symbols.  */
+#define TARGET_KEEP_UNUSED_SECTION_SYMBOLS FALSE
 
 #include "sysdep.h"
 #include <stdarg.h>
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index f76830b6c42..dcd427b3831 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -25,6 +25,9 @@
    http://www.linuxbase.org/spec/ELF/ppc64/PPC-elf64abi.txt, and
    http://www.linuxbase.org/spec/ELF/ppc64/spec/book1.html  */
 
+/* Don't generate unused section symbols.  */
+#define TARGET_KEEP_UNUSED_SECTION_SYMBOLS FALSE
+
 #include "sysdep.h"
 #include <stdarg.h>
 #include "bfd.h"
diff --git a/gas/testsuite/gas/ppc/power4.d b/gas/testsuite/gas/ppc/power4.d
index e4d9ea97918..fd277a2a286 100644
--- a/gas/testsuite/gas/ppc/power4.d
+++ b/gas/testsuite/gas/ppc/power4.d
@@ -21,7 +21,6 @@ Idx Name +Size +VMA +LMA +File off +Algn
 SYMBOL TABLE:
 0+ l +d +\.text	0+ (|\.text)
 0+ l +d +\.data	0+ (|\.data)
-0+ l +d +\.bss	0+ (|\.bss)
 0+ l +\.data	0+ dsym0
 0+10 l +\.data	0+ dsym1
 0+ l +d +\.toc	0+ (|\.toc)
diff --git a/gas/testsuite/gas/ppc/test1elf32.d b/gas/testsuite/gas/ppc/test1elf32.d
index d8d6835c270..fee834e0f32 100644
--- a/gas/testsuite/gas/ppc/test1elf32.d
+++ b/gas/testsuite/gas/ppc/test1elf32.d
@@ -18,7 +18,6 @@ Idx Name +Size +VMA +LMA +File off +Algn
 SYMBOL TABLE:
 0+0000 l    d  \.text	0+0000 (|\.text)
 0+0000 l    d  \.data	0+0000 (|\.data)
-0+0000 l    d  \.bss	0+0000 (|\.bss)
 0+0000 l       \.data	0+0000 dsym0
 0+0004 l       \.data	0+0000 dsym1
 0+0004 l       \.data	0+0000 usym0
diff --git a/gas/testsuite/gas/ppc/test1elf64.d b/gas/testsuite/gas/ppc/test1elf64.d
index 4df9e00a157..24b75bc3f74 100644
--- a/gas/testsuite/gas/ppc/test1elf64.d
+++ b/gas/testsuite/gas/ppc/test1elf64.d
@@ -21,7 +21,6 @@ Idx Name          Size      VMA               LMA               File off  Algn
 SYMBOL TABLE:
 0000000000000000 l    d  \.text	0000000000000000 (|\.text)
 0000000000000000 l    d  \.data	0000000000000000 (|\.data)
-0000000000000000 l    d  \.bss	0000000000000000 (|\.bss)
 0000000000000000 l       \.data	0000000000000000 dsym0
 0000000000000008 l       \.data	0000000000000000 dsym1
 0000000000000000 l    d  \.toc	0000000000000000 (|\.toc)
diff --git a/ld/testsuite/ld-powerpc/relbrlt.d b/ld/testsuite/ld-powerpc/relbrlt.d
index a00b1ffd0c5..3c61ef1918f 100644
--- a/ld/testsuite/ld-powerpc/relbrlt.d
+++ b/ld/testsuite/ld-powerpc/relbrlt.d
@@ -8,53 +8,53 @@
 Disassembly of section \.text:
 
 0*100000c0 <_start>:
-[0-9a-f	 ]*:	(49 bf 00 2d|2d 00 bf 49) 	bl      .*
-[0-9a-f	 ]*: R_PPC64_REL24	\.text\+0x37e003c
+[0-9a-f	 ]*:	(49 bf 00 39|39 00 bf 49) 	bl      .*
+[0-9a-f	 ]*: R_PPC64_REL24	far
 [0-9a-f	 ]*:	(60 00 00 00|00 00 00 60) 	nop
-[0-9a-f	 ]*:	(49 bf 00 19|19 00 bf 49) 	bl      .*
-[0-9a-f	 ]*: R_PPC64_REL24	\.text\+0x3bf0020
+[0-9a-f	 ]*:	(49 bf 00 25|25 00 bf 49) 	bl      .*
+[0-9a-f	 ]*: R_PPC64_REL24	far2far
 [0-9a-f	 ]*:	(60 00 00 00|00 00 00 60) 	nop
-[0-9a-f	 ]*:	(49 bf 00 21|21 00 bf 49) 	bl      .*
-[0-9a-f	 ]*: R_PPC64_REL24	\.text\+0x57e0024
+[0-9a-f	 ]*:	(49 bf 00 11|11 00 bf 49) 	bl      .*
+[0-9a-f	 ]*: R_PPC64_REL24	huge
 [0-9a-f	 ]*:	(60 00 00 00|00 00 00 60) 	nop
 [0-9a-f	 ]*:	00 00 00 00 	\.long 0x0
 [0-9a-f	 ]*:	(4b ff ff e4|e4 ff ff 4b) 	b       .* <_start>
 	\.\.\.
 
 [0-9a-f	 ]*<.*plt_branch.*>:
-[0-9a-f	 ]*:	(e9 82 80 e8|e8 80 82 e9) 	ld      r12,-32536\(r2\)
-[0-9a-f	 ]*: R_PPC64_TOC16_DS	\*ABS\*\+0x157f00e8
+[0-9a-f	 ]*:	(e9 82 80 f8|f8 80 82 e9) 	ld      r12,-32520\(r2\)
+[0-9a-f	 ]*: R_PPC64_TOC16_DS	\*ABS\*\+0x157f00f8
 [0-9a-f	 ]*:	(7d 89 03 a6|a6 03 89 7d) 	mtctr   r12
 [0-9a-f	 ]*:	(4e 80 04 20|20 04 80 4e) 	bctr
 
-[0-9a-f	 ]*<.*long_branch.*>:
-[0-9a-f	 ]*:	(49 bf 00 10|10 00 bf 49) 	b       .* <far>
-[0-9a-f	 ]*: R_PPC64_REL24	\*ABS\*\+0x137e00fc
-
 [0-9a-f	 ]*<.*plt_branch.*>:
-[0-9a-f	 ]*:	(e9 82 80 f0|f0 80 82 e9) 	ld      r12,-32528\(r2\)
-[0-9a-f	 ]*: R_PPC64_TOC16_DS	\*ABS\*\+0x157f00f0
+[0-9a-f	 ]*:	(e9 82 81 00|00 81 82 e9) 	ld      r12,-32512\(r2\)
+[0-9a-f	 ]*: R_PPC64_TOC16_DS	\*ABS\*\+0x157f0100
 [0-9a-f	 ]*:	(7d 89 03 a6|a6 03 89 7d) 	mtctr   r12
 [0-9a-f	 ]*:	(4e 80 04 20|20 04 80 4e) 	bctr
+
+[0-9a-f	 ]*<.*long_branch.*>:
+[0-9a-f	 ]*:	(49 bf 00 04|04 00 bf 49) 	b       .* <far>
+[0-9a-f	 ]*: R_PPC64_REL24	far
 	\.\.\.
 
 0*137e00fc <far>:
 [0-9a-f	 ]*:	(4e 80 00 20|20 00 80 4e) 	blr
 	\.\.\.
 
-0*13bf00e0 <far2far>:
+0*13bf00f0 <far2far>:
 [0-9a-f	 ]*:	(4e 80 00 20|20 00 80 4e) 	blr
 	\.\.\.
 
-0*157e00e4 <huge>:
+0*157e00f4 <huge>:
 [0-9a-f	 ]*:	(4e 80 00 20|20 00 80 4e) 	blr
 
 Disassembly of section \.branch_lt:
 
-0*157f00e8 .*:
-[0-9a-f	 ]*:	(00 00 00 00|e0 00 bf 13) .*
-[0-9a-f	 ]*: R_PPC64_RELATIVE	\*ABS\*\+0x13bf00e0
-[0-9a-f	 ]*:	(13 bf 00 e0|00 00 00 00) .*
-[0-9a-f	 ]*:	(00 00 00 00|e4 00 7e 15) .*
-[0-9a-f	 ]*: R_PPC64_RELATIVE	\*ABS\*\+0x157e00e4
-[0-9a-f	 ]*:	(15 7e 00 e4|00 00 00 00) .*
+0*157f00f8 .*:
+[0-9a-f	 ]*:	(00 00 00 00|f4 00 7e 15) .*
+[0-9a-f	 ]*: R_PPC64_RELATIVE	\*ABS\*\+0x157e00f4
+[0-9a-f	 ]*:	(15 7e 00 f4|00 00 00 00) .*
+[0-9a-f	 ]*:	(00 00 00 00|f0 00 bf 13) .*
+[0-9a-f	 ]*: R_PPC64_RELATIVE	\*ABS\*\+0x13bf00f0
+[0-9a-f	 ]*:	(13 bf 00 f0|00 00 00 00) .*
diff --git a/ld/testsuite/ld-powerpc/relbrlt.s b/ld/testsuite/ld-powerpc/relbrlt.s
index cee0cddfda0..dc4ad7a1ef2 100644
--- a/ld/testsuite/ld-powerpc/relbrlt.s
+++ b/ld/testsuite/ld-powerpc/relbrlt.s
@@ -16,13 +16,15 @@ _start:
  .space 0x1bf0000
 
  .section .text.far,"ax"
+ .globl far
 far:
  blr
 
  .section .text.pad2,"ax"
- .space 0x40ffe0
+ .space 0x40fff0
 
  .section .text.far2far,"ax"
+ .globl far2far
 far2far:
  blr
 
@@ -30,5 +32,6 @@ far2far:
  .space 0x1bf0000
 
  .section .text.huge,"ax"
+ .globl huge
 huge:
  blr
diff --git a/ld/testsuite/ld-powerpc/tlsexe.r b/ld/testsuite/ld-powerpc/tlsexe.r
index a2a129d9546..13c3efb12d5 100644
--- a/ld/testsuite/ld-powerpc/tlsexe.r
+++ b/ld/testsuite/ld-powerpc/tlsexe.r
@@ -70,19 +70,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND *
-.* SECTION +LOCAL +DEFAULT +1 *
-.* SECTION +LOCAL +DEFAULT +2 *
-.* SECTION +LOCAL +DEFAULT +3 *
-.* SECTION +LOCAL +DEFAULT +4 *
-.* SECTION +LOCAL +DEFAULT +5 *
-.* SECTION +LOCAL +DEFAULT +6 *
-.* SECTION +LOCAL +DEFAULT +7 *
-.* SECTION +LOCAL +DEFAULT +8 *
-.* SECTION +LOCAL +DEFAULT +9 *
-.* SECTION +LOCAL +DEFAULT +10 *
-.* SECTION +LOCAL +DEFAULT +11 *
-.* SECTION +LOCAL +DEFAULT +12 *
-.* SECTION +LOCAL +DEFAULT +13 *
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK
 .* TLS +LOCAL +DEFAULT +8 gd4
diff --git a/ld/testsuite/ld-powerpc/tlsexe32.r b/ld/testsuite/ld-powerpc/tlsexe32.r
index 112acde9331..9017069ad84 100644
--- a/ld/testsuite/ld-powerpc/tlsexe32.r
+++ b/ld/testsuite/ld-powerpc/tlsexe32.r
@@ -69,18 +69,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* NOTYPE +LOCAL +DEFAULT +UND 
-.* SECTION +LOCAL +DEFAULT +1 
-.* SECTION +LOCAL +DEFAULT +2 
-.* SECTION +LOCAL +DEFAULT +3 
-.* SECTION +LOCAL +DEFAULT +4 
-.* SECTION +LOCAL +DEFAULT +5 
-.* SECTION +LOCAL +DEFAULT +6 
-.* SECTION +LOCAL +DEFAULT +7 
-.* SECTION +LOCAL +DEFAULT +8 
-.* SECTION +LOCAL +DEFAULT +9 
-.* SECTION +LOCAL +DEFAULT +10 
-.* SECTION +LOCAL +DEFAULT +11 
-.* SECTION +LOCAL +DEFAULT +12 
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK
 .* TLS +LOCAL +DEFAULT +8 gd4
diff --git a/ld/testsuite/ld-powerpc/tlsexe32no.r b/ld/testsuite/ld-powerpc/tlsexe32no.r
index 4658b7d4eca..9715b6bc631 100644
--- a/ld/testsuite/ld-powerpc/tlsexe32no.r
+++ b/ld/testsuite/ld-powerpc/tlsexe32no.r
@@ -70,18 +70,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* NOTYPE +LOCAL +DEFAULT +UND 
-.* SECTION +LOCAL +DEFAULT +1 
-.* SECTION +LOCAL +DEFAULT +2 
-.* SECTION +LOCAL +DEFAULT +3 
-.* SECTION +LOCAL +DEFAULT +4 
-.* SECTION +LOCAL +DEFAULT +5 
-.* SECTION +LOCAL +DEFAULT +6 
-.* SECTION +LOCAL +DEFAULT +7 
-.* SECTION +LOCAL +DEFAULT +8 
-.* SECTION +LOCAL +DEFAULT +9 
-.* SECTION +LOCAL +DEFAULT +10 
-.* SECTION +LOCAL +DEFAULT +11 
-.* SECTION +LOCAL +DEFAULT +12 
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK
 .* TLS +LOCAL +DEFAULT +8 gd4
diff --git a/ld/testsuite/ld-powerpc/tlsexeno.r b/ld/testsuite/ld-powerpc/tlsexeno.r
index c0f6620f67f..d4dcebf4ec2 100644
--- a/ld/testsuite/ld-powerpc/tlsexeno.r
+++ b/ld/testsuite/ld-powerpc/tlsexeno.r
@@ -71,19 +71,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND *
-.* SECTION +LOCAL +DEFAULT +1 *
-.* SECTION +LOCAL +DEFAULT +2 *
-.* SECTION +LOCAL +DEFAULT +3 *
-.* SECTION +LOCAL +DEFAULT +4 *
-.* SECTION +LOCAL +DEFAULT +5 *
-.* SECTION +LOCAL +DEFAULT +6 *
-.* SECTION +LOCAL +DEFAULT +7 *
-.* SECTION +LOCAL +DEFAULT +8 *
-.* SECTION +LOCAL +DEFAULT +9 *
-.* SECTION +LOCAL +DEFAULT +10 *
-.* SECTION +LOCAL +DEFAULT +11 *
-.* SECTION +LOCAL +DEFAULT +12 *
-.* SECTION +LOCAL +DEFAULT +13 *
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK
 .* TLS +LOCAL +DEFAULT +8 gd4
diff --git a/ld/testsuite/ld-powerpc/tlsexenors.r b/ld/testsuite/ld-powerpc/tlsexenors.r
index e25fecd4d73..aec6a8dec88 100644
--- a/ld/testsuite/ld-powerpc/tlsexenors.r
+++ b/ld/testsuite/ld-powerpc/tlsexenors.r
@@ -71,19 +71,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND *
-.* SECTION +LOCAL +DEFAULT +1 *
-.* SECTION +LOCAL +DEFAULT +2 *
-.* SECTION +LOCAL +DEFAULT +3 *
-.* SECTION +LOCAL +DEFAULT +4 *
-.* SECTION +LOCAL +DEFAULT +5 *
-.* SECTION +LOCAL +DEFAULT +6 *
-.* SECTION +LOCAL +DEFAULT +7 *
-.* SECTION +LOCAL +DEFAULT +8 *
-.* SECTION +LOCAL +DEFAULT +9 *
-.* SECTION +LOCAL +DEFAULT +10 *
-.* SECTION +LOCAL +DEFAULT +11 *
-.* SECTION +LOCAL +DEFAULT +12 *
-.* SECTION +LOCAL +DEFAULT +13 *
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK
 .* TLS +LOCAL +DEFAULT +8 gd4
diff --git a/ld/testsuite/ld-powerpc/tlsexers.r b/ld/testsuite/ld-powerpc/tlsexers.r
index 3940dad347d..bb852310574 100644
--- a/ld/testsuite/ld-powerpc/tlsexers.r
+++ b/ld/testsuite/ld-powerpc/tlsexers.r
@@ -70,19 +70,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND *
-.* SECTION +LOCAL +DEFAULT +1 *
-.* SECTION +LOCAL +DEFAULT +2 *
-.* SECTION +LOCAL +DEFAULT +3 *
-.* SECTION +LOCAL +DEFAULT +4 *
-.* SECTION +LOCAL +DEFAULT +5 *
-.* SECTION +LOCAL +DEFAULT +6 *
-.* SECTION +LOCAL +DEFAULT +7 *
-.* SECTION +LOCAL +DEFAULT +8 *
-.* SECTION +LOCAL +DEFAULT +9 *
-.* SECTION +LOCAL +DEFAULT +10 *
-.* SECTION +LOCAL +DEFAULT +11 *
-.* SECTION +LOCAL +DEFAULT +12 *
-.* SECTION +LOCAL +DEFAULT +13 *
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK
 .* TLS +LOCAL +DEFAULT +8 gd4
diff --git a/ld/testsuite/ld-powerpc/tlsexetoc.r b/ld/testsuite/ld-powerpc/tlsexetoc.r
index 4ee5ffb2f01..6e676e15dfc 100644
--- a/ld/testsuite/ld-powerpc/tlsexetoc.r
+++ b/ld/testsuite/ld-powerpc/tlsexetoc.r
@@ -71,19 +71,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* NOTYPE +LOCAL +DEFAULT +UND *
-.* SECTION +LOCAL +DEFAULT +1 *
-.* SECTION +LOCAL +DEFAULT +2 *
-.* SECTION +LOCAL +DEFAULT +3 *
-.* SECTION +LOCAL +DEFAULT +4 *
-.* SECTION +LOCAL +DEFAULT +5 *
-.* SECTION +LOCAL +DEFAULT +6 *
-.* SECTION +LOCAL +DEFAULT +7 *
-.* SECTION +LOCAL +DEFAULT +8 *
-.* SECTION +LOCAL +DEFAULT +9 *
-.* SECTION +LOCAL +DEFAULT +10 *
-.* SECTION +LOCAL +DEFAULT +11 *
-.* SECTION +LOCAL +DEFAULT +12 *
-.* SECTION +LOCAL +DEFAULT +13 *
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* TLS +LOCAL +DEFAULT +8 gd4
 .* TLS +LOCAL +DEFAULT +8 ld4
diff --git a/ld/testsuite/ld-powerpc/tlsexetocrs.r b/ld/testsuite/ld-powerpc/tlsexetocrs.r
index 96ada16414f..36919c7aedc 100644
--- a/ld/testsuite/ld-powerpc/tlsexetocrs.r
+++ b/ld/testsuite/ld-powerpc/tlsexetocrs.r
@@ -71,19 +71,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* NOTYPE +LOCAL +DEFAULT +UND *
-.* SECTION +LOCAL +DEFAULT +1 *
-.* SECTION +LOCAL +DEFAULT +2 *
-.* SECTION +LOCAL +DEFAULT +3 *
-.* SECTION +LOCAL +DEFAULT +4 *
-.* SECTION +LOCAL +DEFAULT +5 *
-.* SECTION +LOCAL +DEFAULT +6 *
-.* SECTION +LOCAL +DEFAULT +7 *
-.* SECTION +LOCAL +DEFAULT +8 *
-.* SECTION +LOCAL +DEFAULT +9 *
-.* SECTION +LOCAL +DEFAULT +10 *
-.* SECTION +LOCAL +DEFAULT +11 *
-.* SECTION +LOCAL +DEFAULT +12 *
-.* SECTION +LOCAL +DEFAULT +13 *
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* TLS +LOCAL +DEFAULT +8 gd4
 .* TLS +LOCAL +DEFAULT +8 ld4
diff --git a/ld/testsuite/ld-powerpc/tlsget.d b/ld/testsuite/ld-powerpc/tlsget.d
index 729ee95c0f2..1c61fce0be7 100644
--- a/ld/testsuite/ld-powerpc/tlsget.d
+++ b/ld/testsuite/ld-powerpc/tlsget.d
@@ -8,16 +8,6 @@
 
 Disassembly of section \.text:
 
-.* <.*\.plt_call\..*>:
-.*:	(04 10 .. ..|.. .. 10 04) 	pld     r12,.*
-.*:	(e5 80 .. ..|.. .. 80 e5) 
-.*:	(7d 89 03 a6|a6 03 89 7d) 	mtctr   r12
-.*:	(4e 80 04 20|20 04 80 4e) 	bctr
-.*:	(f8 41 00 18|18 00 41 f8) 	std     r2,24\(r1\)
-.*:	(e9 82 .. ..|.. .. 82 e9) 	ld      r12,.*\(r2\)
-.*:	(7d 89 03 a6|a6 03 89 7d) 	mtctr   r12
-.*:	(4e 80 04 20|20 04 80 4e) 	bctr
-
 .* <.*\.plt_call\.__tls_get_addr_opt.*>:
 .*:	(e8 03 00 00|00 00 03 e8) 	ld      r0,0\(r3\)
 .*:	(e9 83 00 08|08 00 83 e9) 	ld      r12,8\(r3\)
@@ -48,6 +38,17 @@ Disassembly of section \.text:
 .*:	(e8 01 00 08|08 00 01 e8) 	ld      r0,8\(r1\)
 .*:	(7c 08 03 a6|a6 03 08 7c) 	mtlr    r0
 .*:	(4e 80 00 20|20 00 80 4e) 	blr
+
+.* <.*\.plt_call\..*>:
+.*:	(60 00 00 00|00 00 00 60) 	nop
+.*:	(04 10 .. ..|.. .. 10 04) 	pld     r12,.*
+.*:	(e5 80 .. ..|.. .. 80 e5) 
+.*:	(7d 89 03 a6|a6 03 89 7d) 	mtctr   r12
+.*:	(4e 80 04 20|20 04 80 4e) 	bctr
+.*:	(f8 41 00 18|18 00 41 f8) 	std     r2,24\(r1\)
+.*:	(e9 82 .. ..|.. .. 82 e9) 	ld      r12,.*\(r2\)
+.*:	(7d 89 03 a6|a6 03 89 7d) 	mtctr   r12
+.*:	(4e 80 04 20|20 04 80 4e) 	bctr
 #...
 
 .* <_start>:
@@ -59,7 +60,7 @@ Disassembly of section \.text:
 .*:	(4b ff .. ..|.. .. ff 4b) 	bl      .* <.*\.plt_call\.__tls_get_addr_opt.*\+0x30>
 .*:	(60 00 00 00|00 00 00 60) 	nop
 .*:	(4b ff .. ..|.. .. ff 4b) 	bl      .* <.*\.plt_call\..*:[^\+]*>
-.*:	(4b ff .. ..|.. .. ff 4b) 	bl      .* <.*.plt_call\..*:.*\+0x10>
+.*:	(4b ff .. ..|.. .. ff 4b) 	bl      .* <.*.plt_call\..*:.*\+0x14>
 .*:	(e8 41 00 18|18 00 41 e8) 	ld      r2,24\(r1\)
 
 .* <fun>:
diff --git a/ld/testsuite/ld-powerpc/tlsget.wf b/ld/testsuite/ld-powerpc/tlsget.wf
index bc9ccadf442..181bb397f97 100644
--- a/ld/testsuite/ld-powerpc/tlsget.wf
+++ b/ld/testsuite/ld-powerpc/tlsget.wf
@@ -9,8 +9,8 @@ Contents of the .eh_frame section:
   Augmentation data:     1b
   DW_CFA_def_cfa: r1 ofs 0
 
-0+14 0+14 0+18 FDE cie=0+ pc=0+280..0+314
-  DW_CFA_advance_loc: 128 to 0+300
+0+14 0+14 0+18 FDE cie=0+ pc=0+280..0+318
+  DW_CFA_advance_loc: 96 to 0+2e0
   DW_CFA_offset_extended_sf: r65 at cfa\+8
   DW_CFA_advance_loc: 16 to .*
   DW_CFA_restore_extended: r65
diff --git a/ld/testsuite/ld-powerpc/tlsget2.d b/ld/testsuite/ld-powerpc/tlsget2.d
index a1c77ed7f0e..48569c8c2e3 100644
--- a/ld/testsuite/ld-powerpc/tlsget2.d
+++ b/ld/testsuite/ld-powerpc/tlsget2.d
@@ -8,14 +8,6 @@
 
 Disassembly of section \.text:
 
-.* <.*\.plt_call\..*>:
-.*:	(f8 41 00 18|18 00 41 f8) 	std     r2,24\(r1\)
-.*:	(60 00 00 00|00 00 00 60) 	nop
-.*:	(04 10 .. ..|.. .. 10 04) 	pld     r12,.*
-.*:	(e5 80 .. ..|.. .. 80 e5) 
-.*:	(7d 89 03 a6|a6 03 89 7d) 	mtctr   r12
-.*:	(4e 80 04 20|20 04 80 4e) 	bctr
-
 .* <.*\.plt_call\.__tls_get_addr_opt.*>:
 .*:	(e8 03 00 00|00 00 03 e8) 	ld      r0,0\(r3\)
 .*:	(e9 83 00 08|08 00 83 e9) 	ld      r12,8\(r3\)
@@ -35,6 +27,14 @@ Disassembly of section \.text:
 .*:	(e8 01 00 08|08 00 01 e8) 	ld      r0,8\(r1\)
 .*:	(7c 08 03 a6|a6 03 08 7c) 	mtlr    r0
 .*:	(4e 80 00 20|20 00 80 4e) 	blr
+
+.* <.*\.plt_call\..*>:
+.*:	(f8 41 00 18|18 00 41 f8) 	std     r2,24\(r1\)
+.*:	(60 00 00 00|00 00 00 60) 	nop
+.*:	(04 10 .. ..|.. .. 10 04) 	pld     r12,.*
+.*:	(e5 80 .. ..|.. .. 80 e5) 
+.*:	(7d 89 03 a6|a6 03 89 7d) 	mtctr   r12
+.*:	(4e 80 04 20|20 04 80 4e) 	bctr
 #...
 
 .* <_start>:
diff --git a/ld/testsuite/ld-powerpc/tlsget2.wf b/ld/testsuite/ld-powerpc/tlsget2.wf
index 359e62de760..0d09c701760 100644
--- a/ld/testsuite/ld-powerpc/tlsget2.wf
+++ b/ld/testsuite/ld-powerpc/tlsget2.wf
@@ -10,7 +10,7 @@ Contents of the .eh_frame section:
   DW_CFA_def_cfa: r1 ofs 0
 
 0+14 0+14 0+18 FDE cie=0+ pc=0+280..0+2e0
-  DW_CFA_advance_loc: 76 to 0+2cc
+  DW_CFA_advance_loc: 52 to 0+2b4
   DW_CFA_offset_extended_sf: r65 at cfa\+8
   DW_CFA_advance_loc: 16 to .*
   DW_CFA_restore_extended: r65
diff --git a/ld/testsuite/ld-powerpc/tlsso.r b/ld/testsuite/ld-powerpc/tlsso.r
index 573139dbca0..99f52ba7b1b 100644
--- a/ld/testsuite/ld-powerpc/tlsso.r
+++ b/ld/testsuite/ld-powerpc/tlsso.r
@@ -91,18 +91,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* NOTYPE +LOCAL +DEFAULT +UND *
-.* SECTION +LOCAL +DEFAULT +1 *
-.* SECTION +LOCAL +DEFAULT +2 *
-.* SECTION +LOCAL +DEFAULT +3 *
-.* SECTION +LOCAL +DEFAULT +4 *
-.* SECTION +LOCAL +DEFAULT +5 *
-.* SECTION +LOCAL +DEFAULT +6 *
-.* SECTION +LOCAL +DEFAULT +7 *
-.* SECTION +LOCAL +DEFAULT +8 *
-.* SECTION +LOCAL +DEFAULT +9 *
-.* SECTION +LOCAL +DEFAULT +10 *
-.* SECTION +LOCAL +DEFAULT +11 *
-.* SECTION +LOCAL +DEFAULT +12 *
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK
 .* TLS +LOCAL +DEFAULT +7 gd4
diff --git a/ld/testsuite/ld-powerpc/tlsso32.r b/ld/testsuite/ld-powerpc/tlsso32.r
index 7c0d680acff..a20d740eedd 100644
--- a/ld/testsuite/ld-powerpc/tlsso32.r
+++ b/ld/testsuite/ld-powerpc/tlsso32.r
@@ -89,17 +89,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* NOTYPE +LOCAL +DEFAULT +UND 
-.* SECTION +LOCAL +DEFAULT +1 
-.* SECTION +LOCAL +DEFAULT +2 
-.* SECTION +LOCAL +DEFAULT +3 
-.* SECTION +LOCAL +DEFAULT +4 
-.* SECTION +LOCAL +DEFAULT +5 
-.* SECTION +LOCAL +DEFAULT +6 
-.* SECTION +LOCAL +DEFAULT +7 
-.* SECTION +LOCAL +DEFAULT +8 
-.* SECTION +LOCAL +DEFAULT +9 
-.* SECTION +LOCAL +DEFAULT +10 
-.* SECTION +LOCAL +DEFAULT +11 
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK
 .* TLS +LOCAL +DEFAULT +7 gd4
diff --git a/ld/testsuite/ld-powerpc/tlstocso.r b/ld/testsuite/ld-powerpc/tlstocso.r
index bf3e8fc0975..65f0c4c7921 100644
--- a/ld/testsuite/ld-powerpc/tlstocso.r
+++ b/ld/testsuite/ld-powerpc/tlstocso.r
@@ -84,18 +84,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
 .* NOTYPE +LOCAL +DEFAULT +UND *
-.* SECTION +LOCAL +DEFAULT +1 *
-.* SECTION +LOCAL +DEFAULT +2 *
-.* SECTION +LOCAL +DEFAULT +3 *
-.* SECTION +LOCAL +DEFAULT +4 *
-.* SECTION +LOCAL +DEFAULT +5 *
-.* SECTION +LOCAL +DEFAULT +6 *
-.* SECTION +LOCAL +DEFAULT +7 *
-.* SECTION +LOCAL +DEFAULT +8 *
-.* SECTION +LOCAL +DEFAULT +9 *
-.* SECTION +LOCAL +DEFAULT +10 *
-.* SECTION +LOCAL +DEFAULT +11 *
-.* SECTION +LOCAL +DEFAULT +12 *
 .* FILE +LOCAL +DEFAULT +ABS .*
 .* TLS +LOCAL +DEFAULT +7 gd4
 .* TLS +LOCAL +DEFAULT +7 ld4

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list