This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RFC: Remove empty output sections
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Thu, 24 Feb 2005 12:36:31 -0800
- Subject: RFC: Remove empty output sections
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