public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RFC: Remove empty output sections
@ 2005-02-24 22:38 H. J. Lu
  2005-02-25 15:30 ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-02-24 22:38 UTC (permalink / raw)
  To: binutils

This patch removes empty output sections. It works on ia32, ia64 and
x86_64. Any comments?


H.J.
--
bfd/

2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (elf_gc_mark_section): New.
	(bfd_elf_gc_sections): Call elf_gc_mark_section for
	non-relocatable link if we don't to GC. Return afterwards if
	GC is off.

include/

2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>

	* bfdlink.h (bfd_link_info): Add gc_sections.

ld/

2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Remove
	unused empty output sections for non-relocatable link.

	* ld.h (args_type): Remove gc_sections.

	* ldlang.c (lang_gc_sections): Always call bfd_gc_sections.

	* ldmain.c (main): Initialize link_info.gc_sections to FALSE.
	Use link_info.gc_sections instead of command_line.gc_sections.
	* lexsup.c (parse_args): Likewise.

ld/testsuite/

2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-i386/tlsbin.rd: Updated for empty section removal.
	* ld-i386/tlsnopic.rd: Likewise.
	* ld-i386/tlspic.rd: Likewise.
	* ld-ia64/tlsbin.rd: Likewise.
	* ld-ia64/tlspic.rd: Likewise.
	* ld-x86-64/tlsbin.rd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.

--- binutils/bfd/elflink.c.empty	2005-02-24 11:23:47.000000000 -0800
+++ binutils/bfd/elflink.c	2005-02-24 12:25:54.108720906 -0800
@@ -8996,23 +8996,51 @@ elf_gc_mark_dynamic_ref_symbol (struct e
 
   return TRUE;
 }
+ 
+/* Mark sections containing global symbols.  This is called through
+   elf_link_hash_traverse.  */
 
+static bfd_boolean
+elf_gc_mark_section (struct elf_link_hash_entry *h,
+		     void *global ATTRIBUTE_UNUSED)
+{
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  if ((h->root.type == bfd_link_hash_defined
+       || h->root.type == bfd_link_hash_defweak)
+      && h->def_regular)
+    h->root.u.def.section->flags |= SEC_KEEP;
+
+  return TRUE;
+}
+ 
 /* Do mark and sweep of unused sections.  */
 
 bfd_boolean
 bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
 {
-  bfd_boolean ok = TRUE;
+  bfd_boolean ok;
   bfd *sub;
   asection * (*gc_mark_hook)
     (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
      struct elf_link_hash_entry *h, Elf_Internal_Sym *);
 
-  if (!get_elf_backend_data (abfd)->can_gc_sections
-      || info->relocatable
-      || info->emitrelocations
-      || info->shared
-      || !is_elf_hash_table (info->hash))
+  ok = (get_elf_backend_data (abfd)->can_gc_sections
+	&& !info->emitrelocations
+	&& !info->shared
+	&& is_elf_hash_table (info->hash));
+
+  /* For non-relocable link, keep all sections containing global
+     symbols if we won't do GC.  */
+  if (!info->relocatable && (!ok || !info->gc_sections))
+    elf_link_hash_traverse (elf_hash_table (info), elf_gc_mark_section,
+			    NULL);
+
+  if (!info->gc_sections)
+    return TRUE;
+
+  if (!ok || info->relocatable)
     {
       (*_bfd_error_handler)(_("Warning: gc-sections option ignored"));
       return TRUE;
--- binutils/include/bfdlink.h.empty	2005-02-03 12:00:28.000000000 -0800
+++ binutils/include/bfdlink.h	2005-02-24 10:52:55.135366138 -0800
@@ -324,6 +324,9 @@ struct bfd_link_info
   /* TRUE if we should warn when adding a DT_TEXTREL to a shared object.  */
   unsigned int warn_shared_textrel: 1;
 
+  /* TRUE if unreferenced sections should be removed.  */
+  unsigned int gc_sections: 1;
+
   /* What to do with unresolved symbols in an object file.
      When producing executables the default is GENERATE_ERROR.
      When producing shared libraries the default is IGNORE.  The
--- binutils/ld/emultempl/elf32.em.empty	2005-02-23 09:30:13.000000000 -0800
+++ binutils/ld/emultempl/elf32.em	2005-02-24 09:10:43.000000000 -0800
@@ -1441,6 +1441,36 @@ gld${EMULATION_NAME}_finish (void)
       lang_do_assignments (stat_ptr->head, abs_output_section,
 			   (fill_type *) 0, (bfd_vma) 0);
     }
+
+  if (!link_info.relocatable)
+    {
+      lang_output_section_statement_type *os;
+
+      for (os = &lang_output_section_statement.head->output_section_statement;
+	   os != NULL;
+	   os = os->next)
+	{
+	  asection *s;
+
+	  if (os == abs_output_section || os->constraint == -1)
+	    continue;
+	  s = os->bfd_section;
+	  if (s != NULL && s->size == 0 && (s->flags & SEC_KEEP) == 0)
+	    {
+	      asection **p;
+
+	      os->bfd_section = NULL;
+
+	      for (p = &output_bfd->sections; *p; p = &(*p)->next)
+		if (*p == s)
+		  {
+		    bfd_section_list_remove (output_bfd, p);
+		    output_bfd->section_count--;
+		    break;
+		  }
+	    }
+	}
+    }
 }
 EOF
 fi
--- binutils/ld/ld.h.empty	2004-10-04 10:29:29.000000000 -0700
+++ binutils/ld/ld.h	2005-02-24 10:49:51.000000000 -0800
@@ -155,9 +155,6 @@ typedef struct {
      files.  */
   bfd_boolean warn_mismatch;
 
-  /* Remove unreferenced sections?  */
-  bfd_boolean gc_sections;
-
   /* Name of shared object whose symbol table should be filtered with
      this shared object.  From the --filter option.  */
   char *filter_shlib;
--- binutils/ld/ldlang.c.empty	2005-02-23 09:29:54.000000000 -0800
+++ binutils/ld/ldlang.c	2005-02-24 10:52:09.000000000 -0800
@@ -4718,8 +4718,7 @@ lang_gc_sections (void)
 	}
     }
 
-  if (command_line.gc_sections)
-    bfd_gc_sections (output_bfd, &link_info);
+  bfd_gc_sections (output_bfd, &link_info);
 }
 
 void
--- binutils/ld/ldmain.c.empty	2005-02-09 13:24:47.000000000 -0800
+++ binutils/ld/ldmain.c	2005-02-24 10:51:20.000000000 -0800
@@ -312,6 +312,7 @@ main (int argc, char **argv)
   link_info.flags_1 = 0;
   link_info.need_relax_finalize = FALSE;
   link_info.warn_shared_textrel = FALSE;
+  link_info.gc_sections = FALSE;
 
   ldfile_add_arch ("");
 
@@ -335,7 +336,7 @@ main (int argc, char **argv)
 
   if (link_info.relocatable)
     {
-      if (command_line.gc_sections)
+      if (link_info.gc_sections)
 	einfo ("%P%F: --gc-sections and -r may not be used together\n");
       else if (command_line.relax)
 	einfo (_("%P%F: --relax and -r may not be used together\n"));
--- binutils/ld/lexsup.c.empty	2005-01-19 09:06:48.000000000 -0800
+++ binutils/ld/lexsup.c	2005-02-24 10:51:54.000000000 -0800
@@ -808,7 +808,7 @@ parse_args (unsigned argc, char **argv)
 	  /* Ignore.  */
 	  break;
 	case OPTION_GC_SECTIONS:
-	  command_line.gc_sections = TRUE;
+	  link_info.gc_sections = TRUE;
 	  break;
 	case OPTION_HELP:
 	  init_demangler (style, NULL, demangler);
@@ -852,7 +852,7 @@ parse_args (unsigned argc, char **argv)
 	  demangling = FALSE;
 	  break;
 	case OPTION_NO_GC_SECTIONS:
-	  command_line.gc_sections = FALSE;
+	  link_info.gc_sections = FALSE;
 	  break;
 	case OPTION_NO_KEEP_MEMORY:
 	  link_info.keep_memory = FALSE;
--- binutils/ld/testsuite/ld-i386/tlsbin.rd.empty	2004-11-02 09:03:14.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlsbin.rd	2005-02-24 09:30:38.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: i?86-*-*
 
-There are 19 section headers, starting at offset 0x[0-9a-f]+:
+There are 17 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -23,11 +23,9 @@ Section Headers:
   \[11\] \.dynamic +DYNAMIC +0+804a060 .*
   \[12\] \.got +PROGBITS +0+804a100 .*
   \[13\] \.got\.plt +PROGBITS +0+804a124 .*
-  \[14\] \.data +.*
-  \[15\] \.bss +.*
-  \[16\] \.shstrtab +.*
-  \[17\] \.symtab +.*
-  \[18\] \.strtab +.*
+  \[14\] \.shstrtab +.*
+  \[15\] \.symtab +.*
+  \[16\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -89,7 +87,7 @@ Symbol table '.dynsym' contains 14 entri
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sG8
  +[0-9]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT  UND ___tls_get_addr
 
-Symbol table '.symtab' contains 75 entries:
+Symbol table '.symtab' contains 73 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -108,8 +106,6 @@ Symbol table '.symtab' contains 75 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +18 *
  +[0-9]+: 00000020 +0 TLS +LOCAL  DEFAULT +9 sl1
  +[0-9]+: 00000024 +0 TLS +LOCAL  DEFAULT +9 sl2
  +[0-9]+: 00000028 +0 TLS +LOCAL  DEFAULT +9 sl3
--- binutils/ld/testsuite/ld-i386/tlsnopic.rd.empty	2004-11-02 09:03:14.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlsnopic.rd	2005-02-24 09:31:08.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: i?86-*-*
 
-There are 16 section headers, starting at offset 0x[0-9a-f]+:
+There are 13 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -16,15 +16,12 @@ Section Headers:
   \[ 4\] \.rel.dyn +.*
   \[ 5\] \.text +PROGBITS +0+1000 .*
   \[ 6\] \.tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ 000024 00 WAT  0   0  1
-  \[ 7\] \.data.rel.ro +PROGBITS +.*
-  \[ 8\] \.dynamic +DYNAMIC +0+2000 .*
-  \[ 9\] \.got +PROGBITS +0+2080 .*
-  \[10\] \.got.plt +PROGBITS +0+2098 .*
-  \[11\] \.data +.*
-  \[12\] \.bss +.*
-  \[13\] \.shstrtab +.*
-  \[14\] \.symtab +.*
-  \[15\] \.strtab +.*
+  \[ 7\] \.dynamic +DYNAMIC +0+2000 .*
+  \[ 8\] \.got +PROGBITS +0+2080 .*
+  \[ 9\] \.got.plt +PROGBITS +0+2098 .*
+  \[10\] \.shstrtab +.*
+  \[11\] \.symtab +.*
+  \[12\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -77,9 +74,9 @@ Symbol table '.dynsym' contains 16 entri
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +5 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +6 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +11 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sg3
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sg4
@@ -91,7 +88,7 @@ Symbol table '.dynsym' contains 16 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 36 entries:
+Symbol table '.symtab' contains 33 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -106,9 +103,6 @@ Symbol table '.symtab' contains 36 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +10 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +11 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: 0+00 +0 TLS +LOCAL  DEFAULT +6 bl1
  +[0-9]+: 0+04 +0 TLS +LOCAL  DEFAULT +6 bl2
  +[0-9]+: 0+08 +0 TLS +LOCAL  DEFAULT +6 bl3
--- binutils/ld/testsuite/ld-i386/tlspic.rd.empty	2004-11-02 09:03:14.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlspic.rd	2005-02-24 09:28:32.000000000 -0800
@@ -22,11 +22,9 @@ Section Headers:
   \[10\] \.dynamic +.*
   \[11\] \.got +.*
   \[12\] \.got.plt +.*
-  \[13\] \.data +.*
-  \[14\] \.bss +.*
-  \[15\] \.shstrtab +.*
-  \[16\] \.symtab +.*
-  \[17\] \.strtab +.*
+  \[13\] \.shstrtab +.*
+  \[14\] \.symtab +.*
+  \[15\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -89,8 +87,8 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -106,7 +104,7 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
  +[0-9]+: 0+ +0 NOTYPE  GLOBAL DEFAULT  UND ___tls_get_addr
 
-Symbol table '.symtab' contains 57 entries:
+Symbol table '.symtab' contains 55 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -124,8 +122,6 @@ Symbol table '.symtab' contains 57 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3
--- binutils/ld/testsuite/ld-ia64/tlsbin.rd.empty	2005-01-30 09:33:45.000000000 -0800
+++ binutils/ld/testsuite/ld-ia64/tlsbin.rd	2005-02-24 10:04:49.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: ia64-*-*
 
-There are 22 section headers, starting at offset 0x[0-9a-f]+:
+There are 19 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -23,14 +23,11 @@ Section Headers:
   \[11\] .tdata +PROGBITS +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+60 00 WAT +0 +0 +4
   \[12\] .tbss +NOBITS +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+40 00 WAT +0 +0 +1
   \[13\] .dynamic +DYNAMIC +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+150 10 +WA +4 +0 +8
-  \[14\] .data +.*
-  \[15\] .got +PROGBITS +60+2000 0+2000 0+48 00 WAp +0 +0 +8
-  \[16\] .IA_64.pltoff +.*
-  \[17\] .sbss +.*
-  \[18\] .bss +.*
-  \[19\] .shstrtab +.*
-  \[20\] .symtab +.*
-  \[21\] .strtab +.*
+  \[14\] .got +PROGBITS +60+2000 0+2000 0+48 00 WAp +0 +0 +8
+  \[15\] .IA_64.pltoff +.*
+  \[16\] .shstrtab +.*
+  \[17\] .symtab +.*
+  \[18\] .strtab +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -61,86 +58,83 @@ Relocation section '.rela.IA_64.pltoff' 
 
 Symbol table '.dynsym' contains 8 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
- +1: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +2: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +3: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +4: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +5: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +6: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +7: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 72 entries:
+Symbol table '.symtab' contains 69 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
- +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
- +2: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +2 *
- +3: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +3 *
- +4: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +4 *
- +5: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 *
- +6: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 *
- +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
- +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
- +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 *
- +20: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +20 *
- +21: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +21 *
- +22: 0+20 +0 TLS +LOCAL +DEFAULT +11 sl1
- +23: 0+24 +0 TLS +LOCAL +DEFAULT +11 sl2
- +24: 0+28 +0 TLS +LOCAL +DEFAULT +11 sl3
- +25: 0+2c +0 TLS +LOCAL +DEFAULT +11 sl4
- +26: 0+30 +0 TLS +LOCAL +DEFAULT +11 sl5
- +27: 0+34 +0 TLS +LOCAL +DEFAULT +11 sl6
- +28: 0+38 +0 TLS +LOCAL +DEFAULT +11 sl7
- +29: 0+3c +0 TLS +LOCAL +DEFAULT +11 sl8
- +30: 0+80 +0 TLS +LOCAL +DEFAULT +12 bl1
- +31: 0+84 +0 TLS +LOCAL +DEFAULT +12 bl2
- +32: 0+88 +0 TLS +LOCAL +DEFAULT +12 bl3
- +33: 0+8c +0 TLS +LOCAL +DEFAULT +12 bl4
- +34: 0+90 +0 TLS +LOCAL +DEFAULT +12 bl5
- +35: 0+94 +0 TLS +LOCAL +DEFAULT +12 bl6
- +36: 0+98 +0 TLS +LOCAL +DEFAULT +12 bl7
- +37: 0+9c +0 TLS +LOCAL +DEFAULT +12 bl8
- +38: 0+1c +0 TLS +GLOBAL DEFAULT +11 sg8
- +39: 0+7c +0 TLS +GLOBAL DEFAULT +12 bg8
- +40: 0+74 +0 TLS +GLOBAL DEFAULT +12 bg6
- +41: 0+68 +0 TLS +GLOBAL DEFAULT +12 bg3
- +42: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +43: 0+8 +0 TLS +GLOBAL DEFAULT +11 sg3
- +44: 0+48 +0 TLS +GLOBAL HIDDEN +11 sh3
- +45: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +46: 0+c +0 TLS +GLOBAL DEFAULT +11 sg4
- +47: 0+10 +0 TLS +GLOBAL DEFAULT +11 sg5
- +48: 0+70 +0 TLS +GLOBAL DEFAULT +12 bg5
- +49: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +50: 0+58 +0 TLS +GLOBAL HIDDEN +11 sh7
- +51: 0+5c +0 TLS +GLOBAL HIDDEN +11 sh8
- +52: 0+ +0 TLS +GLOBAL DEFAULT +11 sg1
- +53: 40+10d0 +112 FUNC +GLOBAL DEFAULT +8 _start
- +54: 0+4c +0 TLS +GLOBAL HIDDEN +11 sh4
- +55: 0+78 +0 TLS +GLOBAL DEFAULT +12 bg7
- +56: 0+50 +0 TLS +GLOBAL HIDDEN +11 sh5
- +57: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +58: 40+1000 +208 FUNC +GLOBAL DEFAULT +8 fn2
- +59: 0+4 +0 TLS +GLOBAL DEFAULT +11 sg2
- +60: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +61: 0+40 +0 TLS +GLOBAL HIDDEN +11 sh1
- +62: 0+14 +0 TLS +GLOBAL DEFAULT +11 sg6
- +63: 0+18 +0 TLS +GLOBAL DEFAULT +11 sg7
- +64: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +65: [0-9a-f]+ +0 OBJECT +GLOBAL HIDDEN +15 _GLOBAL_OFFSET_TABLE_
- +66: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +67: 0+44 +0 TLS +GLOBAL HIDDEN +11 sh2
- +68: 0+54 +0 TLS +GLOBAL HIDDEN +11 sh6
- +69: 0+64 +0 TLS +GLOBAL DEFAULT +12 bg2
- +70: 0+60 +0 TLS +GLOBAL DEFAULT +12 bg1
- +71: 0+6c +0 TLS +GLOBAL DEFAULT +12 bg4
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +2 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +3 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +4 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
+ +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +11 sl1
+ +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +11 sl2
+ +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +11 sl3
+ +[0-9]+: 0+2c +0 TLS +LOCAL +DEFAULT +11 sl4
+ +[0-9]+: 0+30 +0 TLS +LOCAL +DEFAULT +11 sl5
+ +[0-9]+: 0+34 +0 TLS +LOCAL +DEFAULT +11 sl6
+ +[0-9]+: 0+38 +0 TLS +LOCAL +DEFAULT +11 sl7
+ +[0-9]+: 0+3c +0 TLS +LOCAL +DEFAULT +11 sl8
+ +[0-9]+: 0+80 +0 TLS +LOCAL +DEFAULT +12 bl1
+ +[0-9]+: 0+84 +0 TLS +LOCAL +DEFAULT +12 bl2
+ +[0-9]+: 0+88 +0 TLS +LOCAL +DEFAULT +12 bl3
+ +[0-9]+: 0+8c +0 TLS +LOCAL +DEFAULT +12 bl4
+ +[0-9]+: 0+90 +0 TLS +LOCAL +DEFAULT +12 bl5
+ +[0-9]+: 0+94 +0 TLS +LOCAL +DEFAULT +12 bl6
+ +[0-9]+: 0+98 +0 TLS +LOCAL +DEFAULT +12 bl7
+ +[0-9]+: 0+9c +0 TLS +LOCAL +DEFAULT +12 bl8
+ +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +11 sg8
+ +[0-9]+: 0+7c +0 TLS +GLOBAL DEFAULT +12 bg8
+ +[0-9]+: 0+74 +0 TLS +GLOBAL DEFAULT +12 bg6
+ +[0-9]+: 0+68 +0 TLS +GLOBAL DEFAULT +12 bg3
+ +[0-9]+: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +11 sg3
+ +[0-9]+: 0+48 +0 TLS +GLOBAL HIDDEN +11 sh3
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: 0+c +0 TLS +GLOBAL DEFAULT +11 sg4
+ +[0-9]+: 0+10 +0 TLS +GLOBAL DEFAULT +11 sg5
+ +[0-9]+: 0+70 +0 TLS +GLOBAL DEFAULT +12 bg5
+ +[0-9]+: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: 0+58 +0 TLS +GLOBAL HIDDEN +11 sh7
+ +[0-9]+: 0+5c +0 TLS +GLOBAL HIDDEN +11 sh8
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +11 sg1
+ +[0-9]+: 40+10d0 +112 FUNC +GLOBAL DEFAULT +8 _start
+ +[0-9]+: 0+4c +0 TLS +GLOBAL HIDDEN +11 sh4
+ +[0-9]+: 0+78 +0 TLS +GLOBAL DEFAULT +12 bg7
+ +[0-9]+: 0+50 +0 TLS +GLOBAL HIDDEN +11 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 40+1000 +208 FUNC +GLOBAL DEFAULT +8 fn2
+ +[0-9]+: 0+4 +0 TLS +GLOBAL DEFAULT +11 sg2
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: 0+40 +0 TLS +GLOBAL HIDDEN +11 sh1
+ +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +11 sg6
+ +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +11 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL HIDDEN +14 _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0+44 +0 TLS +GLOBAL HIDDEN +11 sh2
+ +[0-9]+: 0+54 +0 TLS +GLOBAL HIDDEN +11 sh6
+ +[0-9]+: 0+64 +0 TLS +GLOBAL DEFAULT +12 bg2
+ +[0-9]+: 0+60 +0 TLS +GLOBAL DEFAULT +12 bg1
+ +[0-9]+: 0+6c +0 TLS +GLOBAL DEFAULT +12 bg4
--- binutils/ld/testsuite/ld-ia64/tlspic.rd.empty	2005-01-30 09:33:45.000000000 -0800
+++ binutils/ld/testsuite/ld-ia64/tlspic.rd	2005-02-24 09:56:49.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: ia64-*-*
 
-There are 21 section headers, starting at offset 0x[0-9a-f]+:
+There are 18 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -22,14 +22,11 @@ Section Headers:
   \[10\] .tdata +PROGBITS +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+60 00 WAT +0 +0 +4
   \[11\] .tbss +NOBITS +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+20 00 WAT +0 +0 +1
   \[12\] .dynamic +DYNAMIC +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+140 10 +WA +3 +0 +8
-  \[13\] .data +.*
-  \[14\] .got +PROGBITS +0+12000 0+2000 0+50 00 WAp +0 +0 +8
-  \[15\] .IA_64.pltoff +.*
-  \[16\] .sbss +.*
-  \[17\] .bss +.*
-  \[18\] .shstrtab +.*
-  \[19\] .symtab +.*
-  \[20\] .strtab +.*
+  \[13\] .got +PROGBITS +0+12000 0+2000 0+50 00 WAp +0 +0 +8
+  \[14\] .IA_64.pltoff +.*
+  \[15\] .shstrtab +.*
+  \[16\] .symtab +.*
+  \[17\] .strtab +.*
 Key to Flags:
 #...
 
@@ -67,9 +64,9 @@ Symbol table '.dynsym' contains 23 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +10 sg8
  +[0-9]+: 0+11[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +10 sg3
@@ -85,7 +82,7 @@ Symbol table '.dynsym' contains 23 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 60 entries:
+Symbol table '.symtab' contains 57 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -105,9 +102,6 @@ Symbol table '.symtab' contains 60 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +20 *
  +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +10 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +10 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +10 sl3
--- binutils/ld/testsuite/ld-x86-64/tlsbin.rd.empty	2004-11-02 09:03:17.000000000 -0800
+++ binutils/ld/testsuite/ld-x86-64/tlsbin.rd	2005-02-24 10:12:25.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: x86_64-*-*
 
-There are 19 section headers, starting at offset 0x[0-9a-f]+:
+There are 17 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -23,11 +23,9 @@ Section Headers:
   \[11\] .dynamic +DYNAMIC +0+501290 0+1290 0+140 10 +WA +4 +0 +8
   \[12\] .got +PROGBITS +0+5013d0 0+13d0 0+20 08 +WA +0 +0 +8
   \[13\] .got.plt +PROGBITS +0+5013f0 0+13f0 0+20 08 +WA +0 +0 +8
-  \[14\] .data +.*
-  \[15\] .bss +.*
-  \[16\] .shstrtab +.*
-  \[17\] .symtab +.*
-  \[18\] .strtab +.*
+  \[14\] .shstrtab +.*
+  \[15\] .symtab +.*
+  \[16\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -43,7 +41,7 @@ Program Headers:
   INTERP +0x0+190 0x0+400190 0x0+400190 0x0+f 0x0+f R +0x1
 .*Requesting program interpreter.*
   LOAD +0x0+ 0x0+400000 0x0+400000 0x0+122a 0x0+122a R E 0x100000
-  LOAD +0x0+122a 0x0+50122a 0x0+50122a 0x0+dd6 0x0+dd6 RW  0x100000
+  LOAD +0x0+122a 0x0+50122a 0x0+50122a 0x0+1e6 0x0+1e6 RW  0x100000
   DYNAMIC +0x0+1290 0x0+501290 0x0+501290 0x0+140 0x0+140 RW  0x8
   TLS +0x0+122a 0x0+50122a 0x0+50122a 0x0+60 0x0+a0 R +0x1
 
@@ -80,7 +78,7 @@ Symbol table '.dynsym' contains 10 entri
  +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 71 entries:
+Symbol table '.symtab' contains 69 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -99,8 +97,6 @@ Symbol table '.symtab' contains 71 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +18 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +9 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +9 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +9 sl3
--- binutils/ld/testsuite/ld-x86-64/tlspic.rd.empty	2004-11-02 09:03:17.000000000 -0800
+++ binutils/ld/testsuite/ld-x86-64/tlspic.rd	2005-02-24 10:13:02.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: x86_64-*-*
 
-There are 18 section headers, starting at offset 0x[0-9a-f]+:
+There are 16 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -22,11 +22,9 @@ Section Headers:
   \[10\] .dynamic +DYNAMIC +0+101210 0+1210 0+130 10 +WA +3 +0 +8
   \[11\] .got +PROGBITS +0+101340 0+1340 0+90 08 +WA +0 +0 +8
   \[12\] .got.plt +PROGBITS +0+1013d0 0+13d0 0+20 08 +WA +0 +0 +8
-  \[13\] .data +.*
-  \[14\] .bss +.*
-  \[15\] .shstrtab +.*
-  \[16\] .symtab +.*
-  \[17\] .strtab +.*
+  \[13\] .shstrtab +.*
+  \[14\] .symtab +.*
+  \[15\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -39,7 +37,7 @@ There are 4 program headers, starting at
 Program Headers:
   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
   LOAD +0x0+ 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x100000
-  LOAD +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+e54 0x0+e54 RW +0x100000
+  LOAD +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+244 0x0+244 RW +0x100000
   DYNAMIC +0x0+1210 0x0+101210 0x0+101210 0x0+130 0x0+130 RW +0x8
   TLS +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+60 0x0+80 R +0x1
 
@@ -77,8 +75,8 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: 0+101210 +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -94,7 +92,7 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 57 entries:
+Symbol table '.symtab' contains 55 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -112,8 +110,6 @@ Symbol table '.symtab' contains 57 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3

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

* Re: RFC: Remove empty output sections
  2005-02-24 22:38 RFC: Remove empty output sections H. J. Lu
@ 2005-02-25 15:30 ` H. J. Lu
  2005-03-01 11:46   ` Nick Clifton
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-02-25 15:30 UTC (permalink / raw)
  To: binutils

On Thu, Feb 24, 2005 at 12:36:31PM -0800, H. J. Lu wrote:
> This patch removes empty output sections. It works on ia32, ia64 and
> x86_64. Any comments?
> 
> 

It turned out that we needed to mark sections used after linker
assigned all the linker created symbols. Here is the updated patch.


H.J.
----
bfd/

2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (elf_mark_used_section): New.
	(bfd_elf_gc_sections): Call elf_gc_mark_section for
	non-relocatable link if we don't do GC.

include/

2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>

	* bfdlink.h (bfd_link_info): Add gc_sections.

ld/

2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Remove
	unused empty output sections for non-relocatable link.

	* ld.h (args_type): Remove gc_sections.

	* ldlang.c (lang_mark_used_section): New.
	(lang_gc_sections): Use link_info.gc_sections instead of
	command_line.gc_sections.
	* ldmain.c (main): Likewise.
	* lexsup.c (parse_args): Likewise.
	* ldlang.c (lang_process): Call lang_mark_used_section.

	* ldmain.c (main): Initialize link_info.gc_sections to FALSE.

ld/testsuite/

2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-alpha/tlsbin.dd: Updated for empty section removal.
	* ld-alpha/tlsbin.rd: Likewise.
	* ld-alpha/tlsbin.sd: Likewise.
	* ld-alpha/tlsbinr.dd: Likewise.
	* ld-alpha/tlsbinr.rd: Likewise.
	* ld-alpha/tlspic.dd: Likewise.
	* ld-alpha/tlspic.rd: Likewise.
	* ld-alpha/tlspic.sd: Likewise.
	* ld-arm/mixed-lib.sym: Likewise.
	* ld-i386/tlsbin.rd: Likewise.
	* ld-i386/tlsnopic.rd: Likewise.
	* ld-i386/tlspic.rd: Likewise.
	* ld-ia64/tlsbin.rd: Likewise.
	* ld-ia64/tlspic.rd: Likewise.
	* ld-powerpc/apuinfo.rd: Likewise.
	* ld-powerpc/powerpc.exp: Likewise.
	* ld-powerpc/tlsexe32.r: Likewise.
	* ld-powerpc/tlsso32.r: Likewise.
	* ld-s390/tlsbin.rd: Likewise.
	* ld-s390/tlsbin_64.rd: Likewise.
	* ld-s390/tlspic.rd: Likewise.
	* ld-s390/tlspic_64.rd: Likewise.
	* ld-sh/tlsbin-2.d: Likewise.
	* ld-sh/tlspic-2.d: Likewise.
	* ld-sparc/tlssunbin32.rd: Likewise.
	* ld-sparc/tlssunnopic32.rd: Likewise.
	* ld-sparc/tlssunpic32.rd: Likewise.
	* ld-x86-64/tlsbin.rd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.

--- binutils/bfd/elflink.c.empty	2005-02-24 11:23:47.000000000 -0800
+++ binutils/bfd/elflink.c	2005-02-24 13:46:03.393359696 -0800
@@ -8996,7 +8996,28 @@ elf_gc_mark_dynamic_ref_symbol (struct e
 
   return TRUE;
 }
+ 
+/* Mark sections containing global symbols.  This is called through
+   elf_link_hash_traverse.  */
 
+static bfd_boolean
+elf_mark_used_section (struct elf_link_hash_entry *h,
+		     void *global ATTRIBUTE_UNUSED)
+{
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  if ((h->root.type == bfd_link_hash_defined
+       || h->root.type == bfd_link_hash_defweak))
+    {
+      asection *s = h->root.u.def.section->output_section;
+      if (s)
+	s->flags |= SEC_KEEP;
+    }
+
+  return TRUE;
+}
+ 
 /* Do mark and sweep of unused sections.  */
 
 bfd_boolean
@@ -9008,6 +9029,17 @@ bfd_elf_gc_sections (bfd *abfd, struct b
     (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
      struct elf_link_hash_entry *h, Elf_Internal_Sym *);
 
+  if (!info->gc_sections)
+    {
+      /* If we are called when info->gc_sections is 0, we will mark
+	 all sections containing global symbols for non-relocable
+	 link.  */
+      if (!info->relocatable)
+	elf_link_hash_traverse (elf_hash_table (info),
+				elf_mark_used_section, NULL);
+      return TRUE;
+    }
+
   if (!get_elf_backend_data (abfd)->can_gc_sections
       || info->relocatable
       || info->emitrelocations
--- binutils/include/bfdlink.h.empty	2005-02-03 12:00:28.000000000 -0800
+++ binutils/include/bfdlink.h	2005-02-24 10:52:55.000000000 -0800
@@ -324,6 +324,9 @@ struct bfd_link_info
   /* TRUE if we should warn when adding a DT_TEXTREL to a shared object.  */
   unsigned int warn_shared_textrel: 1;
 
+  /* TRUE if unreferenced sections should be removed.  */
+  unsigned int gc_sections: 1;
+
   /* What to do with unresolved symbols in an object file.
      When producing executables the default is GENERATE_ERROR.
      When producing shared libraries the default is IGNORE.  The
--- binutils/ld/emultempl/elf32.em.empty	2005-02-23 09:30:13.000000000 -0800
+++ binutils/ld/emultempl/elf32.em	2005-02-24 09:10:43.000000000 -0800
@@ -1441,6 +1441,36 @@ gld${EMULATION_NAME}_finish (void)
       lang_do_assignments (stat_ptr->head, abs_output_section,
 			   (fill_type *) 0, (bfd_vma) 0);
     }
+
+  if (!link_info.relocatable)
+    {
+      lang_output_section_statement_type *os;
+
+      for (os = &lang_output_section_statement.head->output_section_statement;
+	   os != NULL;
+	   os = os->next)
+	{
+	  asection *s;
+
+	  if (os == abs_output_section || os->constraint == -1)
+	    continue;
+	  s = os->bfd_section;
+	  if (s != NULL && s->size == 0 && (s->flags & SEC_KEEP) == 0)
+	    {
+	      asection **p;
+
+	      os->bfd_section = NULL;
+
+	      for (p = &output_bfd->sections; *p; p = &(*p)->next)
+		if (*p == s)
+		  {
+		    bfd_section_list_remove (output_bfd, p);
+		    output_bfd->section_count--;
+		    break;
+		  }
+	    }
+	}
+    }
 }
 EOF
 fi
--- binutils/ld/ld.h.empty	2004-10-04 10:29:29.000000000 -0700
+++ binutils/ld/ld.h	2005-02-24 10:49:51.000000000 -0800
@@ -155,9 +155,6 @@ typedef struct {
      files.  */
   bfd_boolean warn_mismatch;
 
-  /* Remove unreferenced sections?  */
-  bfd_boolean gc_sections;
-
   /* Name of shared object whose symbol table should be filtered with
      this shared object.  From the --filter option.  */
   char *filter_shlib;
--- binutils/ld/ldlang.c.empty	2005-02-23 09:29:54.000000000 -0800
+++ binutils/ld/ldlang.c	2005-02-24 13:10:36.963799788 -0800
@@ -4718,10 +4718,20 @@ lang_gc_sections (void)
 	}
     }
 
-  if (command_line.gc_sections)
+  if (link_info.gc_sections)
     bfd_gc_sections (output_bfd, &link_info);
 }
 
+static void
+lang_mark_used_section (void)
+{
+  unsigned int gc_sections = link_info.gc_sections;
+
+  link_info.gc_sections = 0;
+  bfd_gc_sections (output_bfd, &link_info);
+  link_info.gc_sections = gc_sections;
+}
+
 void
 lang_process (void)
 {
@@ -4883,7 +4893,7 @@ lang_process (void)
     lang_check_section_addresses ();
 
   /* Final stuffs.  */
-
+  lang_mark_used_section ();
   ldemul_finish ();
   lang_finish ();
 }
--- binutils/ld/ldmain.c.empty	2005-02-09 13:24:47.000000000 -0800
+++ binutils/ld/ldmain.c	2005-02-24 10:51:20.000000000 -0800
@@ -312,6 +312,7 @@ main (int argc, char **argv)
   link_info.flags_1 = 0;
   link_info.need_relax_finalize = FALSE;
   link_info.warn_shared_textrel = FALSE;
+  link_info.gc_sections = FALSE;
 
   ldfile_add_arch ("");
 
@@ -335,7 +336,7 @@ main (int argc, char **argv)
 
   if (link_info.relocatable)
     {
-      if (command_line.gc_sections)
+      if (link_info.gc_sections)
 	einfo ("%P%F: --gc-sections and -r may not be used together\n");
       else if (command_line.relax)
 	einfo (_("%P%F: --relax and -r may not be used together\n"));
--- binutils/ld/lexsup.c.empty	2005-01-19 09:06:48.000000000 -0800
+++ binutils/ld/lexsup.c	2005-02-24 10:51:54.000000000 -0800
@@ -808,7 +808,7 @@ parse_args (unsigned argc, char **argv)
 	  /* Ignore.  */
 	  break;
 	case OPTION_GC_SECTIONS:
-	  command_line.gc_sections = TRUE;
+	  link_info.gc_sections = TRUE;
 	  break;
 	case OPTION_HELP:
 	  init_demangler (style, NULL, demangler);
@@ -852,7 +852,7 @@ parse_args (unsigned argc, char **argv)
 	  demangling = FALSE;
 	  break;
 	case OPTION_NO_GC_SECTIONS:
-	  command_line.gc_sections = FALSE;
+	  link_info.gc_sections = FALSE;
 	  break;
 	case OPTION_NO_KEEP_MEMORY:
 	  link_info.keep_memory = FALSE;
--- binutils/ld/testsuite/ld-alpha/tlsbin.dd.empty	2003-07-29 08:18:46.000000000 -0700
+++ binutils/ld/testsuite/ld-alpha/tlsbin.dd	2005-02-24 15:15:37.572189015 -0800
@@ -12,30 +12,30 @@ Disassembly of section \.text:
 
 0+120001000 <fn2>:
    120001000:	02 00 bb 27 	ldah	gp,2\(t12\)
-   120001004:	f8 91 bd 23 	lda	gp,-28168\(gp\)
+   120001004:	00 a0 bd 23 	lda	gp,-24576\(gp\)
    120001008:	3e 15 c2 43 	subq	sp,0x10,sp
    12000100c:	00 00 5e b7 	stq	ra,0\(sp\)
    120001010:	18 80 1d 22 	lda	a0,-32744\(gp\)
    120001014:	08 80 7d a7 	ldq	t12,-32760\(gp\)
    120001018:	00 40 5b 6b 	jsr	ra,\(t12\),12000101c <.*>
    12000101c:	02 00 ba 27 	ldah	gp,2\(ra\)
-   120001020:	dc 91 bd 23 	lda	gp,-28196\(gp\)
+   120001020:	e4 9f bd 23 	lda	gp,-24604\(gp\)
    120001024:	38 80 1d 22 	lda	a0,-32712\(gp\)
    120001028:	08 80 7d a7 	ldq	t12,-32760\(gp\)
    12000102c:	00 40 5b 6b 	jsr	ra,\(t12\),120001030 <.*>
    120001030:	02 00 ba 27 	ldah	gp,2\(ra\)
-   120001034:	c8 91 bd 23 	lda	gp,-28216\(gp\)
+   120001034:	d0 9f bd 23 	lda	gp,-24624\(gp\)
    120001038:	28 80 1d 22 	lda	a0,-32728\(gp\)
    12000103c:	08 80 7d a7 	ldq	t12,-32760\(gp\)
    120001040:	00 40 5b 6b 	jsr	ra,\(t12\),120001044 <.*>
    120001044:	02 00 ba 27 	ldah	gp,2\(ra\)
-   120001048:	b4 91 bd 23 	lda	gp,-28236\(gp\)
+   120001048:	bc 9f bd 23 	lda	gp,-24644\(gp\)
    12000104c:	21 00 20 20 	lda	t0,33\(v0\)
    120001050:	28 80 1d 22 	lda	a0,-32728\(gp\)
    120001054:	08 80 7d a7 	ldq	t12,-32760\(gp\)
    120001058:	00 40 5b 6b 	jsr	ra,\(t12\),12000105c <.*>
    12000105c:	02 00 ba 27 	ldah	gp,2\(ra\)
-   120001060:	9c 91 bd 23 	lda	gp,-28260\(gp\)
+   120001060:	a4 9f bd 23 	lda	gp,-24668\(gp\)
    120001064:	40 00 20 20 	lda	t0,64\(v0\)
    120001068:	46 00 20 20 	lda	t0,70\(v0\)
    12000106c:	00 00 20 24 	ldah	t0,0\(v0\)
--- binutils/ld/testsuite/ld-alpha/tlsbin.rd.empty	2003-07-29 08:18:46.000000000 -0700
+++ binutils/ld/testsuite/ld-alpha/tlsbin.rd	2005-02-24 15:13:35.130020927 -0800
@@ -18,18 +18,15 @@ Section Headers:
   \[ 5\] .rela.dyn +.*
   \[ 6\] .rela.plt +.*
   \[ 7\] .text +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +AX +0 +0 4096
-  \[ 8\] .data +.*
+  \[ 8\] .eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8
   \[ 9\] .tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WAT +0 +0 +4
   \[10\] .tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WAT +0 +0 +1
-  \[11\] .eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8
-  \[12\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +4 +0 +8
-  \[13\] .plt +.*
-  \[14\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +WA +0 +0 +8
-  \[15\] .sbss +.*
-  \[16\] .bss +.*
-  \[17\] .shstrtab +.*
-  \[18\] .symtab +.*
-  \[19\] .strtab +.*
+  \[11\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +4 +0 +8
+  \[12\] .plt +.*
+  \[13\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +WA +0 +0 +8
+  \[14\] .shstrtab +.*
+  \[15\] .symtab +.*
+  \[16\] .strtab +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -82,64 +79,61 @@ Symbol table '.symtab' contains [0-9]+ e
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 
- +20: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl1
- +21: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl2
- +22: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl3
- +23: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl4
- +24: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl5
- +25: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl6
- +26: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl7
- +27: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl8
- +28: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl1
- +29: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl2
- +30: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl3
- +31: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl4
- +32: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl5
- +33: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl6
- +34: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl7
- +35: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl8
- +36: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg8
- +37: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg8
- +38: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg6
- +39: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg3
- +40: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +41: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg3
- +42: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh3
- +43: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +44: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg4
- +45: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg5
- +46: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +47: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg5
- +48: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +49: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh7
- +50: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh8
- +51: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg1
- +52: [0-9a-f]+ +52 FUNC +GLOBAL DEFAULT +7 _start
- +53: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh4
- +54: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg7
- +55: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh5
- +56: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +57: [0-9a-f]+ +136 FUNC +GLOBAL DEFAULT +7 fn2
- +58: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg2
- +59: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +60: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh1
- +61: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg6
- +62: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg7
- +63: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +64: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
- +65: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +66: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh2
- +67: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh6
- +68: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg2
- +69: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg1
- +70: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg4
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg3
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg5
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg5
+ +[0-9]+: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh7
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg1
+ +[0-9]+: [0-9a-f]+ +52 FUNC +GLOBAL DEFAULT +7 _start
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg7
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: [0-9a-f]+ +136 FUNC +GLOBAL DEFAULT +7 fn2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg4
--- binutils/ld/testsuite/ld-alpha/tlsbin.sd.empty	2003-07-29 08:18:46.000000000 -0700
+++ binutils/ld/testsuite/ld-alpha/tlsbin.sd	2005-02-24 15:16:05.834534661 -0800
@@ -9,7 +9,7 @@
 .*: +file format elf64-alpha
 
 Contents of section .got:
- [0-9a-f]+ 00000000 00000000 e8210120 01000000  .*
+ [0-9a-f]+ 00000000 00000000 c0210120 01000000  .*
  [0-9a-f]+ 56000000 00000000 00000000 00000000  .*
  [0-9a-f]+ 00000000 00000000 01000000 00000000  .*
  [0-9a-f]+ 00000000 00000000 01000000 00000000  .*
--- binutils/ld/testsuite/ld-alpha/tlsbinr.dd.empty	2003-07-29 08:18:46.000000000 -0700
+++ binutils/ld/testsuite/ld-alpha/tlsbinr.dd	2005-02-24 15:21:37.796611586 -0800
@@ -12,7 +12,7 @@ Disassembly of section \.text:
 
 0+120001000 <fn2>:
    120001000:	02 00 bb 27 	ldah	gp,2\(t12\)
-   120001004:	c8 91 bd 23 	lda	gp,-28216\(gp\)
+   120001004:	00 a0 bd 23 	lda	gp,-24576\(gp\)
    120001008:	3e 15 c2 43 	subq	sp,0x10,sp
    12000100c:	00 00 5e b7 	stq	ra,0\(sp\)
    120001010:	08 80 1d a6 	ldq	a0,-32760\(gp\)
--- binutils/ld/testsuite/ld-alpha/tlsbinr.rd.empty	2003-07-29 08:18:46.000000000 -0700
+++ binutils/ld/testsuite/ld-alpha/tlsbinr.rd	2005-02-24 15:20:54.930154268 -0800
@@ -16,20 +16,16 @@ Section Headers:
  +\[ 3\] .dynsym +.*
  +\[ 4\] .dynstr +.*
  +\[ 5\] .rela.dyn +.*
- +\[ 6\] .rela.plt +.*
- +\[ 7\] .text +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +AX +0 +0 4096
- +\[ 8\] .data +.*
- +\[ 9\] .tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +4
- +\[10\] .tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +1
- +\[11\] .eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8
- +\[12\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +4 +0 +8
- +\[13\] .plt +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAX +0 +0 +8
- +\[14\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +WA +0 +0 +8
- +\[15\] .sbss +.*
- +\[16\] .bss +.*
- +\[17\] .shstrtab +.*
- +\[18\] .symtab +.*
- +\[19\] .strtab +.*
+ +\[ 6\] .text +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +AX +0 +0 4096
+ +\[ 7\] .eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8
+ +\[ 8\] .tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +4
+ +\[ 9\] .tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +1
+ +\[10\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +4 +0 +8
+ +\[11\] .plt +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAX +0 +0 +8
+ +\[12\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +WA +0 +0 +8
+ +\[13\] .shstrtab +.*
+ +\[14\] .symtab +.*
+ +\[15\] .strtab +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -65,7 +61,7 @@ Symbol table '.dynsym' contains 10 entri
  +8: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
  +9: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 71 entries:
+Symbol table '.symtab' contains 67 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: [0-9a-f]+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 
@@ -77,64 +73,60 @@ Symbol table '.symtab' contains 71 entri
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 
- +20: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl1
- +21: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl2
- +22: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl3
- +23: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl4
- +24: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl5
- +25: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl6
- +26: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl7
- +27: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl8
- +28: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl1
- +29: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl2
- +30: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl3
- +31: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl4
- +32: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl5
- +33: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl6
- +34: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl7
- +35: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl8
- +36: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg8
- +37: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg8
- +38: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg6
- +39: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg3
- +40: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +41: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg3
- +42: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh3
- +43: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +44: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg4
- +45: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg5
- +46: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +47: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg5
- +48: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +49: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh7
- +50: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh8
- +51: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg1
- +52: [0-9a-f]+ +52 FUNC +GLOBAL DEFAULT +7 _start
- +53: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh4
- +54: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg7
- +55: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh5
- +56: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +57: [0-9a-f]+ +136 FUNC +GLOBAL DEFAULT +7 fn2
- +58: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg2
- +59: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +60: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh1
- +61: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg6
- +62: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg7
- +63: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +64: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
- +65: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +66: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh2
- +67: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh6
- +68: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg2
- +69: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg1
- +70: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg4
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg3
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg5
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg5
+ +[0-9]+: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh7
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg1
+ +[0-9]+: [0-9a-f]+ +52 FUNC +GLOBAL DEFAULT +6 _start
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg7
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: [0-9a-f]+ +136 FUNC +GLOBAL DEFAULT +6 fn2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg4
--- binutils/ld/testsuite/ld-alpha/tlspic.dd.empty	2003-07-29 08:18:46.000000000 -0700
+++ binutils/ld/testsuite/ld-alpha/tlspic.dd	2005-02-24 15:09:36.332897667 -0800
@@ -12,7 +12,7 @@ Disassembly of section .text:
 
 0+1000 <fn1>:
     1000:	02 00 bb 27 	ldah	gp,2\(t12\)
-    1004:	e8 91 bd 23 	lda	gp,-28184\(gp\)
+    1004:	00 a0 bd 23 	lda	gp,-24576\(gp\)
     1008:	3e 15 c2 43 	subq	sp,0x10,sp
     100c:	00 00 5e b7 	stq	ra,0\(sp\)
     1010:	08 00 3e b5 	stq	s0,8\(sp\)
@@ -22,23 +22,23 @@ Disassembly of section .text:
     1020:	00 80 7d a7 	ldq	t12,-32768\(gp\)
     1024:	00 40 5b 6b 	jsr	ra,\(t12\),1028 <.*>
     1028:	02 00 ba 27 	ldah	gp,2\(ra\)
-    102c:	c0 91 bd 23 	lda	gp,-28224\(gp\)
+    102c:	d8 9f bd 23 	lda	gp,-24616\(gp\)
     1030:	30 80 1d 22 	lda	a0,-32720\(gp\)
     1034:	00 80 7d a7 	ldq	t12,-32768\(gp\)
     1038:	00 40 5b 6b 	jsr	ra,\(t12\),103c <.*>
     103c:	02 00 ba 27 	ldah	gp,2\(ra\)
-    1040:	ac 91 bd 23 	lda	gp,-28244\(gp\)
+    1040:	c4 9f bd 23 	lda	gp,-24636\(gp\)
     1044:	40 80 1d 22 	lda	a0,-32704\(gp\)
     1048:	00 80 7d a7 	ldq	t12,-32768\(gp\)
     104c:	00 40 5b 6b 	jsr	ra,\(t12\),1050 <.*>
     1050:	02 00 ba 27 	ldah	gp,2\(ra\)
-    1054:	98 91 bd 23 	lda	gp,-28264\(gp\)
+    1054:	b0 9f bd 23 	lda	gp,-24656\(gp\)
     1058:	21 00 20 20 	lda	t0,33\(v0\)
     105c:	40 80 1d 22 	lda	a0,-32704\(gp\)
     1060:	00 80 7d a7 	ldq	t12,-32768\(gp\)
     1064:	00 40 5b 6b 	jsr	ra,\(t12\),1068 <.*>
     1068:	02 00 ba 27 	ldah	gp,2\(ra\)
-    106c:	80 91 bd 23 	lda	gp,-28288\(gp\)
+    106c:	98 9f bd 23 	lda	gp,-24680\(gp\)
     1070:	40 00 20 20 	lda	t0,64\(v0\)
     1074:	62 00 20 20 	lda	t0,98\(v0\)
     1078:	00 00 20 24 	ldah	t0,0\(v0\)
--- binutils/ld/testsuite/ld-alpha/tlspic.rd.empty	2003-07-29 08:18:46.000000000 -0700
+++ binutils/ld/testsuite/ld-alpha/tlspic.rd	2005-02-24 15:05:52.079893836 -0800
@@ -17,18 +17,15 @@ Section Headers:
  +\[ 4\] .rela.dyn +.*
  +\[ 5\] .rela.plt +.*
  +\[ 6\] .text +PROGBITS +0+1000 0+1000 0+ac 0+ +AX +0 +0 4096
- +\[ 7\] .data +.*
+ +\[ 7\] .eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8
  +\[ 8\] .tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +4
  +\[ 9\] .tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +1
- +\[10\] .eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8
- +\[11\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +3 +0 +8
- +\[12\] .plt +.*
- +\[13\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +WA +0 +0 +8
- +\[14\] .sbss +.*
- +\[15\] .bss +.*
- +\[16\] .shstrtab +.*
- +\[17\] .symtab +.*
- +\[18\] .strtab +.*
+ +\[10\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +3 +0 +8
+ +\[11\] .plt +.*
+ +\[12\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +WA +0 +0 +8
+ +\[13\] .shstrtab +.*
+ +\[14\] .symtab +.*
+ +\[15\] .strtab +.*
 #...
 
 Elf file type is DYN \(Shared object file\)
@@ -60,37 +57,28 @@ Relocation section '.rela.plt' at offset
 Symbol table '.dynsym' contains [0-9]+ entries:
    Num:    Value          Size Type    Bind   Vis      Ndx Name
      0: [0-9a-f]+     0 NOTYPE  LOCAL  DEFAULT  UND 
-     1: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    1 
-     2: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    2 
-     3: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    3 
-     4: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    4 
-     5: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    5 
-     6: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    6 
-     7: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    7 
-     8: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    8 
-     9: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    9 
-    10: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   10 
-    11: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   11 
-    12: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   12 
-    13: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   13 
-    14: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   14 
-    15: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   15 
-    16: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg8
-    17: [0-9a-f]+     0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
-    18: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg3
-    19: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg4
-    20: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg5
-    21: [0-9a-f]+     0 OBJECT  GLOBAL DEFAULT  ABS _PROCEDURE_LINKAGE_TABLE_
-    22: [0-9a-f]+     0 NOTYPE  GLOBAL DEFAULT  UND __tls_get_addr
-    23: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg1
-    24: [0-9a-f]+   172 FUNC    GLOBAL DEFAULT    6 fn1
-    25: [0-9a-f]+     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
-    26: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg2
-    27: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg6
-    28: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg7
-    29: [0-9a-f]+     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
-    30: [0-9a-f]+     0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
-    31: [0-9a-f]+     0 NOTYPE  GLOBAL DEFAULT  ABS _end
+     1: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    6 
+     2: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    7 
+     3: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    8 
+     4: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    9 
+     5: [0-9a-f]+     0 NOTYPE  LOCAL  DEFAULT  UND 
+     6: [0-9a-f]+     0 NOTYPE  LOCAL  DEFAULT  UND 
+     7: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg8
+     8: [0-9a-f]+     0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
+     9: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg3
+    10: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg4
+    11: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg5
+    12: [0-9a-f]+     0 OBJECT  GLOBAL DEFAULT  ABS _PROCEDURE_LINKAGE_TABLE_
+    13: [0-9a-f]+     0 NOTYPE  GLOBAL DEFAULT  UND __tls_get_addr
+    14: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg1
+    15: [0-9a-f]+   172 FUNC    GLOBAL DEFAULT    6 fn1
+    16: [0-9a-f]+     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
+    17: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg2
+    18: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg6
+    19: [0-9a-f]+     0 TLS     GLOBAL DEFAULT    8 sg7
+    20: [0-9a-f]+     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
+    21: [0-9a-f]+     0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
+    22: [0-9a-f]+     0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
 Symbol table '.symtab' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
@@ -104,52 +92,49 @@ Symbol table '.symtab' contains [0-9]+ e
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 
- +19: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl1
- +20: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl2
- +21: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl3
- +22: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl4
- +23: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl5
- +24: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl6
- +25: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl7
- +26: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl8
- +27: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH1
- +28: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh3
- +29: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH2
- +30: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH7
- +31: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh7
- +32: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh8
- +33: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH4
- +34: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh4
- +35: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH3
- +36: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh5
- +37: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH5
- +38: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH6
- +39: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH8
- +40: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh1
- +41: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh2
- +42: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh6
- +43: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg8
- +44: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +45: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg3
- +46: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg4
- +47: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg5
- +48: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +49: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr
- +50: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg1
- +51: [0-9a-f]+ +172 FUNC +GLOBAL DEFAULT +6 fn1
- +52: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +53: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg2
- +54: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg6
- +55: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg7
- +56: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +57: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
- +58: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh8
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +9 sH8
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +HIDDEN +8 sh6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg8
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg5
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg1
+ +[0-9]+: [0-9a-f]+ +172 FUNC +GLOBAL DEFAULT +6 fn1
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
--- binutils/ld/testsuite/ld-alpha/tlspic.sd.empty	2003-07-29 08:18:46.000000000 -0700
+++ binutils/ld/testsuite/ld-alpha/tlspic.sd	2005-02-24 15:11:35.949431113 -0800
@@ -9,9 +9,9 @@
 .*: +file format elf64-alpha
 
 Contents of section .got:
- 121e8 d8210100 00000000 00000000 00000000  .*
- 121f8 00000000 00000000 71000000 00000000  .*
- 12208 00000000 00000000 00000000 00000000  .*
- 12218 00000000 00000000 44000000 00000000  .*
- 12228 00000000 00000000 00000000 00000000  .*
- 12238 00000000 00000000                    .*
+ 13000 b0210100 00000000 00000000 00000000  .*
+ 13010 00000000 00000000 71000000 00000000  .*
+ 13020 00000000 00000000 00000000 00000000  .*
+ 13030 00000000 00000000 44000000 00000000  .*
+ 13040 00000000 00000000 00000000 00000000  .*
+ 13050 00000000 00000000                    .*
--- binutils/ld/testsuite/ld-arm/mixed-lib.sym.empty	2004-11-24 07:52:48.000000000 -0800
+++ binutils/ld/testsuite/ld-arm/mixed-lib.sym	2005-02-24 15:23:39.063931583 -0800
@@ -7,7 +7,7 @@ Symbol table for image:
    ..  ..: ........     0  NOTYPE GLOBAL DEFAULT ABS _bss_end__
    ..  ..: ........     0  OBJECT GLOBAL DEFAULT ABS _DYNAMIC
    ..  ..: ........     0  NOTYPE GLOBAL DEFAULT ABS __bss_end__
-   ..  ..: ........     0  NOTYPE GLOBAL DEFAULT  11 _stack
+   ..  ..: ........     0  NOTYPE GLOBAL DEFAULT  10 _stack
    ..  ..: ........     4  OBJECT GLOBAL DEFAULT   9 data_obj
    ..  ..: ........     0  NOTYPE GLOBAL DEFAULT ABS __bss_start__
    ..  ..: ........     0  NOTYPE GLOBAL DEFAULT ABS __bss_start
--- binutils/ld/testsuite/ld-i386/tlsbin.rd.empty	2004-11-02 09:03:14.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlsbin.rd	2005-02-24 09:30:38.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: i?86-*-*
 
-There are 19 section headers, starting at offset 0x[0-9a-f]+:
+There are 17 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -23,11 +23,9 @@ Section Headers:
   \[11\] \.dynamic +DYNAMIC +0+804a060 .*
   \[12\] \.got +PROGBITS +0+804a100 .*
   \[13\] \.got\.plt +PROGBITS +0+804a124 .*
-  \[14\] \.data +.*
-  \[15\] \.bss +.*
-  \[16\] \.shstrtab +.*
-  \[17\] \.symtab +.*
-  \[18\] \.strtab +.*
+  \[14\] \.shstrtab +.*
+  \[15\] \.symtab +.*
+  \[16\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -89,7 +87,7 @@ Symbol table '.dynsym' contains 14 entri
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sG8
  +[0-9]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT  UND ___tls_get_addr
 
-Symbol table '.symtab' contains 75 entries:
+Symbol table '.symtab' contains 73 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -108,8 +106,6 @@ Symbol table '.symtab' contains 75 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +18 *
  +[0-9]+: 00000020 +0 TLS +LOCAL  DEFAULT +9 sl1
  +[0-9]+: 00000024 +0 TLS +LOCAL  DEFAULT +9 sl2
  +[0-9]+: 00000028 +0 TLS +LOCAL  DEFAULT +9 sl3
--- binutils/ld/testsuite/ld-i386/tlsnopic.rd.empty	2004-11-02 09:03:14.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlsnopic.rd	2005-02-24 09:31:08.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: i?86-*-*
 
-There are 16 section headers, starting at offset 0x[0-9a-f]+:
+There are 13 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -16,15 +16,12 @@ Section Headers:
   \[ 4\] \.rel.dyn +.*
   \[ 5\] \.text +PROGBITS +0+1000 .*
   \[ 6\] \.tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ 000024 00 WAT  0   0  1
-  \[ 7\] \.data.rel.ro +PROGBITS +.*
-  \[ 8\] \.dynamic +DYNAMIC +0+2000 .*
-  \[ 9\] \.got +PROGBITS +0+2080 .*
-  \[10\] \.got.plt +PROGBITS +0+2098 .*
-  \[11\] \.data +.*
-  \[12\] \.bss +.*
-  \[13\] \.shstrtab +.*
-  \[14\] \.symtab +.*
-  \[15\] \.strtab +.*
+  \[ 7\] \.dynamic +DYNAMIC +0+2000 .*
+  \[ 8\] \.got +PROGBITS +0+2080 .*
+  \[ 9\] \.got.plt +PROGBITS +0+2098 .*
+  \[10\] \.shstrtab +.*
+  \[11\] \.symtab +.*
+  \[12\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -77,9 +74,9 @@ Symbol table '.dynsym' contains 16 entri
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +5 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +6 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +11 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sg3
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sg4
@@ -91,7 +88,7 @@ Symbol table '.dynsym' contains 16 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 36 entries:
+Symbol table '.symtab' contains 33 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -106,9 +103,6 @@ Symbol table '.symtab' contains 36 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +10 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +11 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: 0+00 +0 TLS +LOCAL  DEFAULT +6 bl1
  +[0-9]+: 0+04 +0 TLS +LOCAL  DEFAULT +6 bl2
  +[0-9]+: 0+08 +0 TLS +LOCAL  DEFAULT +6 bl3
--- binutils/ld/testsuite/ld-i386/tlspic.rd.empty	2004-11-02 09:03:14.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlspic.rd	2005-02-24 09:28:32.000000000 -0800
@@ -22,11 +22,9 @@ Section Headers:
   \[10\] \.dynamic +.*
   \[11\] \.got +.*
   \[12\] \.got.plt +.*
-  \[13\] \.data +.*
-  \[14\] \.bss +.*
-  \[15\] \.shstrtab +.*
-  \[16\] \.symtab +.*
-  \[17\] \.strtab +.*
+  \[13\] \.shstrtab +.*
+  \[14\] \.symtab +.*
+  \[15\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -89,8 +87,8 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -106,7 +104,7 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
  +[0-9]+: 0+ +0 NOTYPE  GLOBAL DEFAULT  UND ___tls_get_addr
 
-Symbol table '.symtab' contains 57 entries:
+Symbol table '.symtab' contains 55 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -124,8 +122,6 @@ Symbol table '.symtab' contains 57 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3
--- binutils/ld/testsuite/ld-ia64/tlsbin.rd.empty	2005-01-30 09:33:45.000000000 -0800
+++ binutils/ld/testsuite/ld-ia64/tlsbin.rd	2005-02-24 10:04:49.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: ia64-*-*
 
-There are 22 section headers, starting at offset 0x[0-9a-f]+:
+There are 19 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -23,14 +23,11 @@ Section Headers:
   \[11\] .tdata +PROGBITS +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+60 00 WAT +0 +0 +4
   \[12\] .tbss +NOBITS +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+40 00 WAT +0 +0 +1
   \[13\] .dynamic +DYNAMIC +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+150 10 +WA +4 +0 +8
-  \[14\] .data +.*
-  \[15\] .got +PROGBITS +60+2000 0+2000 0+48 00 WAp +0 +0 +8
-  \[16\] .IA_64.pltoff +.*
-  \[17\] .sbss +.*
-  \[18\] .bss +.*
-  \[19\] .shstrtab +.*
-  \[20\] .symtab +.*
-  \[21\] .strtab +.*
+  \[14\] .got +PROGBITS +60+2000 0+2000 0+48 00 WAp +0 +0 +8
+  \[15\] .IA_64.pltoff +.*
+  \[16\] .shstrtab +.*
+  \[17\] .symtab +.*
+  \[18\] .strtab +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -61,86 +58,83 @@ Relocation section '.rela.IA_64.pltoff' 
 
 Symbol table '.dynsym' contains 8 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
- +1: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +2: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +3: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +4: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +5: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +6: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +7: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 72 entries:
+Symbol table '.symtab' contains 69 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
- +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
- +2: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +2 *
- +3: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +3 *
- +4: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +4 *
- +5: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 *
- +6: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 *
- +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
- +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
- +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 *
- +20: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +20 *
- +21: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +21 *
- +22: 0+20 +0 TLS +LOCAL +DEFAULT +11 sl1
- +23: 0+24 +0 TLS +LOCAL +DEFAULT +11 sl2
- +24: 0+28 +0 TLS +LOCAL +DEFAULT +11 sl3
- +25: 0+2c +0 TLS +LOCAL +DEFAULT +11 sl4
- +26: 0+30 +0 TLS +LOCAL +DEFAULT +11 sl5
- +27: 0+34 +0 TLS +LOCAL +DEFAULT +11 sl6
- +28: 0+38 +0 TLS +LOCAL +DEFAULT +11 sl7
- +29: 0+3c +0 TLS +LOCAL +DEFAULT +11 sl8
- +30: 0+80 +0 TLS +LOCAL +DEFAULT +12 bl1
- +31: 0+84 +0 TLS +LOCAL +DEFAULT +12 bl2
- +32: 0+88 +0 TLS +LOCAL +DEFAULT +12 bl3
- +33: 0+8c +0 TLS +LOCAL +DEFAULT +12 bl4
- +34: 0+90 +0 TLS +LOCAL +DEFAULT +12 bl5
- +35: 0+94 +0 TLS +LOCAL +DEFAULT +12 bl6
- +36: 0+98 +0 TLS +LOCAL +DEFAULT +12 bl7
- +37: 0+9c +0 TLS +LOCAL +DEFAULT +12 bl8
- +38: 0+1c +0 TLS +GLOBAL DEFAULT +11 sg8
- +39: 0+7c +0 TLS +GLOBAL DEFAULT +12 bg8
- +40: 0+74 +0 TLS +GLOBAL DEFAULT +12 bg6
- +41: 0+68 +0 TLS +GLOBAL DEFAULT +12 bg3
- +42: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +43: 0+8 +0 TLS +GLOBAL DEFAULT +11 sg3
- +44: 0+48 +0 TLS +GLOBAL HIDDEN +11 sh3
- +45: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +46: 0+c +0 TLS +GLOBAL DEFAULT +11 sg4
- +47: 0+10 +0 TLS +GLOBAL DEFAULT +11 sg5
- +48: 0+70 +0 TLS +GLOBAL DEFAULT +12 bg5
- +49: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +50: 0+58 +0 TLS +GLOBAL HIDDEN +11 sh7
- +51: 0+5c +0 TLS +GLOBAL HIDDEN +11 sh8
- +52: 0+ +0 TLS +GLOBAL DEFAULT +11 sg1
- +53: 40+10d0 +112 FUNC +GLOBAL DEFAULT +8 _start
- +54: 0+4c +0 TLS +GLOBAL HIDDEN +11 sh4
- +55: 0+78 +0 TLS +GLOBAL DEFAULT +12 bg7
- +56: 0+50 +0 TLS +GLOBAL HIDDEN +11 sh5
- +57: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +58: 40+1000 +208 FUNC +GLOBAL DEFAULT +8 fn2
- +59: 0+4 +0 TLS +GLOBAL DEFAULT +11 sg2
- +60: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +61: 0+40 +0 TLS +GLOBAL HIDDEN +11 sh1
- +62: 0+14 +0 TLS +GLOBAL DEFAULT +11 sg6
- +63: 0+18 +0 TLS +GLOBAL DEFAULT +11 sg7
- +64: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +65: [0-9a-f]+ +0 OBJECT +GLOBAL HIDDEN +15 _GLOBAL_OFFSET_TABLE_
- +66: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +67: 0+44 +0 TLS +GLOBAL HIDDEN +11 sh2
- +68: 0+54 +0 TLS +GLOBAL HIDDEN +11 sh6
- +69: 0+64 +0 TLS +GLOBAL DEFAULT +12 bg2
- +70: 0+60 +0 TLS +GLOBAL DEFAULT +12 bg1
- +71: 0+6c +0 TLS +GLOBAL DEFAULT +12 bg4
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +2 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +3 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +4 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
+ +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +11 sl1
+ +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +11 sl2
+ +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +11 sl3
+ +[0-9]+: 0+2c +0 TLS +LOCAL +DEFAULT +11 sl4
+ +[0-9]+: 0+30 +0 TLS +LOCAL +DEFAULT +11 sl5
+ +[0-9]+: 0+34 +0 TLS +LOCAL +DEFAULT +11 sl6
+ +[0-9]+: 0+38 +0 TLS +LOCAL +DEFAULT +11 sl7
+ +[0-9]+: 0+3c +0 TLS +LOCAL +DEFAULT +11 sl8
+ +[0-9]+: 0+80 +0 TLS +LOCAL +DEFAULT +12 bl1
+ +[0-9]+: 0+84 +0 TLS +LOCAL +DEFAULT +12 bl2
+ +[0-9]+: 0+88 +0 TLS +LOCAL +DEFAULT +12 bl3
+ +[0-9]+: 0+8c +0 TLS +LOCAL +DEFAULT +12 bl4
+ +[0-9]+: 0+90 +0 TLS +LOCAL +DEFAULT +12 bl5
+ +[0-9]+: 0+94 +0 TLS +LOCAL +DEFAULT +12 bl6
+ +[0-9]+: 0+98 +0 TLS +LOCAL +DEFAULT +12 bl7
+ +[0-9]+: 0+9c +0 TLS +LOCAL +DEFAULT +12 bl8
+ +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +11 sg8
+ +[0-9]+: 0+7c +0 TLS +GLOBAL DEFAULT +12 bg8
+ +[0-9]+: 0+74 +0 TLS +GLOBAL DEFAULT +12 bg6
+ +[0-9]+: 0+68 +0 TLS +GLOBAL DEFAULT +12 bg3
+ +[0-9]+: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +11 sg3
+ +[0-9]+: 0+48 +0 TLS +GLOBAL HIDDEN +11 sh3
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: 0+c +0 TLS +GLOBAL DEFAULT +11 sg4
+ +[0-9]+: 0+10 +0 TLS +GLOBAL DEFAULT +11 sg5
+ +[0-9]+: 0+70 +0 TLS +GLOBAL DEFAULT +12 bg5
+ +[0-9]+: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: 0+58 +0 TLS +GLOBAL HIDDEN +11 sh7
+ +[0-9]+: 0+5c +0 TLS +GLOBAL HIDDEN +11 sh8
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +11 sg1
+ +[0-9]+: 40+10d0 +112 FUNC +GLOBAL DEFAULT +8 _start
+ +[0-9]+: 0+4c +0 TLS +GLOBAL HIDDEN +11 sh4
+ +[0-9]+: 0+78 +0 TLS +GLOBAL DEFAULT +12 bg7
+ +[0-9]+: 0+50 +0 TLS +GLOBAL HIDDEN +11 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 40+1000 +208 FUNC +GLOBAL DEFAULT +8 fn2
+ +[0-9]+: 0+4 +0 TLS +GLOBAL DEFAULT +11 sg2
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: 0+40 +0 TLS +GLOBAL HIDDEN +11 sh1
+ +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +11 sg6
+ +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +11 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL HIDDEN +14 _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0+44 +0 TLS +GLOBAL HIDDEN +11 sh2
+ +[0-9]+: 0+54 +0 TLS +GLOBAL HIDDEN +11 sh6
+ +[0-9]+: 0+64 +0 TLS +GLOBAL DEFAULT +12 bg2
+ +[0-9]+: 0+60 +0 TLS +GLOBAL DEFAULT +12 bg1
+ +[0-9]+: 0+6c +0 TLS +GLOBAL DEFAULT +12 bg4
--- binutils/ld/testsuite/ld-ia64/tlspic.rd.empty	2005-01-30 09:33:45.000000000 -0800
+++ binutils/ld/testsuite/ld-ia64/tlspic.rd	2005-02-24 09:56:49.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: ia64-*-*
 
-There are 21 section headers, starting at offset 0x[0-9a-f]+:
+There are 18 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -22,14 +22,11 @@ Section Headers:
   \[10\] .tdata +PROGBITS +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+60 00 WAT +0 +0 +4
   \[11\] .tbss +NOBITS +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+20 00 WAT +0 +0 +1
   \[12\] .dynamic +DYNAMIC +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+140 10 +WA +3 +0 +8
-  \[13\] .data +.*
-  \[14\] .got +PROGBITS +0+12000 0+2000 0+50 00 WAp +0 +0 +8
-  \[15\] .IA_64.pltoff +.*
-  \[16\] .sbss +.*
-  \[17\] .bss +.*
-  \[18\] .shstrtab +.*
-  \[19\] .symtab +.*
-  \[20\] .strtab +.*
+  \[13\] .got +PROGBITS +0+12000 0+2000 0+50 00 WAp +0 +0 +8
+  \[14\] .IA_64.pltoff +.*
+  \[15\] .shstrtab +.*
+  \[16\] .symtab +.*
+  \[17\] .strtab +.*
 Key to Flags:
 #...
 
@@ -67,9 +64,9 @@ Symbol table '.dynsym' contains 23 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +10 sg8
  +[0-9]+: 0+11[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +10 sg3
@@ -85,7 +82,7 @@ Symbol table '.dynsym' contains 23 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 60 entries:
+Symbol table '.symtab' contains 57 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -105,9 +102,6 @@ Symbol table '.symtab' contains 60 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +20 *
  +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +10 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +10 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +10 sl3
--- binutils/ld/testsuite/ld-powerpc/apuinfo.rd.empty	2003-06-26 07:34:54.000000000 -0700
+++ binutils/ld/testsuite/ld-powerpc/apuinfo.rd	2005-02-24 14:44:46.927479486 -0800
@@ -1,7 +1,7 @@
 #source: apuinfo1.s
 #source: apuinfo2.s
 #as: -me500
-#readelf: -x5
+#readelf: -x2
 #target: powerpc-eabi*
 
 Hex dump of section '.PPC.EMB.apuinfo':
--- binutils/ld/testsuite/ld-powerpc/powerpc.exp.empty	2003-07-10 07:27:30.000000000 -0700
+++ binutils/ld/testsuite/ld-powerpc/powerpc.exp	2005-02-24 14:43:50.086829047 -0800
@@ -54,7 +54,7 @@ set ppcelftests {
      {{objdump -hw reloc.d}} "reloc.so"}
     {"APUinfo section processing" "-melf32ppc"
      "-a32 -me500" {apuinfo1.s apuinfo2.s}
-    {{readelf -x5 apuinfo.rd}} "apuinfo"}
+    {{readelf -x2 apuinfo.rd}} "apuinfo"}
     {"TLS32 static exec" "-melf32ppc" "-a32"  {tls32.s tlslib32.s}
      {{objdump -dr tls32.d} {objdump -sj.got tls32.g}
       {objdump -sj.tdata tls32.t}}
--- binutils/ld/testsuite/ld-powerpc/tlsexe32.r.empty	2004-11-02 09:03:15.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/tlsexe32.r	2005-02-24 14:48:52.231761363 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: powerpc*-*-*
 
-There are 21 section headers.*
+There are 18 section headers.*
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -21,15 +21,12 @@ Section Headers:
  +\[ 9\] \.tdata +PROGBITS +018102d4 0002d4 00001c 00 WAT +0 +0 +4
  +\[10\] \.tbss +NOBITS +018102f0 0002f0 00001c 00 WAT +0 +0 +4
  +\[11\] \.dynamic +DYNAMIC +018102f0 0002f0 0000a0 08 +WA +4 +0 +4
- +\[12\] \.data +PROGBITS +01810390 000390 000000 00 +WA +0 +0 +1
- +\[13\] \.got +PROGBITS +01810390 000390 00001c 04 WAX +0 +0 +4
- +\[14\] \.sdata +PROGBITS +018103ac 0003ac 000000 00 +WA +0 +0 +4
- +\[15\] \.sbss +NOBITS +018103ac 0003ac 000000 00 +WA +0 +0 +1
- +\[16\] \.plt +NOBITS +.*
- +\[17\] \.bss +NOBITS +.*
- +\[18\] \.shstrtab +STRTAB +.*
- +\[19\] \.symtab +SYMTAB +.*
- +\[20\] \.strtab +STRTAB +.*
+ +\[12\] \.got +PROGBITS +01810390 000390 00001c 04 WAX +0 +0 +4
+ +\[13\] \.sdata +PROGBITS +018103ac 0003ac 000000 00 +WA +0 +0 +4
+ +\[14\] \.plt +NOBITS +.*
+ +\[15\] \.shstrtab +STRTAB +.*
+ +\[16\] \.symtab +SYMTAB +.*
+ +\[17\] \.strtab +STRTAB +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -76,7 +73,7 @@ Symbol table '\.dynsym' contains 9 entri
  +7: 018103ac +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +8: 01810400 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '\.symtab' contains 47 entries:
+Symbol table '\.symtab' contains 44 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 00000000 +0 NOTYPE +LOCAL +DEFAULT +UND 
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 
@@ -88,40 +85,37 @@ Symbol table '\.symtab' contains 47 entr
  +7: 01800264 +0 SECTION LOCAL +DEFAULT +7 
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 
  +9: 018102d4 +0 SECTION LOCAL +DEFAULT +9 
- +10: 018102f0 +0 SECTION LOCAL +DEFAULT +10 
- +11: 018102f0 +0 SECTION LOCAL +DEFAULT +11 
- +12: 01810390 +0 SECTION LOCAL +DEFAULT +12 
- +13: 01810390 +0 SECTION LOCAL +DEFAULT +13 
- +14: 018103ac +0 SECTION LOCAL +DEFAULT +14 
- +15: 018103ac +0 SECTION LOCAL +DEFAULT +15 
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 
- +20: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +20 
- +21: 00000000 +0 TLS +LOCAL +DEFAULT +9 gd4
- +22: 00000004 +0 TLS +LOCAL +DEFAULT +9 ld4
- +23: 00000008 +0 TLS +LOCAL +DEFAULT +9 ld5
- +24: 0000000c +0 TLS +LOCAL +DEFAULT +9 ld6
- +25: 00000010 +0 TLS +LOCAL +DEFAULT +9 ie4
- +26: 00000014 +0 TLS +LOCAL +DEFAULT +9 le4
- +27: 00000018 +0 TLS +LOCAL +DEFAULT +9 le5
- +28: 018102f0 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +29: 00000000 +0 TLS +GLOBAL DEFAULT +UND gd
- +30: 00000030 +0 TLS +GLOBAL DEFAULT +10 le0
- +31: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +32: 00000020 +0 TLS +GLOBAL DEFAULT +10 ld0
- +33: 00000034 +0 TLS +GLOBAL DEFAULT +10 le1
- +34: 00000000 +0 TLS +GLOBAL DEFAULT +UND ld
- +35: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +7 _start
- +36: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end
- +37: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +14 _SDA_BASE_
- +38: 00000028 +0 TLS +GLOBAL DEFAULT +10 ld2
- +39: 00000024 +0 TLS +GLOBAL DEFAULT +10 ld1
- +40: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +41: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +42: 01810394 +0 OBJECT +GLOBAL +HIDDEN +13 _GLOBAL_OFFSET_TABLE_
- +43: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +44: 0000001c +0 TLS +GLOBAL DEFAULT +10 gd0
- +45: 0000002c +0 TLS +GLOBAL DEFAULT +10 ie0
- +46: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +8 _SDA2_BASE_
+ +[0-9]+: 018102f0 +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: 018102f0 +0 SECTION LOCAL +DEFAULT +11 
+ +[0-9]+: 01810390 +0 SECTION LOCAL +DEFAULT +12 
+ +[0-9]+: 018103ac +0 SECTION LOCAL +DEFAULT +13 
+ +[0-9]+: 018103ac +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: 00000000 +0 SECTION LOCAL +DEFAULT +15 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
+ +[0-9]+: 00000000 +0 TLS +LOCAL +DEFAULT +9 gd4
+ +[0-9]+: 00000004 +0 TLS +LOCAL +DEFAULT +9 ld4
+ +[0-9]+: 00000008 +0 TLS +LOCAL +DEFAULT +9 ld5
+ +[0-9]+: 0000000c +0 TLS +LOCAL +DEFAULT +9 ld6
+ +[0-9]+: 00000010 +0 TLS +LOCAL +DEFAULT +9 ie4
+ +[0-9]+: 00000014 +0 TLS +LOCAL +DEFAULT +9 le4
+ +[0-9]+: 00000018 +0 TLS +LOCAL +DEFAULT +9 le5
+ +[0-9]+: 018102f0 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 00000000 +0 TLS +GLOBAL DEFAULT +UND gd
+ +[0-9]+: 00000030 +0 TLS +GLOBAL DEFAULT +10 le0
+ +[0-9]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: 00000020 +0 TLS +GLOBAL DEFAULT +10 ld0
+ +[0-9]+: 00000034 +0 TLS +GLOBAL DEFAULT +10 le1
+ +[0-9]+: 00000000 +0 TLS +GLOBAL DEFAULT +UND ld
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +7 _start
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +13 _SDA_BASE_
+ +[0-9]+: 00000028 +0 TLS +GLOBAL DEFAULT +10 ld2
+ +[0-9]+: 00000024 +0 TLS +GLOBAL DEFAULT +10 ld1
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: 01810394 +0 OBJECT +GLOBAL +HIDDEN +12 _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0000001c +0 TLS +GLOBAL DEFAULT +10 gd0
+ +[0-9]+: 0000002c +0 TLS +GLOBAL DEFAULT +10 ie0
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +8 _SDA2_BASE_
--- binutils/ld/testsuite/ld-powerpc/tlsso32.r.empty	2004-11-02 09:03:16.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/tlsso32.r	2005-02-24 14:54:09.208775874 -0800
@@ -4,7 +4,7 @@
 #readelf: -WSsrl
 #target: powerpc*-*-*
 
-There are 20 section headers.*
+There are 17 section headers.*
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -18,16 +18,13 @@ Section Headers:
  +\[ 7\] \.tdata +PROGBITS +0+104dc 0+4dc 0+1c 0+ WAT +0 +0 +4
  +\[ 8\] \.tbss +NOBITS +0+104f8 0+4f8 0+1c 0+ WAT +0 +0 +4
  +\[ 9\] \.dynamic +DYNAMIC +0+104f8 0+4f8 0+a0 08 +WA +3 +0 +4
- +\[10\] \.data +PROGBITS +0+10598 0+598 0+ 0+ +WA +0 +0 +1
- +\[11\] \.got +PROGBITS +0+10598 0+598 0+34 04 WAX +0 +0 +4
- +\[12\] \.sdata2 +.*
- +\[13\] \.sdata +.*
- +\[14\] \.sbss +.*
- +\[15\] \.plt +.*
- +\[16\] \.bss +.*
- +\[17\] \.shstrtab +.*
- +\[18\] \.symtab +.*
- +\[19\] \.strtab +.*
+ +\[10\] \.got +PROGBITS +0+10598 0+598 0+34 04 WAX +0 +0 +4
+ +\[11\] \.sdata2 +.*
+ +\[12\] \.sdata +.*
+ +\[13\] \.plt +.*
+ +\[14\] \.shstrtab +.*
+ +\[15\] \.symtab +.*
+ +\[16\] \.strtab +.*
 #...
 
 Elf file type is DYN \(Shared object file\)
@@ -79,11 +76,11 @@ Symbol table '\.dynsym' contains 27 entr
  +[0-9]+: 0+46c +0 SECTION LOCAL +DEFAULT +6 
  +[0-9]+: 0+104dc +0 SECTION LOCAL +DEFAULT +7 
  +[0-9]+: 0+104f8 +0 SECTION LOCAL +DEFAULT +8 
- +[0-9]+: 0+10598 +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
+ +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +11 
  +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +12 
- +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +13 
- +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +14 
- +[0-9]+: 0+10620 +0 SECTION LOCAL +DEFAULT +16 
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +[0-9]+: 0+104f8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
  +[0-9]+: 0+30 +0 TLS +GLOBAL DEFAULT +8 le0
@@ -93,7 +90,7 @@ Symbol table '\.dynsym' contains 27 entr
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +6 _start
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +13 _SDA_BASE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA_BASE_
  +[0-9]+: 0+28 +0 TLS +GLOBAL DEFAULT +8 ld2
  +[0-9]+: 0+24 +0 TLS +GLOBAL DEFAULT +8 ld1
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
@@ -101,9 +98,9 @@ Symbol table '\.dynsym' contains 27 entr
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 gd0
  +[0-9]+: 0+2c +0 TLS +GLOBAL DEFAULT +8 ie0
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA2_BASE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +11 _SDA2_BASE_
 
-Symbol table '\.symtab' contains 46 entries:
+Symbol table '\.symtab' contains 43 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 
@@ -119,12 +116,9 @@ Symbol table '\.symtab' contains 46 entr
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
  +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +12 
  +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +13 
- +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +14 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +[0-9]+: 0+10620 +0 SECTION LOCAL +DEFAULT +16 
- +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +17 
- +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +18 
- +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +19 
+ +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +16 
  +[0-9]+: 0+ +0 TLS +LOCAL +DEFAULT +7 gd4
  +[0-9]+: 0+4 +0 TLS +LOCAL +DEFAULT +7 ld4
  +[0-9]+: 0+8 +0 TLS +LOCAL +DEFAULT +7 ld5
@@ -142,7 +136,7 @@ Symbol table '\.symtab' contains 46 entr
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +6 _start
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +13 _SDA_BASE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA_BASE_
  +[0-9]+: 0+28 +0 TLS +GLOBAL DEFAULT +8 ld2
  +[0-9]+: 0+24 +0 TLS +GLOBAL DEFAULT +8 ld1
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
@@ -150,4 +144,4 @@ Symbol table '\.symtab' contains 46 entr
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 gd0
  +[0-9]+: 0+2c +0 TLS +GLOBAL DEFAULT +8 ie0
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA2_BASE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +11 _SDA2_BASE_
--- binutils/ld/testsuite/ld-s390/tlsbin.rd.empty	2004-11-02 09:03:16.000000000 -0800
+++ binutils/ld/testsuite/ld-s390/tlsbin.rd	2005-02-24 15:30:22.042872633 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: s390-*-*
 
-There are 18 section headers, starting at offset 0x[0-9a-f]+:
+There are 16 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -22,11 +22,9 @@ Section Headers:
   \[10\] .tbss +NOBITS +0+4014e0 0+4e0 0+40 00 WAT +0 +0 +1
   \[11\] .dynamic +DYNAMIC +0+4014e0 0+4e0 0+a0 08 +WA +4 +0 +4
   \[12\] .got +PROGBITS +0+401580 0+580 0+2c 04 +WA +0 +0 +4
-  \[13\] .data +.*
-  \[14\] .bss +.*
-  \[15\] .shstrtab +.*
-  \[16\] .symtab +.*
-  \[17\] .strtab +.*
+  \[13\] .shstrtab +.*
+  \[14\] .symtab +.*
+  \[15\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -79,7 +77,7 @@ Symbol table '.dynsym' contains 10 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 70 entries:
+Symbol table '.symtab' contains 68 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 
@@ -97,8 +95,6 @@ Symbol table '.symtab' contains 70 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +9 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +9 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +9 sl3
--- binutils/ld/testsuite/ld-s390/tlsbin_64.rd.empty	2004-09-27 09:12:06.000000000 -0700
+++ binutils/ld/testsuite/ld-s390/tlsbin_64.rd	2005-02-24 14:41:04.136286642 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: s390x-*-*
 
-There are 18 section headers, starting at offset 0x[0-9a-f]+:
+There are 16 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -18,15 +18,13 @@ Section Headers:
   \[ 6\] .rela.plt +.*
   \[ 7\] .plt +.*
   \[ 8\] .text +PROGBITS +.*
-  \[ 9\] .tdata +PROGBITS +0+80001720 0+720 0+60 00 WAT +0 +0 +32
-  \[10\] .tbss +NOBITS +0+80001780 0+780 0+40 00 WAT +0 +0 +1
-  \[11\] .dynamic +DYNAMIC +0+80001780 0+780 0+140 10 +WA +4 +0 +8
-  \[12\] .got +PROGBITS +0+800018c0 0+8c0 0+78 08 +WA +0 +0 +8
-  \[13\] .data +.*
-  \[14\] .bss +.*
-  \[15\] .shstrtab +.*
-  \[16\] .symtab +.*
-  \[17\] .strtab +.*
+  \[ 9\] .tdata +PROGBITS +0+800016e0 0+6e0 0+60 00 WAT +0 +0 +32
+  \[10\] .tbss +NOBITS +0+80001740 0+740 0+40 00 WAT +0 +0 +1
+  \[11\] .dynamic +DYNAMIC +0+80001740 0+740 0+140 10 +WA +4 +0 +8
+  \[12\] .got +PROGBITS +0+80001880 0+880 0+78 08 +WA +0 +0 +8
+  \[13\] .shstrtab +.*
+  \[14\] .symtab +.*
+  \[15\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -41,10 +39,10 @@ Program Headers:
   PHDR +0x0+40 0x0+80000040 0x0+80000040 0x0+150 0x0+150 R E 0x8
   INTERP +0x0+190 0x0+80000190 0x0+80000190 0x0+11 0x0+11 R +0x1
 .*Requesting program interpreter.*
-  LOAD +0x0+ 0x0+80000000 0x0+80000000 0x0+720 0x0+720 R E 0x1000
-  LOAD +0x0+720 0x0+80001720 0x0+80001720 0x0+218 0x0+218 RW  0x1000
-  DYNAMIC +0x0+780 0x0+80001780 0x0+80001780 0x0+140 0x0+140 RW  0x8
-  TLS +0x0+720 0x0+80001720 0x0+80001720 0x0+60 0x0+a0 R +0x20
+  LOAD +0x0+ 0x0+80000000 0x0+80000000 0x0+6e0 0x0+6e0 R E 0x1000
+  LOAD +0x0+6e0 0x0+800016e0 0x0+800016e0 0x0+218 0x0+218 RW  0x1000
+  DYNAMIC +0x0+740 0x0+80001740 0x0+80001740 0x0+140 0x0+140 RW  0x8
+  TLS +0x0+6e0 0x0+800016e0 0x0+800016e0 0x0+60 0x0+a0 R +0x20
 
  Section to Segment mapping:
   Segment Sections...
@@ -62,11 +60,11 @@ Relocation section '.rela.dyn' at offset
 [0-9a-f]+ +0+60+38 R_390_TLS_TPOFF +0+ sG6 \+ 0
 [0-9a-f]+ +0+70+38 R_390_TLS_TPOFF +0+ sG1 \+ 0
 
-Relocation section '.rela.plt' at offset 0x40+ contains 1 entries:
+Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries:
  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
-[0-9a-f]+ +0+40+b R_390_JMP_SLOT +0+80+438 __tls_get_offset \+ 0
+[0-9a-f]+ +0+40+b R_390_JMP_SLOT +0+80+408 __tls_get_offset \+ 0
 
-Symbol table '.dynsym' contains 11 entries:
+Symbol table '.dynsym' contains 10 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG3
@@ -77,10 +75,9 @@ Symbol table '.dynsym' contains 11 entri
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG6
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 70 entries:
+Symbol table '.symtab' contains 68 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 
@@ -98,8 +95,6 @@ Symbol table '.symtab' contains 70 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
  +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +9 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +9 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +9 sl3
@@ -145,7 +140,7 @@ Symbol table '.symtab' contains 70 entri
  +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +9 sg6
  +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +9 sg7
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL HIDDEN +12 _GLOBAL_OFFSET_TABLE_
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
  +[0-9]+: 0+44 +0 TLS +GLOBAL HIDDEN +9 sh2
  +[0-9]+: 0+54 +0 TLS +GLOBAL HIDDEN +9 sh6
--- binutils/ld/testsuite/ld-s390/tlspic.rd.empty	2004-11-02 09:03:16.000000000 -0800
+++ binutils/ld/testsuite/ld-s390/tlspic.rd	2005-02-24 15:28:43.718567950 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: s390-*-*
 
-There are 17 section headers, starting at offset 0x[0-9a-f]+:
+There are 15 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -21,11 +21,9 @@ Section Headers:
   \[ 9\] .tbss +NOBITS +0+1620 0+620 0+20 00 WAT  0 +0  1
   \[10\] .dynamic +DYNAMIC +0+1620 0+620 0+98 08  WA  3 +0  4
   \[11\] .got +PROGBITS +0+16b8 0+6b8 0+58 04  WA  0 +0  4
-  \[12\] .data +.*
-  \[13\] .bss +.*
-  \[14\] .shstrtab +.*
-  \[15\] .symtab +.*
-  \[16\] .strtab +.*
+  \[12\] .shstrtab +.*
+  \[13\] .symtab +.*
+  \[14\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -76,8 +74,8 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -93,7 +91,7 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 56 entries:
+Symbol table '.symtab' contains 54 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 
@@ -110,8 +108,6 @@ Symbol table '.symtab' contains 56 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3
--- binutils/ld/testsuite/ld-s390/tlspic_64.rd.empty	2004-09-27 09:12:06.000000000 -0700
+++ binutils/ld/testsuite/ld-s390/tlspic_64.rd	2005-02-24 14:34:24.038019804 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: s390x-*-*
 
-There are 17 section headers, starting at offset 0x[0-9a-f]+:
+There are 15 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -17,15 +17,13 @@ Section Headers:
   \[ 5\] .rela.plt +.*
   \[ 6\] .plt +.*
   \[ 7\] .text +PROGBITS +.*
-  \[ 8\] .tdata +PROGBITS +0+1900 0+900 0+60 00 WAT +0 +0 +32
-  \[ 9\] .tbss +NOBITS +0+1960 0+960 0+20 00 WAT +0 +0 +1
-  \[10\] .dynamic +DYNAMIC +0+1960 0+960 0+130 10 +WA +3 +0 +8
-  \[11\] .got +PROGBITS +0+1a90 0+a90 0+b0 08 +WA +0 +0 +8
-  \[12\] .data +.*
-  \[13\] .bss +.*
-  \[14\] .shstrtab +.*
-  \[15\] .symtab +.*
-  \[16\] .strtab +.*
+  \[ 8\] .tdata +PROGBITS +0+18c0 0+8c0 0+60 00 WAT +0 +0 +32
+  \[ 9\] .tbss +NOBITS +0+1920 0+920 0+20 00 WAT +0 +0 +1
+  \[10\] .dynamic +DYNAMIC +0+1920 0+920 0+130 10 +WA +3 +0 +8
+  \[11\] .got +PROGBITS +0+1a50 0+a50 0+b0 08 +WA +0 +0 +8
+  \[12\] .shstrtab +.*
+  \[13\] .symtab +.*
+  \[14\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -38,9 +36,9 @@ There are 4 program headers, starting at
 Program Headers:
   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
   LOAD +0x0+ 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x1000
-  LOAD +0x0+900 0x0+1900 0x0+1900 0x0+240 0x0+240 RW +0x1000
-  DYNAMIC +0x0+960 0x0+1960 0x0+1960 0x0+130 0x0+130 RW +0x8
-  TLS +0x0+900 0x0+1900 0x0+1900 0x0+60 0x0+80 R +0x20
+  LOAD +0x0+8c0 0x0+18c0 0x0+18c0 0x0+240 0x0+240 RW +0x1000
+  DYNAMIC +0x0+920 0x0+1920 0x0+1920 0x0+130 0x0+130 RW +0x8
+  TLS +0x0+8c0 0x0+18c0 0x0+18c0 0x0+60 0x0+80 R +0x20
 
  Section to Segment mapping:
   Segment Sections...
@@ -70,14 +68,14 @@ Relocation section '.rela.plt' at offset
  +Offset +Info +Type +Symbol's Value  Symbol's Name \+ Addend
 [0-9a-f]+  0+b0+b R_390_JMP_SLOT +0+ __tls_get_offset \+ 0
 
-Symbol table '.dynsym' contains 21 entries:
+Symbol table '.dynsym' contains 20 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -91,10 +89,9 @@ Symbol table '.dynsym' contains 21 entri
  +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +8 sg6
  +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +8 sg7
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
- +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 56 entries:
+Symbol table '.symtab' contains 54 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 
@@ -111,8 +108,6 @@ Symbol table '.symtab' contains 56 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3
@@ -135,6 +130,7 @@ Symbol table '.symtab' contains 56 entri
  +[0-9]+: 0+74 +0 TLS +LOCAL  HIDDEN +9 sH6
  +[0-9]+: 0+7c +0 TLS +LOCAL  HIDDEN +9 sH8
  +[0-9]+: 0+40 +0 TLS +LOCAL  HIDDEN +8 sh1
+ +[0-9]+: [0-9a-f]+ +0 OBJECT  LOCAL  HIDDEN  ABS _GLOBAL_OFFSET_TABLE_
  +[0-9]+: 0+44 +0 TLS +LOCAL  HIDDEN +8 sh2
  +[0-9]+: 0+54 +0 TLS +LOCAL  HIDDEN +8 sh6
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
@@ -150,5 +146,4 @@ Symbol table '.symtab' contains 56 entri
  +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +8 sg6
  +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +8 sg7
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
- +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
--- binutils/ld/testsuite/ld-sh/tlsbin-2.d.empty	2004-09-27 09:12:07.000000000 -0700
+++ binutils/ld/testsuite/ld-sh/tlsbin-2.d	2005-02-24 13:58:19.928139118 -0800
@@ -22,8 +22,6 @@ Section Headers:
   \[10\] \.tbss +NOBITS +0+413018 [0-9a-f]+ 0+010 00 WAT  0   0  1
 #...
   \[[0-9a-f]+\] \.got +PROGBITS +0+414000 .*
-  \[[0-9a-f]+\] \.sbss +.*
-  \[[0-9a-f]+\] \.bss +.*
 #...
   \[[0-9a-f]+\] \.shstrtab +.*
   \[[0-9a-f]+\] \.symtab +.*
--- binutils/ld/testsuite/ld-sh/tlspic-2.d.empty	2004-09-27 09:12:07.000000000 -0700
+++ binutils/ld/testsuite/ld-sh/tlspic-2.d	2005-02-24 13:59:42.892413343 -0800
@@ -21,8 +21,6 @@ Section Headers:
   \[ 9\] \.tbss +NOBITS +0+[0-9a-f]+ [0-9a-f]+ 0+008 00 WAT  0   0  1
 #...
   \[[0-9a-f]+\] \.got +PROGBITS +0+[0-9a-f]+ .*
-  \[[0-9a-f]+\] \.sbss +.*
-  \[[0-9a-f]+\] \.bss +.*
 #...
   \[[0-9a-f]+\] \.shstrtab +.*
   \[[0-9a-f]+\] \.symtab +.*
@@ -74,7 +72,7 @@ Symbol table '\.dynsym' contains [0-9]+ 
  +2: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 *
  +3: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 *
  +4: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +[0-9]+ *
- +5: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +[0-9]+ *
+ +5: 0+ +0 NOTYPE +LOCAL +DEFAULT  UND *
  +6: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9a-f]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  UND __tls_get_addr
  +[0-9a-f]+: 0+00 +0 TLS +GLOBAL DEFAULT +8 sg1
--- binutils/ld/testsuite/ld-sparc/tlssunbin32.rd.empty	2004-11-02 09:03:16.000000000 -0800
+++ binutils/ld/testsuite/ld-sparc/tlssunbin32.rd	2005-02-24 14:09:59.380712596 -0800
@@ -4,7 +4,7 @@
 #readelf: -WSsrl
 #target: sparc*-*-*
 
-There are 17 section headers, starting at offset 0x[0-9a-f]+:
+There are 15 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -20,11 +20,9 @@ Section Headers:
  +\[ 9\] .dynamic +DYNAMIC +0+231f8 0+31f8 0+80 08 +WA +4 +0 +4
  +\[10\] .got +PROGBITS +0+23278 0+3278 0+14 04 +WA +0 +0 +4
  +\[11\] .plt +.*
- +\[12\] .data +.*
- +\[13\] .bss +.*
- +\[14\] .shstrtab +.*
- +\[15\] .symtab +.*
- +\[16\] .strtab +.*
+ +\[12\] .shstrtab +.*
+ +\[13\] .symtab +.*
+ +\[14\] .strtab +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -37,7 +35,7 @@ Program Headers:
  +INTERP +0x0+f4 0x0+100f4 0x0+100f4 0x0+11 0x0+11 R +0x1
 .*Requesting program interpreter.*
  +LOAD +0x0+ 0x0+10000 0x0+10000 0x0+2194 0x0+2194 R E 0x10000
- +LOAD +0x0+2194 0x0+22194 0x0+22194 0x0+1e6c 0x0+1e6c RWE 0x10000
+ +LOAD +0x0+2194 0x0+22194 0x0+22194 0x0+10f8 0x0+10f8 RWE 0x10000
  +DYNAMIC +0x0+31f8 0x0+231f8 0x0+231f8 0x0+80 0x0+80 RW +0x4
  +TLS +0x0+2194 0x0+22194 0x0+22194 0x0+1060 0x0+10a0 R +0x4
 #...
@@ -63,7 +61,7 @@ Symbol table '.dynsym' contains 11 entri
  +9: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +10: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 70 entries:
+Symbol table '.symtab' contains 68 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -75,63 +73,61 @@ Symbol table '.symtab' contains 70 entri
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
- +17: 0+1020 +0 TLS +LOCAL +DEFAULT +7 sl1
- +18: 0+1024 +0 TLS +LOCAL +DEFAULT +7 sl2
- +19: 0+1028 +0 TLS +LOCAL +DEFAULT +7 sl3
- +20: 0+102c +0 TLS +LOCAL +DEFAULT +7 sl4
- +21: 0+1030 +0 TLS +LOCAL +DEFAULT +7 sl5
- +22: 0+1034 +0 TLS +LOCAL +DEFAULT +7 sl6
- +23: 0+1038 +0 TLS +LOCAL +DEFAULT +7 sl7
- +24: 0+103c +0 TLS +LOCAL +DEFAULT +7 sl8
- +25: 0+1080 +0 TLS +LOCAL +DEFAULT +8 bl1
- +26: 0+1084 +0 TLS +LOCAL +DEFAULT +8 bl2
- +27: 0+1088 +0 TLS +LOCAL +DEFAULT +8 bl3
- +28: 0+108c +0 TLS +LOCAL +DEFAULT +8 bl4
- +29: 0+1090 +0 TLS +LOCAL +DEFAULT +8 bl5
- +30: 0+1094 +0 TLS +LOCAL +DEFAULT +8 bl6
- +31: 0+1098 +0 TLS +LOCAL +DEFAULT +8 bl7
- +32: 0+109c +0 TLS +LOCAL +DEFAULT +8 bl8
- +33: 0+101c +0 TLS +GLOBAL DEFAULT +7 sg8
- +34: 0+107c +0 TLS +GLOBAL DEFAULT +8 bg8
- +35: 0+1074 +0 TLS +GLOBAL DEFAULT +8 bg6
- +36: 0+ +0 TLS +GLOBAL DEFAULT +UND sG5
- +37: 0+1068 +0 TLS +GLOBAL DEFAULT +8 bg3
- +38: 0+231f8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +39: 0+1008 +0 TLS +GLOBAL DEFAULT +7 sg3
- +40: 0+1048 +0 TLS +GLOBAL HIDDEN +7 sh3
- +41: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +42: 0+100c +0 TLS +GLOBAL DEFAULT +7 sg4
- +43: 0+1010 +0 TLS +GLOBAL DEFAULT +7 sg5
- +44: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +45: 0+1070 +0 TLS +GLOBAL DEFAULT +8 bg5
- +46: 0+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +47: 0+1058 +0 TLS +GLOBAL HIDDEN +7 sh7
- +48: 0+105c +0 TLS +GLOBAL HIDDEN +7 sh8
- +49: 0+ +0 TLS +GLOBAL DEFAULT +7 sg1
- +50: 0+12000 +0 FUNC +GLOBAL DEFAULT +6 _start
- +51: 0+104c +0 TLS +GLOBAL HIDDEN +7 sh4
- +52: 0+1078 +0 TLS +GLOBAL DEFAULT +8 bg7
- +53: 0+1050 +0 TLS +GLOBAL HIDDEN +7 sh5
- +54: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +55: 0+ +0 TLS +GLOBAL DEFAULT +UND sG6
- +56: 0+11008 +0 FUNC +GLOBAL DEFAULT +6 fn2
- +57: 0+1004 +0 TLS +GLOBAL DEFAULT +7 sg2
- +58: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +59: 0+1040 +0 TLS +GLOBAL HIDDEN +7 sh1
- +60: 0+1014 +0 TLS +GLOBAL DEFAULT +7 sg6
- +61: 0+1018 +0 TLS +GLOBAL DEFAULT +7 sg7
- +62: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +63: 0+23278 +0 OBJECT +GLOBAL +HIDDEN +10 _GLOBAL_OFFSET_TABLE_
- +64: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +65: 0+1044 +0 TLS +GLOBAL HIDDEN +7 sh2
- +66: 0+1054 +0 TLS +GLOBAL HIDDEN +7 sh6
- +67: 0+1064 +0 TLS +GLOBAL DEFAULT +8 bg2
- +68: 0+1060 +0 TLS +GLOBAL DEFAULT +8 bg1
- +69: 0+106c +0 TLS +GLOBAL DEFAULT +8 bg4
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
+ +[0-9]+: 0+1020 +0 TLS +LOCAL +DEFAULT +7 sl1
+ +[0-9]+: 0+1024 +0 TLS +LOCAL +DEFAULT +7 sl2
+ +[0-9]+: 0+1028 +0 TLS +LOCAL +DEFAULT +7 sl3
+ +[0-9]+: 0+102c +0 TLS +LOCAL +DEFAULT +7 sl4
+ +[0-9]+: 0+1030 +0 TLS +LOCAL +DEFAULT +7 sl5
+ +[0-9]+: 0+1034 +0 TLS +LOCAL +DEFAULT +7 sl6
+ +[0-9]+: 0+1038 +0 TLS +LOCAL +DEFAULT +7 sl7
+ +[0-9]+: 0+103c +0 TLS +LOCAL +DEFAULT +7 sl8
+ +[0-9]+: 0+1080 +0 TLS +LOCAL +DEFAULT +8 bl1
+ +[0-9]+: 0+1084 +0 TLS +LOCAL +DEFAULT +8 bl2
+ +[0-9]+: 0+1088 +0 TLS +LOCAL +DEFAULT +8 bl3
+ +[0-9]+: 0+108c +0 TLS +LOCAL +DEFAULT +8 bl4
+ +[0-9]+: 0+1090 +0 TLS +LOCAL +DEFAULT +8 bl5
+ +[0-9]+: 0+1094 +0 TLS +LOCAL +DEFAULT +8 bl6
+ +[0-9]+: 0+1098 +0 TLS +LOCAL +DEFAULT +8 bl7
+ +[0-9]+: 0+109c +0 TLS +LOCAL +DEFAULT +8 bl8
+ +[0-9]+: 0+101c +0 TLS +GLOBAL DEFAULT +7 sg8
+ +[0-9]+: 0+107c +0 TLS +GLOBAL DEFAULT +8 bg8
+ +[0-9]+: 0+1074 +0 TLS +GLOBAL DEFAULT +8 bg6
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG5
+ +[0-9]+: 0+1068 +0 TLS +GLOBAL DEFAULT +8 bg3
+ +[0-9]+: 0+231f8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+1008 +0 TLS +GLOBAL DEFAULT +7 sg3
+ +[0-9]+: 0+1048 +0 TLS +GLOBAL HIDDEN +7 sh3
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: 0+100c +0 TLS +GLOBAL DEFAULT +7 sg4
+ +[0-9]+: 0+1010 +0 TLS +GLOBAL DEFAULT +7 sg5
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: 0+1070 +0 TLS +GLOBAL DEFAULT +8 bg5
+ +[0-9]+: 0+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: 0+1058 +0 TLS +GLOBAL HIDDEN +7 sh7
+ +[0-9]+: 0+105c +0 TLS +GLOBAL HIDDEN +7 sh8
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +7 sg1
+ +[0-9]+: 0+12000 +0 FUNC +GLOBAL DEFAULT +6 _start
+ +[0-9]+: 0+104c +0 TLS +GLOBAL HIDDEN +7 sh4
+ +[0-9]+: 0+1078 +0 TLS +GLOBAL DEFAULT +8 bg7
+ +[0-9]+: 0+1050 +0 TLS +GLOBAL HIDDEN +7 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG6
+ +[0-9]+: 0+11008 +0 FUNC +GLOBAL DEFAULT +6 fn2
+ +[0-9]+: 0+1004 +0 TLS +GLOBAL DEFAULT +7 sg2
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: 0+1040 +0 TLS +GLOBAL HIDDEN +7 sh1
+ +[0-9]+: 0+1014 +0 TLS +GLOBAL DEFAULT +7 sg6
+ +[0-9]+: 0+1018 +0 TLS +GLOBAL DEFAULT +7 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: 0+23278 +0 OBJECT +GLOBAL +HIDDEN +10 _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0+1044 +0 TLS +GLOBAL HIDDEN +7 sh2
+ +[0-9]+: 0+1054 +0 TLS +GLOBAL HIDDEN +7 sh6
+ +[0-9]+: 0+1064 +0 TLS +GLOBAL DEFAULT +8 bg2
+ +[0-9]+: 0+1060 +0 TLS +GLOBAL DEFAULT +8 bg1
+ +[0-9]+: 0+106c +0 TLS +GLOBAL DEFAULT +8 bg4
--- binutils/ld/testsuite/ld-sparc/tlssunnopic32.rd.empty	2005-02-14 09:31:19.000000000 -0800
+++ binutils/ld/testsuite/ld-sparc/tlssunnopic32.rd	2005-02-24 14:13:40.745094200 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: sparc-*-*
 
-There are 15 section headers, starting at offset 0x[0-9a-f]+:
+There are 13 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -19,11 +19,9 @@ Section Headers:
  +\[ 7\] .dynamic +DYNAMIC +0+12000 0+2000 0+80 08 +WA +3 +0 +4
  +\[ 8\] .got +PROGBITS +0+12080 0+2080 0+1c 04 +WA +0 +0 +4
  +\[ 9\] .plt +.*
- +\[10\] .data +PROGBITS +0+13000 0+3000 0+ 0+ +WA +0 +0 4096
- +\[11\] .bss +.*
- +\[12\] .shstrtab +.*
- +\[13\] .symtab +.*
- +\[14\] .strtab +.*
+ +\[10\] .shstrtab +.*
+ +\[11\] .symtab +.*
+ +\[12\] .strtab +.*
 #...
 Elf file type is DYN \(Shared object file\)
 Entry point 0x1000
@@ -32,7 +30,7 @@ There are 4 program headers, starting at
 Program Headers:
  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x10000
- +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+1000 0x0+1000 RWE 0x10000
+ +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+9c 0x0+9c RWE 0x10000
  +DYNAMIC +0x0+2000 0x0+12000 0x0+12000 0x0+80 0x0+80 RW +0x4
  +TLS +0x0+2000 0x0+12000 0x0+12000 0x0+ 0x0+24 R +0x4
 #...
@@ -58,8 +56,8 @@ Symbol table '.dynsym' contains 14 entri
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 *
  +2: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 *
  +3: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
- +4: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +5: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +4: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +5: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +6: 0+12000 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +7: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
  +8: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
@@ -69,7 +67,7 @@ Symbol table '.dynsym' contains 14 entri
  +12: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +13: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 33 entries:
+Symbol table '.symtab' contains 31 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -81,26 +79,24 @@ Symbol table '.symtab' contains 33 entri
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +15: 0+ +0 TLS +LOCAL +DEFAULT +6 bl1
- +16: 0+4 +0 TLS +LOCAL +DEFAULT +6 bl2
- +17: 0+8 +0 TLS +LOCAL +DEFAULT +6 bl3
- +18: 0+c +0 TLS +LOCAL +DEFAULT +6 bl4
- +19: 0+10 +0 TLS +LOCAL +DEFAULT +6 bl5
- +20: 0+1c +0 TLS +LOCAL +HIDDEN +6 sh3
- +21: 0+20 +0 TLS +LOCAL +HIDDEN +6 sh4
- +22: 0+14 +0 TLS +LOCAL +HIDDEN +6 sh1
- +23: 0+12080 +0 OBJECT +LOCAL +HIDDEN +ABS _GLOBAL_OFFSET_TABLE_
- +24: 0+18 +0 TLS +LOCAL +HIDDEN +6 sh2
- +25: 0+12000 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +26: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
- +27: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +28: 0+ +0 TLS +GLOBAL DEFAULT +UND sg1
- +29: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +30: 0+ +0 TLS +GLOBAL DEFAULT +UND sg2
- +31: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +32: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
+ +[0-9]+: 0+ +0 TLS +LOCAL +DEFAULT +6 bl1
+ +[0-9]+: 0+4 +0 TLS +LOCAL +DEFAULT +6 bl2
+ +[0-9]+: 0+8 +0 TLS +LOCAL +DEFAULT +6 bl3
+ +[0-9]+: 0+c +0 TLS +LOCAL +DEFAULT +6 bl4
+ +[0-9]+: 0+10 +0 TLS +LOCAL +DEFAULT +6 bl5
+ +[0-9]+: 0+1c +0 TLS +LOCAL +HIDDEN +6 sh3
+ +[0-9]+: 0+20 +0 TLS +LOCAL +HIDDEN +6 sh4
+ +[0-9]+: 0+14 +0 TLS +LOCAL +HIDDEN +6 sh1
+ +[0-9]+: 0+12080 +0 OBJECT +LOCAL +HIDDEN +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: 0+18 +0 TLS +LOCAL +HIDDEN +6 sh2
+ +[0-9]+: 0+12000 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sg1
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sg2
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
--- binutils/ld/testsuite/ld-sparc/tlssunpic32.rd.empty	2005-02-14 09:31:19.000000000 -0800
+++ binutils/ld/testsuite/ld-sparc/tlssunpic32.rd	2005-02-24 14:06:49.585249705 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: sparc*-*-*
 
-There are 17 section headers, starting at offset 0x[0-9a-f]+:
+There are 15 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -21,11 +21,9 @@ Section Headers:
  +\[ 9\] .dynamic +DYNAMIC +0+12060 0+2060 0+98 08 +WA +3 +0 +4
  +\[10\] .got +PROGBITS +0+120f8 0+20f8 0+4c 04 +WA +0 +0 +4
  +\[11\] .plt +.*
- +\[12\] .data +PROGBITS +0+13000 0+3000 0+ 0+ +WA +0 +0 4096
- +\[13\] .bss +.*
- +\[14\] .shstrtab +.*
- +\[15\] .symtab +.*
- +\[16\] .strtab +.*
+ +\[12\] .shstrtab +.*
+ +\[13\] .symtab +.*
+ +\[14\] .strtab +.*
 #...
 
 Elf file type is DYN \(Shared object file\)
@@ -35,7 +33,7 @@ There are 4 program headers, starting at
 Program Headers:
  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x10000
- +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+1000 0x0+1000 RWE 0x10000
+ +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+184 0x0+184 RWE 0x10000
  +DYNAMIC +0x0+2060 0x0+12060 0x0+12060 0x0+98 0x0+98 RW +0x4
  +TLS +0x0+2000 0x0+12000 0x0+12000 0x0+60 0x0+80 R +0x4
 #...
@@ -68,8 +66,8 @@ Symbol table '.dynsym' contains 22 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +7 sg8
  +[0-9]+: 0+12060 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +7 sg3
@@ -86,7 +84,7 @@ Symbol table '.dynsym' contains 22 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 57 entries:
+Symbol table '.symtab' contains 55 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -103,8 +101,6 @@ Symbol table '.symtab' contains 57 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
  +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +7 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +7 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +7 sl3
--- binutils/ld/testsuite/ld-x86-64/tlsbin.rd.empty	2004-11-02 09:03:17.000000000 -0800
+++ binutils/ld/testsuite/ld-x86-64/tlsbin.rd	2005-02-24 10:12:25.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: x86_64-*-*
 
-There are 19 section headers, starting at offset 0x[0-9a-f]+:
+There are 17 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -23,11 +23,9 @@ Section Headers:
   \[11\] .dynamic +DYNAMIC +0+501290 0+1290 0+140 10 +WA +4 +0 +8
   \[12\] .got +PROGBITS +0+5013d0 0+13d0 0+20 08 +WA +0 +0 +8
   \[13\] .got.plt +PROGBITS +0+5013f0 0+13f0 0+20 08 +WA +0 +0 +8
-  \[14\] .data +.*
-  \[15\] .bss +.*
-  \[16\] .shstrtab +.*
-  \[17\] .symtab +.*
-  \[18\] .strtab +.*
+  \[14\] .shstrtab +.*
+  \[15\] .symtab +.*
+  \[16\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -43,7 +41,7 @@ Program Headers:
   INTERP +0x0+190 0x0+400190 0x0+400190 0x0+f 0x0+f R +0x1
 .*Requesting program interpreter.*
   LOAD +0x0+ 0x0+400000 0x0+400000 0x0+122a 0x0+122a R E 0x100000
-  LOAD +0x0+122a 0x0+50122a 0x0+50122a 0x0+dd6 0x0+dd6 RW  0x100000
+  LOAD +0x0+122a 0x0+50122a 0x0+50122a 0x0+1e6 0x0+1e6 RW  0x100000
   DYNAMIC +0x0+1290 0x0+501290 0x0+501290 0x0+140 0x0+140 RW  0x8
   TLS +0x0+122a 0x0+50122a 0x0+50122a 0x0+60 0x0+a0 R +0x1
 
@@ -80,7 +78,7 @@ Symbol table '.dynsym' contains 10 entri
  +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 71 entries:
+Symbol table '.symtab' contains 69 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -99,8 +97,6 @@ Symbol table '.symtab' contains 71 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +18 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +9 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +9 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +9 sl3
--- binutils/ld/testsuite/ld-x86-64/tlspic.rd.empty	2004-11-02 09:03:17.000000000 -0800
+++ binutils/ld/testsuite/ld-x86-64/tlspic.rd	2005-02-24 10:13:02.000000000 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: x86_64-*-*
 
-There are 18 section headers, starting at offset 0x[0-9a-f]+:
+There are 16 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -22,11 +22,9 @@ Section Headers:
   \[10\] .dynamic +DYNAMIC +0+101210 0+1210 0+130 10 +WA +3 +0 +8
   \[11\] .got +PROGBITS +0+101340 0+1340 0+90 08 +WA +0 +0 +8
   \[12\] .got.plt +PROGBITS +0+1013d0 0+13d0 0+20 08 +WA +0 +0 +8
-  \[13\] .data +.*
-  \[14\] .bss +.*
-  \[15\] .shstrtab +.*
-  \[16\] .symtab +.*
-  \[17\] .strtab +.*
+  \[13\] .shstrtab +.*
+  \[14\] .symtab +.*
+  \[15\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -39,7 +37,7 @@ There are 4 program headers, starting at
 Program Headers:
   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
   LOAD +0x0+ 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x100000
-  LOAD +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+e54 0x0+e54 RW +0x100000
+  LOAD +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+244 0x0+244 RW +0x100000
   DYNAMIC +0x0+1210 0x0+101210 0x0+101210 0x0+130 0x0+130 RW +0x8
   TLS +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+60 0x0+80 R +0x1
 
@@ -77,8 +75,8 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: 0+101210 +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -94,7 +92,7 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 57 entries:
+Symbol table '.symtab' contains 55 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -112,8 +110,6 @@ Symbol table '.symtab' contains 57 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3

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

* Re: RFC: Remove empty output sections
  2005-02-25 15:30 ` H. J. Lu
@ 2005-03-01 11:46   ` Nick Clifton
  2005-03-14  6:32     ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Nick Clifton @ 2005-03-01 11:46 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

Hi H. J.

>>This patch removes empty output sections. It works on ia32, ia64 and
>>x86_64. Any comments?

I like the idea of this patch, but I am going to hold off reviewing it 
until after the 2.16 branch.  I am just worried in case it introduces 
new bugs which have not thought of at the current time.

Cheers
   Nick

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

* Re: RFC: Remove empty output sections
  2005-03-01 11:46   ` Nick Clifton
@ 2005-03-14  6:32     ` H. J. Lu
  2005-03-14  8:35       ` Alan Modra
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-14  6:32 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

On Tue, Mar 01, 2005 at 11:57:44AM +0000, Nick Clifton wrote:
> Hi H. J.
> 
> >>This patch removes empty output sections. It works on ia32, ia64 and
> >>x86_64. Any comments?
> 
> I like the idea of this patch, but I am going to hold off reviewing it 
> until after the 2.16 branch.  I am just worried in case it introduces 
> new bugs which have not thought of at the current time.
> 

This is the updated patch for mainline. Ok to check in?


H.J.
----
bfd/

2005-03-13  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (elf_mark_used_section): New.
	(bfd_elf_gc_sections): Call elf_gc_mark_section for
	non-relocatable link if we don't do GC.

include/

2005-03-13  H.J. Lu  <hongjiu.lu@intel.com>

	* bfdlink.h (bfd_link_info): Add gc_sections.

ld/

2005-03-13  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Remove
	unused empty output sections for non-relocatable link.

	* ld.h (args_type): Remove gc_sections.

	* ldlang.c (lang_mark_used_section): New.
	(lang_gc_sections): Use link_info.gc_sections instead of
	command_line.gc_sections.
	* ldmain.c (main): Likewise.
	* lexsup.c (parse_args): Likewise.
	* ldlang.c (lang_process): Call lang_mark_used_section.

	* ldmain.c (main): Initialize link_info.gc_sections to FALSE.

ld/testsuite/

2005-03-13  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-alpha/tlsbin.rd: Updated for empty section removal.
	* ld-alpha/tlsbinr.rd: Likewise.
	* ld-arm/mixed-lib.sym: Likewise.
	* ld-i386/tlsbin.rd: Likewise.
	* ld-i386/tlsnopic.rd: Likewise.
	* ld-i386/tlspic.rd: Likewise.
	* ld-ia64/tlsbin.rd: Likewise.
	* ld-ia64/tlspic.rd: Likewise.
	* ld-powerpc/apuinfo.rd: Likewise.
	* ld-powerpc/powerpc.exp: Likewise.
	* ld-powerpc/tlsexe32.r: Likewise.
	* ld-powerpc/tlsso32.r: Likewise.
	* ld-s390/tlsbin.rd: Likewise.
	* ld-s390/tlsbin_64.rd: Likewise.
	* ld-s390/tlspic.rd: Likewise.
	* ld-s390/tlspic_64.rd: Likewise.
	* ld-sh/tlsbin-2.d: Likewise.
	* ld-sh/tlspic-2.d: Likewise.
	* ld-sparc/tlssunbin32.rd: Likewise.
	* ld-sparc/tlssunnopic32.rd: Likewise.
	* ld-sparc/tlssunpic32.rd: Likewise.
	* ld-x86-64/tlsbin.rd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.

--- binutils/bfd/elflink.c.empty	2005-02-28 09:06:49.000000000 -0800
+++ binutils/bfd/elflink.c	2005-03-13 21:17:51.210963315 -0800
@@ -8996,7 +8996,28 @@ elf_gc_mark_dynamic_ref_symbol (struct e
 
   return TRUE;
 }
+ 
+/* Mark sections containing global symbols.  This is called through
+   elf_link_hash_traverse.  */
 
+static bfd_boolean
+elf_mark_used_section (struct elf_link_hash_entry *h,
+		     void *global ATTRIBUTE_UNUSED)
+{
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  if ((h->root.type == bfd_link_hash_defined
+       || h->root.type == bfd_link_hash_defweak))
+    {
+      asection *s = h->root.u.def.section->output_section;
+      if (s)
+	s->flags |= SEC_KEEP;
+    }
+
+  return TRUE;
+}
+ 
 /* Do mark and sweep of unused sections.  */
 
 bfd_boolean
@@ -9008,6 +9029,17 @@ bfd_elf_gc_sections (bfd *abfd, struct b
     (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
      struct elf_link_hash_entry *h, Elf_Internal_Sym *);
 
+  if (!info->gc_sections)
+    {
+      /* If we are called when info->gc_sections is 0, we will mark
+	 all sections containing global symbols for non-relocable
+	 link.  */
+      if (!info->relocatable)
+	elf_link_hash_traverse (elf_hash_table (info),
+				elf_mark_used_section, NULL);
+      return TRUE;
+    }
+
   if (!get_elf_backend_data (abfd)->can_gc_sections
       || info->relocatable
       || info->emitrelocations
--- binutils/include/bfdlink.h.empty	2005-03-03 08:56:10.000000000 -0800
+++ binutils/include/bfdlink.h	2005-03-13 21:17:51.221961889 -0800
@@ -324,6 +324,9 @@ struct bfd_link_info
   /* TRUE if we should warn when adding a DT_TEXTREL to a shared object.  */
   unsigned int warn_shared_textrel: 1;
 
+  /* TRUE if unreferenced sections should be removed.  */
+  unsigned int gc_sections: 1;
+
   /* What to do with unresolved symbols in an object file.
      When producing executables the default is GENERATE_ERROR.
      When producing shared libraries the default is IGNORE.  The
--- binutils/ld/emultempl/elf32.em.empty	2005-02-24 12:47:44.000000000 -0800
+++ binutils/ld/emultempl/elf32.em	2005-03-13 21:17:51.257957222 -0800
@@ -1441,6 +1441,36 @@ gld${EMULATION_NAME}_finish (void)
       lang_do_assignments (stat_ptr->head, abs_output_section,
 			   (fill_type *) 0, (bfd_vma) 0);
     }
+
+  if (!link_info.relocatable)
+    {
+      lang_output_section_statement_type *os;
+
+      for (os = &lang_output_section_statement.head->output_section_statement;
+	   os != NULL;
+	   os = os->next)
+	{
+	  asection *s;
+
+	  if (os == abs_output_section || os->constraint == -1)
+	    continue;
+	  s = os->bfd_section;
+	  if (s != NULL && s->size == 0 && (s->flags & SEC_KEEP) == 0)
+	    {
+	      asection **p;
+
+	      os->bfd_section = NULL;
+
+	      for (p = &output_bfd->sections; *p; p = &(*p)->next)
+		if (*p == s)
+		  {
+		    bfd_section_list_remove (output_bfd, p);
+		    output_bfd->section_count--;
+		    break;
+		  }
+	    }
+	}
+    }
 }
 EOF
 fi
--- binutils/ld/ld.h.empty	2005-03-03 08:56:33.000000000 -0800
+++ binutils/ld/ld.h	2005-03-13 21:17:51.261956704 -0800
@@ -156,9 +156,6 @@ typedef struct {
      files.  */
   bfd_boolean warn_mismatch;
 
-  /* Remove unreferenced sections?  */
-  bfd_boolean gc_sections;
-
   /* Name of shared object whose symbol table should be filtered with
      this shared object.  From the --filter option.  */
   char *filter_shlib;
--- binutils/ld/ldlang.c.empty	2005-02-24 12:47:41.000000000 -0800
+++ binutils/ld/ldlang.c	2005-03-13 21:17:51.282953981 -0800
@@ -4718,10 +4718,20 @@ lang_gc_sections (void)
 	}
     }
 
-  if (command_line.gc_sections)
+  if (link_info.gc_sections)
     bfd_gc_sections (output_bfd, &link_info);
 }
 
+static void
+lang_mark_used_section (void)
+{
+  unsigned int gc_sections = link_info.gc_sections;
+
+  link_info.gc_sections = 0;
+  bfd_gc_sections (output_bfd, &link_info);
+  link_info.gc_sections = gc_sections;
+}
+
 void
 lang_process (void)
 {
@@ -4883,7 +4893,7 @@ lang_process (void)
     lang_check_section_addresses ();
 
   /* Final stuffs.  */
-
+  lang_mark_used_section ();
   ldemul_finish ();
   lang_finish ();
 }
--- binutils/ld/ldmain.c.empty	2005-03-03 08:56:33.000000000 -0800
+++ binutils/ld/ldmain.c	2005-03-13 21:17:51.284953722 -0800
@@ -312,6 +312,7 @@ main (int argc, char **argv)
   link_info.flags_1 = 0;
   link_info.need_relax_finalize = FALSE;
   link_info.warn_shared_textrel = FALSE;
+  link_info.gc_sections = FALSE;
 
   ldfile_add_arch ("");
 
@@ -335,7 +336,7 @@ main (int argc, char **argv)
 
   if (link_info.relocatable)
     {
-      if (command_line.gc_sections)
+      if (link_info.gc_sections)
 	einfo ("%P%F: --gc-sections and -r may not be used together\n");
       else if (command_line.relax)
 	einfo (_("%P%F: --relax and -r may not be used together\n"));
--- binutils/ld/lexsup.c.empty	2005-03-03 08:56:33.000000000 -0800
+++ binutils/ld/lexsup.c	2005-03-13 21:17:51.293952555 -0800
@@ -809,7 +809,7 @@ parse_args (unsigned argc, char **argv)
 	  /* Ignore.  */
 	  break;
 	case OPTION_GC_SECTIONS:
-	  command_line.gc_sections = TRUE;
+	  link_info.gc_sections = TRUE;
 	  break;
 	case OPTION_HELP:
 	  help ();
@@ -852,7 +852,7 @@ parse_args (unsigned argc, char **argv)
 	  demangling = FALSE;
 	  break;
 	case OPTION_NO_GC_SECTIONS:
-	  command_line.gc_sections = FALSE;
+	  link_info.gc_sections = FALSE;
 	  break;
 	case OPTION_NO_KEEP_MEMORY:
 	  link_info.keep_memory = FALSE;
--- binutils/ld/testsuite/ld-alpha/tlsbin.rd.empty	2005-03-09 02:51:59.000000000 -0800
+++ binutils/ld/testsuite/ld-alpha/tlsbin.rd	2005-03-13 21:17:55.383422312 -0800
@@ -82,64 +82,61 @@ Symbol table '.symtab' contains [0-9]+ e
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 
- +20: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl1
- +21: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl2
- +22: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl3
- +23: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl4
- +24: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl5
- +25: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl6
- +26: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl7
- +27: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl8
- +28: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl1
- +29: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl2
- +30: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl3
- +31: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl4
- +32: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl5
- +33: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl6
- +34: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl7
- +35: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl8
- +36: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg8
- +37: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg8
- +38: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg6
- +39: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg3
- +40: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +41: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg3
- +42: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh3
- +43: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +44: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg4
- +45: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg5
- +46: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +47: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg5
- +48: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +49: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh7
- +50: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh8
- +51: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg1
- +52: [0-9a-f]+ +52 FUNC +GLOBAL DEFAULT +7 _start
- +53: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh4
- +54: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg7
- +55: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh5
- +56: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +57: [0-9a-f]+ +136 FUNC +GLOBAL DEFAULT +7 fn2
- +58: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg2
- +59: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +60: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh1
- +61: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg6
- +62: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg7
- +63: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +64: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
- +65: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +66: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh2
- +67: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh6
- +68: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg2
- +69: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg1
- +70: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg4
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg3
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg5
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg5
+ +[0-9]+: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh7
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg1
+ +[0-9]+: [0-9a-f]+ +52 FUNC +GLOBAL DEFAULT +7 _start
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg7
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: [0-9a-f]+ +136 FUNC +GLOBAL DEFAULT +7 fn2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg4
--- binutils/ld/testsuite/ld-alpha/tlsbinr.rd.empty	2005-03-09 02:51:59.000000000 -0800
+++ binutils/ld/testsuite/ld-alpha/tlsbinr.rd	2005-03-13 21:17:57.364165487 -0800
@@ -65,7 +65,7 @@ Symbol table '.dynsym' contains 10 entri
  +8: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
  +9: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 71 entries:
+Symbol table '.symtab' contains 67 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: [0-9a-f]+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 
@@ -77,64 +77,60 @@ Symbol table '.symtab' contains 71 entri
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 
- +20: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl1
- +21: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl2
- +22: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl3
- +23: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl4
- +24: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl5
- +25: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl6
- +26: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl7
- +27: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 sl8
- +28: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl1
- +29: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl2
- +30: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl3
- +31: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl4
- +32: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl5
- +33: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl6
- +34: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl7
- +35: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +10 bl8
- +36: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg8
- +37: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg8
- +38: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg6
- +39: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg3
- +40: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +41: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg3
- +42: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh3
- +43: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +44: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg4
- +45: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg5
- +46: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +47: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg5
- +48: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +49: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh7
- +50: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh8
- +51: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg1
- +52: [0-9a-f]+ +52 FUNC +GLOBAL DEFAULT +7 _start
- +53: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh4
- +54: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg7
- +55: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh5
- +56: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +57: [0-9a-f]+ +136 FUNC +GLOBAL DEFAULT +7 fn2
- +58: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg2
- +59: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +60: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh1
- +61: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg6
- +62: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 sg7
- +63: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +64: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
- +65: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +66: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh2
- +67: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +9 sh6
- +68: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg2
- +69: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg1
- +70: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +10 bg4
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +8 sl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl1
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl2
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl3
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl4
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl5
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl6
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl7
+ +[0-9]+: [0-9a-f]+ +0 TLS +LOCAL +DEFAULT +9 bl8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg3
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh3
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg5
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg5
+ +[0-9]+: [0-9a-f]+ +4 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh7
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh8
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg1
+ +[0-9]+: [0-9a-f]+ +52 FUNC +GLOBAL DEFAULT +6 _start
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh4
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg7
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: [0-9a-f]+ +136 FUNC +GLOBAL DEFAULT +6 fn2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +8 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL HIDDEN +8 sh6
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg2
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg1
+ +[0-9]+: [0-9a-f]+ +0 TLS +GLOBAL DEFAULT +9 bg4
--- binutils/ld/testsuite/ld-arm/mixed-lib.sym.empty	2004-11-24 06:44:47.000000000 -0800
+++ binutils/ld/testsuite/ld-arm/mixed-lib.sym	2005-03-13 21:17:59.542882994 -0800
@@ -7,7 +7,7 @@ Symbol table for image:
    ..  ..: ........     0  NOTYPE GLOBAL DEFAULT ABS _bss_end__
    ..  ..: ........     0  OBJECT GLOBAL DEFAULT ABS _DYNAMIC
    ..  ..: ........     0  NOTYPE GLOBAL DEFAULT ABS __bss_end__
-   ..  ..: ........     0  NOTYPE GLOBAL DEFAULT  11 _stack
+   ..  ..: ........     0  NOTYPE GLOBAL DEFAULT  10 _stack
    ..  ..: ........     4  OBJECT GLOBAL DEFAULT   9 data_obj
    ..  ..: ........     0  NOTYPE GLOBAL DEFAULT ABS __bss_start__
    ..  ..: ........     0  NOTYPE GLOBAL DEFAULT ABS __bss_start
--- binutils/ld/testsuite/ld-i386/tlsbin.rd.empty	2004-11-05 14:41:52.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlsbin.rd	2005-03-13 21:17:59.552881697 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: i?86-*-*
 
-There are 19 section headers, starting at offset 0x[0-9a-f]+:
+There are 17 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -23,11 +23,9 @@ Section Headers:
   \[11\] \.dynamic +DYNAMIC +0+804a060 .*
   \[12\] \.got +PROGBITS +0+804a100 .*
   \[13\] \.got\.plt +PROGBITS +0+804a124 .*
-  \[14\] \.data +.*
-  \[15\] \.bss +.*
-  \[16\] \.shstrtab +.*
-  \[17\] \.symtab +.*
-  \[18\] \.strtab +.*
+  \[14\] \.shstrtab +.*
+  \[15\] \.symtab +.*
+  \[16\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -89,7 +87,7 @@ Symbol table '.dynsym' contains 14 entri
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sG8
  +[0-9]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT  UND ___tls_get_addr
 
-Symbol table '.symtab' contains 75 entries:
+Symbol table '.symtab' contains 73 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -108,8 +106,6 @@ Symbol table '.symtab' contains 75 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +18 *
  +[0-9]+: 00000020 +0 TLS +LOCAL  DEFAULT +9 sl1
  +[0-9]+: 00000024 +0 TLS +LOCAL  DEFAULT +9 sl2
  +[0-9]+: 00000028 +0 TLS +LOCAL  DEFAULT +9 sl3
--- binutils/ld/testsuite/ld-i386/tlsnopic.rd.empty	2004-11-05 14:41:52.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlsnopic.rd	2005-03-13 21:17:59.552881697 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: i?86-*-*
 
-There are 16 section headers, starting at offset 0x[0-9a-f]+:
+There are 13 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -16,15 +16,12 @@ Section Headers:
   \[ 4\] \.rel.dyn +.*
   \[ 5\] \.text +PROGBITS +0+1000 .*
   \[ 6\] \.tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ 000024 00 WAT  0   0  1
-  \[ 7\] \.data.rel.ro +PROGBITS +.*
-  \[ 8\] \.dynamic +DYNAMIC +0+2000 .*
-  \[ 9\] \.got +PROGBITS +0+2080 .*
-  \[10\] \.got.plt +PROGBITS +0+2098 .*
-  \[11\] \.data +.*
-  \[12\] \.bss +.*
-  \[13\] \.shstrtab +.*
-  \[14\] \.symtab +.*
-  \[15\] \.strtab +.*
+  \[ 7\] \.dynamic +DYNAMIC +0+2000 .*
+  \[ 8\] \.got +PROGBITS +0+2080 .*
+  \[ 9\] \.got.plt +PROGBITS +0+2098 .*
+  \[10\] \.shstrtab +.*
+  \[11\] \.symtab +.*
+  \[12\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -77,9 +74,9 @@ Symbol table '.dynsym' contains 16 entri
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +5 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +6 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +11 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sg3
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT  UND sg4
@@ -91,7 +88,7 @@ Symbol table '.dynsym' contains 16 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 36 entries:
+Symbol table '.symtab' contains 33 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -106,9 +103,6 @@ Symbol table '.symtab' contains 36 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +10 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +11 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: 0+00 +0 TLS +LOCAL  DEFAULT +6 bl1
  +[0-9]+: 0+04 +0 TLS +LOCAL  DEFAULT +6 bl2
  +[0-9]+: 0+08 +0 TLS +LOCAL  DEFAULT +6 bl3
--- binutils/ld/testsuite/ld-i386/tlspic.rd.empty	2004-11-05 14:41:52.000000000 -0800
+++ binutils/ld/testsuite/ld-i386/tlspic.rd	2005-03-13 21:17:59.553881567 -0800
@@ -22,11 +22,9 @@ Section Headers:
   \[10\] \.dynamic +.*
   \[11\] \.got +.*
   \[12\] \.got.plt +.*
-  \[13\] \.data +.*
-  \[14\] \.bss +.*
-  \[15\] \.shstrtab +.*
-  \[16\] \.symtab +.*
-  \[17\] \.strtab +.*
+  \[13\] \.shstrtab +.*
+  \[14\] \.symtab +.*
+  \[15\] \.strtab +.*
 Key to Flags:
 .*
 .*
@@ -89,8 +87,8 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -106,7 +104,7 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
  +[0-9]+: 0+ +0 NOTYPE  GLOBAL DEFAULT  UND ___tls_get_addr
 
-Symbol table '.symtab' contains 57 entries:
+Symbol table '.symtab' contains 55 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -124,8 +122,6 @@ Symbol table '.symtab' contains 57 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3
--- binutils/ld/testsuite/ld-ia64/tlsbin.rd.empty	2005-01-31 12:20:43.000000000 -0800
+++ binutils/ld/testsuite/ld-ia64/tlsbin.rd	2005-03-13 21:17:59.560880660 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: ia64-*-*
 
-There are 22 section headers, starting at offset 0x[0-9a-f]+:
+There are 19 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -23,14 +23,11 @@ Section Headers:
   \[11\] .tdata +PROGBITS +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+60 00 WAT +0 +0 +4
   \[12\] .tbss +NOBITS +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+40 00 WAT +0 +0 +1
   \[13\] .dynamic +DYNAMIC +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+150 10 +WA +4 +0 +8
-  \[14\] .data +.*
-  \[15\] .got +PROGBITS +60+2000 0+2000 0+48 00 WAp +0 +0 +8
-  \[16\] .IA_64.pltoff +.*
-  \[17\] .sbss +.*
-  \[18\] .bss +.*
-  \[19\] .shstrtab +.*
-  \[20\] .symtab +.*
-  \[21\] .strtab +.*
+  \[14\] .got +PROGBITS +60+2000 0+2000 0+48 00 WAp +0 +0 +8
+  \[15\] .IA_64.pltoff +.*
+  \[16\] .shstrtab +.*
+  \[17\] .symtab +.*
+  \[18\] .strtab +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -61,86 +58,83 @@ Relocation section '.rela.IA_64.pltoff' 
 
 Symbol table '.dynsym' contains 8 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
- +1: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +2: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +3: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +4: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +5: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +6: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +7: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 72 entries:
+Symbol table '.symtab' contains 69 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
- +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
- +2: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +2 *
- +3: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +3 *
- +4: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +4 *
- +5: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 *
- +6: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 *
- +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
- +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
- +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 *
- +20: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +20 *
- +21: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +21 *
- +22: 0+20 +0 TLS +LOCAL +DEFAULT +11 sl1
- +23: 0+24 +0 TLS +LOCAL +DEFAULT +11 sl2
- +24: 0+28 +0 TLS +LOCAL +DEFAULT +11 sl3
- +25: 0+2c +0 TLS +LOCAL +DEFAULT +11 sl4
- +26: 0+30 +0 TLS +LOCAL +DEFAULT +11 sl5
- +27: 0+34 +0 TLS +LOCAL +DEFAULT +11 sl6
- +28: 0+38 +0 TLS +LOCAL +DEFAULT +11 sl7
- +29: 0+3c +0 TLS +LOCAL +DEFAULT +11 sl8
- +30: 0+80 +0 TLS +LOCAL +DEFAULT +12 bl1
- +31: 0+84 +0 TLS +LOCAL +DEFAULT +12 bl2
- +32: 0+88 +0 TLS +LOCAL +DEFAULT +12 bl3
- +33: 0+8c +0 TLS +LOCAL +DEFAULT +12 bl4
- +34: 0+90 +0 TLS +LOCAL +DEFAULT +12 bl5
- +35: 0+94 +0 TLS +LOCAL +DEFAULT +12 bl6
- +36: 0+98 +0 TLS +LOCAL +DEFAULT +12 bl7
- +37: 0+9c +0 TLS +LOCAL +DEFAULT +12 bl8
- +38: 0+1c +0 TLS +GLOBAL DEFAULT +11 sg8
- +39: 0+7c +0 TLS +GLOBAL DEFAULT +12 bg8
- +40: 0+74 +0 TLS +GLOBAL DEFAULT +12 bg6
- +41: 0+68 +0 TLS +GLOBAL DEFAULT +12 bg3
- +42: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +43: 0+8 +0 TLS +GLOBAL DEFAULT +11 sg3
- +44: 0+48 +0 TLS +GLOBAL HIDDEN +11 sh3
- +45: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +46: 0+c +0 TLS +GLOBAL DEFAULT +11 sg4
- +47: 0+10 +0 TLS +GLOBAL DEFAULT +11 sg5
- +48: 0+70 +0 TLS +GLOBAL DEFAULT +12 bg5
- +49: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +50: 0+58 +0 TLS +GLOBAL HIDDEN +11 sh7
- +51: 0+5c +0 TLS +GLOBAL HIDDEN +11 sh8
- +52: 0+ +0 TLS +GLOBAL DEFAULT +11 sg1
- +53: 40+10d0 +112 FUNC +GLOBAL DEFAULT +8 _start
- +54: 0+4c +0 TLS +GLOBAL HIDDEN +11 sh4
- +55: 0+78 +0 TLS +GLOBAL DEFAULT +12 bg7
- +56: 0+50 +0 TLS +GLOBAL HIDDEN +11 sh5
- +57: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +58: 40+1000 +208 FUNC +GLOBAL DEFAULT +8 fn2
- +59: 0+4 +0 TLS +GLOBAL DEFAULT +11 sg2
- +60: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +61: 0+40 +0 TLS +GLOBAL HIDDEN +11 sh1
- +62: 0+14 +0 TLS +GLOBAL DEFAULT +11 sg6
- +63: 0+18 +0 TLS +GLOBAL DEFAULT +11 sg7
- +64: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +65: [0-9a-f]+ +0 OBJECT +GLOBAL HIDDEN +15 _GLOBAL_OFFSET_TABLE_
- +66: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +67: 0+44 +0 TLS +GLOBAL HIDDEN +11 sh2
- +68: 0+54 +0 TLS +GLOBAL HIDDEN +11 sh6
- +69: 0+64 +0 TLS +GLOBAL DEFAULT +12 bg2
- +70: 0+60 +0 TLS +GLOBAL DEFAULT +12 bg1
- +71: 0+6c +0 TLS +GLOBAL DEFAULT +12 bg4
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +2 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +3 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +4 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
+ +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +11 sl1
+ +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +11 sl2
+ +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +11 sl3
+ +[0-9]+: 0+2c +0 TLS +LOCAL +DEFAULT +11 sl4
+ +[0-9]+: 0+30 +0 TLS +LOCAL +DEFAULT +11 sl5
+ +[0-9]+: 0+34 +0 TLS +LOCAL +DEFAULT +11 sl6
+ +[0-9]+: 0+38 +0 TLS +LOCAL +DEFAULT +11 sl7
+ +[0-9]+: 0+3c +0 TLS +LOCAL +DEFAULT +11 sl8
+ +[0-9]+: 0+80 +0 TLS +LOCAL +DEFAULT +12 bl1
+ +[0-9]+: 0+84 +0 TLS +LOCAL +DEFAULT +12 bl2
+ +[0-9]+: 0+88 +0 TLS +LOCAL +DEFAULT +12 bl3
+ +[0-9]+: 0+8c +0 TLS +LOCAL +DEFAULT +12 bl4
+ +[0-9]+: 0+90 +0 TLS +LOCAL +DEFAULT +12 bl5
+ +[0-9]+: 0+94 +0 TLS +LOCAL +DEFAULT +12 bl6
+ +[0-9]+: 0+98 +0 TLS +LOCAL +DEFAULT +12 bl7
+ +[0-9]+: 0+9c +0 TLS +LOCAL +DEFAULT +12 bl8
+ +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +11 sg8
+ +[0-9]+: 0+7c +0 TLS +GLOBAL DEFAULT +12 bg8
+ +[0-9]+: 0+74 +0 TLS +GLOBAL DEFAULT +12 bg6
+ +[0-9]+: 0+68 +0 TLS +GLOBAL DEFAULT +12 bg3
+ +[0-9]+: 60+1[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +11 sg3
+ +[0-9]+: 0+48 +0 TLS +GLOBAL HIDDEN +11 sh3
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: 0+c +0 TLS +GLOBAL DEFAULT +11 sg4
+ +[0-9]+: 0+10 +0 TLS +GLOBAL DEFAULT +11 sg5
+ +[0-9]+: 0+70 +0 TLS +GLOBAL DEFAULT +12 bg5
+ +[0-9]+: 0+ +16 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: 0+58 +0 TLS +GLOBAL HIDDEN +11 sh7
+ +[0-9]+: 0+5c +0 TLS +GLOBAL HIDDEN +11 sh8
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +11 sg1
+ +[0-9]+: 40+10d0 +112 FUNC +GLOBAL DEFAULT +8 _start
+ +[0-9]+: 0+4c +0 TLS +GLOBAL HIDDEN +11 sh4
+ +[0-9]+: 0+78 +0 TLS +GLOBAL DEFAULT +12 bg7
+ +[0-9]+: 0+50 +0 TLS +GLOBAL HIDDEN +11 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 40+1000 +208 FUNC +GLOBAL DEFAULT +8 fn2
+ +[0-9]+: 0+4 +0 TLS +GLOBAL DEFAULT +11 sg2
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: 0+40 +0 TLS +GLOBAL HIDDEN +11 sh1
+ +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +11 sg6
+ +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +11 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL HIDDEN +14 _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0+44 +0 TLS +GLOBAL HIDDEN +11 sh2
+ +[0-9]+: 0+54 +0 TLS +GLOBAL HIDDEN +11 sh6
+ +[0-9]+: 0+64 +0 TLS +GLOBAL DEFAULT +12 bg2
+ +[0-9]+: 0+60 +0 TLS +GLOBAL DEFAULT +12 bg1
+ +[0-9]+: 0+6c +0 TLS +GLOBAL DEFAULT +12 bg4
--- binutils/ld/testsuite/ld-ia64/tlspic.rd.empty	2005-01-31 12:20:43.000000000 -0800
+++ binutils/ld/testsuite/ld-ia64/tlspic.rd	2005-03-13 21:17:59.561880530 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: ia64-*-*
 
-There are 21 section headers, starting at offset 0x[0-9a-f]+:
+There are 18 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -22,14 +22,11 @@ Section Headers:
   \[10\] .tdata +PROGBITS +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+60 00 WAT +0 +0 +4
   \[11\] .tbss +NOBITS +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+20 00 WAT +0 +0 +1
   \[12\] .dynamic +DYNAMIC +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+140 10 +WA +3 +0 +8
-  \[13\] .data +.*
-  \[14\] .got +PROGBITS +0+12000 0+2000 0+50 00 WAp +0 +0 +8
-  \[15\] .IA_64.pltoff +.*
-  \[16\] .sbss +.*
-  \[17\] .bss +.*
-  \[18\] .shstrtab +.*
-  \[19\] .symtab +.*
-  \[20\] .strtab +.*
+  \[13\] .got +PROGBITS +0+12000 0+2000 0+50 00 WAp +0 +0 +8
+  \[14\] .IA_64.pltoff +.*
+  \[15\] .shstrtab +.*
+  \[16\] .symtab +.*
+  \[17\] .strtab +.*
 Key to Flags:
 #...
 
@@ -67,9 +64,9 @@ Symbol table '.dynsym' contains 23 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +10 sg8
  +[0-9]+: 0+11[0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +10 sg3
@@ -85,7 +82,7 @@ Symbol table '.dynsym' contains 23 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 60 entries:
+Symbol table '.symtab' contains 57 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -105,9 +102,6 @@ Symbol table '.symtab' contains 60 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +20 *
  +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +10 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +10 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +10 sl3
--- binutils/ld/testsuite/ld-powerpc/apuinfo.rd.empty	2003-06-25 04:12:46.000000000 -0700
+++ binutils/ld/testsuite/ld-powerpc/apuinfo.rd	2005-03-13 21:17:59.564880141 -0800
@@ -1,7 +1,7 @@
 #source: apuinfo1.s
 #source: apuinfo2.s
 #as: -me500
-#readelf: -x5
+#readelf: -x2
 #target: powerpc-eabi*
 
 Hex dump of section '.PPC.EMB.apuinfo':
--- binutils/ld/testsuite/ld-powerpc/powerpc.exp.empty	2003-07-09 17:38:42.000000000 -0700
+++ binutils/ld/testsuite/ld-powerpc/powerpc.exp	2005-03-13 21:17:59.565880012 -0800
@@ -54,7 +54,7 @@ set ppcelftests {
      {{objdump -hw reloc.d}} "reloc.so"}
     {"APUinfo section processing" "-melf32ppc"
      "-a32 -me500" {apuinfo1.s apuinfo2.s}
-    {{readelf -x5 apuinfo.rd}} "apuinfo"}
+    {{readelf -x2 apuinfo.rd}} "apuinfo"}
     {"TLS32 static exec" "-melf32ppc" "-a32"  {tls32.s tlslib32.s}
      {{objdump -dr tls32.d} {objdump -sj.got tls32.g}
       {objdump -sj.tdata tls32.t}}
--- binutils/ld/testsuite/ld-powerpc/tlsexe32.r.empty	2004-11-05 14:41:52.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/tlsexe32.r	2005-03-13 21:17:59.571879234 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: powerpc*-*-*
 
-There are 21 section headers.*
+There are 18 section headers.*
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -21,15 +21,12 @@ Section Headers:
  +\[ 9\] \.tdata +PROGBITS +018102d4 0002d4 00001c 00 WAT +0 +0 +4
  +\[10\] \.tbss +NOBITS +018102f0 0002f0 00001c 00 WAT +0 +0 +4
  +\[11\] \.dynamic +DYNAMIC +018102f0 0002f0 0000a0 08 +WA +4 +0 +4
- +\[12\] \.data +PROGBITS +01810390 000390 000000 00 +WA +0 +0 +1
- +\[13\] \.got +PROGBITS +01810390 000390 00001c 04 WAX +0 +0 +4
- +\[14\] \.sdata +PROGBITS +018103ac 0003ac 000000 00 +WA +0 +0 +4
- +\[15\] \.sbss +NOBITS +018103ac 0003ac 000000 00 +WA +0 +0 +1
- +\[16\] \.plt +NOBITS +.*
- +\[17\] \.bss +NOBITS +.*
- +\[18\] \.shstrtab +STRTAB +.*
- +\[19\] \.symtab +SYMTAB +.*
- +\[20\] \.strtab +STRTAB +.*
+ +\[12\] \.got +PROGBITS +01810390 000390 00001c 04 WAX +0 +0 +4
+ +\[13\] \.sdata +PROGBITS +018103ac 0003ac 000000 00 +WA +0 +0 +4
+ +\[14\] \.plt +NOBITS +.*
+ +\[15\] \.shstrtab +STRTAB +.*
+ +\[16\] \.symtab +SYMTAB +.*
+ +\[17\] \.strtab +STRTAB +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -76,7 +73,7 @@ Symbol table '\.dynsym' contains 9 entri
  +7: 018103ac +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +8: 01810400 +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '\.symtab' contains 47 entries:
+Symbol table '\.symtab' contains 44 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 00000000 +0 NOTYPE +LOCAL +DEFAULT +UND 
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 
@@ -88,40 +85,37 @@ Symbol table '\.symtab' contains 47 entr
  +7: 01800264 +0 SECTION LOCAL +DEFAULT +7 
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 
  +9: 018102d4 +0 SECTION LOCAL +DEFAULT +9 
- +10: 018102f0 +0 SECTION LOCAL +DEFAULT +10 
- +11: 018102f0 +0 SECTION LOCAL +DEFAULT +11 
- +12: 01810390 +0 SECTION LOCAL +DEFAULT +12 
- +13: 01810390 +0 SECTION LOCAL +DEFAULT +13 
- +14: 018103ac +0 SECTION LOCAL +DEFAULT +14 
- +15: 018103ac +0 SECTION LOCAL +DEFAULT +15 
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
- +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 
- +19: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +19 
- +20: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +20 
- +21: 00000000 +0 TLS +LOCAL +DEFAULT +9 gd4
- +22: 00000004 +0 TLS +LOCAL +DEFAULT +9 ld4
- +23: 00000008 +0 TLS +LOCAL +DEFAULT +9 ld5
- +24: 0000000c +0 TLS +LOCAL +DEFAULT +9 ld6
- +25: 00000010 +0 TLS +LOCAL +DEFAULT +9 ie4
- +26: 00000014 +0 TLS +LOCAL +DEFAULT +9 le4
- +27: 00000018 +0 TLS +LOCAL +DEFAULT +9 le5
- +28: 018102f0 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +29: 00000000 +0 TLS +GLOBAL DEFAULT +UND gd
- +30: 00000030 +0 TLS +GLOBAL DEFAULT +10 le0
- +31: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +32: 00000020 +0 TLS +GLOBAL DEFAULT +10 ld0
- +33: 00000034 +0 TLS +GLOBAL DEFAULT +10 le1
- +34: 00000000 +0 TLS +GLOBAL DEFAULT +UND ld
- +35: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +7 _start
- +36: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end
- +37: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +14 _SDA_BASE_
- +38: 00000028 +0 TLS +GLOBAL DEFAULT +10 ld2
- +39: 00000024 +0 TLS +GLOBAL DEFAULT +10 ld1
- +40: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +41: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +42: 01810394 +0 OBJECT +GLOBAL +HIDDEN +13 _GLOBAL_OFFSET_TABLE_
- +43: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +44: 0000001c +0 TLS +GLOBAL DEFAULT +10 gd0
- +45: 0000002c +0 TLS +GLOBAL DEFAULT +10 ie0
- +46: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +8 _SDA2_BASE_
+ +[0-9]+: 018102f0 +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: 018102f0 +0 SECTION LOCAL +DEFAULT +11 
+ +[0-9]+: 01810390 +0 SECTION LOCAL +DEFAULT +12 
+ +[0-9]+: 018103ac +0 SECTION LOCAL +DEFAULT +13 
+ +[0-9]+: 018103ac +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: 00000000 +0 SECTION LOCAL +DEFAULT +15 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
+ +[0-9]+: 00000000 +0 TLS +LOCAL +DEFAULT +9 gd4
+ +[0-9]+: 00000004 +0 TLS +LOCAL +DEFAULT +9 ld4
+ +[0-9]+: 00000008 +0 TLS +LOCAL +DEFAULT +9 ld5
+ +[0-9]+: 0000000c +0 TLS +LOCAL +DEFAULT +9 ld6
+ +[0-9]+: 00000010 +0 TLS +LOCAL +DEFAULT +9 ie4
+ +[0-9]+: 00000014 +0 TLS +LOCAL +DEFAULT +9 le4
+ +[0-9]+: 00000018 +0 TLS +LOCAL +DEFAULT +9 le5
+ +[0-9]+: 018102f0 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 00000000 +0 TLS +GLOBAL DEFAULT +UND gd
+ +[0-9]+: 00000030 +0 TLS +GLOBAL DEFAULT +10 le0
+ +[0-9]+: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: 00000020 +0 TLS +GLOBAL DEFAULT +10 ld0
+ +[0-9]+: 00000034 +0 TLS +GLOBAL DEFAULT +10 le1
+ +[0-9]+: 00000000 +0 TLS +GLOBAL DEFAULT +UND ld
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +7 _start
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +13 _SDA_BASE_
+ +[0-9]+: 00000028 +0 TLS +GLOBAL DEFAULT +10 ld2
+ +[0-9]+: 00000024 +0 TLS +GLOBAL DEFAULT +10 ld1
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: 01810394 +0 OBJECT +GLOBAL +HIDDEN +12 _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0000001c +0 TLS +GLOBAL DEFAULT +10 gd0
+ +[0-9]+: 0000002c +0 TLS +GLOBAL DEFAULT +10 ie0
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +8 _SDA2_BASE_
--- binutils/ld/testsuite/ld-powerpc/tlsso32.r.empty	2004-11-05 14:41:52.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/tlsso32.r	2005-03-13 21:17:59.587877160 -0800
@@ -4,7 +4,7 @@
 #readelf: -WSsrl
 #target: powerpc*-*-*
 
-There are 20 section headers.*
+There are 17 section headers.*
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -18,16 +18,13 @@ Section Headers:
  +\[ 7\] \.tdata +PROGBITS +0+104dc 0+4dc 0+1c 0+ WAT +0 +0 +4
  +\[ 8\] \.tbss +NOBITS +0+104f8 0+4f8 0+1c 0+ WAT +0 +0 +4
  +\[ 9\] \.dynamic +DYNAMIC +0+104f8 0+4f8 0+a0 08 +WA +3 +0 +4
- +\[10\] \.data +PROGBITS +0+10598 0+598 0+ 0+ +WA +0 +0 +1
- +\[11\] \.got +PROGBITS +0+10598 0+598 0+34 04 WAX +0 +0 +4
- +\[12\] \.sdata2 +.*
- +\[13\] \.sdata +.*
- +\[14\] \.sbss +.*
- +\[15\] \.plt +.*
- +\[16\] \.bss +.*
- +\[17\] \.shstrtab +.*
- +\[18\] \.symtab +.*
- +\[19\] \.strtab +.*
+ +\[10\] \.got +PROGBITS +0+10598 0+598 0+34 04 WAX +0 +0 +4
+ +\[11\] \.sdata2 +.*
+ +\[12\] \.sdata +.*
+ +\[13\] \.plt +.*
+ +\[14\] \.shstrtab +.*
+ +\[15\] \.symtab +.*
+ +\[16\] \.strtab +.*
 #...
 
 Elf file type is DYN \(Shared object file\)
@@ -79,11 +76,11 @@ Symbol table '\.dynsym' contains 27 entr
  +[0-9]+: 0+46c +0 SECTION LOCAL +DEFAULT +6 
  +[0-9]+: 0+104dc +0 SECTION LOCAL +DEFAULT +7 
  +[0-9]+: 0+104f8 +0 SECTION LOCAL +DEFAULT +8 
- +[0-9]+: 0+10598 +0 SECTION LOCAL +DEFAULT +10 
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
+ +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +11 
  +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +12 
- +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +13 
- +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +14 
- +[0-9]+: 0+10620 +0 SECTION LOCAL +DEFAULT +16 
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +[0-9]+: 0+104f8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
  +[0-9]+: 0+30 +0 TLS +GLOBAL DEFAULT +8 le0
@@ -93,7 +90,7 @@ Symbol table '\.dynsym' contains 27 entr
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +6 _start
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +13 _SDA_BASE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA_BASE_
  +[0-9]+: 0+28 +0 TLS +GLOBAL DEFAULT +8 ld2
  +[0-9]+: 0+24 +0 TLS +GLOBAL DEFAULT +8 ld1
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
@@ -101,9 +98,9 @@ Symbol table '\.dynsym' contains 27 entr
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 gd0
  +[0-9]+: 0+2c +0 TLS +GLOBAL DEFAULT +8 ie0
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA2_BASE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +11 _SDA2_BASE_
 
-Symbol table '\.symtab' contains 46 entries:
+Symbol table '\.symtab' contains 43 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 
@@ -119,12 +116,9 @@ Symbol table '\.symtab' contains 46 entr
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 
  +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +12 
  +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +13 
- +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +14 
+ +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +14 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +[0-9]+: 0+10620 +0 SECTION LOCAL +DEFAULT +16 
- +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +17 
- +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +18 
- +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +19 
+ +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +16 
  +[0-9]+: 0+ +0 TLS +LOCAL +DEFAULT +7 gd4
  +[0-9]+: 0+4 +0 TLS +LOCAL +DEFAULT +7 ld4
  +[0-9]+: 0+8 +0 TLS +LOCAL +DEFAULT +7 ld5
@@ -142,7 +136,7 @@ Symbol table '\.symtab' contains 46 entr
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND ld
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +6 _start
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +13 _SDA_BASE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA_BASE_
  +[0-9]+: 0+28 +0 TLS +GLOBAL DEFAULT +8 ld2
  +[0-9]+: 0+24 +0 TLS +GLOBAL DEFAULT +8 ld1
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
@@ -150,4 +144,4 @@ Symbol table '\.symtab' contains 46 entr
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 gd0
  +[0-9]+: 0+2c +0 TLS +GLOBAL DEFAULT +8 ie0
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA2_BASE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +11 _SDA2_BASE_
--- binutils/ld/testsuite/ld-s390/tlsbin.rd.empty	2004-11-05 14:41:52.000000000 -0800
+++ binutils/ld/testsuite/ld-s390/tlsbin.rd	2005-03-13 21:17:59.600875474 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: s390-*-*
 
-There are 18 section headers, starting at offset 0x[0-9a-f]+:
+There are 16 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -22,11 +22,9 @@ Section Headers:
   \[10\] .tbss +NOBITS +0+4014e0 0+4e0 0+40 00 WAT +0 +0 +1
   \[11\] .dynamic +DYNAMIC +0+4014e0 0+4e0 0+a0 08 +WA +4 +0 +4
   \[12\] .got +PROGBITS +0+401580 0+580 0+2c 04 +WA +0 +0 +4
-  \[13\] .data +.*
-  \[14\] .bss +.*
-  \[15\] .shstrtab +.*
-  \[16\] .symtab +.*
-  \[17\] .strtab +.*
+  \[13\] .shstrtab +.*
+  \[14\] .symtab +.*
+  \[15\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -79,7 +77,7 @@ Symbol table '.dynsym' contains 10 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 70 entries:
+Symbol table '.symtab' contains 68 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 
@@ -97,8 +95,6 @@ Symbol table '.symtab' contains 70 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +9 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +9 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +9 sl3
--- binutils/ld/testsuite/ld-s390/tlsbin_64.rd.empty	2004-09-22 00:24:14.000000000 -0700
+++ binutils/ld/testsuite/ld-s390/tlsbin_64.rd	2005-03-13 21:17:59.603875085 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: s390x-*-*
 
-There are 18 section headers, starting at offset 0x[0-9a-f]+:
+There are 16 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -18,15 +18,13 @@ Section Headers:
   \[ 6\] .rela.plt +.*
   \[ 7\] .plt +.*
   \[ 8\] .text +PROGBITS +.*
-  \[ 9\] .tdata +PROGBITS +0+80001720 0+720 0+60 00 WAT +0 +0 +32
-  \[10\] .tbss +NOBITS +0+80001780 0+780 0+40 00 WAT +0 +0 +1
-  \[11\] .dynamic +DYNAMIC +0+80001780 0+780 0+140 10 +WA +4 +0 +8
-  \[12\] .got +PROGBITS +0+800018c0 0+8c0 0+78 08 +WA +0 +0 +8
-  \[13\] .data +.*
-  \[14\] .bss +.*
-  \[15\] .shstrtab +.*
-  \[16\] .symtab +.*
-  \[17\] .strtab +.*
+  \[ 9\] .tdata +PROGBITS +0+800016e0 0+6e0 0+60 00 WAT +0 +0 +32
+  \[10\] .tbss +NOBITS +0+80001740 0+740 0+40 00 WAT +0 +0 +1
+  \[11\] .dynamic +DYNAMIC +0+80001740 0+740 0+140 10 +WA +4 +0 +8
+  \[12\] .got +PROGBITS +0+80001880 0+880 0+78 08 +WA +0 +0 +8
+  \[13\] .shstrtab +.*
+  \[14\] .symtab +.*
+  \[15\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -41,10 +39,10 @@ Program Headers:
   PHDR +0x0+40 0x0+80000040 0x0+80000040 0x0+150 0x0+150 R E 0x8
   INTERP +0x0+190 0x0+80000190 0x0+80000190 0x0+11 0x0+11 R +0x1
 .*Requesting program interpreter.*
-  LOAD +0x0+ 0x0+80000000 0x0+80000000 0x0+720 0x0+720 R E 0x1000
-  LOAD +0x0+720 0x0+80001720 0x0+80001720 0x0+218 0x0+218 RW  0x1000
-  DYNAMIC +0x0+780 0x0+80001780 0x0+80001780 0x0+140 0x0+140 RW  0x8
-  TLS +0x0+720 0x0+80001720 0x0+80001720 0x0+60 0x0+a0 R +0x20
+  LOAD +0x0+ 0x0+80000000 0x0+80000000 0x0+6e0 0x0+6e0 R E 0x1000
+  LOAD +0x0+6e0 0x0+800016e0 0x0+800016e0 0x0+218 0x0+218 RW  0x1000
+  DYNAMIC +0x0+740 0x0+80001740 0x0+80001740 0x0+140 0x0+140 RW  0x8
+  TLS +0x0+6e0 0x0+800016e0 0x0+800016e0 0x0+60 0x0+a0 R +0x20
 
  Section to Segment mapping:
   Segment Sections...
@@ -62,11 +60,11 @@ Relocation section '.rela.dyn' at offset
 [0-9a-f]+ +0+60+38 R_390_TLS_TPOFF +0+ sG6 \+ 0
 [0-9a-f]+ +0+70+38 R_390_TLS_TPOFF +0+ sG1 \+ 0
 
-Relocation section '.rela.plt' at offset 0x40+ contains 1 entries:
+Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries:
  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
-[0-9a-f]+ +0+40+b R_390_JMP_SLOT +0+80+438 __tls_get_offset \+ 0
+[0-9a-f]+ +0+40+b R_390_JMP_SLOT +0+80+408 __tls_get_offset \+ 0
 
-Symbol table '.dynsym' contains 11 entries:
+Symbol table '.dynsym' contains 10 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG3
@@ -77,10 +75,9 @@ Symbol table '.dynsym' contains 11 entri
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG6
  +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 70 entries:
+Symbol table '.symtab' contains 68 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 
@@ -98,8 +95,6 @@ Symbol table '.symtab' contains 70 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 
  +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +9 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +9 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +9 sl3
@@ -145,7 +140,7 @@ Symbol table '.symtab' contains 70 entri
  +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +9 sg6
  +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +9 sg7
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL HIDDEN +12 _GLOBAL_OFFSET_TABLE_
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
  +[0-9]+: 0+44 +0 TLS +GLOBAL HIDDEN +9 sh2
  +[0-9]+: 0+54 +0 TLS +GLOBAL HIDDEN +9 sh6
--- binutils/ld/testsuite/ld-s390/tlspic.rd.empty	2004-11-05 14:41:53.000000000 -0800
+++ binutils/ld/testsuite/ld-s390/tlspic.rd	2005-03-13 21:17:59.604874956 -0800
@@ -5,7 +5,7 @@
 #readelf: -Ssrl
 #target: s390-*-*
 
-There are 17 section headers, starting at offset 0x[0-9a-f]+:
+There are 15 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -21,11 +21,9 @@ Section Headers:
   \[ 9\] .tbss +NOBITS +0+1620 0+620 0+20 00 WAT  0 +0  1
   \[10\] .dynamic +DYNAMIC +0+1620 0+620 0+98 08  WA  3 +0  4
   \[11\] .got +PROGBITS +0+16b8 0+6b8 0+58 04  WA  0 +0  4
-  \[12\] .data +.*
-  \[13\] .bss +.*
-  \[14\] .shstrtab +.*
-  \[15\] .symtab +.*
-  \[16\] .strtab +.*
+  \[12\] .shstrtab +.*
+  \[13\] .symtab +.*
+  \[14\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -76,8 +74,8 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -93,7 +91,7 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 56 entries:
+Symbol table '.symtab' contains 54 entries:
  +Num: +Value  Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 
@@ -110,8 +108,6 @@ Symbol table '.symtab' contains 56 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3
--- binutils/ld/testsuite/ld-s390/tlspic_64.rd.empty	2004-09-22 00:24:14.000000000 -0700
+++ binutils/ld/testsuite/ld-s390/tlspic_64.rd	2005-03-13 21:17:59.609874307 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: s390x-*-*
 
-There are 17 section headers, starting at offset 0x[0-9a-f]+:
+There are 15 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -17,15 +17,13 @@ Section Headers:
   \[ 5\] .rela.plt +.*
   \[ 6\] .plt +.*
   \[ 7\] .text +PROGBITS +.*
-  \[ 8\] .tdata +PROGBITS +0+1900 0+900 0+60 00 WAT +0 +0 +32
-  \[ 9\] .tbss +NOBITS +0+1960 0+960 0+20 00 WAT +0 +0 +1
-  \[10\] .dynamic +DYNAMIC +0+1960 0+960 0+130 10 +WA +3 +0 +8
-  \[11\] .got +PROGBITS +0+1a90 0+a90 0+b0 08 +WA +0 +0 +8
-  \[12\] .data +.*
-  \[13\] .bss +.*
-  \[14\] .shstrtab +.*
-  \[15\] .symtab +.*
-  \[16\] .strtab +.*
+  \[ 8\] .tdata +PROGBITS +0+18c0 0+8c0 0+60 00 WAT +0 +0 +32
+  \[ 9\] .tbss +NOBITS +0+1920 0+920 0+20 00 WAT +0 +0 +1
+  \[10\] .dynamic +DYNAMIC +0+1920 0+920 0+130 10 +WA +3 +0 +8
+  \[11\] .got +PROGBITS +0+1a50 0+a50 0+b0 08 +WA +0 +0 +8
+  \[12\] .shstrtab +.*
+  \[13\] .symtab +.*
+  \[14\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -38,9 +36,9 @@ There are 4 program headers, starting at
 Program Headers:
   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
   LOAD +0x0+ 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x1000
-  LOAD +0x0+900 0x0+1900 0x0+1900 0x0+240 0x0+240 RW +0x1000
-  DYNAMIC +0x0+960 0x0+1960 0x0+1960 0x0+130 0x0+130 RW +0x8
-  TLS +0x0+900 0x0+1900 0x0+1900 0x0+60 0x0+80 R +0x20
+  LOAD +0x0+8c0 0x0+18c0 0x0+18c0 0x0+240 0x0+240 RW +0x1000
+  DYNAMIC +0x0+920 0x0+1920 0x0+1920 0x0+130 0x0+130 RW +0x8
+  TLS +0x0+8c0 0x0+18c0 0x0+18c0 0x0+60 0x0+80 R +0x20
 
  Section to Segment mapping:
   Segment Sections...
@@ -70,14 +68,14 @@ Relocation section '.rela.plt' at offset
  +Offset +Info +Type +Symbol's Value  Symbol's Name \+ Addend
 [0-9a-f]+  0+b0+b R_390_JMP_SLOT +0+ __tls_get_offset \+ 0
 
-Symbol table '.dynsym' contains 21 entries:
+Symbol table '.dynsym' contains 20 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -91,10 +89,9 @@ Symbol table '.dynsym' contains 21 entri
  +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +8 sg6
  +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +8 sg7
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
- +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 56 entries:
+Symbol table '.symtab' contains 54 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 
@@ -111,8 +108,6 @@ Symbol table '.symtab' contains 56 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +12 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3
@@ -135,6 +130,7 @@ Symbol table '.symtab' contains 56 entri
  +[0-9]+: 0+74 +0 TLS +LOCAL  HIDDEN +9 sH6
  +[0-9]+: 0+7c +0 TLS +LOCAL  HIDDEN +9 sH8
  +[0-9]+: 0+40 +0 TLS +LOCAL  HIDDEN +8 sh1
+ +[0-9]+: [0-9a-f]+ +0 OBJECT  LOCAL  HIDDEN  ABS _GLOBAL_OFFSET_TABLE_
  +[0-9]+: 0+44 +0 TLS +LOCAL  HIDDEN +8 sh2
  +[0-9]+: 0+54 +0 TLS +LOCAL  HIDDEN +8 sh6
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
@@ -150,5 +146,4 @@ Symbol table '.symtab' contains 56 entri
  +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +8 sg6
  +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +8 sg7
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
- +[0-9]+: [0-9a-f]+ +0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
--- binutils/ld/testsuite/ld-sh/tlsbin-2.d.empty	2004-09-22 00:24:14.000000000 -0700
+++ binutils/ld/testsuite/ld-sh/tlsbin-2.d	2005-03-13 21:17:59.613873789 -0800
@@ -22,8 +22,6 @@ Section Headers:
   \[10\] \.tbss +NOBITS +0+413018 [0-9a-f]+ 0+010 00 WAT  0   0  1
 #...
   \[[0-9a-f]+\] \.got +PROGBITS +0+414000 .*
-  \[[0-9a-f]+\] \.sbss +.*
-  \[[0-9a-f]+\] \.bss +.*
 #...
   \[[0-9a-f]+\] \.shstrtab +.*
   \[[0-9a-f]+\] \.symtab +.*
--- binutils/ld/testsuite/ld-sh/tlspic-2.d.empty	2004-09-22 00:24:14.000000000 -0700
+++ binutils/ld/testsuite/ld-sh/tlspic-2.d	2005-03-13 21:17:59.614873659 -0800
@@ -21,8 +21,6 @@ Section Headers:
   \[ 9\] \.tbss +NOBITS +0+[0-9a-f]+ [0-9a-f]+ 0+008 00 WAT  0   0  1
 #...
   \[[0-9a-f]+\] \.got +PROGBITS +0+[0-9a-f]+ .*
-  \[[0-9a-f]+\] \.sbss +.*
-  \[[0-9a-f]+\] \.bss +.*
 #...
   \[[0-9a-f]+\] \.shstrtab +.*
   \[[0-9a-f]+\] \.symtab +.*
@@ -74,7 +72,7 @@ Symbol table '\.dynsym' contains [0-9]+ 
  +2: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 *
  +3: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 *
  +4: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +[0-9]+ *
- +5: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +[0-9]+ *
+ +5: 0+ +0 NOTYPE +LOCAL +DEFAULT  UND *
  +6: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9a-f]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  UND __tls_get_addr
  +[0-9a-f]+: 0+00 +0 TLS +GLOBAL DEFAULT +8 sg1
--- binutils/ld/testsuite/ld-sparc/tlssunbin32.rd.empty	2004-11-05 14:41:53.000000000 -0800
+++ binutils/ld/testsuite/ld-sparc/tlssunbin32.rd	2005-03-13 21:17:59.622872622 -0800
@@ -4,7 +4,7 @@
 #readelf: -WSsrl
 #target: sparc*-*-*
 
-There are 17 section headers, starting at offset 0x[0-9a-f]+:
+There are 15 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -20,11 +20,9 @@ Section Headers:
  +\[ 9\] .dynamic +DYNAMIC +0+231f8 0+31f8 0+80 08 +WA +4 +0 +4
  +\[10\] .got +PROGBITS +0+23278 0+3278 0+14 04 +WA +0 +0 +4
  +\[11\] .plt +.*
- +\[12\] .data +.*
- +\[13\] .bss +.*
- +\[14\] .shstrtab +.*
- +\[15\] .symtab +.*
- +\[16\] .strtab +.*
+ +\[12\] .shstrtab +.*
+ +\[13\] .symtab +.*
+ +\[14\] .strtab +.*
 #...
 
 Elf file type is EXEC \(Executable file\)
@@ -37,7 +35,7 @@ Program Headers:
  +INTERP +0x0+f4 0x0+100f4 0x0+100f4 0x0+11 0x0+11 R +0x1
 .*Requesting program interpreter.*
  +LOAD +0x0+ 0x0+10000 0x0+10000 0x0+2194 0x0+2194 R E 0x10000
- +LOAD +0x0+2194 0x0+22194 0x0+22194 0x0+1e6c 0x0+1e6c RWE 0x10000
+ +LOAD +0x0+2194 0x0+22194 0x0+22194 0x0+10f8 0x0+10f8 RWE 0x10000
  +DYNAMIC +0x0+31f8 0x0+231f8 0x0+231f8 0x0+80 0x0+80 RW +0x4
  +TLS +0x0+2194 0x0+22194 0x0+22194 0x0+1060 0x0+10a0 R +0x4
 #...
@@ -63,7 +61,7 @@ Symbol table '.dynsym' contains 11 entri
  +9: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +10: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 70 entries:
+Symbol table '.symtab' contains 68 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -75,63 +73,61 @@ Symbol table '.symtab' contains 70 entri
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +15: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
- +17: 0+1020 +0 TLS +LOCAL +DEFAULT +7 sl1
- +18: 0+1024 +0 TLS +LOCAL +DEFAULT +7 sl2
- +19: 0+1028 +0 TLS +LOCAL +DEFAULT +7 sl3
- +20: 0+102c +0 TLS +LOCAL +DEFAULT +7 sl4
- +21: 0+1030 +0 TLS +LOCAL +DEFAULT +7 sl5
- +22: 0+1034 +0 TLS +LOCAL +DEFAULT +7 sl6
- +23: 0+1038 +0 TLS +LOCAL +DEFAULT +7 sl7
- +24: 0+103c +0 TLS +LOCAL +DEFAULT +7 sl8
- +25: 0+1080 +0 TLS +LOCAL +DEFAULT +8 bl1
- +26: 0+1084 +0 TLS +LOCAL +DEFAULT +8 bl2
- +27: 0+1088 +0 TLS +LOCAL +DEFAULT +8 bl3
- +28: 0+108c +0 TLS +LOCAL +DEFAULT +8 bl4
- +29: 0+1090 +0 TLS +LOCAL +DEFAULT +8 bl5
- +30: 0+1094 +0 TLS +LOCAL +DEFAULT +8 bl6
- +31: 0+1098 +0 TLS +LOCAL +DEFAULT +8 bl7
- +32: 0+109c +0 TLS +LOCAL +DEFAULT +8 bl8
- +33: 0+101c +0 TLS +GLOBAL DEFAULT +7 sg8
- +34: 0+107c +0 TLS +GLOBAL DEFAULT +8 bg8
- +35: 0+1074 +0 TLS +GLOBAL DEFAULT +8 bg6
- +36: 0+ +0 TLS +GLOBAL DEFAULT +UND sG5
- +37: 0+1068 +0 TLS +GLOBAL DEFAULT +8 bg3
- +38: 0+231f8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +39: 0+1008 +0 TLS +GLOBAL DEFAULT +7 sg3
- +40: 0+1048 +0 TLS +GLOBAL HIDDEN +7 sh3
- +41: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
- +42: 0+100c +0 TLS +GLOBAL DEFAULT +7 sg4
- +43: 0+1010 +0 TLS +GLOBAL DEFAULT +7 sg5
- +44: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +45: 0+1070 +0 TLS +GLOBAL DEFAULT +8 bg5
- +46: 0+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
- +47: 0+1058 +0 TLS +GLOBAL HIDDEN +7 sh7
- +48: 0+105c +0 TLS +GLOBAL HIDDEN +7 sh8
- +49: 0+ +0 TLS +GLOBAL DEFAULT +7 sg1
- +50: 0+12000 +0 FUNC +GLOBAL DEFAULT +6 _start
- +51: 0+104c +0 TLS +GLOBAL HIDDEN +7 sh4
- +52: 0+1078 +0 TLS +GLOBAL DEFAULT +8 bg7
- +53: 0+1050 +0 TLS +GLOBAL HIDDEN +7 sh5
- +54: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +55: 0+ +0 TLS +GLOBAL DEFAULT +UND sG6
- +56: 0+11008 +0 FUNC +GLOBAL DEFAULT +6 fn2
- +57: 0+1004 +0 TLS +GLOBAL DEFAULT +7 sg2
- +58: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
- +59: 0+1040 +0 TLS +GLOBAL HIDDEN +7 sh1
- +60: 0+1014 +0 TLS +GLOBAL DEFAULT +7 sg6
- +61: 0+1018 +0 TLS +GLOBAL DEFAULT +7 sg7
- +62: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +63: 0+23278 +0 OBJECT +GLOBAL +HIDDEN +10 _GLOBAL_OFFSET_TABLE_
- +64: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
- +65: 0+1044 +0 TLS +GLOBAL HIDDEN +7 sh2
- +66: 0+1054 +0 TLS +GLOBAL HIDDEN +7 sh6
- +67: 0+1064 +0 TLS +GLOBAL DEFAULT +8 bg2
- +68: 0+1060 +0 TLS +GLOBAL DEFAULT +8 bg1
- +69: 0+106c +0 TLS +GLOBAL DEFAULT +8 bg4
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
+ +[0-9]+: 0+1020 +0 TLS +LOCAL +DEFAULT +7 sl1
+ +[0-9]+: 0+1024 +0 TLS +LOCAL +DEFAULT +7 sl2
+ +[0-9]+: 0+1028 +0 TLS +LOCAL +DEFAULT +7 sl3
+ +[0-9]+: 0+102c +0 TLS +LOCAL +DEFAULT +7 sl4
+ +[0-9]+: 0+1030 +0 TLS +LOCAL +DEFAULT +7 sl5
+ +[0-9]+: 0+1034 +0 TLS +LOCAL +DEFAULT +7 sl6
+ +[0-9]+: 0+1038 +0 TLS +LOCAL +DEFAULT +7 sl7
+ +[0-9]+: 0+103c +0 TLS +LOCAL +DEFAULT +7 sl8
+ +[0-9]+: 0+1080 +0 TLS +LOCAL +DEFAULT +8 bl1
+ +[0-9]+: 0+1084 +0 TLS +LOCAL +DEFAULT +8 bl2
+ +[0-9]+: 0+1088 +0 TLS +LOCAL +DEFAULT +8 bl3
+ +[0-9]+: 0+108c +0 TLS +LOCAL +DEFAULT +8 bl4
+ +[0-9]+: 0+1090 +0 TLS +LOCAL +DEFAULT +8 bl5
+ +[0-9]+: 0+1094 +0 TLS +LOCAL +DEFAULT +8 bl6
+ +[0-9]+: 0+1098 +0 TLS +LOCAL +DEFAULT +8 bl7
+ +[0-9]+: 0+109c +0 TLS +LOCAL +DEFAULT +8 bl8
+ +[0-9]+: 0+101c +0 TLS +GLOBAL DEFAULT +7 sg8
+ +[0-9]+: 0+107c +0 TLS +GLOBAL DEFAULT +8 bg8
+ +[0-9]+: 0+1074 +0 TLS +GLOBAL DEFAULT +8 bg6
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG5
+ +[0-9]+: 0+1068 +0 TLS +GLOBAL DEFAULT +8 bg3
+ +[0-9]+: 0+231f8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+1008 +0 TLS +GLOBAL DEFAULT +7 sg3
+ +[0-9]+: 0+1048 +0 TLS +GLOBAL HIDDEN +7 sh3
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG2
+ +[0-9]+: 0+100c +0 TLS +GLOBAL DEFAULT +7 sg4
+ +[0-9]+: 0+1010 +0 TLS +GLOBAL DEFAULT +7 sg5
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: 0+1070 +0 TLS +GLOBAL DEFAULT +8 bg5
+ +[0-9]+: 0+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr
+ +[0-9]+: 0+1058 +0 TLS +GLOBAL HIDDEN +7 sh7
+ +[0-9]+: 0+105c +0 TLS +GLOBAL HIDDEN +7 sh8
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +7 sg1
+ +[0-9]+: 0+12000 +0 FUNC +GLOBAL DEFAULT +6 _start
+ +[0-9]+: 0+104c +0 TLS +GLOBAL HIDDEN +7 sh4
+ +[0-9]+: 0+1078 +0 TLS +GLOBAL DEFAULT +8 bg7
+ +[0-9]+: 0+1050 +0 TLS +GLOBAL HIDDEN +7 sh5
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG6
+ +[0-9]+: 0+11008 +0 FUNC +GLOBAL DEFAULT +6 fn2
+ +[0-9]+: 0+1004 +0 TLS +GLOBAL DEFAULT +7 sg2
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sG1
+ +[0-9]+: 0+1040 +0 TLS +GLOBAL HIDDEN +7 sh1
+ +[0-9]+: 0+1014 +0 TLS +GLOBAL DEFAULT +7 sg6
+ +[0-9]+: 0+1018 +0 TLS +GLOBAL DEFAULT +7 sg7
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: 0+23278 +0 OBJECT +GLOBAL +HIDDEN +10 _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: 0+1044 +0 TLS +GLOBAL HIDDEN +7 sh2
+ +[0-9]+: 0+1054 +0 TLS +GLOBAL HIDDEN +7 sh6
+ +[0-9]+: 0+1064 +0 TLS +GLOBAL DEFAULT +8 bg2
+ +[0-9]+: 0+1060 +0 TLS +GLOBAL DEFAULT +8 bg1
+ +[0-9]+: 0+106c +0 TLS +GLOBAL DEFAULT +8 bg4
--- binutils/ld/testsuite/ld-sparc/tlssunnopic32.rd.empty	2005-02-17 14:14:42.000000000 -0800
+++ binutils/ld/testsuite/ld-sparc/tlssunnopic32.rd	2005-03-13 21:17:59.634871066 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: sparc-*-*
 
-There are 15 section headers, starting at offset 0x[0-9a-f]+:
+There are 13 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -19,11 +19,9 @@ Section Headers:
  +\[ 7\] .dynamic +DYNAMIC +0+12000 0+2000 0+80 08 +WA +3 +0 +4
  +\[ 8\] .got +PROGBITS +0+12080 0+2080 0+1c 04 +WA +0 +0 +4
  +\[ 9\] .plt +.*
- +\[10\] .data +PROGBITS +0+13000 0+3000 0+ 0+ +WA +0 +0 4096
- +\[11\] .bss +.*
- +\[12\] .shstrtab +.*
- +\[13\] .symtab +.*
- +\[14\] .strtab +.*
+ +\[10\] .shstrtab +.*
+ +\[11\] .symtab +.*
+ +\[12\] .strtab +.*
 #...
 Elf file type is DYN \(Shared object file\)
 Entry point 0x1000
@@ -32,7 +30,7 @@ There are 4 program headers, starting at
 Program Headers:
  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x10000
- +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+1000 0x0+1000 RWE 0x10000
+ +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+9c 0x0+9c RWE 0x10000
  +DYNAMIC +0x0+2000 0x0+12000 0x0+12000 0x0+80 0x0+80 RW +0x4
  +TLS +0x0+2000 0x0+12000 0x0+12000 0x0+ 0x0+24 R +0x4
 #...
@@ -58,8 +56,8 @@ Symbol table '.dynsym' contains 14 entri
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 *
  +2: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 *
  +3: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
- +4: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +5: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +4: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +5: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +6: 0+12000 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +7: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
  +8: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
@@ -69,7 +67,7 @@ Symbol table '.dynsym' contains 14 entri
  +12: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +13: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 33 entries:
+Symbol table '.symtab' contains 31 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +1: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -81,26 +79,24 @@ Symbol table '.symtab' contains 33 entri
  +7: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
  +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
  +9: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 *
- +10: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +11: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
- +12: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +13: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
- +14: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +15: 0+ +0 TLS +LOCAL +DEFAULT +6 bl1
- +16: 0+4 +0 TLS +LOCAL +DEFAULT +6 bl2
- +17: 0+8 +0 TLS +LOCAL +DEFAULT +6 bl3
- +18: 0+c +0 TLS +LOCAL +DEFAULT +6 bl4
- +19: 0+10 +0 TLS +LOCAL +DEFAULT +6 bl5
- +20: 0+1c +0 TLS +LOCAL +HIDDEN +6 sh3
- +21: 0+20 +0 TLS +LOCAL +HIDDEN +6 sh4
- +22: 0+14 +0 TLS +LOCAL +HIDDEN +6 sh1
- +23: 0+12080 +0 OBJECT +LOCAL +HIDDEN +ABS _GLOBAL_OFFSET_TABLE_
- +24: 0+18 +0 TLS +LOCAL +HIDDEN +6 sh2
- +25: 0+12000 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
- +26: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
- +27: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
- +28: 0+ +0 TLS +GLOBAL DEFAULT +UND sg1
- +29: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
- +30: 0+ +0 TLS +GLOBAL DEFAULT +UND sg2
- +31: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
- +32: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 *
+ +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
+ +[0-9]+: 0+ +0 TLS +LOCAL +DEFAULT +6 bl1
+ +[0-9]+: 0+4 +0 TLS +LOCAL +DEFAULT +6 bl2
+ +[0-9]+: 0+8 +0 TLS +LOCAL +DEFAULT +6 bl3
+ +[0-9]+: 0+c +0 TLS +LOCAL +DEFAULT +6 bl4
+ +[0-9]+: 0+10 +0 TLS +LOCAL +DEFAULT +6 bl5
+ +[0-9]+: 0+1c +0 TLS +LOCAL +HIDDEN +6 sh3
+ +[0-9]+: 0+20 +0 TLS +LOCAL +HIDDEN +6 sh4
+ +[0-9]+: 0+14 +0 TLS +LOCAL +HIDDEN +6 sh1
+ +[0-9]+: 0+12080 +0 OBJECT +LOCAL +HIDDEN +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: 0+18 +0 TLS +LOCAL +HIDDEN +6 sh2
+ +[0-9]+: 0+12000 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+ +[0-9]+: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
+ +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sg1
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
+ +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND sg2
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
+ +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
--- binutils/ld/testsuite/ld-sparc/tlssunpic32.rd.empty	2005-02-17 14:14:42.000000000 -0800
+++ binutils/ld/testsuite/ld-sparc/tlssunpic32.rd	2005-03-13 21:17:59.634871066 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: sparc*-*-*
 
-There are 17 section headers, starting at offset 0x[0-9a-f]+:
+There are 15 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
  +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
@@ -21,11 +21,9 @@ Section Headers:
  +\[ 9\] .dynamic +DYNAMIC +0+12060 0+2060 0+98 08 +WA +3 +0 +4
  +\[10\] .got +PROGBITS +0+120f8 0+20f8 0+4c 04 +WA +0 +0 +4
  +\[11\] .plt +.*
- +\[12\] .data +PROGBITS +0+13000 0+3000 0+ 0+ +WA +0 +0 4096
- +\[13\] .bss +.*
- +\[14\] .shstrtab +.*
- +\[15\] .symtab +.*
- +\[16\] .strtab +.*
+ +\[12\] .shstrtab +.*
+ +\[13\] .symtab +.*
+ +\[14\] .strtab +.*
 #...
 
 Elf file type is DYN \(Shared object file\)
@@ -35,7 +33,7 @@ There are 4 program headers, starting at
 Program Headers:
  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x10000
- +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+1000 0x0+1000 RWE 0x10000
+ +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+184 0x0+184 RWE 0x10000
  +DYNAMIC +0x0+2060 0x0+12060 0x0+12060 0x0+98 0x0+98 RW +0x4
  +TLS +0x0+2000 0x0+12000 0x0+12000 0x0+60 0x0+80 R +0x4
 #...
@@ -68,8 +66,8 @@ Symbol table '.dynsym' contains 22 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +7 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +10 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
+ +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +7 sg8
  +[0-9]+: 0+12060 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +7 sg3
@@ -86,7 +84,7 @@ Symbol table '.dynsym' contains 22 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
 
-Symbol table '.symtab' contains 57 entries:
+Symbol table '.symtab' contains 55 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 *
@@ -103,8 +101,6 @@ Symbol table '.symtab' contains 57 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +12 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +13 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +14 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 *
  +[0-9]+: 0+20 +0 TLS +LOCAL +DEFAULT +7 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL +DEFAULT +7 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL +DEFAULT +7 sl3
--- binutils/ld/testsuite/ld-x86-64/tlsbin.rd.empty	2004-11-05 14:41:53.000000000 -0800
+++ binutils/ld/testsuite/ld-x86-64/tlsbin.rd	2005-03-13 21:17:59.635870937 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: x86_64-*-*
 
-There are 19 section headers, starting at offset 0x[0-9a-f]+:
+There are 17 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -23,11 +23,9 @@ Section Headers:
   \[11\] .dynamic +DYNAMIC +0+501290 0+1290 0+140 10 +WA +4 +0 +8
   \[12\] .got +PROGBITS +0+5013d0 0+13d0 0+20 08 +WA +0 +0 +8
   \[13\] .got.plt +PROGBITS +0+5013f0 0+13f0 0+20 08 +WA +0 +0 +8
-  \[14\] .data +.*
-  \[15\] .bss +.*
-  \[16\] .shstrtab +.*
-  \[17\] .symtab +.*
-  \[18\] .strtab +.*
+  \[14\] .shstrtab +.*
+  \[15\] .symtab +.*
+  \[16\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -39,11 +37,11 @@ There are 6 program headers, starting at
 
 Program Headers:
   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-  PHDR +0x0+40 0x0+400040 0x0+400040 0x0+150 0x0+150 R E 0x8
-  INTERP +0x0+190 0x0+400190 0x0+400190 0x0+f 0x0+f R +0x1
+  PHDR.*
+  INTERP.*
 .*Requesting program interpreter.*
   LOAD +0x0+ 0x0+400000 0x0+400000 0x0+122a 0x0+122a R E 0x100000
-  LOAD +0x0+122a 0x0+50122a 0x0+50122a 0x0+dd6 0x0+dd6 RW  0x100000
+  LOAD +0x0+122a 0x0+50122a 0x0+50122a 0x0+1e6 0x0+1e6 RW  0x100000
   DYNAMIC +0x0+1290 0x0+501290 0x0+501290 0x0+140 0x0+140 RW  0x8
   TLS +0x0+122a 0x0+50122a 0x0+50122a 0x0+60 0x0+a0 R +0x1
 
@@ -56,14 +54,14 @@ Program Headers:
    04 +.dynamic *
    05 +.tdata .tbss *
 
-Relocation section '.rela.dyn' at offset 0x328 contains 4 entries:
+Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
  +Offset +Info +Type +Symbol's Value  Symbol's Name \+ Addend
 0+5013d0  0+100000012 R_X86_64_TPOFF64 +0+ sG5 \+ 0
 0+5013d8  0+300000012 R_X86_64_TPOFF64 +0+ sG2 \+ 0
 0+5013e0  0+600000012 R_X86_64_TPOFF64 +0+ sG6 \+ 0
 0+5013e8  0+700000012 R_X86_64_TPOFF64 +0+ sG1 \+ 0
 
-Relocation section '.rela.plt' at offset 0x388 contains 1 entries:
+Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries:
  +Offset +Info +Type +Symbol's Value  Symbol's Name \+ Addend
 0+[0-9a-f]+  0+400000007 R_X86_64_JUMP_SLOT +0+[0-9a-f]+ __tls_get_addr \+ 0
 
@@ -80,7 +78,7 @@ Symbol table '.dynsym' contains 10 entri
  +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 71 entries:
+Symbol table '.symtab' contains 69 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -99,8 +97,6 @@ Symbol table '.symtab' contains 71 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +18 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +9 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +9 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +9 sl3
--- binutils/ld/testsuite/ld-x86-64/tlspic.rd.empty	2004-11-05 14:41:53.000000000 -0800
+++ binutils/ld/testsuite/ld-x86-64/tlspic.rd	2005-03-13 21:17:59.636870807 -0800
@@ -5,7 +5,7 @@
 #readelf: -WSsrl
 #target: x86_64-*-*
 
-There are 18 section headers, starting at offset 0x[0-9a-f]+:
+There are 16 section headers, starting at offset 0x[0-9a-f]+:
 
 Section Headers:
   \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
@@ -22,11 +22,9 @@ Section Headers:
   \[10\] .dynamic +DYNAMIC +0+101210 0+1210 0+130 10 +WA +3 +0 +8
   \[11\] .got +PROGBITS +0+101340 0+1340 0+90 08 +WA +0 +0 +8
   \[12\] .got.plt +PROGBITS +0+1013d0 0+13d0 0+20 08 +WA +0 +0 +8
-  \[13\] .data +.*
-  \[14\] .bss +.*
-  \[15\] .shstrtab +.*
-  \[16\] .symtab +.*
-  \[17\] .strtab +.*
+  \[13\] .shstrtab +.*
+  \[14\] .symtab +.*
+  \[15\] .strtab +.*
 Key to Flags:
 .*
 .*
@@ -39,7 +37,7 @@ There are 4 program headers, starting at
 Program Headers:
   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
   LOAD +0x0+ 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x100000
-  LOAD +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+e54 0x0+e54 RW +0x100000
+  LOAD +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+244 0x0+244 RW +0x100000
   DYNAMIC +0x0+1210 0x0+101210 0x0+101210 0x0+130 0x0+130 RW +0x8
   TLS +0x0+11ac 0x0+1011ac 0x0+1011ac 0x0+60 0x0+80 R +0x1
 
@@ -77,8 +75,8 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +7 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +8 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +9 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
+ +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +8 sg8
  +[0-9]+: 0+101210 +0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
  +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3
@@ -94,7 +92,7 @@ Symbol table '.dynsym' contains 20 entri
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  +[0-9]+: [0-9a-f]+ +0 NOTYPE  GLOBAL DEFAULT  ABS _end
 
-Symbol table '.symtab' contains 57 entries:
+Symbol table '.symtab' contains 55 entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +[0-9]+: 0+ +0 NOTYPE  LOCAL  DEFAULT  UND *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +1 *
@@ -112,8 +110,6 @@ Symbol table '.symtab' contains 57 entri
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +13 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +14 *
  +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +15 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +16 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL  DEFAULT +17 *
  +[0-9]+: 0+20 +0 TLS +LOCAL  DEFAULT +8 sl1
  +[0-9]+: 0+24 +0 TLS +LOCAL  DEFAULT +8 sl2
  +[0-9]+: 0+28 +0 TLS +LOCAL  DEFAULT +8 sl3

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

* Re: RFC: Remove empty output sections
  2005-03-14  6:32     ` H. J. Lu
@ 2005-03-14  8:35       ` Alan Modra
  2005-03-14 16:11         ` H. J. Lu
  2005-03-18 10:34         ` Alan Modra
  0 siblings, 2 replies; 25+ messages in thread
From: Alan Modra @ 2005-03-14  8:35 UTC (permalink / raw)
  To: H. J. Lu; +Cc: Nick Clifton, binutils

On Sun, Mar 13, 2005 at 10:31:41PM -0800, H. J. Lu wrote:
> @@ -4883,7 +4893,7 @@ lang_process (void)
>      lang_check_section_addresses ();
>  
>    /* Final stuffs.  */
> -
> +  lang_mark_used_section ();
>    ldemul_finish ();
>    lang_finish ();
>  }

Isn't this too late to strip sections?  What happens if one of the
sections stripped has a dynamic section symbol?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-14  8:35       ` Alan Modra
@ 2005-03-14 16:11         ` H. J. Lu
  2005-03-14 22:15           ` Alan Modra
  2005-03-18 10:34         ` Alan Modra
  1 sibling, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-14 16:11 UTC (permalink / raw)
  To: Nick Clifton, binutils

On Mon, Mar 14, 2005 at 07:05:15PM +1030, Alan Modra wrote:
> On Sun, Mar 13, 2005 at 10:31:41PM -0800, H. J. Lu wrote:
> > @@ -4883,7 +4893,7 @@ lang_process (void)
> >      lang_check_section_addresses ();
> >  
> >    /* Final stuffs.  */
> > -
> > +  lang_mark_used_section ();
> >    ldemul_finish ();
> >    lang_finish ();
> >  }
> 
> Isn't this too late to strip sections?  What happens if one of the
> sections stripped has a dynamic section symbol?

An empty section has a dynamic section symbol. Do you have a testcase
for that?


H.J.

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

* Re: RFC: Remove empty output sections
  2005-03-14 16:11         ` H. J. Lu
@ 2005-03-14 22:15           ` Alan Modra
  2005-03-15 19:58             ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Alan Modra @ 2005-03-14 22:15 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Mon, Mar 14, 2005 at 08:10:48AM -0800, H. J. Lu wrote:
> On Mon, Mar 14, 2005 at 07:05:15PM +1030, Alan Modra wrote:
> > On Sun, Mar 13, 2005 at 10:31:41PM -0800, H. J. Lu wrote:
> > > @@ -4883,7 +4893,7 @@ lang_process (void)
> > >      lang_check_section_addresses ();
> > >  
> > >    /* Final stuffs.  */
> > > -
> > > +  lang_mark_used_section ();
> > >    ldemul_finish ();
> > >    lang_finish ();
> > >  }
> > 
> > Isn't this too late to strip sections?  What happens if one of the
> > sections stripped has a dynamic section symbol?
> 
> An empty section has a dynamic section symbol. Do you have a testcase
> for that?

Easy.  This also demonstrates another potential problem with removing
empty sections;  Their alignment can affect layout of other sections.

$ cat > dynsym.s <<EOF
 .section .text2,"ax",@progbits
 .p2align 12

 .text
 nop

 .data
 .long 123
EOF
$ cat > dynsym.lnk <<EOF
SECTIONS
{
  .text : { *(.text) }
  .text2 : { *(.text2) }
  .data : { *(.data) }
  .bss : { *(.bss) }
}
EOF
$ as -o dynsym.o dynsym.s
$ ld -o dynsym -shared -T dynsym.lnk dynsym.o

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-14 22:15           ` Alan Modra
@ 2005-03-15 19:58             ` H. J. Lu
  2005-03-15 20:38               ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-15 19:58 UTC (permalink / raw)
  To: binutils

On Tue, Mar 15, 2005 at 08:45:44AM +1030, Alan Modra wrote:
> On Mon, Mar 14, 2005 at 08:10:48AM -0800, H. J. Lu wrote:
> > On Mon, Mar 14, 2005 at 07:05:15PM +1030, Alan Modra wrote:
> > > On Sun, Mar 13, 2005 at 10:31:41PM -0800, H. J. Lu wrote:
> > > > @@ -4883,7 +4893,7 @@ lang_process (void)
> > > >      lang_check_section_addresses ();
> > > >  
> > > >    /* Final stuffs.  */
> > > > -
> > > > +  lang_mark_used_section ();
> > > >    ldemul_finish ();
> > > >    lang_finish ();
> > > >  }
> > > 
> > > Isn't this too late to strip sections?  What happens if one of the
> > > sections stripped has a dynamic section symbol?
> > 
> > An empty section has a dynamic section symbol. Do you have a testcase
> > for that?
> 
> Easy.  This also demonstrates another potential problem with removing
> empty sections;  Their alignment can affect layout of other sections.
> 

Here is the output from readelf -Sls after removing empty sections.
Removing an empty section will certainly change the layout of other
sections. I don't think it should be a problem. I believe that
anything depending on alignment of an empty section is broken.

3 local entries in .dynsym have UND index since they are removed. It
is hard to remove them since it is done too late. I don't think it
should cause any probleme though.


H.J.
-----
There are 11 section headers, starting at offset 0x2164:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 001000 000001 00  AX  0   0  4
  [ 2] .dynsym           DYNSYM          00001000 002000 000070 10   A  3   4  4
  [ 3] .dynstr           STRTAB          00001070 002070 00000a 00   A  0   0  1
  [ 4] .hash             HASH            0000107c 00207c 000030 04   A  2   0  4
  [ 5] .data             PROGBITS        000010ac 0020ac 000004 00  WA  0   0  4
  [ 6] .dynamic          DYNAMIC         000010b0 0020b0 000058 08  WA  3   0  4
  [ 7] .got.plt          PROGBITS        00001108 002108 00000c 04  WA  0   0  4
  [ 8] .shstrtab         STRTAB          00000000 002114 00004f 00      0   0  1
  [ 9] .symtab           SYMTAB          00000000 00231c 0000d0 10     10  12  4
  [10] .strtab           STRTAB          00000000 0023ec 000020 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

Elf file type is DYN (Shared object file)
Entry point 0x0
There are 2 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x001000 0x00000000 0x00000000 0x01114 0x01114 RWE 0x1000
  DYNAMIC        0x0020b0 0x000010b0 0x000010b0 0x00058 0x00058 RW  0x4

 Section to Segment mapping:
  Segment Sections...
   00     .text .dynsym .dynstr .hash .data .dynamic .got.plt 
   01     .dynamic 

Symbol table '.dynsym' contains 7 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 SECTION LOCAL  DEFAULT    1 
     2: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     3: 000010ac     0 SECTION LOCAL  DEFAULT    5 
     4: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     5: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     6: 000010b0     0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC

Symbol table '.symtab' contains 13 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 SECTION LOCAL  DEFAULT    1 
     2: 00001000     0 SECTION LOCAL  DEFAULT    2 
     3: 00001070     0 SECTION LOCAL  DEFAULT    3 
     4: 0000107c     0 SECTION LOCAL  DEFAULT    4 
     5: 000010ac     0 SECTION LOCAL  DEFAULT    5 
     6: 000010b0     0 SECTION LOCAL  DEFAULT    6 
     7: 00001108     0 SECTION LOCAL  DEFAULT    7 
     8: 00000000     0 SECTION LOCAL  DEFAULT    8 
     9: 00000000     0 SECTION LOCAL  DEFAULT    9 
    10: 00000000     0 SECTION LOCAL  DEFAULT   10 
    11: 00001108     0 OBJECT  LOCAL  HIDDEN  ABS _GLOBAL_OFFSET_TABLE_
    12: 000010b0     0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC

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

* Re: RFC: Remove empty output sections
  2005-03-15 19:58             ` H. J. Lu
@ 2005-03-15 20:38               ` H. J. Lu
  2005-03-16  2:32                 ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-15 20:38 UTC (permalink / raw)
  To: binutils

On Tue, Mar 15, 2005 at 11:58:24AM -0800, H. J. Lu wrote:
> On Tue, Mar 15, 2005 at 08:45:44AM +1030, Alan Modra wrote:
> > On Mon, Mar 14, 2005 at 08:10:48AM -0800, H. J. Lu wrote:
> > > On Mon, Mar 14, 2005 at 07:05:15PM +1030, Alan Modra wrote:
> > > > On Sun, Mar 13, 2005 at 10:31:41PM -0800, H. J. Lu wrote:
> > > > > @@ -4883,7 +4893,7 @@ lang_process (void)
> > > > >      lang_check_section_addresses ();
> > > > >  
> > > > >    /* Final stuffs.  */
> > > > > -
> > > > > +  lang_mark_used_section ();
> > > > >    ldemul_finish ();
> > > > >    lang_finish ();
> > > > >  }
> > > > 
> > > > Isn't this too late to strip sections?  What happens if one of the
> > > > sections stripped has a dynamic section symbol?
> > > 
> > > An empty section has a dynamic section symbol. Do you have a testcase
> > > for that?
> > 
> > Easy.  This also demonstrates another potential problem with removing
> > empty sections;  Their alignment can affect layout of other sections.
> > 
> 
> Here is the output from readelf -Sls after removing empty sections.
> Removing an empty section will certainly change the layout of other
> sections. I don't think it should be a problem. I believe that
> anything depending on alignment of an empty section is broken.
> 
> 3 local entries in .dynsym have UND index since they are removed. It
> is hard to remove them since it is done too late. I don't think it
> should cause any probleme though.
> 

FYI, removing empty sections doesn't change the layout. I will see
if I can remove those UND entries in .dynsym.


H.J.

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

* Re: RFC: Remove empty output sections
  2005-03-15 20:38               ` H. J. Lu
@ 2005-03-16  2:32                 ` H. J. Lu
  2005-03-16  2:50                   ` Alan Modra
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-16  2:32 UTC (permalink / raw)
  To: binutils

On Tue, Mar 15, 2005 at 12:38:45PM -0800, H. J. Lu wrote:
> On Tue, Mar 15, 2005 at 11:58:24AM -0800, H. J. Lu wrote:
> > On Tue, Mar 15, 2005 at 08:45:44AM +1030, Alan Modra wrote:
> > > On Mon, Mar 14, 2005 at 08:10:48AM -0800, H. J. Lu wrote:
> > > > On Mon, Mar 14, 2005 at 07:05:15PM +1030, Alan Modra wrote:
> > > > > On Sun, Mar 13, 2005 at 10:31:41PM -0800, H. J. Lu wrote:
> > > > > > @@ -4883,7 +4893,7 @@ lang_process (void)
> > > > > >      lang_check_section_addresses ();
> > > > > >  
> > > > > >    /* Final stuffs.  */
> > > > > > -
> > > > > > +  lang_mark_used_section ();
> > > > > >    ldemul_finish ();
> > > > > >    lang_finish ();
> > > > > >  }
> > > > > 
> > > > > Isn't this too late to strip sections?  What happens if one of the
> > > > > sections stripped has a dynamic section symbol?
> > > > 
> > > > An empty section has a dynamic section symbol. Do you have a testcase
> > > > for that?
> > > 
> > > Easy.  This also demonstrates another potential problem with removing
> > > empty sections;  Their alignment can affect layout of other sections.
> > > 
> > 
> > Here is the output from readelf -Sls after removing empty sections.
> > Removing an empty section will certainly change the layout of other
> > sections. I don't think it should be a problem. I believe that
> > anything depending on alignment of an empty section is broken.
> > 
> > 3 local entries in .dynsym have UND index since they are removed. It
> > is hard to remove them since it is done too late. I don't think it
> > should cause any probleme though.
> > 
> 
> FYI, removing empty sections doesn't change the layout. I will see
> if I can remove those UND entries in .dynsym.
> 

One benefit of removing empty sections late is there will be no
layout changes. The only changes are

1. No empty sections in section table.
2. Some undefine section symbols in .dynsym.
3. No empty segment.

bash-3.00$ cat foo.c
int
_start ()
{
  return 0;
}
bash-3.00$ /usr/bin/ld foo.o
bash-3.00$ readelf -l a.out

Elf file type is EXEC (Executable file)
Entry point 0x8048094
There are 3 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg
Align
  LOAD           0x000000 0x08048000 0x08048000 0x0009e 0x0009e R E
0x1000
  LOAD           0x0000a0 0x080490a0 0x080490a0 0x00000 0x00000 RW
0x1000
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4

 Section to Segment mapping:
  Segment Sections...
   00     .text
   01
   02

With the new linker,

bash-3.00$ ./ld foo.o
bash-3.00$ readelf -l a.out

Elf file type is EXEC (Executable file)
Entry point 0x8048094
There are 2 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg
Align
  LOAD           0x000000 0x08048000 0x08048000 0x0009e 0x0009e R E
0x1000
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4

 Section to Segment mapping:
  Segment Sections...
   00     .text
   01


H.J.

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

* Re: RFC: Remove empty output sections
  2005-03-16  2:32                 ` H. J. Lu
@ 2005-03-16  2:50                   ` Alan Modra
  2005-03-17  4:22                     ` H. J. Lu
  2005-03-18  3:15                     ` Alan Modra
  0 siblings, 2 replies; 25+ messages in thread
From: Alan Modra @ 2005-03-16  2:50 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Tue, Mar 15, 2005 at 06:32:46PM -0800, H. J. Lu wrote:
> One benefit of removing empty sections late is there will be no
> layout changes.

That's true.

>  The only changes are
> 1. No empty sections in section table.
> 2. Some undefine section symbols in .dynsym.
> 3. No empty segment.

Well, that's good.  I was worried that something might go wrong with
dynamic section symbols, but it seems that you are OK there.
Patch is OK for mainline.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-16  2:50                   ` Alan Modra
@ 2005-03-17  4:22                     ` H. J. Lu
  2005-03-17  8:39                       ` Alan Modra
  2005-03-18  3:15                     ` Alan Modra
  1 sibling, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-17  4:22 UTC (permalink / raw)
  To: binutils

On Wed, Mar 16, 2005 at 01:20:12PM +1030, Alan Modra wrote:
> On Tue, Mar 15, 2005 at 06:32:46PM -0800, H. J. Lu wrote:
> > One benefit of removing empty sections late is there will be no
> > layout changes.
> 
> That's true.
> 
> >  The only changes are
> > 1. No empty sections in section table.
> > 2. Some undefine section symbols in .dynsym.
> > 3. No empty segment.
> 
> Well, that's good.  I was worried that something might go wrong with
> dynamic section symbols, but it seems that you are OK there.
> Patch is OK for mainline.

I checked it. There were failures:

./build-ppc-linux/ld/ld.log:FAIL: TLS32 shared
./build-ppc64-linux/ld/ld.log:FAIL: TLS32 shared

without my patch. I didn't update them. Also MIPS needs

http://sourceware.org/ml/binutils/2005-03/msg00459.html


H.J.

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

* Re: RFC: Remove empty output sections
  2005-03-17  4:22                     ` H. J. Lu
@ 2005-03-17  8:39                       ` Alan Modra
  0 siblings, 0 replies; 25+ messages in thread
From: Alan Modra @ 2005-03-17  8:39 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Wed, Mar 16, 2005 at 02:00:15PM -0800, H. J. Lu wrote:
> ./build-ppc-linux/ld/ld.log:FAIL: TLS32 shared
> ./build-ppc64-linux/ld/ld.log:FAIL: TLS32 shared

Ignore them.  I'll be committing some ppc changes to mainline shortly
that will require me to update them anyway.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-16  2:50                   ` Alan Modra
  2005-03-17  4:22                     ` H. J. Lu
@ 2005-03-18  3:15                     ` Alan Modra
  2005-03-18  3:29                       ` H. J. Lu
  1 sibling, 1 reply; 25+ messages in thread
From: Alan Modra @ 2005-03-18  3:15 UTC (permalink / raw)
  To: H. J. Lu, binutils

Hi HJ,
  It seems your change to remove zero-size output sections is
responsible for segfaults when generating map files.  For example,
taking something from the ld testsuite with -Map added:

$ gcc -L/home/alan/build/ppc/bin/./ld -B/home/alan/build/ppc/bin/ld/tmpdir/ld/ -L/usr/local/powerpc-linux/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/libsize_bar.so --shared  tmpdir/size_bar.o -Wl,-Map,xxx.map
collect2: ld terminated with signal 11 [Segmentation fault]

On powerpc-linux this particular .so has an empty .bss, and the linker
script has an ALIGN inside the .bss output section.  Processing ALIGN_K
in ldexp.c refeferences the bfd_section, which is now NULL.  I expect
other linker expressions will similarly segfault if their associated
output section is removed before the linker map is printed.  Would you
take a look, please?

A solution that might work is to simply not clear os->bfd_section in
gld${EMULATION_NAME}_finish.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-18  3:15                     ` Alan Modra
@ 2005-03-18  3:29                       ` H. J. Lu
  2005-03-18  3:51                         ` Alan Modra
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-18  3:29 UTC (permalink / raw)
  To: binutils

On Fri, Mar 18, 2005 at 12:06:51PM +1030, Alan Modra wrote:
> Hi HJ,
>   It seems your change to remove zero-size output sections is
> responsible for segfaults when generating map files.  For example,
> taking something from the ld testsuite with -Map added:
> 
> $ gcc -L/home/alan/build/ppc/bin/./ld -B/home/alan/build/ppc/bin/ld/tmpdir/ld/ -L/usr/local/powerpc-linux/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/libsize_bar.so --shared  tmpdir/size_bar.o -Wl,-Map,xxx.map
> collect2: ld terminated with signal 11 [Segmentation fault]
> 
> On powerpc-linux this particular .so has an empty .bss, and the linker
> script has an ALIGN inside the .bss output section.  Processing ALIGN_K
> in ldexp.c refeferences the bfd_section, which is now NULL.  I expect
> other linker expressions will similarly segfault if their associated
> output section is removed before the linker map is printed.  Would you
> take a look, please?
> 
> A solution that might work is to simply not clear os->bfd_section in
> gld${EMULATION_NAME}_finish.

Can you send me a testcase?


H.J.

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

* Re: RFC: Remove empty output sections
  2005-03-18  3:29                       ` H. J. Lu
@ 2005-03-18  3:51                         ` Alan Modra
  2005-03-18  7:07                           ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Alan Modra @ 2005-03-18  3:51 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Thu, Mar 17, 2005 at 05:49:29PM -0800, H. J. Lu wrote:
> On Fri, Mar 18, 2005 at 12:06:51PM +1030, Alan Modra wrote:
> > Hi HJ,
> >   It seems your change to remove zero-size output sections is
> > responsible for segfaults when generating map files.  For example,
> > taking something from the ld testsuite with -Map added:
> > 
> > $ gcc -L/home/alan/build/ppc/bin/./ld -B/home/alan/build/ppc/bin/ld/tmpdir/ld/ -L/usr/local/powerpc-linux/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/libsize_bar.so --shared  tmpdir/size_bar.o -Wl,-Map,xxx.map
> > collect2: ld terminated with signal 11 [Segmentation fault]
> > 
> > On powerpc-linux this particular .so has an empty .bss, and the linker
> > script has an ALIGN inside the .bss output section.  Processing ALIGN_K
> > in ldexp.c refeferences the bfd_section, which is now NULL.  I expect
> > other linker expressions will similarly segfault if their associated
> > output section is removed before the linker map is printed.  Would you
> > take a look, please?
> > 
> > A solution that might work is to simply not clear os->bfd_section in
> > gld${EMULATION_NAME}_finish.
> 
> Can you send me a testcase?

$ echo > empty.s
$ ../gas/as-new -o empty.o empty.s
$ ./ld-new -shared -Map empty.map -o empty.so empty.o
Segmentation fault

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-18  3:51                         ` Alan Modra
@ 2005-03-18  7:07                           ` H. J. Lu
  2005-03-18  7:13                             ` Alan Modra
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-18  7:07 UTC (permalink / raw)
  To: binutils

On Fri, Mar 18, 2005 at 12:33:10PM +1030, Alan Modra wrote:
> On Thu, Mar 17, 2005 at 05:49:29PM -0800, H. J. Lu wrote:
> > On Fri, Mar 18, 2005 at 12:06:51PM +1030, Alan Modra wrote:
> > > Hi HJ,
> > >   It seems your change to remove zero-size output sections is
> > > responsible for segfaults when generating map files.  For example,
> > > taking something from the ld testsuite with -Map added:
> > > 
> > > $ gcc -L/home/alan/build/ppc/bin/./ld -B/home/alan/build/ppc/bin/ld/tmpdir/ld/ -L/usr/local/powerpc-linux/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/libsize_bar.so --shared  tmpdir/size_bar.o -Wl,-Map,xxx.map
> > > collect2: ld terminated with signal 11 [Segmentation fault]
> > > 
> > > On powerpc-linux this particular .so has an empty .bss, and the linker
> > > script has an ALIGN inside the .bss output section.  Processing ALIGN_K
> > > in ldexp.c refeferences the bfd_section, which is now NULL.  I expect
> > > other linker expressions will similarly segfault if their associated
> > > output section is removed before the linker map is printed.  Would you
> > > take a look, please?
> > > 
> > > A solution that might work is to simply not clear os->bfd_section in
> > > gld${EMULATION_NAME}_finish.
> > 
> > Can you send me a testcase?
> 
> $ echo > empty.s
> $ ../gas/as-new -o empty.o empty.s
> $ ./ld-new -shared -Map empty.map -o empty.so empty.o
> Segmentation fault
> 

How about this patch?


H.J.
----
2005-03-17  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Set
	bfd_section to bfd_abs_section_ptr when removing unused empty
	output sections for non-relocatable link.

--- ld/emultempl/elf32.em.abs	2005-03-16 21:20:12.000000000 -0800
+++ ld/emultempl/elf32.em	2005-03-17 18:56:46.662523655 -0800
@@ -1459,7 +1459,7 @@ gld${EMULATION_NAME}_finish (void)
 	    {
 	      asection **p;
 
-	      os->bfd_section = NULL;
+	      os->bfd_section = bfd_abs_section_ptr;
 
 	      for (p = &output_bfd->sections; *p; p = &(*p)->next)
 		if (*p == s)

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

* Re: RFC: Remove empty output sections
  2005-03-18  7:07                           ` H. J. Lu
@ 2005-03-18  7:13                             ` Alan Modra
  2005-03-18  9:59                               ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Alan Modra @ 2005-03-18  7:13 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Thu, Mar 17, 2005 at 06:59:25PM -0800, H. J. Lu wrote:
> 	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Set
> 	bfd_section to bfd_abs_section_ptr when removing unused empty
> 	output sections for non-relocatable link.

No.  The map file output needs to use the sections actually linked,
otherwise wrong values will be reported.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-18  7:13                             ` Alan Modra
@ 2005-03-18  9:59                               ` H. J. Lu
  2005-03-18 10:14                                 ` Alan Modra
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-18  9:59 UTC (permalink / raw)
  To: binutils

On Fri, Mar 18, 2005 at 01:45:47PM +1030, Alan Modra wrote:
> On Thu, Mar 17, 2005 at 06:59:25PM -0800, H. J. Lu wrote:
> > 	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Set
> > 	bfd_section to bfd_abs_section_ptr when removing unused empty
> > 	output sections for non-relocatable link.
> 
> No.  The map file output needs to use the sections actually linked,
> otherwise wrong values will be reported.
> 

Here it is.


H.J.
----
2005-03-17  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Don't set
	bfd_section when removing unused empty output sections for
	non-relocatable link.

--- ld/emultempl/elf32.em.abs	2005-03-16 21:20:12.000000000 -0800
+++ ld/emultempl/elf32.em	2005-03-17 19:49:00.600705303 -0800
@@ -1459,8 +1459,6 @@ gld${EMULATION_NAME}_finish (void)
 	    {
 	      asection **p;
 
-	      os->bfd_section = NULL;
-
 	      for (p = &output_bfd->sections; *p; p = &(*p)->next)
 		if (*p == s)
 		  {

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

* Re: RFC: Remove empty output sections
  2005-03-18  9:59                               ` H. J. Lu
@ 2005-03-18 10:14                                 ` Alan Modra
  2005-03-18 15:37                                   ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Alan Modra @ 2005-03-18 10:14 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Thu, Mar 17, 2005 at 07:51:27PM -0800, H. J. Lu wrote:
> On Fri, Mar 18, 2005 at 01:45:47PM +1030, Alan Modra wrote:
> > On Thu, Mar 17, 2005 at 06:59:25PM -0800, H. J. Lu wrote:
> > > 	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Set
> > > 	bfd_section to bfd_abs_section_ptr when removing unused empty
> > > 	output sections for non-relocatable link.
> > 
> > No.  The map file output needs to use the sections actually linked,
> > otherwise wrong values will be reported.
> 
> Here it is.

How have you tested this?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-14  8:35       ` Alan Modra
  2005-03-14 16:11         ` H. J. Lu
@ 2005-03-18 10:34         ` Alan Modra
  2005-03-18 14:53           ` Alan Modra
  1 sibling, 1 reply; 25+ messages in thread
From: Alan Modra @ 2005-03-18 10:34 UTC (permalink / raw)
  To: H. J. Lu, binutils

On Mon, Mar 14, 2005 at 07:05:15PM +1030, Alan Modra wrote:
> On Sun, Mar 13, 2005 at 10:31:41PM -0800, H. J. Lu wrote:
> > @@ -4883,7 +4893,7 @@ lang_process (void)
> >      lang_check_section_addresses ();
> >  
> >    /* Final stuffs.  */
> > -
> > +  lang_mark_used_section ();
> >    ldemul_finish ();
> >    lang_finish ();
> >  }
> 
> Isn't this too late to strip sections?  What happens if one of the
> sections stripped has a dynamic section symbol?

I wish I'd trusted my instincts here, and not believed your report that
dynamic section syms look OK.  They aren't OK at all.  .dynsym section
contents are left uninitialised, and you've just been lucky that all
your bfd_alloc's happened to return zeroed memory.  I'm seeing this:

    10: 00011a38     0 SECTION LOCAL  DEFAULT   19
    11: 00011a3c     0 SECTION LOCAL  DEFAULT   20
    12: 00000034   143 FUNC    GLOBAL DEFAULT  UND

Please fix.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-18 10:34         ` Alan Modra
@ 2005-03-18 14:53           ` Alan Modra
  2005-03-18 17:22             ` H. J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Alan Modra @ 2005-03-18 14:53 UTC (permalink / raw)
  To: H. J. Lu, binutils

On Fri, Mar 18, 2005 at 05:43:00PM +1030, Alan Modra wrote:
> your bfd_alloc's happened to return zeroed memory.  I'm seeing this:
> 
>     10: 00011a38     0 SECTION LOCAL  DEFAULT   19
>     11: 00011a3c     0 SECTION LOCAL  DEFAULT   20
>     12: 00000034   143 FUNC    GLOBAL DEFAULT  UND
> 
> Please fix.

I decided to fix this myself, because it was breaking my builds.

	* elf-bfd.h (_bfd_elf_link_renumber_dynsyms): Delete.
	* elflink.c (_bfd_elf_link_renumber_dynsyms): Make static, add
	section_sym_count param, and return number of section symbols.
	(bfd_elf_size_dynamic_sections): Clear section symbol area of
	.dynsym contents.  Don't bother calling swap_symbol_out on the
	first all-zero dynsym.
	(elf_mark_used_section): Formatting.  Avoid twiddling flags in
	special sections like bfd_abs_section.
	(bfd_elf_gc_sections): Spelling fix.

Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.175
diff -u -p -r1.175 elf-bfd.h
--- bfd/elf-bfd.h	3 Mar 2005 20:52:31 -0000	1.175
+++ bfd/elf-bfd.h	18 Mar 2005 12:22:50 -0000
@@ -1592,8 +1592,6 @@ extern bfd_boolean _bfd_elf_create_dynam
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean _bfd_elf_create_got_section
   (bfd *, struct bfd_link_info *);
-extern unsigned long _bfd_elf_link_renumber_dynsyms
-  (bfd *, struct bfd_link_info *);
 
 extern bfd_boolean _bfd_elfcore_make_pseudosection
   (bfd *, char *, size_t, ufile_ptr);
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.137
diff -u -p -r1.137 elflink.c
--- bfd/elflink.c	16 Mar 2005 21:52:40 -0000	1.137
+++ bfd/elflink.c	18 Mar 2005 12:22:59 -0000
@@ -707,8 +707,10 @@ _bfd_elf_link_omit_section_dynsym (bfd *
    allocated local dynamic syms, followed by the rest of the global
    symbols.  */
 
-unsigned long
-_bfd_elf_link_renumber_dynsyms (bfd *output_bfd, struct bfd_link_info *info)
+static unsigned long
+_bfd_elf_link_renumber_dynsyms (bfd *output_bfd,
+				struct bfd_link_info *info,
+				unsigned long *section_sym_count)
 {
   unsigned long dynsymcount = 0;
 
@@ -722,6 +724,7 @@ _bfd_elf_link_renumber_dynsyms (bfd *out
 	    && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p))
 	  elf_section_data (p)->dynindx = ++dynsymcount;
     }
+  *section_sym_count = dynsymcount;
 
   elf_link_hash_traverse (elf_hash_table (info),
 			  elf_link_renumber_local_hash_table_dynsyms,
@@ -5273,6 +5272,7 @@ bfd_elf_size_dynamic_sections (bfd *outp
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       bfd_size_type dynsymcount;
+      unsigned long section_sym_count;
       asection *s;
       size_t bucketcount = 0;
       size_t hash_entry_size;
@@ -5639,7 +5639,8 @@ bfd_elf_size_dynamic_sections (bfd *outp
 	 Next come all of the back-end allocated local dynamic syms,
 	 followed by the rest of the global symbols.  */
 
-      dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info);
+      dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info,
+						    &section_sym_count);
 
       /* Work out the size of the symbol version section.  */
       s = bfd_get_section_by_name (dynobj, ".gnu.version");
@@ -5651,7 +5652,8 @@ bfd_elf_size_dynamic_sections (bfd *outp
 	  _bfd_strip_section_from_output (info, s);
 	  /* The DYNSYMCOUNT might have changed if we were going to
 	     output a dynamic symbol table entry for S.  */
-	  dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info);
+	  dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info,
+							&section_sym_count);
 	}
       else
 	{
@@ -5673,22 +5675,17 @@ bfd_elf_size_dynamic_sections (bfd *outp
       s = bfd_get_section_by_name (dynobj, ".dynsym");
       BFD_ASSERT (s != NULL);
       s->size = dynsymcount * bed->s->sizeof_sym;
-      s->contents = bfd_alloc (output_bfd, s->size);
-      if (s->contents == NULL && s->size != 0)
-	return FALSE;
 
       if (dynsymcount != 0)
 	{
-	  Elf_Internal_Sym isym;
+	  s->contents = bfd_alloc (output_bfd, s->size);
+	  if (s->contents == NULL)
+	    return FALSE;
 
-	  /* The first entry in .dynsym is a dummy symbol.  */
-	  isym.st_value = 0;
-	  isym.st_size = 0;
-	  isym.st_name = 0;
-	  isym.st_info = 0;
-	  isym.st_other = 0;
-	  isym.st_shndx = 0;
-	  bed->s->swap_symbol_out (output_bfd, &isym, s->contents, 0);
+	  /* The first entry in .dynsym is a dummy symbol.
+	     Clear all the section syms, in case we don't output them all.  */
+	  ++section_sym_count;
+	  memset (s->contents, 0, section_sym_count * bed->s->sizeof_sym);
 	}
 
       /* Compute the size of the hashing table.  As a side effect this
@@ -9002,17 +8999,17 @@ elf_gc_mark_dynamic_ref_symbol (struct e
 
 static bfd_boolean
 elf_mark_used_section (struct elf_link_hash_entry *h,
-		     void *global ATTRIBUTE_UNUSED)
+		       void *data ATTRIBUTE_UNUSED)
 {
   if (h->root.type == bfd_link_hash_warning)
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
-  if ((h->root.type == bfd_link_hash_defined
-       || h->root.type == bfd_link_hash_defweak))
+  if (h->root.type == bfd_link_hash_defined
+      || h->root.type == bfd_link_hash_defweak)
     {
-      asection *s = h->root.u.def.section->output_section;
-      if (s)
-	s->flags |= SEC_KEEP;
+      asection *s = h->root.u.def.section;
+      if (s != NULL && s->output_section != NULL && s->output_section != s)
+	s->output_section->flags |= SEC_KEEP;
     }
 
   return TRUE;
@@ -9032,7 +9029,7 @@ bfd_elf_gc_sections (bfd *abfd, struct b
   if (!info->gc_sections)
     {
       /* If we are called when info->gc_sections is 0, we will mark
-	 all sections containing global symbols for non-relocable
+	 all sections containing global symbols for non-relocatable
 	 link.  */
       if (!info->relocatable)
 	elf_link_hash_traverse (elf_hash_table (info),

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: RFC: Remove empty output sections
  2005-03-18 10:14                                 ` Alan Modra
@ 2005-03-18 15:37                                   ` H. J. Lu
  2005-03-21  8:32                                     ` Alan Modra
  0 siblings, 1 reply; 25+ messages in thread
From: H. J. Lu @ 2005-03-18 15:37 UTC (permalink / raw)
  To: binutils

On Fri, Mar 18, 2005 at 05:37:31PM +1030, Alan Modra wrote:
> On Thu, Mar 17, 2005 at 07:51:27PM -0800, H. J. Lu wrote:
> > On Fri, Mar 18, 2005 at 01:45:47PM +1030, Alan Modra wrote:
> > > On Thu, Mar 17, 2005 at 06:59:25PM -0800, H. J. Lu wrote:
> > > > 	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Set
> > > > 	bfd_section to bfd_abs_section_ptr when removing unused empty
> > > > 	output sections for non-relocatable link.
> > > 
> > > No.  The map file output needs to use the sections actually linked,
> > > otherwise wrong values will be reported.
> > 
> > Here it is.
> 
> How have you tested this?

It works on x86-64 and your testcase.


H.J.

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

* Re: RFC: Remove empty output sections
  2005-03-18 14:53           ` Alan Modra
@ 2005-03-18 17:22             ` H. J. Lu
  0 siblings, 0 replies; 25+ messages in thread
From: H. J. Lu @ 2005-03-18 17:22 UTC (permalink / raw)
  To: binutils

On Fri, Mar 18, 2005 at 11:32:20PM +1030, Alan Modra wrote:
> On Fri, Mar 18, 2005 at 05:43:00PM +1030, Alan Modra wrote:
> > your bfd_alloc's happened to return zeroed memory.  I'm seeing this:
> > 
> >     10: 00011a38     0 SECTION LOCAL  DEFAULT   19
> >     11: 00011a3c     0 SECTION LOCAL  DEFAULT   20
> >     12: 00000034   143 FUNC    GLOBAL DEFAULT  UND
> > 
> > Please fix.
> 
> I decided to fix this myself, because it was breaking my builds.
> 
> 	* elf-bfd.h (_bfd_elf_link_renumber_dynsyms): Delete.
> 	* elflink.c (_bfd_elf_link_renumber_dynsyms): Make static, add
> 	section_sym_count param, and return number of section symbols.
> 	(bfd_elf_size_dynamic_sections): Clear section symbol area of
> 	.dynsym contents.  Don't bother calling swap_symbol_out on the
> 	first all-zero dynsym.
> 	(elf_mark_used_section): Formatting.  Avoid twiddling flags in
> 	special sections like bfd_abs_section.
> 	(bfd_elf_gc_sections): Spelling fix.
> 
>  static bfd_boolean
>  elf_mark_used_section (struct elf_link_hash_entry *h,
> -		     void *global ATTRIBUTE_UNUSED)
> +		       void *data ATTRIBUTE_UNUSED)
>  {
>    if (h->root.type == bfd_link_hash_warning)
>      h = (struct elf_link_hash_entry *) h->root.u.i.link;
>  
> -  if ((h->root.type == bfd_link_hash_defined
> -       || h->root.type == bfd_link_hash_defweak))
> +  if (h->root.type == bfd_link_hash_defined
> +      || h->root.type == bfd_link_hash_defweak)
>      {
> -      asection *s = h->root.u.def.section->output_section;
> -      if (s)
> -	s->flags |= SEC_KEEP;
> +      asection *s = h->root.u.def.section;
> +      if (s != NULL && s->output_section != NULL && s->output_section != s)
> +	s->output_section->flags |= SEC_KEEP;
>      }
>  

I don't think s->output_section != s is right. It may be the cause
of "make check" failures for cris-elf. Can we use

!bfd_is_const_section (s->output_section)

instead?


H.J.

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

* Re: RFC: Remove empty output sections
  2005-03-18 15:37                                   ` H. J. Lu
@ 2005-03-21  8:32                                     ` Alan Modra
  0 siblings, 0 replies; 25+ messages in thread
From: Alan Modra @ 2005-03-21  8:32 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Fri, Mar 18, 2005 at 06:03:37AM -0800, H. J. Lu wrote:
> On Fri, Mar 18, 2005 at 05:37:31PM +1030, Alan Modra wrote:
> > On Thu, Mar 17, 2005 at 07:51:27PM -0800, H. J. Lu wrote:
> > > On Fri, Mar 18, 2005 at 01:45:47PM +1030, Alan Modra wrote:
> > > > On Thu, Mar 17, 2005 at 06:59:25PM -0800, H. J. Lu wrote:
> > > > > 	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Set
> > > > > 	bfd_section to bfd_abs_section_ptr when removing unused empty
> > > > > 	output sections for non-relocatable link.
> > > > 
> > > > No.  The map file output needs to use the sections actually linked,
> > > > otherwise wrong values will be reported.
> > > 
> > > Here it is.
> > 
> > How have you tested this?
> 
> It works on x86-64 and your testcase.

OK then.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

end of thread, other threads:[~2005-03-21  0:45 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-24 22:38 RFC: Remove empty output sections H. J. Lu
2005-02-25 15:30 ` H. J. Lu
2005-03-01 11:46   ` Nick Clifton
2005-03-14  6:32     ` H. J. Lu
2005-03-14  8:35       ` Alan Modra
2005-03-14 16:11         ` H. J. Lu
2005-03-14 22:15           ` Alan Modra
2005-03-15 19:58             ` H. J. Lu
2005-03-15 20:38               ` H. J. Lu
2005-03-16  2:32                 ` H. J. Lu
2005-03-16  2:50                   ` Alan Modra
2005-03-17  4:22                     ` H. J. Lu
2005-03-17  8:39                       ` Alan Modra
2005-03-18  3:15                     ` Alan Modra
2005-03-18  3:29                       ` H. J. Lu
2005-03-18  3:51                         ` Alan Modra
2005-03-18  7:07                           ` H. J. Lu
2005-03-18  7:13                             ` Alan Modra
2005-03-18  9:59                               ` H. J. Lu
2005-03-18 10:14                                 ` Alan Modra
2005-03-18 15:37                                   ` H. J. Lu
2005-03-21  8:32                                     ` Alan Modra
2005-03-18 10:34         ` Alan Modra
2005-03-18 14:53           ` Alan Modra
2005-03-18 17:22             ` H. J. Lu

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