diff options
author | Alan Modra <amodra@gmail.com> | 2006-10-17 13:41:49 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2006-10-17 13:41:49 +0000 |
commit | 74541ad4c01323646d5bebe7ff10828f84af0f49 (patch) | |
tree | 290813ab87157e643bf32d7271cecb1dc394179d | |
parent | 21643204152d14c5e9c32a56ef6dfd1b4067cf28 (diff) | |
download | binutils-74541ad4c01323646d5bebe7ff10828f84af0f49.zip binutils-74541ad4c01323646d5bebe7ff10828f84af0f49.tar.gz binutils-74541ad4c01323646d5bebe7ff10828f84af0f49.tar.bz2 |
bfd/
* elf-bfd.h (struct elf_link_hash_table): Reorder. Add
text_index_section and data_index_section.
(struct elf_backend_data): Add elf_backend_init_index_section.
(_bfd_elf_init_1_index_section): Declare.
(_bfd_elf_init_2_index_sections): Declare.
* elfxx-target.h (elf_backend_init_index_section): Define.
(elfNN_bed): Init new field.
* elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls
section and text_index_section plus data_index_section.
(_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections.
(_bfd_elf_init_1_index_section): New function.
(_bfd_elf_init_2_index_sections): New function.
(bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section.
(elf_link_input_bfd): When emitting relocs, use text_index_section
and data_index_section for removed sections.
* elf-m10300.c (elf_backend_omit_section_dynsym): Define.
* elf32-i386.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-xstormy16.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-sh64.c: Likewise.
* elfxx-ia64.c: Likewise.
* elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section
and data_index_section sym for relocs against sections with no dynamic
section sym.
(elf_backend_init_index_section): Define.
* elf32-cris.c: Similarly.
* elf32-hppa.c: Similarly.
* elf32-i370.c: Similarly.
* elf32-m68k.c: Similarly.
* elf32-mips.c: Similarly.
* elf32-ppc.c: Similarly.
* elf32-s390.c: Similarly.
* elf32-sparc.c: Similarly.
* elf32-vax.c: Similarly.
* elf64-mips.c: Similarly.
* elf64-ppc.c: Similarly.
* elf64-s390.c: Similarly.
* elf64-sparc.c: Similarly.
* elf64-x86-64.c: Similarly.
* elfn32-mips.c: Similarly.
* elfxx-mips.c: Similarly.
* elfxx-sparc.c: Similarly.
* linker.c (fix_syms): Base symbols in removed sections on
previous section in preference to using absolute section.
ld/
* ldlang.c (strip_excluded_output_sections): Do strip sections
that define syms, but don't ignore them.
* ld.texinfo (Output Section Discarding): Revise.
* emultempl/armcoff.em (gld${EMULATION_NAME}_finish): Always call
finish_default.
ld/testsuite/
Update for section sym changes.
96 files changed, 751 insertions, 431 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index eba1f15..03cff6c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,55 @@ +2006-10-17 Alan Modra <amodra@bigpond.net.au> + + * elf-bfd.h (struct elf_link_hash_table): Reorder. Add + text_index_section and data_index_section. + (struct elf_backend_data): Add elf_backend_init_index_section. + (_bfd_elf_init_1_index_section): Declare. + (_bfd_elf_init_2_index_sections): Declare. + * elfxx-target.h (elf_backend_init_index_section): Define. + (elfNN_bed): Init new field. + * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls + section and text_index_section plus data_index_section. + (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections. + (_bfd_elf_init_1_index_section): New function. + (_bfd_elf_init_2_index_sections): New function. + (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section. + (elf_link_input_bfd): When emitting relocs, use text_index_section + and data_index_section for removed sections. + * elf-m10300.c (elf_backend_omit_section_dynsym): Define. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section + and data_index_section sym for relocs against sections with no dynamic + section sym. + (elf_backend_init_index_section): Define. + * elf32-cris.c: Similarly. + * elf32-hppa.c: Similarly. + * elf32-i370.c: Similarly. + * elf32-m68k.c: Similarly. + * elf32-mips.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-s390.c: Similarly. + * elf32-sparc.c: Similarly. + * elf32-vax.c: Similarly. + * elf64-mips.c: Similarly. + * elf64-ppc.c: Similarly. + * elf64-s390.c: Similarly. + * elf64-sparc.c: Similarly. + * elf64-x86-64.c: Similarly. + * elfn32-mips.c: Similarly. + * elfxx-mips.c: Similarly. + * elfxx-sparc.c: Similarly. + * linker.c (fix_syms): Base symbols in removed sections on + previous section in preference to using absolute section. + 2006-10-16 Andreas Schwab <schwab@suse.de> * elfxx-ia64.c (addend_compare): Properly compute return value. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 1e541da..bb86c4e 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -345,6 +345,10 @@ struct elf_link_hash_table when linking against or generating a shared object. */ bfd_boolean dynamic_sections_created; + /* True if this target has relocatable executables, so needs dynamic + section symbols. */ + bfd_boolean is_relocatable_executable; + /* The BFD used to hold special sections created by the linker. This will be the first BFD found which requires these sections to be created. */ @@ -378,6 +382,12 @@ struct elf_link_hash_table included in the link. */ struct bfd_link_needed_list *needed; + /* Sections in the output bfd that provides a section symbol + to be used by relocations emitted against local symbols. + Most targets will not use data_index_section. */ + asection *text_index_section; + asection *data_index_section; + /* The _GLOBAL_OFFSET_TABLE_ symbol. */ struct elf_link_hash_entry *hgot; @@ -406,10 +416,6 @@ struct elf_link_hash_table /* A linked list of BFD's loaded in the link. */ struct elf_link_loaded_list *loaded; - - /* True if this target has relocatable executables, so needs dynamic - section symbols. */ - bfd_boolean is_relocatable_executable; }; /* Look up an entry in an ELF linker hash table. */ @@ -766,6 +772,11 @@ struct elf_backend_data bfd_boolean (*elf_backend_size_dynamic_sections) (bfd *output_bfd, struct bfd_link_info *info); + /* Set TEXT_INDEX_SECTION and DATA_INDEX_SECTION, the output sections + we keep to use as a base for relocs and symbols. */ + void (*elf_backend_init_index_section) + (bfd *output_bfd, struct bfd_link_info *info); + /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -1697,6 +1708,10 @@ extern bfd_boolean _bfd_elf_create_got_section (bfd *, struct bfd_link_info *); extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym (bfd *, struct bfd_link_info *, asection *, const char *); +extern void _bfd_elf_init_1_index_section + (bfd *, struct bfd_link_info *); +extern void _bfd_elf_init_2_index_sections + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elfcore_make_pseudosection (bfd *, char *, size_t, ufile_ptr); diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 423ec52..7a72925 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -4756,6 +4756,8 @@ _bfd_mn10300_elf_reloc_type_class (const Elf_Internal_Rela *rela) _bfd_mn10300_elf_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ _bfd_mn10300_elf_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_symbol \ _bfd_mn10300_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index bdbdd6a..f4342b6 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -3731,6 +3731,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, value |= 1; if (globals->symbian_p) { + asection *osec; + /* On Symbian OS, the data segment and text segement can be relocated independently. Therefore, we must indicate the segment to which this @@ -3738,11 +3740,27 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, use any symbol in the right segment; we just use the section symbol as it is convenient. (We cannot use the symbol given by "h" directly as it - will not appear in the dynamic symbol table.) */ + will not appear in the dynamic symbol table.) + + Note that the dynamic linker ignores the section + symbol value, so we don't subtract osec->vma + from the emitted reloc addend. */ if (sym_sec) - symbol = elf_section_data (sym_sec->output_section)->dynindx; + osec = sym_sec->output_section; else - symbol = elf_section_data (input_section->output_section)->dynindx; + osec = input_section->output_section; + symbol = elf_section_data (osec)->dynindx; + if (symbol == 0) + { + struct elf_link_hash_table *htab = elf_hash_table (info); + + if ((osec->flags & SEC_READONLY) == 0 + && htab->data_index_section != NULL) + osec = htab->data_index_section; + else + osec = htab->text_index_section; + symbol = elf_section_data (osec)->dynindx; + } BFD_ASSERT (symbol != 0); } else @@ -8551,7 +8569,8 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info /* UnixWare sets the entsize of .plt to 4, although that doesn't really seem like the right value. */ - elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4; + if (splt->output_section->owner == output_bfd) + elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4; if (htab->vxworks_p && !info->shared && htab->splt->size > 0) { @@ -9494,6 +9513,7 @@ const struct elf_size_info elf32_arm_size_info = { #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections #define elf_backend_link_output_symbol_hook elf32_arm_output_symbol_hook #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_2_index_sections #define elf_backend_post_process_headers elf32_arm_post_process_headers #define elf_backend_reloc_type_class elf32_arm_reloc_type_class #define elf_backend_object_p elf32_arm_object_p diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 66c8219..199ee1b 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -1430,11 +1430,12 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else { + outrel.r_addend = relocation + rel->r_addend; + if (r_type == R_CRIS_32) { relocate = TRUE; outrel.r_info = ELF32_R_INFO (0, R_CRIS_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; } else { @@ -1451,13 +1452,24 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + struct elf_cris_link_hash_table *htab; + htab = elf_cris_hash_table (info); + osec = htab->root.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); } outrel.r_info = ELF32_R_INFO (indx, r_type); - outrel.r_addend = relocation + rel->r_addend; } } @@ -3390,6 +3402,7 @@ elf_cris_reloc_type_class (rela) elf_cris_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elf_cris_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_finish_dynamic_symbol \ elf_cris_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 0a8b3b1..db6e842 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -4024,17 +4024,22 @@ elf32_hppa_relocate_section (bfd *output_bfd, && sym_sec->output_section != NULL && ! bfd_is_abs_section (sym_sec)) { - /* Skip this relocation if the output section has - been discarded. */ - if (bfd_is_abs_section (sym_sec->output_section)) - break; + asection *osec; + + osec = sym_sec->output_section; + indx = elf_section_data (osec)->dynindx; + if (indx == 0) + { + osec = htab->etab.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); - indx = elf_section_data (sym_sec->output_section)->dynindx; /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the offset of the input section in the output section. */ - outrel.r_addend -= sym_sec->output_section->vma; + outrel.r_addend -= osec->vma; } outrel.r_info = ELF32_R_INFO (indx, r_type); @@ -4642,6 +4647,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type) #define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections #define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook #define elf_backend_gc_sweep_hook elf32_hppa_gc_sweep_hook #define elf_backend_grok_prstatus elf32_hppa_grok_prstatus diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index 3c7c372..4930581 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1290,9 +1290,21 @@ i370_elf_relocate_section (bfd *output_bfd, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT(indx > 0); + if (indx == 0) + { + struct elf_link_hash_table *htab; + htab = elf_hash_table (info); + osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); #ifdef DEBUG if (indx <= 0) { @@ -1427,6 +1439,7 @@ i370_elf_post_process_headers (bfd * abfd, link glibc's ld.so without errors. */ #define elf_backend_create_dynamic_sections i370_elf_create_dynamic_sections #define elf_backend_size_dynamic_sections i370_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_finish_dynamic_sections i370_elf_finish_dynamic_sections #define elf_backend_fake_sections i370_elf_fake_sections #define elf_backend_section_from_shdr i370_elf_section_from_shdr diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 227bc9e..97054a5 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -3872,6 +3872,8 @@ elf_i386_hash_symbol (struct elf_link_hash_entry *h) #define elf_backend_relocate_section elf_i386_relocate_section #define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections #define elf_backend_always_size_sections elf_i386_always_size_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_plt_sym_val elf_i386_plt_sym_val #define elf_backend_hash_symbol elf_i386_hash_symbol diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 7456c1c..30674f3 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -4141,6 +4141,8 @@ m32r_elf_reloc_type_class (const Elf_Internal_Rela *rela) #define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create #define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol #define elf_backend_finish_dynamic_symbol m32r_elf_finish_dynamic_symbol diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 50b962d..81d219d 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -1833,11 +1833,12 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, else { /* This symbol is local, or marked to become local. */ + outrel.r_addend = relocation + rel->r_addend; + if (r_type == R_68K_32) { relocate = TRUE; outrel.r_info = ELF32_R_INFO (0, R_68K_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; } else { @@ -1854,13 +1855,24 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + struct elf_link_hash_table *htab; + htab = elf_hash_table (info); + osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); } outrel.r_info = ELF32_R_INFO (indx, r_type); - outrel.r_addend = relocation + rel->r_addend; } } @@ -2418,6 +2430,7 @@ elf_m68k_plt_sym_val (bfd_vma i, const asection *plt, elf_m68k_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elf_m68k_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section elf_m68k_relocate_section #define elf_backend_finish_dynamic_symbol \ elf_m68k_finish_dynamic_symbol diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 1a293a0..c5e7dd4 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1513,6 +1513,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 7b3e722..59bac50 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -6280,9 +6280,14 @@ ppc_elf_relocate_section (bfd *output_bfd, but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); #ifdef DEBUG - if (indx <= 0) + if (indx == 0) printf ("indx=%ld section=%s flags=%08x name=%s\n", indx, osec->name, osec->flags, h->root.root.string); @@ -7472,6 +7477,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define elf_backend_get_sec_type_attr ppc_elf_get_sec_type_attr #define elf_backend_plt_sym_val ppc_elf_plt_sym_val #define elf_backend_action_discarded ppc_elf_action_discarded +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #include "elf32-target.h" diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 287e683..83bf5e1 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -2630,14 +2630,18 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + if (sindx == 0) + { + osec = htab->elf.text_index_section; + sindx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (sindx != 0); /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the offset of the input section in the output section. */ - outrel.r_addend -= osec->vma; } outrel.r_info = ELF32_R_INFO (sindx, r_type); @@ -3542,6 +3546,7 @@ elf_s390_plt_sym_val (bfd_vma i, const asection *plt, #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_grok_prstatus elf_s390_grok_prstatus #define elf_backend_plt_sym_val elf_s390_plt_sym_val diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 02093cf..85f3d8f 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -6028,6 +6028,8 @@ sh_elf_plt_sym_val (bfd_vma i, const asection *plt, sh_elf_always_size_sections #define elf_backend_size_dynamic_sections \ sh_elf_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_symbol \ sh_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 3f0c7d6..5f13b96 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -207,6 +207,7 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela) #define elf_backend_gc_mark_hook _bfd_sparc_elf_gc_mark_hook #define elf_backend_gc_sweep_hook _bfd_sparc_elf_gc_sweep_hook #define elf_backend_plt_sym_val _bfd_sparc_elf_plt_sym_val +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index fe8ea03..2572b68 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -1680,9 +1680,21 @@ elf_vax_relocate_section (bfd *output_bfd, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + struct elf_link_hash_table *htab; + htab = elf_hash_table (info); + osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); } outrel.r_info = ELF32_R_INFO (indx, r_type); @@ -2062,6 +2074,7 @@ elf_vax_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) elf_vax_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elf_vax_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section elf_vax_relocate_section #define elf_backend_finish_dynamic_symbol \ elf_vax_finish_dynamic_symbol diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index 818b62d..c5c88c7 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -999,6 +999,8 @@ xstormy16_elf_gc_mark_hook (asection *sec, #define elf_backend_check_relocs xstormy16_elf_check_relocs #define elf_backend_always_size_sections \ xstormy16_elf_always_size_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_sections \ xstormy16_elf_finish_dynamic_sections diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 2a6c695..34f7f47 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -9844,6 +9844,8 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] = #define elf_backend_reloc_type_class elf_xtensa_reloc_type_class #define elf_backend_relocate_section elf_xtensa_relocate_section #define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_special_sections elf_xtensa_special_sections #define elf_backend_action_discarded elf_xtensa_action_discarded diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index f37a317..1f7e546 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -5275,6 +5275,8 @@ static const struct elf_size_info alpha_elf_size_info = elf64_alpha_always_size_sections #define elf_backend_size_dynamic_sections \ elf64_alpha_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_relocate_section \ elf64_alpha_relocate_section #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 4ff7e6a..4b5e95d 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -2820,6 +2820,8 @@ const struct elf_size_info hppa64_elf_size_info = elf64_hppa_create_dynamic_sections #define elf_backend_post_process_headers elf64_hppa_post_process_headers +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_adjust_dynamic_symbol \ elf64_hppa_adjust_dynamic_symbol diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 09d13e8..408c352 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -3034,6 +3034,7 @@ const struct elf_size_info mips_elf64_size_info = _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index 63176eb..e18f4a1 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -2916,6 +2916,8 @@ mmix_elf_relax_section (abfd, sec, link_info, again) #define elf_backend_check_relocs mmix_elf_check_relocs #define elf_backend_symbol_processing mmix_elf_symbol_processing +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define bfd_elf64_bfd_is_local_label_name \ mmix_elf_is_local_label_name diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index d87a1b2..fcbc71e 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -97,6 +97,7 @@ static bfd_vma opd_entry_value #define elf_backend_hide_symbol ppc64_elf_hide_symbol #define elf_backend_always_size_sections ppc64_elf_func_desc_adjust #define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_2_index_sections #define elf_backend_action_discarded ppc64_elf_action_discarded #define elf_backend_relocate_section ppc64_elf_relocate_section #define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol @@ -10840,6 +10841,17 @@ ppc64_elf_relocate_section (bfd *output_bfd, osec = sec->output_section; indx = elf_section_data (osec)->dynindx; + if (indx == 0) + { + if ((osec->flags & SEC_READONLY) == 0 + && htab->elf.data_index_section != NULL) + osec = htab->elf.data_index_section; + else + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); + /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 59151d8..1d86820 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -2611,14 +2611,19 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + + if (sindx == 0) + { + osec = htab->elf.text_index_section; + sindx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (sindx != 0); /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the offset of the input section in the output section. */ - outrel.r_addend -= osec->vma; } outrel.r_info = ELF64_R_INFO (sindx, r_type); @@ -3449,6 +3454,7 @@ const struct elf_size_info s390_elf64_size_info = #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_plt_sym_val elf_s390_plt_sym_val diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index e55c19a..5ebea96 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -4094,6 +4094,8 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]= sh64_elf64_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ sh64_elf64_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_symbol \ sh64_elf64_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 5c928e2..1185553 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -889,6 +889,8 @@ const struct elf_size_info elf64_sparc_size_info = _bfd_sparc_elf_gc_mark_hook #define elf_backend_gc_sweep_hook \ _bfd_sparc_elf_gc_sweep_hook +#define elf_backend_init_index_section \ + _bfd_elf_init_1_index_section #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 23dee16..2556fdc 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -2457,9 +2457,19 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + if (sindx == 0) + { + asection *oi = htab->elf.text_index_section; + sindx = elf_section_data (oi)->dynindx; + } + BFD_ASSERT (sindx != 0); } outrel.r_info = ELF64_R_INFO (sindx, r_type); @@ -3657,6 +3667,7 @@ static const struct bfd_elf_special_section #define elf_backend_relocate_section elf64_x86_64_relocate_section #define elf_backend_size_dynamic_sections elf64_x86_64_size_dynamic_sections #define elf_backend_always_size_sections elf64_x86_64_always_size_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_plt_sym_val elf64_x86_64_plt_sym_val #define elf_backend_object_p elf64_x86_64_elf_object_p #define bfd_elf64_mkobject elf64_x86_64_mkobject diff --git a/bfd/elflink.c b/bfd/elflink.c index 1df583f..63cac8e 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -712,6 +712,8 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info, asection *p) { + struct elf_link_hash_table *htab; + switch (elf_section_data (p)->this_hdr.sh_type) { case SHT_PROGBITS: @@ -719,15 +721,21 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, /* If sh_type is yet undecided, assume it could be SHT_PROGBITS/SHT_NOBITS. */ case SHT_NULL: + htab = elf_hash_table (info); + if (p == htab->tls_sec) + return FALSE; + + if (htab->text_index_section != NULL) + return p != htab->text_index_section && p != htab->data_index_section; + if (strcmp (p->name, ".got") == 0 || strcmp (p->name, ".got.plt") == 0 || strcmp (p->name, ".plt") == 0) { asection *ip; - bfd *dynobj = elf_hash_table (info)->dynobj; - if (dynobj != NULL - && (ip = bfd_get_section_by_name (dynobj, p->name)) != NULL + if (htab->dynobj != NULL + && (ip = bfd_get_section_by_name (htab->dynobj, p->name)) != NULL && (ip->flags & SEC_LINKER_CREATED) && ip->output_section == p) return TRUE; @@ -763,6 +771,8 @@ _bfd_elf_link_renumber_dynsyms (bfd *output_bfd, && (p->flags & SEC_ALLOC) != 0 && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p)) elf_section_data (p)->dynindx = ++dynsymcount; + else + elf_section_data (p)->dynindx = 0; } *section_sym_count = dynsymcount; @@ -5932,16 +5942,65 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, return TRUE; } +/* Find the first non-excluded output section. We'll use its + section symbol for some emitted relocs. */ +void +_bfd_elf_init_1_index_section (bfd *output_bfd, struct bfd_link_info *info) +{ + asection *s; + + for (s = output_bfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_EXCLUDE | SEC_ALLOC)) == SEC_ALLOC + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->text_index_section = s; + break; + } +} + +/* Find two non-excluded output sections, one for code, one for data. + We'll use their section symbols for some emitted relocs. */ +void +_bfd_elf_init_2_index_sections (bfd *output_bfd, struct bfd_link_info *info) +{ + asection *s; + + for (s = output_bfd->sections; s != NULL; s = s->next) + if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) + == (SEC_ALLOC | SEC_READONLY)) + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->text_index_section = s; + break; + } + + for (s = output_bfd->sections; s != NULL; s = s->next) + if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) == SEC_ALLOC) + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->data_index_section = s; + break; + } + + if (elf_hash_table (info)->text_index_section == NULL) + elf_hash_table (info)->text_index_section + = elf_hash_table (info)->data_index_section; +} + bfd_boolean bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info) { + const struct elf_backend_data *bed; + if (!is_elf_hash_table (info->hash)) return TRUE; + bed = get_elf_backend_data (output_bfd); + (*bed->elf_backend_init_index_section) (output_bfd, info); + if (elf_hash_table (info)->dynamic_sections_created) { bfd *dynobj; - const struct elf_backend_data *bed; asection *s; bfd_size_type dynsymcount; unsigned long section_sym_count; @@ -5980,7 +6039,6 @@ bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info) section as we went along in elf_link_add_object_symbols. */ s = bfd_get_section_by_name (dynobj, ".dynsym"); BFD_ASSERT (s != NULL); - bed = get_elf_backend_data (output_bfd); s->size = dynsymcount * bed->s->sizeof_sym; if (dynsymcount != 0) @@ -7769,6 +7827,24 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) if (!bfd_is_abs_section (osec)) { r_symndx = osec->target_index; + if (r_symndx == 0) + { + struct elf_link_hash_table *htab; + asection *oi; + + htab = elf_hash_table (finfo->info); + oi = htab->text_index_section; + if ((osec->flags & SEC_READONLY) == 0 + && htab->data_index_section != NULL) + oi = htab->data_index_section; + + if (oi != NULL) + { + irela->r_addend += osec->vma - oi->vma; + r_symndx = oi->target_index; + } + } + BFD_ASSERT (r_symndx != 0); } } diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 1e42faa..21cf4af 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -2301,6 +2301,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 89271ea..dbea35b 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -5762,6 +5762,8 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, elfNN_ia64_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elfNN_ia64_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_relocate_section \ elfNN_ia64_relocate_section #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 83d6258..66cdf14 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -4801,6 +4801,11 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd, { indx = elf_section_data (sec->output_section)->dynindx; if (indx == 0) + { + asection *osec = htab->root.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + if (indx == 0) abort (); } diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index ccbd272..77ffbfe 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -2864,6 +2864,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { long indx; + outrel.r_addend = relocation + rel->r_addend; + if (is_plt) sec = htab->splt; @@ -2878,9 +2880,20 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; + if (indx == 0) + { + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + /* FIXME: we really should be able to link non-pic shared libraries. */ if (indx == 0) @@ -2894,8 +2907,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } } - outrel.r_info = SPARC_ELF_R_INFO (htab, rel, indx, r_type); - outrel.r_addend = relocation + rel->r_addend; + outrel.r_info = SPARC_ELF_R_INFO (htab, rel, indx, + r_type); } } diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 537cc3b..9e8ceca 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -381,6 +381,10 @@ #ifndef elf_backend_size_dynamic_sections #define elf_backend_size_dynamic_sections 0 #endif +#ifndef elf_backend_init_index_section +#define elf_backend_init_index_section \ + ((void (*) (bfd *, struct bfd_link_info *)) bfd_void) +#endif #ifndef elf_backend_relocate_section #define elf_backend_relocate_section 0 #endif @@ -603,6 +607,7 @@ static struct elf_backend_data elfNN_bed = elf_backend_adjust_dynamic_symbol, elf_backend_always_size_sections, elf_backend_size_dynamic_sections, + elf_backend_init_index_section, elf_backend_relocate_section, elf_backend_finish_dynamic_symbol, elf_backend_finish_dynamic_sections, diff --git a/bfd/linker.c b/bfd/linker.c index ea14d76..257a585 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -3073,7 +3073,7 @@ _bfd_generic_section_already_linked (bfd *abfd, asection *sec) bfd_section_already_linked_table_insert (already_linked_list, sec); } -/* Convert symbols in excluded output sections to absolute. */ +/* Convert symbols in excluded output sections to use a kept section. */ static bfd_boolean fix_syms (struct bfd_link_hash_entry *h, void *data) @@ -3092,8 +3092,27 @@ fix_syms (struct bfd_link_hash_entry *h, void *data) && (s->output_section->flags & SEC_EXCLUDE) != 0 && bfd_section_removed_from_list (obfd, s->output_section)) { + asection *op; + for (op = s->output_section->prev; op != NULL; op = op->prev) + if ((op->flags & SEC_EXCLUDE) == 0 + && !bfd_section_removed_from_list (obfd, op)) + break; + if (op == NULL) + { + if (s->output_section->prev != NULL) + op = s->output_section->prev->next; + else + op = s->output_section->owner->sections; + for (; op != NULL; op = op->next) + if ((op->flags & SEC_EXCLUDE) == 0 + && !bfd_section_removed_from_list (obfd, op)) + break; + if (op == NULL) + op = bfd_abs_section_ptr; + } h->u.def.value += s->output_offset + s->output_section->vma; - h->u.def.section = bfd_abs_section_ptr; + h->u.def.value -= op->vma; + h->u.def.section = op; } } diff --git a/ld/ChangeLog b/ld/ChangeLog index 258e92f..d7907c6 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2006-10-17 Alan Modra <amodra@bigpond.net.au> + + * ldlang.c (strip_excluded_output_sections): Do strip sections + that define syms, but don't ignore them. + * ld.texinfo (Output Section Discarding): Revise. + * emultempl/armcoff.em (gld${EMULATION_NAME}_finish): Always call + finish_default. + 2006-10-16 Richard Sandiford <richard@codesourcery.com> * Makefile.am (eelf64bmip.c): Depend on emulparams/elf64bmip-defs.sh. diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em index d5fd67d..fb8766a 100644 --- a/ld/emultempl/armcoff.em +++ b/ld/emultempl/armcoff.em @@ -154,45 +154,46 @@ gld${EMULATION_NAME}_after_open (void) static void gld${EMULATION_NAME}_finish (void) { - struct bfd_link_hash_entry * h; - - if (thumb_entry_symbol == NULL) - return; - - h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, - FALSE, FALSE, TRUE); - - if (h != (struct bfd_link_hash_entry *) NULL - && (h->type == bfd_link_hash_defined - || h->type == bfd_link_hash_defweak) - && h->u.def.section->output_section != NULL) + if (thumb_entry_symbol != NULL) { - static char buffer[32]; - bfd_vma val; - - /* Special procesing is required for a Thumb entry symbol. The - bottom bit of its address must be set. */ - val = (h->u.def.value - + bfd_get_section_vma (output_bfd, - h->u.def.section->output_section) - + h->u.def.section->output_offset); - - val |= 1; - - /* Now convert this value into a string and store it in entry_symbol - where the lang_finish() function will pick it up. */ - buffer[0] = '0'; - buffer[1] = 'x'; - - sprintf_vma (buffer + 2, val); - - if (entry_symbol.name != NULL && entry_from_cmdline) - einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"), - thumb_entry_symbol, entry_symbol.name); - entry_symbol.name = buffer; + struct bfd_link_hash_entry * h; + + h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, + FALSE, FALSE, TRUE); + + if (h != (struct bfd_link_hash_entry *) NULL + && (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak) + && h->u.def.section->output_section != NULL) + { + static char buffer[32]; + bfd_vma val; + + /* Special procesing is required for a Thumb entry symbol. The + bottom bit of its address must be set. */ + val = (h->u.def.value + + bfd_get_section_vma (output_bfd, + h->u.def.section->output_section) + + h->u.def.section->output_offset); + + val |= 1; + + /* Now convert this value into a string and store it in entry_symbol + where the lang_finish() function will pick it up. */ + buffer[0] = '0'; + buffer[1] = 'x'; + + sprintf_vma (buffer + 2, val); + + if (entry_symbol.name != NULL && entry_from_cmdline) + einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"), + thumb_entry_symbol, entry_symbol.name); + entry_symbol.name = buffer; + } + else + einfo (_("%P: warning: connot find thumb start symbol %s\n"), + thumb_entry_symbol); } - else - einfo (_("%P: warning: connot find thumb start symbol %s\n"), thumb_entry_symbol); finish_default (); } diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 6835147..1fbd6ef 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -3684,21 +3684,23 @@ scripts. @cindex discarding sections @cindex sections, discarding @cindex removing sections -The linker will not create output section which do not have any -contents. This is for convenience when referring to input sections that -may or may not be present in any of the input files. For example: +The linker will not create output sections with no contents. This is +for convenience when referring to input sections that may or may not +be present in any of the input files. For example: @smallexample .foo : @{ *(.foo) @} @end smallexample @noindent will only create a @samp{.foo} section in the output file if there is a -@samp{.foo} section in at least one input file. - -If you use anything other than an input section description as an output -section command, such as a symbol assignment, then the output section -will always be created, even if there are no matching input sections. -When a section is discarded, its address (@xref{Output Section Address}) -will also be ignored. +@samp{.foo} section in at least one input file, and if the input +sections are not all empty. Other link script directives that allocate +space in an output section will also create the output section. + +The linker will ignore address assignments (@xref{Output Section Address}) +on discarded output sections, except when the linker script defines +symbols in the output section. In that case the linker will obey +the address assignments, possibly advancing dot and/or current lma +even though the section is discarded. @cindex /DISCARD/ The special output section name @samp{/DISCARD/} may be used to discard diff --git a/ld/ldlang.c b/ld/ldlang.c index 62a4ed7..d9b8ac9 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -3342,7 +3342,6 @@ strip_excluded_output_sections (void) continue; exclude = (output_section->rawsize == 0 - && !os->section_relative_symbol && (output_section->flags & SEC_KEEP) == 0 && !bfd_section_removed_from_list (output_bfd, output_section)); @@ -3372,7 +3371,8 @@ strip_excluded_output_sections (void) { /* We don't set bfd_section to NULL since bfd_section of the removed output section statement may still be used. */ - os->ignored = TRUE; + if (!os->section_relative_symbol) + os->ignored = TRUE; output_section->flags |= SEC_EXCLUDE; bfd_section_list_remove (output_bfd, output_section); output_bfd->section_count--; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 72ac66e..36d20a3 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,30 @@ +2006-10-17 Alan Modra <amodra@bigpond.net.au> + + * ld-arm/mixed-app.sym, ld-cris/ldsym1.d, ld-cris/libdso-12.d, + * ld-cris/v32-ba-1.d, ld-elf/orphan.d, ld-elf/orphan2.d, + * ld-i386/tlsbin.rd, ld-i386/tlsbindesc.rd, ld-i386/tlsdesc.rd, + * ld-i386/tlsdesc.sd, ld-i386/tlsgdesc.rd, ld-i386/tlsnopic.rd, + * ld-i386/tlspic.rd, ld-ia64/tlspic.rd, ld-mips-elf/eh-frame1-n32.d, + * ld-mips-elf/eh-frame1-n64.d, ld-mips-elf/eh-frame2-n32.d, + * ld-mips-elf/eh-frame2-n64.d, ld-mips-elf/mips-elf.exp, + * ld-mips-elf/rel32-n32.d, ld-mips-elf/rel32-o32.d, + * ld-mips-elf/rel64.d, ld-mips-elf/tls-multi-got-1.got, + * ld-mips-elf/tls-multi-got-1.r, ld-mips-elf/tlsdyn-o32-1.d, + * ld-mips-elf/tlsdyn-o32-1.got, ld-mips-elf/tlsdyn-o32-2.d, + * ld-mips-elf/tlsdyn-o32-2.got, ld-mips-elf/tlsdyn-o32-3.d, + * ld-mips-elf/tlsdyn-o32-3.got, ld-mips-elf/tlsdyn-o32.d, + * ld-mips-elf/tlsdyn-o32.got, ld-mips-elf/tlslib-o32-hidden.got, + * ld-mips-elf/tlslib-o32-ver.got, ld-mips-elf/tlslib-o32.got, + * ld-mmix/bpo-10.d, ld-powerpc/tlsso.g, ld-powerpc/tlsso.r, + * ld-powerpc/tlsso32.d, ld-powerpc/tlsso32.g, ld-powerpc/tlsso32.r, + * ld-powerpc/tlstocso.g, ld-powerpc/tlstocso.r, ld-s390/tlspic.rd, + * ld-s390/tlspic_64.rd, ld-scripts/empty-address-1.d, + * ld-scripts/empty-address-3c.d, ld-scripts/empty-orphan.t, + * ld-sh/shared-1.d, ld-sh/tlspic-2.d, ld-sparc/tlssunbin32.rd, + * ld-sparc/tlssunbin64.rd, ld-sparc/tlssunpic32.rd, + * ld-sparc/tlssunpic64.rd, ld-x86-64/tlsdesc.pd, ld-x86-64/tlsdesc.rd, + * ld-x86-64/tlspic.rd: Update for section sym changes. + 2006-10-16 Richard Sandiford <richard@codesourcery.com> * ld-mips-elf/branch-misc-1.d: Set the start address to 0x20000000. diff --git a/ld/testsuite/ld-arm/mixed-app.sym b/ld/testsuite/ld-arm/mixed-app.sym index 49c5edf..b0f4f60 100644 --- a/ld/testsuite/ld-arm/mixed-app.sym +++ b/ld/testsuite/ld-arm/mixed-app.sym @@ -9,7 +9,7 @@ Symbol table for image: .. ..: 0*[^0]*.* 20 FUNC GLOBAL DEFAULT UND lib_func1 .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __exidx_start .. ..: ........ 0 NOTYPE GLOBAL DEFAULT 11 __data_start - .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS _stack + .. ..: ........ 0 NOTYPE GLOBAL DEFAULT 12 _stack .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __end__ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __bss_start .. ..: .......0 0 FUNC GLOBAL DEFAULT 8 app_func2 diff --git a/ld/testsuite/ld-cris/ldsym1.d b/ld/testsuite/ld-cris/ldsym1.d index 1a2a61a..32d8a1f 100644 --- a/ld/testsuite/ld-cris/ldsym1.d +++ b/ld/testsuite/ld-cris/ldsym1.d @@ -13,7 +13,7 @@ Disassembly of section \.text: -0+ <__start>: +0+ <(__start|__Stext)>: 0: 0f05 nop 0+2 <expfn>: diff --git a/ld/testsuite/ld-cris/libdso-12.d b/ld/testsuite/ld-cris/libdso-12.d index 2cb8038..c8a4f62d 100644 --- a/ld/testsuite/ld-cris/libdso-12.d +++ b/ld/testsuite/ld-cris/libdso-12.d @@ -12,40 +12,40 @@ DYNAMIC SYMBOL TABLE: #... -0+252 g DF \.text 0+12 dsofn4 -0+248 g DF \.text 0+2 expfn -0+2310 g DO \.data 0+4 expobj +0+23e g DF \.text 0+12 dsofn4 +0+234 g DF \.text 0+2 expfn +0+22fc g DO \.data 0+4 expobj #... -0+24a g DF \.text 0+8 dsofn3 +0+236 g DF \.text 0+8 dsofn3 #... 0+ D \*UND\* 0+ dsofn #... Contents of section \.rela\.got: - 01d4 0c230000 0a050000 00000000 .* + 01c0 f8220000 0a040000 00000000 .* Contents of section \.rela\.plt: - 01e0 04230000 0b030000 00000000 08230000 .* - 01f0 0b0b0000 00000000 .* + 01cc f0220000 0b020000 00000000 f4220000 .* + 01dc 0b0a0000 00000000 .* Contents of section \.plt: - 01f8 84e20401 7e7a3f7a 04f26ffa bf09b005 .* - 0208 00000000 00000000 00006f0d 0c000000 .* - 0218 6ffabf09 b0053f7e 00000000 bf0ed4ff .* - 0228 ffffb005 6f0d1000 00006ffa bf09b005 .* - 0238 3f7e0c00 0000bf0e baffffff b005 .* + 01e4 84e20401 7e7a3f7a 04f26ffa bf09b005 .* + 01f4 00000000 00000000 00006f0d 0c000000 .* + 0204 6ffabf09 b0053f7e 00000000 bf0ed4ff .* + 0214 ffffb005 6f0d1000 00006ffa bf09b005 .* + 0224 3f7e0c00 0000bf0e baffffff b005 .* Contents of section \.text: - 0246 b005b005 bfbee2ff ffffb005 7f0da620 .* - 0256 00005f0d 1400bfbe b6ffffff b0050000 .* + 0232 b005b005 bfbee2ff ffffb005 7f0da620 .* + 0242 00005f0d 1400bfbe b6ffffff b0050000 .* Contents of section \.dynamic: - 2268 04000000 94000000 05000000 98010000 .* - 2278 06000000 d8000000 0a000000 3a000000 .* - 2288 0b000000 10000000 03000000 f8220000 .* - 2298 02000000 18000000 14000000 07000000 .* - 22a8 17000000 e0010000 07000000 d4010000 .* - 22b8 08000000 0c000000 09000000 0c000000 .* - 22c8 00000000 00000000 00000000 00000000 .* - 22d8 00000000 00000000 00000000 00000000 .* - 22e8 00000000 00000000 00000000 00000000 .* + 2254 04000000 94000000 05000000 84010000 .* + 2264 06000000 d4000000 0a000000 3a000000 .* + 2274 0b000000 10000000 03000000 e4220000 .* + 2284 02000000 18000000 14000000 07000000 .* + 2294 17000000 cc010000 07000000 c0010000 .* + 22a4 08000000 0c000000 09000000 0c000000 .* + 22b4 00000000 00000000 00000000 00000000 .* + 22c4 00000000 00000000 00000000 00000000 .* + 22d4 00000000 00000000 00000000 00000000 .* Contents of section \.got: - 22f8 68220000 00000000 00000000 1e020000 .* - 2308 38020000 00000000 .* + 22e4 54220000 00000000 00000000 0a020000 .* + 22f4 24020000 00000000 .* Contents of section \.data: - 2310 00000000 .* + 22fc 00000000 .* diff --git a/ld/testsuite/ld-cris/v32-ba-1.d b/ld/testsuite/ld-cris/v32-ba-1.d index 24d0751..b4ce78d 100644 --- a/ld/testsuite/ld-cris/v32-ba-1.d +++ b/ld/testsuite/ld-cris/v32-ba-1.d @@ -10,7 +10,7 @@ Disassembly of section \.text: -0+ <a>: +0+ <(a|__Stext)>: 0: bf0e 0800 0000 ba 8 <b> 6: 5e82 moveq 30,r8 diff --git a/ld/testsuite/ld-elf/orphan.d b/ld/testsuite/ld-elf/orphan.d index 04d935c..54d10df 100644 --- a/ld/testsuite/ld-elf/orphan.d +++ b/ld/testsuite/ld-elf/orphan.d @@ -4,6 +4,7 @@ #... \[[ 0-9]+\] \.(text|notbad)[ \t]+PROGBITS[ \t0-9a-f]+AX?.* +#... \[[ 0-9]+\] \.(text|notbad)[ \t]+PROGBITS[ \t0-9a-f]+AX?.* \[[ 0-9]+\] \.data[ \t]+PROGBITS[ \t0-9a-f]+WA.* #... diff --git a/ld/testsuite/ld-elf/orphan2.d b/ld/testsuite/ld-elf/orphan2.d index 867a4a9..a82e721 100644 --- a/ld/testsuite/ld-elf/orphan2.d +++ b/ld/testsuite/ld-elf/orphan2.d @@ -4,5 +4,6 @@ #... \[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t0-9a-f]+AX?.* +#... \[[ 0-9]+\] \.modinfo[ \t]+PROGBITS[ \t0-9a-f]+A.* #pass diff --git a/ld/testsuite/ld-i386/tlsbin.rd b/ld/testsuite/ld-i386/tlsbin.rd index bd2edd1..54abd8b 100644 --- a/ld/testsuite/ld-i386/tlsbin.rd +++ b/ld/testsuite/ld-i386/tlsbin.rd @@ -70,7 +70,7 @@ Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entries: Offset +Info +Type +Sym.Value Sym. Name [0-9a-f ]+R_386_JUMP_SLOT +[0-9a-f]+ +___tls_get_addr -Symbol table '.dynsym' contains 13 entries: +Symbol table '.dynsym' contains [0-9]+ 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 diff --git a/ld/testsuite/ld-i386/tlsbindesc.rd b/ld/testsuite/ld-i386/tlsbindesc.rd index 9e2148e..65b47a2 100644 --- a/ld/testsuite/ld-i386/tlsbindesc.rd +++ b/ld/testsuite/ld-i386/tlsbindesc.rd @@ -64,7 +64,7 @@ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries: 0+804a0fc 00000825 R_386_TLS_TPOFF32 0+ +sG1 0+804a100 00000b0e R_386_TLS_TPOFF +0+ +sG8 -Symbol table '.dynsym' contains 12 entries: +Symbol table '.dynsym' contains [0-9]+ 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 diff --git a/ld/testsuite/ld-i386/tlsdesc.rd b/ld/testsuite/ld-i386/tlsdesc.rd index 1d4a6c2..aca162c 100644 --- a/ld/testsuite/ld-i386/tlsdesc.rd +++ b/ld/testsuite/ld-i386/tlsdesc.rd @@ -49,41 +49,38 @@ Program Headers: Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries: Offset +Info +Type +Sym.Value +Sym. Name -[0-9a-f]+ +0+25 R_386_TLS_TPOFF32 -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+25 R_386_TLS_TPOFF32 -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+25 R_386_TLS_TPOFF32 -[0-9a-f]+ +0+25 R_386_TLS_TPOFF32 -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+25 R_386_TLS_TPOFF32 -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+0e R_386_TLS_TPOFF * -[0-9a-f]+ +0+25 R_386_TLS_TPOFF32 -[0-9a-f]+ +0+50e R_386_TLS_TPOFF 0+8 sg3 -[0-9a-f]+ +0+625 R_386_TLS_TPOFF32 0+c sg4 -[0-9a-f]+ +0+60e R_386_TLS_TPOFF 0+c sg4 -[0-9a-f]+ +0+70e R_386_TLS_TPOFF 0+10 sg5 -[0-9a-f]+ +0+b25 R_386_TLS_TPOFF32 0+4 sg2 +[0-9a-f ]+R_386_TLS_TPOFF32 +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF32 +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF32 +[0-9a-f ]+R_386_TLS_TPOFF32 +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF32 +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF * +[0-9a-f ]+R_386_TLS_TPOFF32 +[0-9a-f ]+R_386_TLS_TPOFF 0+8 sg3 +[0-9a-f ]+R_386_TLS_TPOFF32 0+c sg4 +[0-9a-f ]+R_386_TLS_TPOFF 0+c sg4 +[0-9a-f ]+R_386_TLS_TPOFF 0+10 sg5 +[0-9a-f ]+R_386_TLS_TPOFF32 0+4 sg2 Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 5 entries: Offset Info Type Sym.Value Sym. Name -[0-9a-f]+ +0+829 R_386_TLS_DESC * 0+ sg1 -[0-9a-f]+ +0+29 R_386_TLS_DESC * -[0-9a-f]+ +0+29 R_386_TLS_DESC * -[0-9a-f]+ +0+29 R_386_TLS_DESC * -[0-9a-f]+ +0+29 R_386_TLS_DESC * +[0-9a-f ]+R_386_TLS_DESC * 0+ sg1 +[0-9a-f ]+R_386_TLS_DESC * +[0-9a-f ]+R_386_TLS_DESC * +[0-9a-f ]+R_386_TLS_DESC * +[0-9a-f ]+R_386_TLS_DESC * -Symbol table '.dynsym' contains 16 entries: +Symbol table '.dynsym' contains [0-9]+ 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 +6 * - +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +7 * - +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +8 * +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +7 sg8 +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +7 sg3 +[0-9]+: 0+c +0 TLS +GLOBAL DEFAULT +7 sg4 diff --git a/ld/testsuite/ld-i386/tlsdesc.sd b/ld/testsuite/ld-i386/tlsdesc.sd index 2af8c2d..656c409 100644 --- a/ld/testsuite/ld-i386/tlsdesc.sd +++ b/ld/testsuite/ld-i386/tlsdesc.sd @@ -14,7 +14,7 @@ Contents of section \.got: [0-9a-f]+ 6c000000 b4ffffff 4c000000 68000000 .* [0-9a-f]+ 50000000 70000000 00000000 bcffffff .* Contents of section \.got\.plt: - [0-9a-f]+ ec150000 00000000 00000000 00000000 .* + [0-9a-f]+ b0150000 00000000 00000000 00000000 .* [0-9a-f]+ 20000000 00000000 60000000 00000000 .* [0-9a-f]+ 00000000 00000000 00000000 00000000 .* [0-9a-f]+ 40000000 +.* diff --git a/ld/testsuite/ld-i386/tlsgdesc.rd b/ld/testsuite/ld-i386/tlsgdesc.rd index 08c30bc..0c5c425 100644 --- a/ld/testsuite/ld-i386/tlsgdesc.rd +++ b/ld/testsuite/ld-i386/tlsgdesc.rd @@ -45,25 +45,24 @@ Program Headers: Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 8 entries: Offset +Info +Type +Sym.Value +Sym. Name -[0-9a-f]+ +0+225 R_386_TLS_TPOFF32 0+ sG3 -[0-9a-f]+ +0+30e R_386_TLS_TPOFF 0+ sG5 -[0-9a-f]+ +0+423 R_386_TLS_DTPMOD3 0+ sG2 -[0-9a-f]+ +0+424 R_386_TLS_DTPOFF3 0+ sG2 -[0-9a-f]+ +0+50e R_386_TLS_TPOFF 0+ sG4 -[0-9a-f]+ +0+725 R_386_TLS_TPOFF32 0+ sG6 -[0-9a-f]+ +0+923 R_386_TLS_DTPMOD3 0+ sG1 -[0-9a-f]+ +0+924 R_386_TLS_DTPOFF3 0+ sG1 +[0-9a-f ]+R_386_TLS_TPOFF32 0+ sG3 +[0-9a-f ]+R_386_TLS_TPOFF 0+ sG5 +[0-9a-f ]+R_386_TLS_DTPMOD3 0+ sG2 +[0-9a-f ]+R_386_TLS_DTPOFF3 0+ sG2 +[0-9a-f ]+R_386_TLS_TPOFF 0+ sG4 +[0-9a-f ]+R_386_TLS_TPOFF32 0+ sG6 +[0-9a-f ]+R_386_TLS_DTPMOD3 0+ sG1 +[0-9a-f ]+R_386_TLS_DTPOFF3 0+ sG1 Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 3 entries: Offset Info Type Sym.Value Sym. Name -[0-9a-f]+ 0+c07 R_386_JUMP_SLOT 0+ ___tls_get_addr -[0-9a-f]+ 0+929 R_386_TLS_DESC 0+ sG1 -[0-9a-f]+ 0+429 R_386_TLS_DESC 0+ sG2 +[0-9a-f ]+R_386_JUMP_SLOT 0+ ___tls_get_addr +[0-9a-f ]+R_386_TLS_DESC 0+ sG1 +[0-9a-f ]+R_386_TLS_DESC 0+ sG2 -Symbol table '.dynsym' contains 13 entries: +Symbol table '.dynsym' contains [0-9]+ 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+ +0 TLS +GLOBAL DEFAULT UND sG3 +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG5 +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG2 diff --git a/ld/testsuite/ld-i386/tlsnopic.rd b/ld/testsuite/ld-i386/tlsnopic.rd index 17bd770..6ba628b 100644 --- a/ld/testsuite/ld-i386/tlsnopic.rd +++ b/ld/testsuite/ld-i386/tlsnopic.rd @@ -69,11 +69,9 @@ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries: [0-9a-f ]+R_386_TLS_TPOFF 0+ sg2 -Symbol table '.dynsym' contains 12 entries: +Symbol table '.dynsym' contains [0-9]+ 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 +5 * - +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +6 * +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sg3 +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sg4 +[0-9]+: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3 diff --git a/ld/testsuite/ld-i386/tlspic.rd b/ld/testsuite/ld-i386/tlspic.rd index 5109bce..c902cf3 100644 --- a/ld/testsuite/ld-i386/tlspic.rd +++ b/ld/testsuite/ld-i386/tlspic.rd @@ -81,12 +81,9 @@ Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entries: Offset +Info +Type +Sym.Value +Sym. Name [0-9a-f ]+R_386_JUMP_SLOT 0+ ___tls_get_addr -Symbol table '.dynsym' contains 17 entries: +Symbol table '.dynsym' contains [0-9]+ 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+1c +0 TLS +GLOBAL DEFAULT +8 sg8 +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3 +[0-9]+: 0+c +0 TLS +GLOBAL DEFAULT +8 sg4 diff --git a/ld/testsuite/ld-ia64/tlspic.rd b/ld/testsuite/ld-ia64/tlspic.rd index 5425d53..b3123a8 100644 --- a/ld/testsuite/ld-ia64/tlspic.rd +++ b/ld/testsuite/ld-ia64/tlspic.rd @@ -59,11 +59,6 @@ Relocation section '.rela.IA_64.pltoff' at offset 0x[0-9a-f]+ contains 1 entries Symbol table '.dynsym' contains [0-9]+ entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name .* NOTYPE +LOCAL +DEFAULT +UND * -.* SECTION LOCAL +DEFAULT +7 * -.* SECTION LOCAL +DEFAULT +8 * -.* SECTION LOCAL +DEFAULT +10 * -.* SECTION LOCAL +DEFAULT +11 * -.* SECTION LOCAL +DEFAULT +14 * .* TLS +GLOBAL DEFAULT +10 sg8 .* TLS +GLOBAL DEFAULT +10 sg3 .* TLS +GLOBAL DEFAULT +10 sg4 diff --git a/ld/testsuite/ld-mips-elf/eh-frame1-n32.d b/ld/testsuite/ld-mips-elf/eh-frame1-n32.d index 4e33219..cda12b6 100644 --- a/ld/testsuite/ld-mips-elf/eh-frame1-n32.d +++ b/ld/testsuite/ld-mips-elf/eh-frame1-n32.d @@ -7,19 +7,19 @@ Relocation section '\.rel\.dyn' .*: *Offset .* -00000000 00000000 R_MIPS_NONE * +00000000 [0-9a-f]+ R_MIPS_NONE * # Initial PCs for the FDEs attached to CIE 0xbc -000300dc 00000003 R_MIPS_REL32 * -000300f0 00000003 R_MIPS_REL32 * +000300dc [0-9a-f]+ R_MIPS_REL32 * +000300f0 [0-9a-f]+ R_MIPS_REL32 * # Likewise CIE 0x220 -00030240 00000003 R_MIPS_REL32 * -00030254 00000003 R_MIPS_REL32 * -0003008b 00000503 R_MIPS_REL32 00000000 foo -000300d0 00000503 R_MIPS_REL32 00000000 foo -0003010e 00000503 R_MIPS_REL32 00000000 foo -000301ef 00000503 R_MIPS_REL32 00000000 foo -00030234 00000503 R_MIPS_REL32 00000000 foo -00030272 00000503 R_MIPS_REL32 00000000 foo +00030240 [0-9a-f]+ R_MIPS_REL32 * +00030254 [0-9a-f]+ R_MIPS_REL32 * +0003008b [0-9a-f]+ R_MIPS_REL32 00000000 foo +000300d0 [0-9a-f]+ R_MIPS_REL32 00000000 foo +0003010e [0-9a-f]+ R_MIPS_REL32 00000000 foo +000301ef [0-9a-f]+ R_MIPS_REL32 00000000 foo +00030234 [0-9a-f]+ R_MIPS_REL32 00000000 foo +00030272 [0-9a-f]+ R_MIPS_REL32 00000000 foo #... The section \.eh_frame contains: diff --git a/ld/testsuite/ld-mips-elf/eh-frame1-n64.d b/ld/testsuite/ld-mips-elf/eh-frame1-n64.d index 2b175e0..ccb77e1 100644 --- a/ld/testsuite/ld-mips-elf/eh-frame1-n64.d +++ b/ld/testsuite/ld-mips-elf/eh-frame1-n64.d @@ -7,39 +7,39 @@ Relocation section '\.rel\.dyn' .*: *Offset .* -000000000000 000000000000 R_MIPS_NONE * +000000000000 [0-9a-f]+ R_MIPS_NONE * *Type2: R_MIPS_NONE * *Type3: R_MIPS_NONE * # Initial PCs for the FDEs attached to CIE 0x120 -000000030148 000000001203 R_MIPS_REL32 * +000000030148 [0-9a-f]+ R_MIPS_REL32 * *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030168 000000001203 R_MIPS_REL32 * +000000030168 [0-9a-f]+ R_MIPS_REL32 * *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * # Likewise CIE 0x340 -000000030368 000000001203 R_MIPS_REL32 * +000000030368 [0-9a-f]+ R_MIPS_REL32 * *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030388 000000001203 R_MIPS_REL32 * +000000030388 [0-9a-f]+ R_MIPS_REL32 * *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -0000000300cb 000500001203 R_MIPS_REL32 0000000000000000 foo +0000000300cb [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030138 000500001203 R_MIPS_REL32 0000000000000000 foo +000000030138 [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030192 000500001203 R_MIPS_REL32 0000000000000000 foo +000000030192 [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -0000000302eb 000500001203 R_MIPS_REL32 0000000000000000 foo +0000000302eb [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030358 000500001203 R_MIPS_REL32 0000000000000000 foo +000000030358 [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -0000000303b2 000500001203 R_MIPS_REL32 0000000000000000 foo +0000000303b2 [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * #... diff --git a/ld/testsuite/ld-mips-elf/eh-frame2-n32.d b/ld/testsuite/ld-mips-elf/eh-frame2-n32.d index 1345658..160b7a8 100644 --- a/ld/testsuite/ld-mips-elf/eh-frame2-n32.d +++ b/ld/testsuite/ld-mips-elf/eh-frame2-n32.d @@ -7,19 +7,19 @@ Relocation section '\.rel\.dyn' .*: *Offset .* -00000000 00000000 R_MIPS_NONE * +00000000 [0-9a-f]+ R_MIPS_NONE * # Initial PCs for the FDEs attached to CIE 0xb8 -000300d8 00000003 R_MIPS_REL32 * -000300ec 00000003 R_MIPS_REL32 * +000300d8 [0-9a-f]+ R_MIPS_REL32 * +000300ec [0-9a-f]+ R_MIPS_REL32 * # Likewise CIE 0x218 -00030238 00000003 R_MIPS_REL32 * -0003024c 00000003 R_MIPS_REL32 * -0003008b 00000503 R_MIPS_REL32 00000000 foo -000300cc 00000503 R_MIPS_REL32 00000000 foo -0003010a 00000503 R_MIPS_REL32 00000000 foo -000301eb 00000503 R_MIPS_REL32 00000000 foo -0003022c 00000503 R_MIPS_REL32 00000000 foo -0003026a 00000503 R_MIPS_REL32 00000000 foo +00030238 [0-9a-f]+ R_MIPS_REL32 * +0003024c [0-9a-f]+ R_MIPS_REL32 * +0003008b [0-9a-f]+ R_MIPS_REL32 00000000 foo +000300cc [0-9a-f]+ R_MIPS_REL32 00000000 foo +0003010a [0-9a-f]+ R_MIPS_REL32 00000000 foo +000301eb [0-9a-f]+ R_MIPS_REL32 00000000 foo +0003022c [0-9a-f]+ R_MIPS_REL32 00000000 foo +0003026a [0-9a-f]+ R_MIPS_REL32 00000000 foo #... The section \.eh_frame contains: diff --git a/ld/testsuite/ld-mips-elf/eh-frame2-n64.d b/ld/testsuite/ld-mips-elf/eh-frame2-n64.d index b817bbc..9bc490e 100644 --- a/ld/testsuite/ld-mips-elf/eh-frame2-n64.d +++ b/ld/testsuite/ld-mips-elf/eh-frame2-n64.d @@ -7,39 +7,39 @@ Relocation section '\.rel\.dyn' .*: *Offset .* -000000000000 000000000000 R_MIPS_NONE * +000000000000 [0-9a-f]+ R_MIPS_NONE * *Type2: R_MIPS_NONE * *Type3: R_MIPS_NONE * # Initial PCs for the FDEs attached to CIE 0x118 -000000030140 000000001203 R_MIPS_REL32 * +000000030140 [0-9a-f]+ R_MIPS_REL32 * *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030160 000000001203 R_MIPS_REL32 * +000000030160 [0-9a-f]+ R_MIPS_REL32 * *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * # Likewise CIE 0x330 -000000030358 000000001203 R_MIPS_REL32 * +000000030358 [0-9a-f]+ R_MIPS_REL32 * *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030378 000000001203 R_MIPS_REL32 * +000000030378 [0-9a-f]+ R_MIPS_REL32 * *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -0000000300cb 000500001203 R_MIPS_REL32 0000000000000000 foo +0000000300cb [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030130 000500001203 R_MIPS_REL32 0000000000000000 foo +000000030130 [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -00000003018a 000500001203 R_MIPS_REL32 0000000000000000 foo +00000003018a [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -0000000302e3 000500001203 R_MIPS_REL32 0000000000000000 foo +0000000302e3 [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -000000030348 000500001203 R_MIPS_REL32 0000000000000000 foo +000000030348 [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * -0000000303a2 000500001203 R_MIPS_REL32 0000000000000000 foo +0000000303a2 [0-9a-f]+ R_MIPS_REL32 0000000000000000 foo *Type2: R_MIPS_64 * *Type3: R_MIPS_NONE * #... diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index 773211a..f3d4707 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -147,14 +147,13 @@ run_dump_test "hash1c" if {[istarget mips*-*-linux*]} { # The number of symbols that are always included in the symbol table - # for these tests. The 5 are: + # for these tests. The 4 are: # # the null symbol entry # the .MIPS.stubs section symbol - # the .text section symbol # _gp # _GLOBAL_OFFSET_TABLE_ - set base_syms 5 + set base_syms 4 foreach dynsym { 7fff 8000 fff0 10000 2fe80 } { run_ld_link_tests \ [list [list \ diff --git a/ld/testsuite/ld-mips-elf/rel32-n32.d b/ld/testsuite/ld-mips-elf/rel32-n32.d index c071c01..3b3572f 100644 --- a/ld/testsuite/ld-mips-elf/rel32-n32.d +++ b/ld/testsuite/ld-mips-elf/rel32-n32.d @@ -6,10 +6,10 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries: Offset Info Type Sym.Value Sym. Name -00000000 00000000 R_MIPS_NONE -000002d0 00000003 R_MIPS_REL32 +[0-9a-f ]+R_MIPS_NONE +[0-9a-f ]+R_MIPS_REL32 Hex dump of section '.text': - 0x000002c0 00000000 00000000 00000000 00000000 ................ - 0x000002d0 000002d0 00000000 00000000 00000000 ................ - 0x000002e0 00000000 00000000 00000000 00000000 ................ + 0x000002b0 00000000 00000000 00000000 00000000 ................ + 0x000002c0 000002c0 00000000 00000000 00000000 ................ + 0x000002d0 00000000 00000000 00000000 00000000 ................ diff --git a/ld/testsuite/ld-mips-elf/rel32-o32.d b/ld/testsuite/ld-mips-elf/rel32-o32.d index d98bf21..d2d932e 100644 --- a/ld/testsuite/ld-mips-elf/rel32-o32.d +++ b/ld/testsuite/ld-mips-elf/rel32-o32.d @@ -6,10 +6,10 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries: Offset Info Type Sym.Value Sym. Name -00000000 00000000 R_MIPS_NONE -000002f0 00000003 R_MIPS_REL32 +[0-9a-f ]+R_MIPS_NONE +[0-9a-f ]+R_MIPS_REL32 Hex dump of section '.text': + 0x000002c0 00000000 00000000 00000000 00000000 ................ + 0x000002d0 000002d0 00000000 00000000 00000000 ................ 0x000002e0 00000000 00000000 00000000 00000000 ................ - 0x000002f0 000002f0 00000000 00000000 00000000 ................ - 0x00000300 00000000 00000000 00000000 00000000 ................ diff --git a/ld/testsuite/ld-mips-elf/rel64.d b/ld/testsuite/ld-mips-elf/rel64.d index 61fbf87..34b3b45 100644 --- a/ld/testsuite/ld-mips-elf/rel64.d +++ b/ld/testsuite/ld-mips-elf/rel64.d @@ -6,14 +6,14 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries: Offset Info Type Sym. Value Sym. Name -000000000000 000000000000 R_MIPS_NONE - Type2: R_MIPS_NONE - Type3: R_MIPS_NONE -000000000450 000000001203 R_MIPS_REL32 - Type2: R_MIPS_64 - Type3: R_MIPS_NONE +[0-9a-f ]+R_MIPS_NONE + +Type2: R_MIPS_NONE + +Type3: R_MIPS_NONE +[0-9a-f ]+R_MIPS_REL32 + +Type2: R_MIPS_64 + +Type3: R_MIPS_NONE Hex dump of section '.text': - 0x00000440 00000000 00000000 00000000 00000000 ................ - 0x00000450 00000000 00000450 00000000 00000000 ................ - 0x00000460 00000000 00000000 00000000 00000000 ................ + 0x00000430 00000000 00000000 00000000 00000000 ................ + 0x00000440 00000000 00000440 00000000 00000000 ................ + 0x00000450 00000000 00000000 00000000 00000000 ................ diff --git a/ld/testsuite/ld-mips-elf/tls-multi-got-1.got b/ld/testsuite/ld-mips-elf/tls-multi-got-1.got index 5732701..7e113d6 100644 --- a/ld/testsuite/ld-mips-elf/tls-multi-got-1.got +++ b/ld/testsuite/ld-mips-elf/tls-multi-got-1.got @@ -4,17 +4,17 @@ DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE \*ABS\* -001495d0 R_MIPS_TLS_DTPMOD32 \*ABS\* -0013f948 R_MIPS_TLS_DTPMOD32 \*ABS\* -001495dc R_MIPS_TLS_DTPMOD32 tlsvar_gd -001495e0 R_MIPS_TLS_DTPREL32 tlsvar_gd -0013f954 R_MIPS_TLS_DTPMOD32 tlsvar_gd -0013f958 R_MIPS_TLS_DTPREL32 tlsvar_gd -001495d8 R_MIPS_TLS_TPREL32 tlsvar_ie -0013f950 R_MIPS_TLS_TPREL32 tlsvar_ie -00143f7c R_MIPS_REL32 sym_1_9526 +001495c0 R_MIPS_TLS_DTPMOD32 \*ABS\* +0013f938 R_MIPS_TLS_DTPMOD32 \*ABS\* +001495cc R_MIPS_TLS_DTPMOD32 tlsvar_gd +001495d0 R_MIPS_TLS_DTPREL32 tlsvar_gd +0013f944 R_MIPS_TLS_DTPMOD32 tlsvar_gd +0013f948 R_MIPS_TLS_DTPREL32 tlsvar_gd +001495c8 R_MIPS_TLS_TPREL32 tlsvar_ie +0013f940 R_MIPS_TLS_TPREL32 tlsvar_ie +00143f6c R_MIPS_REL32 sym_1_9526 #... -00139bd0 R_MIPS_REL32 sym_2_8654 +00139bc0 R_MIPS_REL32 sym_2_8654 00000000 R_MIPS_NONE \*ABS\* 00000000 R_MIPS_NONE \*ABS\* 00000000 R_MIPS_NONE \*ABS\* @@ -40,19 +40,19 @@ OFFSET TYPE VALUE Contents of section .got: - 122420 00000000 80000000 00000000 00000000 ................ - 122430 00000000 00000000 00000000 00000000 ................ - 122440 00000000 00000000 00000000 00000000 ................ - 122450 00000000 000d8048 000d66a4 000d2054 .......H..f... T + 122410 00000000 80000000 00000000 00000000 .* + 122420 00000000 00000000 00000000 00000000 .* + 122430 00000000 00000000 00000000 00000000 .* + 122440 00000000 000d8038 000d6694 000d2044 .* #... - 13f930 00000000 00000000 00000000 00000000 ................ - 13f940 00000000 00000000 00000000 00000000 ................ - 13f950 00000000 00000000 00000000 00000000 ................ - 13f960 80000000 00000000 00000000 00000000 ................ + 13f920 00000000 00000000 00000000 00000000 .* + 13f930 00000000 00000000 00000000 00000000 .* + 13f940 00000000 00000000 00000000 00000000 .* + 13f950 80000000 00000000 00000000 00000000 .* #... - 1495a0 00000000 00000000 00000000 00000000 ................ - 1495b0 00000000 00000000 00000000 00000000 ................ - 1495c0 00000000 00000000 00000000 00000000 ................ - 1495d0 00000000 00000000 00000000 00000000 ................ - 1495e0 00000000 .... + 149590 00000000 00000000 00000000 00000000 .* + 1495a0 00000000 00000000 00000000 00000000 .* + 1495b0 00000000 00000000 00000000 00000000 .* + 1495c0 00000000 00000000 00000000 00000000 .* + 1495d0 00000000 .* #pass diff --git a/ld/testsuite/ld-mips-elf/tls-multi-got-1.r b/ld/testsuite/ld-mips-elf/tls-multi-got-1.r index c6280c2..51f3ab1 100644 --- a/ld/testsuite/ld-mips-elf/tls-multi-got-1.r +++ b/ld/testsuite/ld-mips-elf/tls-multi-got-1.r @@ -2,60 +2,39 @@ Dynamic section at offset 0xec contains 19 entries: Tag Type Name/Value 0x00000004 \(HASH\) 0x1ac - 0x00000005 \(STRTAB\) 0x71db8 - 0x00000006 \(SYMTAB\) 0x23ad8 + 0x00000005 \(STRTAB\).* + 0x00000006 \(SYMTAB\).* 0x0000000a \(STRSZ\) 220091 \(bytes\) 0x0000000b \(SYMENT\) 16 \(bytes\) 0x00000015 \(DEBUG\) 0x0 - 0x00000003 \(PLTGOT\) 0x122420 - 0x00000011 \(REL\) 0xa7974 + 0x00000003 \(PLTGOT\) 0x122410 + 0x00000011 \(REL\) 0xa7960 0x00000012 \(RELSZ\) 160072 \(bytes\) 0x00000013 \(RELENT\) 8 \(bytes\) 0x70000001 \(MIPS_RLD_VERSION\) 1 0x70000005 \(MIPS_FLAGS\) NOTPOT 0x70000006 \(MIPS_BASE_ADDRESS\) 0 0x7000000a \(MIPS_LOCAL_GOTNO\) 13 - 0x70000011 \(MIPS_SYMTABNO\) 20014 + 0x70000011 \(MIPS_SYMTABNO\) 20013 0x70000012 \(MIPS_UNREFEXTNO\) 11 - 0x70000013 \(MIPS_GOTSYM\) 0xe + 0x70000013 \(MIPS_GOTSYM\) 0xd 0x0000001e \(FLAGS\) STATIC_TLS 0x00000000 \(NULL\) 0x0 Relocation section '\.rel\.dyn' at offset 0x[0-9a-f]+ contains 20031 entries: Offset Info Type Sym.Value Sym. Name -00000000 00000000 R_MIPS_NONE -001495d0 00000026 R_MIPS_TLS_DTPMOD -0013f948 00000026 R_MIPS_TLS_DTPMOD -001495dc 00000626 R_MIPS_TLS_DTPMOD 00000000 tlsvar_gd -001495e0 00000627 R_MIPS_TLS_DTPREL 00000000 tlsvar_gd -0013f954 00000626 R_MIPS_TLS_DTPMOD 00000000 tlsvar_gd -0013f958 00000627 R_MIPS_TLS_DTPREL 00000000 tlsvar_gd -001495d8 00000b2f R_MIPS_TLS_TPREL3 00000004 tlsvar_ie -0013f950 00000b2f R_MIPS_TLS_TPREL3 00000004 tlsvar_ie -00143f7c 00000e03 R_MIPS_REL32 000d8048 sym_1_9526 -00143768 00000f03 R_MIPS_REL32 000d66a4 sym_1_7885 +[0-9a-f ]+R_MIPS_NONE +[0-9a-f ]+R_MIPS_TLS_DTPMOD +[0-9a-f ]+R_MIPS_TLS_DTPMOD +[0-9a-f ]+R_MIPS_TLS_DTPMOD 00000000 tlsvar_gd +[0-9a-f ]+R_MIPS_TLS_DTPREL 00000000 tlsvar_gd +[0-9a-f ]+R_MIPS_TLS_DTPMOD 00000000 tlsvar_gd +[0-9a-f ]+R_MIPS_TLS_DTPREL 00000000 tlsvar_gd +[0-9a-f ]+R_MIPS_TLS_TPREL3 00000004 tlsvar_ie +[0-9a-f ]+R_MIPS_TLS_TPREL3 00000004 tlsvar_ie +[0-9a-f ]+R_MIPS_REL32 000d8038 sym_1_9526 +[0-9a-f ]+R_MIPS_REL32 000d6694 sym_1_7885 +#... +[0-9a-f ]+R_MIPS_REL32 000cf2a4 sym_1_0465 +[0-9a-f ]+R_MIPS_REL32 000e0ee8 sym_2_8654 #... -0014070c 004e2c03 R_MIPS_REL32 000cf2b4 sym_1_0465 -00139bd0 004e2d03 R_MIPS_REL32 000e0ef8 sym_2_8654 -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE -00000000 00000000 R_MIPS_NONE diff --git a/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d b/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d index 80da247..d416a87 100644 --- a/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d +++ b/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d @@ -5,7 +5,7 @@ Disassembly of section .text: .* <__start>: .*: 3c1c0fc0 lui gp,0xfc0 - .*: 279c7b70 addiu gp,gp,31600 + .*: 279c7ba0 addiu gp,gp,31648 .*: 0399e021 addu gp,gp,t9 .*: 27bdfff0 addiu sp,sp,-16 .*: afbe0008 sw s8,8\(sp\) @@ -55,7 +55,7 @@ Disassembly of section .text: .* <other>: .*: 3c1c0fc0 lui gp,0xfc0 - .*: 279c7ab0 addiu gp,gp,31408 + .*: 279c7ae0 addiu gp,gp,31456 .*: 0399e021 addu gp,gp,t9 .*: 27bdfff0 addiu sp,sp,-16 .*: afbe0008 sw s8,8\(sp\) diff --git a/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got b/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got index 8f5084f..f19d773 100644 --- a/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got +++ b/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got @@ -4,16 +4,16 @@ DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE \*ABS\* -10000044 R_MIPS_TLS_DTPMOD32 tlsbin_gd -10000048 R_MIPS_TLS_DTPREL32 tlsbin_gd -10000038 R_MIPS_TLS_DTPMOD32 tlsvar_gd -1000003c R_MIPS_TLS_DTPREL32 tlsvar_gd -10000040 R_MIPS_TLS_TPREL32 tlsvar_ie -1000004c R_MIPS_TLS_TPREL32 tlsbin_ie +10000054 R_MIPS_TLS_DTPMOD32 tlsbin_gd +10000058 R_MIPS_TLS_DTPREL32 tlsbin_gd +10000048 R_MIPS_TLS_DTPMOD32 tlsvar_gd +1000004c R_MIPS_TLS_DTPREL32 tlsvar_gd +10000050 R_MIPS_TLS_TPREL32 tlsvar_ie +1000005c R_MIPS_TLS_TPREL32 tlsbin_ie Contents of section .got: - 10000010 00000000 80000000 00000000 00000000 ................ - 10000020 00000000 00000000 00000000 0040053c .............@.. - 10000030 00000001 00000000 00000000 00000000 ................ - 10000040 00000000 00000000 00000000 00000000 ................ + 10000020 00000000 80000000 00000000 00000000 ................ + 10000030 00000000 00000000 00000000 0040051c .............@.. + 10000040 00000001 00000000 00000000 00000000 ................ + 10000050 00000000 00000000 00000000 00000000 ................ diff --git a/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d b/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d index 0096520..44730ab 100644 --- a/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d +++ b/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d @@ -5,7 +5,7 @@ Disassembly of section .text: .* <__start>: .*: 3c1c0fc0 lui gp,0xfc0 - .*: 279c7b70 addiu gp,gp,31600 + .*: 279c7ba0 addiu gp,gp,31648 .*: 0399e021 addu gp,gp,t9 .*: 27bdfff0 addiu sp,sp,-16 .*: afbe0008 sw s8,8\(sp\) @@ -55,7 +55,7 @@ Disassembly of section .text: .* <other>: .*: 3c1c0fc0 lui gp,0xfc0 - .*: 279c7ab0 addiu gp,gp,31408 + .*: 279c7ae0 addiu gp,gp,31456 .*: 0399e021 addu gp,gp,t9 .*: 27bdfff0 addiu sp,sp,-16 .*: afbe0008 sw s8,8\(sp\) diff --git a/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got b/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got index 9f8b3ba..8ceef73 100644 --- a/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got +++ b/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got @@ -4,17 +4,17 @@ DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE \*ABS\* -10000048 R_MIPS_TLS_DTPMOD32 tlsbin_gd -1000004c R_MIPS_TLS_DTPREL32 tlsbin_gd -1000003c R_MIPS_TLS_DTPMOD32 tlsvar_gd -10000040 R_MIPS_TLS_DTPREL32 tlsvar_gd -10000044 R_MIPS_TLS_TPREL32 tlsvar_ie -10000050 R_MIPS_TLS_TPREL32 tlsbin_ie +10000058 R_MIPS_TLS_DTPMOD32 tlsbin_gd +1000005c R_MIPS_TLS_DTPREL32 tlsbin_gd +1000004c R_MIPS_TLS_DTPMOD32 tlsvar_gd +10000050 R_MIPS_TLS_DTPREL32 tlsvar_gd +10000054 R_MIPS_TLS_TPREL32 tlsvar_ie +10000060 R_MIPS_TLS_TPREL32 tlsbin_ie Contents of section .got: - 10000010 00000000 80000000 00000000 00000000 ................ - 10000020 00000000 00000000 00000000 00000000 ................ - 10000030 0040053c 00000001 00000000 00000000 .@.<............ - 10000040 00000000 00000000 00000000 00000000 ................ - 10000050 00000000 00000000 00000000 00000000 ................ + 10000020 00000000 80000000 00000000 00000000 .* + 10000030 00000000 00000000 00000000 00000000 .* + 10000040 0040051c 00000001 00000000 00000000 .* + 10000050 00000000 00000000 00000000 00000000 .* + 10000060 00000000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d b/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d index ae671e8..d254c94 100644 --- a/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d +++ b/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d @@ -5,7 +5,7 @@ Disassembly of section .text: .* <other>: .*: 3c1c0fc0 lui gp,0xfc0 - .*: 279c7b70 addiu gp,gp,31600 + .*: 279c7ba0 addiu gp,gp,31648 .*: 0399e021 addu gp,gp,t9 .*: 27bdfff0 addiu sp,sp,-16 .*: afbe0008 sw s8,8\(sp\) @@ -51,7 +51,7 @@ Disassembly of section .text: .* <__start>: .*: 3c1c0fc0 lui gp,0xfc0 - .*: 279c7ac0 addiu gp,gp,31424 + .*: 279c7af0 addiu gp,gp,31472 .*: 0399e021 addu gp,gp,t9 .*: 27bdfff0 addiu sp,sp,-16 .*: afbe0008 sw s8,8\(sp\) diff --git a/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got b/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got index 7342952..89c9961 100644 --- a/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got +++ b/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got @@ -4,17 +4,17 @@ DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE \*ABS\* -10000048 R_MIPS_TLS_DTPMOD32 tlsbin_gd -1000004c R_MIPS_TLS_DTPREL32 tlsbin_gd -1000003c R_MIPS_TLS_DTPMOD32 tlsvar_gd -10000040 R_MIPS_TLS_DTPREL32 tlsvar_gd -10000044 R_MIPS_TLS_TPREL32 tlsvar_ie -10000050 R_MIPS_TLS_TPREL32 tlsbin_ie +10000058 R_MIPS_TLS_DTPMOD32 tlsbin_gd +1000005c R_MIPS_TLS_DTPREL32 tlsbin_gd +1000004c R_MIPS_TLS_DTPMOD32 tlsvar_gd +10000050 R_MIPS_TLS_DTPREL32 tlsvar_gd +10000054 R_MIPS_TLS_TPREL32 tlsvar_ie +10000060 R_MIPS_TLS_TPREL32 tlsbin_ie Contents of section .got: - 10000010 00000000 80000000 00000000 00000000 ................ - 10000020 00000000 00000000 00000000 00000000 ................ - 10000030 004005ec 00000001 00000000 00000000 .@.............. - 10000040 00000000 00000000 00000000 00000000 ................ + 10000020 00000000 80000000 00000000 00000000 ................ + 10000030 00000000 00000000 00000000 00000000 ................ + 10000040 004005cc 00000001 00000000 00000000 .@.............. 10000050 00000000 00000000 00000000 00000000 ................ + 10000060 00000000 00000000 00000000 00000000 ................ diff --git a/ld/testsuite/ld-mips-elf/tlsdyn-o32.d b/ld/testsuite/ld-mips-elf/tlsdyn-o32.d index 5fb13a0..d1f383d 100644 --- a/ld/testsuite/ld-mips-elf/tlsdyn-o32.d +++ b/ld/testsuite/ld-mips-elf/tlsdyn-o32.d @@ -5,7 +5,7 @@ Disassembly of section .text: .* <__start>: .*: 3c1c0fc0 lui gp,0xfc0 - .*: 279c7bb0 addiu gp,gp,31664 + .*: 279c7bc0 addiu gp,gp,31680 .*: 0399e021 addu gp,gp,t9 .*: 27bdfff0 addiu sp,sp,-16 .*: afbe0008 sw s8,8\(sp\) diff --git a/ld/testsuite/ld-mips-elf/tlsdyn-o32.got b/ld/testsuite/ld-mips-elf/tlsdyn-o32.got index 206fd24..633fc39 100644 --- a/ld/testsuite/ld-mips-elf/tlsdyn-o32.got +++ b/ld/testsuite/ld-mips-elf/tlsdyn-o32.got @@ -4,16 +4,16 @@ tmpdir/tls-dynamic-o32: file format elf32-tradbigmips DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE \*ABS\* -10000038 R_MIPS_TLS_DTPMOD32 tlsbin_gd -1000003c R_MIPS_TLS_DTPREL32 tlsbin_gd -10000048 R_MIPS_TLS_DTPMOD32 tlsvar_gd -1000004c R_MIPS_TLS_DTPREL32 tlsvar_gd -10000044 R_MIPS_TLS_TPREL32 tlsbin_ie -10000040 R_MIPS_TLS_TPREL32 tlsvar_ie +10000048 R_MIPS_TLS_DTPMOD32 tlsbin_gd +1000004c R_MIPS_TLS_DTPREL32 tlsbin_gd +10000058 R_MIPS_TLS_DTPMOD32 tlsvar_gd +1000005c R_MIPS_TLS_DTPREL32 tlsvar_gd +10000054 R_MIPS_TLS_TPREL32 tlsbin_ie +10000050 R_MIPS_TLS_TPREL32 tlsvar_ie Contents of section .got: - 10000010 00000000 80000000 00000000 00000000 ................ - 10000020 00000000 00000000 00000000 004004fc ................ - 10000030 00000001 00000000 00000000 00000000 ................ - 10000040 00000000 00000000 00000000 00000000 ................ + 10000020 00000000 80000000 00000000 00000000 ................ + 10000030 00000000 00000000 00000000 004004fc ................ + 10000040 00000001 00000000 00000000 00000000 ................ + 10000050 00000000 00000000 00000000 00000000 ................ diff --git a/ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got b/ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got index a897ec4..e1d64e0 100644 --- a/ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got +++ b/ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got @@ -4,13 +4,13 @@ DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE \*ABS\* -000403fc R_MIPS_TLS_DTPMOD32 \*ABS\* -000403f4 R_MIPS_TLS_DTPMOD32 \*ABS\* -000403f0 R_MIPS_TLS_TPREL32 \*ABS\* +000403cc R_MIPS_TLS_DTPMOD32 \*ABS\* +000403c4 R_MIPS_TLS_DTPMOD32 \*ABS\* +000403c0 R_MIPS_TLS_TPREL32 \*ABS\* Contents of section .got: - 403d0 00000000 80000000 00000000 00000000 ................ - 403e0 00000000 00000000 00000000 000003a0 ................ - 403f0 00000008 00000000 00000000 00000000 ................ - 40400 ffff8004 .... + 403a0 00000000 80000000 00000000 00000000 ................ + 403b0 00000000 00000000 00000000 00000370 ................ + 403c0 00000008 00000000 00000000 00000000 ................ + 403d0 ffff8004 .... diff --git a/ld/testsuite/ld-mips-elf/tlslib-o32-ver.got b/ld/testsuite/ld-mips-elf/tlslib-o32-ver.got index 1ec2551..f039886 100644 --- a/ld/testsuite/ld-mips-elf/tlslib-o32-ver.got +++ b/ld/testsuite/ld-mips-elf/tlslib-o32-ver.got @@ -4,14 +4,14 @@ DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE \*ABS\* -00040544 R_MIPS_TLS_DTPMOD32 \*ABS\* -0004054c R_MIPS_TLS_DTPMOD32 tlsvar_gd -00040550 R_MIPS_TLS_DTPREL32 tlsvar_gd -00040540 R_MIPS_TLS_TPREL32 tlsvar_ie +00040514 R_MIPS_TLS_DTPMOD32 \*ABS\* +0004051c R_MIPS_TLS_DTPMOD32 tlsvar_gd +00040520 R_MIPS_TLS_DTPREL32 tlsvar_gd +00040510 R_MIPS_TLS_TPREL32 tlsvar_ie Contents of section .got: - 40520 00000000 80000000 00000000 00000000 ................ - 40530 00000000 00000000 00000000 000004f0 ................ - 40540 00000000 00000000 00000000 00000000 ................ - 40550 00000000 .... + 404f0 00000000 80000000 00000000 00000000 ................ + 40500 00000000 00000000 00000000 000004c0 ................ + 40510 00000000 00000000 00000000 00000000 ................ + 40520 00000000 .... diff --git a/ld/testsuite/ld-mips-elf/tlslib-o32.got b/ld/testsuite/ld-mips-elf/tlslib-o32.got index a0f3600..9a93aad 100644 --- a/ld/testsuite/ld-mips-elf/tlslib-o32.got +++ b/ld/testsuite/ld-mips-elf/tlslib-o32.got @@ -4,14 +4,14 @@ tmpdir/tlslib-o32.so: file format elf32-tradbigmips DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE \*ABS\* -000404a4 R_MIPS_TLS_DTPMOD32 \*ABS\* -000404ac R_MIPS_TLS_DTPMOD32 tlsvar_gd -000404b0 R_MIPS_TLS_DTPREL32 tlsvar_gd -000404a0 R_MIPS_TLS_TPREL32 tlsvar_ie +00040474 R_MIPS_TLS_DTPMOD32 \*ABS\* +0004047c R_MIPS_TLS_DTPMOD32 tlsvar_gd +00040480 R_MIPS_TLS_DTPREL32 tlsvar_gd +00040470 R_MIPS_TLS_TPREL32 tlsvar_ie Contents of section .got: - 40480 00000000 80000000 00000000 00000000 ................ - 40490 00000000 00000000 00000000 00000450 ................ - 404a0 00000000 00000000 00000000 00000000 ................ - 404b0 00000000 .... + 40450 00000000 80000000 00000000 00000000 ................ + 40460 00000000 00000000 00000000 00000420 ................ + 40470 00000000 00000000 00000000 00000000 ................ + 40480 00000000 .... diff --git a/ld/testsuite/ld-mmix/bpo-10.d b/ld/testsuite/ld-mmix/bpo-10.d index 90908cb..713d7ad 100644 --- a/ld/testsuite/ld-mmix/bpo-10.d +++ b/ld/testsuite/ld-mmix/bpo-10.d @@ -16,7 +16,7 @@ SYMBOL TABLE: 2000000000000000 g \*ABS\* 0+ __bss_start 2000000000000000 g \*ABS\* 0+ _edata 2000000000000000 g \*ABS\* 0+ _end -0+4 g \*ABS\* 0+ _start\. +0+4 g \.init 0+ _start\. Contents of section \.init: 0000 e37704a6 .* diff --git a/ld/testsuite/ld-powerpc/tlsso.g b/ld/testsuite/ld-powerpc/tlsso.g index 6113155..82ccc8d 100644 --- a/ld/testsuite/ld-powerpc/tlsso.g +++ b/ld/testsuite/ld-powerpc/tlsso.g @@ -7,7 +7,7 @@ .*: +file format elf64-powerpc Contents of section \.got: -.* 00000000 000187b8 00000000 00000000 .* +.* 00000000 00018780 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-powerpc/tlsso.r b/ld/testsuite/ld-powerpc/tlsso.r index db54154..7e4ff20 100644 --- a/ld/testsuite/ld-powerpc/tlsso.r +++ b/ld/testsuite/ld-powerpc/tlsso.r @@ -49,9 +49,9 @@ Relocation section '\.rela\.dyn' at offset .* contains 16 entries: [0-9a-f ]+R_PPC64_TPREL16 +0+60 le0 \+ 0 [0-9a-f ]+R_PPC64_TPREL16_HA +0+68 le1 \+ 0 [0-9a-f ]+R_PPC64_TPREL16_LO +0+68 le1 \+ 0 -[0-9a-f ]+R_PPC64_TPREL16_DS +0+10630 \.tdata \+ 28 -[0-9a-f ]+R_PPC64_TPREL16_HA +0+10630 \.tdata \+ 30 -[0-9a-f ]+R_PPC64_TPREL16_LO +0+10630 \.tdata \+ 30 +[0-9a-f ]+R_PPC64_TPREL16_DS +0+105f8 \.tdata \+ 28 +[0-9a-f ]+R_PPC64_TPREL16_HA +0+105f8 \.tdata \+ 30 +[0-9a-f ]+R_PPC64_TPREL16_LO +0+105f8 \.tdata \+ 30 [0-9a-f ]+R_PPC64_DTPMOD64 +0+ [0-9a-f ]+R_PPC64_DTPMOD64 +0+ [0-9a-f ]+R_PPC64_DTPREL64 +0+ @@ -72,8 +72,6 @@ Symbol table '\.dynsym' contains .* entries: .* NOTYPE +LOCAL +DEFAULT +UND .* SECTION LOCAL +DEFAULT +6 .* SECTION LOCAL +DEFAULT +7 -.* SECTION LOCAL +DEFAULT +8 -.* SECTION LOCAL +DEFAULT +9 .* TLS +GLOBAL DEFAULT +UND gd .* TLS +GLOBAL DEFAULT +8 le0 .* NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr diff --git a/ld/testsuite/ld-powerpc/tlsso32.d b/ld/testsuite/ld-powerpc/tlsso32.d index dafca7d..731c568 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.d +++ b/ld/testsuite/ld-powerpc/tlsso32.d @@ -42,5 +42,5 @@ Disassembly of section \.got: .* <\.got>: \.\.\. .*: 4e 80 00 21 blrl -.*: 00 01 04 00 .* +.*: 00 01 03 ec .* \.\.\. diff --git a/ld/testsuite/ld-powerpc/tlsso32.g b/ld/testsuite/ld-powerpc/tlsso32.g index c097ffa..028e869 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.g +++ b/ld/testsuite/ld-powerpc/tlsso32.g @@ -9,5 +9,5 @@ Contents of section \.got: .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* -.* 00000000 4e800021 00010400 00000000 .* +.* 00000000 4e800021 000103ec 00000000 .* .* 00000000 .* diff --git a/ld/testsuite/ld-powerpc/tlsso32.r b/ld/testsuite/ld-powerpc/tlsso32.r index a0ede5f..545c462 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.r +++ b/ld/testsuite/ld-powerpc/tlsso32.r @@ -52,9 +52,9 @@ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries: [0-9a-f ]+R_PPC_TPREL16 +0+30 +le0 \+ 0 [0-9a-f ]+R_PPC_TPREL16_HA +0+34 +le1 \+ 0 [0-9a-f ]+R_PPC_TPREL16_LO +0+34 +le1 \+ 0 -[0-9a-f ]+R_PPC_TPREL16 +0+103e4 +\.tdata \+ 103f8 -[0-9a-f ]+R_PPC_TPREL16_HA +0+103e4 +\.tdata \+ 103fc -[0-9a-f ]+R_PPC_TPREL16_LO +0+103e4 +\.tdata \+ 103fc +[0-9a-f ]+R_PPC_TPREL16 +0+103d0 +\.tdata \+ 103e4 +[0-9a-f ]+R_PPC_TPREL16_HA +0+103d0 +\.tdata \+ 103e8 +[0-9a-f ]+R_PPC_TPREL16_LO +0+103d0 +\.tdata \+ 103e8 [0-9a-f ]+R_PPC_DTPMOD32 +0+ [0-9a-f ]+R_PPC_DTPREL32 +0+ [0-9a-f ]+R_PPC_DTPMOD32 +0+ @@ -73,7 +73,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries: .* NOTYPE +LOCAL +DEFAULT +UND .* SECTION LOCAL +DEFAULT +6 .* SECTION LOCAL +DEFAULT +7 -.* SECTION LOCAL +DEFAULT +8 .* TLS +GLOBAL DEFAULT +UND gd .* TLS +GLOBAL DEFAULT +8 le0 .* NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr diff --git a/ld/testsuite/ld-powerpc/tlstocso.g b/ld/testsuite/ld-powerpc/tlstocso.g index 3d59c43..dbe7897 100644 --- a/ld/testsuite/ld-powerpc/tlstocso.g +++ b/ld/testsuite/ld-powerpc/tlstocso.g @@ -7,7 +7,7 @@ .*: +file format elf64-powerpc Contents of section \.got: -.* 00000000 00018700 00000000 00000000 .* +.* 00000000 000186c8 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* .* 00000000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-powerpc/tlstocso.r b/ld/testsuite/ld-powerpc/tlstocso.r index 4834549..38ef5aa 100644 --- a/ld/testsuite/ld-powerpc/tlstocso.r +++ b/ld/testsuite/ld-powerpc/tlstocso.r @@ -67,8 +67,6 @@ Symbol table '\.dynsym' contains [0-9]+ entries: .* NOTYPE +LOCAL +DEFAULT +UND .* SECTION LOCAL +DEFAULT +6 .* SECTION LOCAL +DEFAULT +7 -.* SECTION LOCAL +DEFAULT +8 -.* SECTION LOCAL +DEFAULT +9 .* TLS +GLOBAL DEFAULT +UND gd .* TLS +GLOBAL DEFAULT +8 le0 .* NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr diff --git a/ld/testsuite/ld-s390/tlspic.rd b/ld/testsuite/ld-s390/tlspic.rd index 570d467..2e7ebde 100644 --- a/ld/testsuite/ld-s390/tlspic.rd +++ b/ld/testsuite/ld-s390/tlspic.rd @@ -73,7 +73,6 @@ Symbol table '.dynsym' contains [0-9]+ entries: .* NOTYPE LOCAL DEFAULT UND .* SECTION LOCAL DEFAULT +7 .* SECTION LOCAL DEFAULT +8 -.* SECTION LOCAL DEFAULT +9 .* TLS +GLOBAL DEFAULT +8 sg8 .* TLS +GLOBAL DEFAULT +8 sg3 .* TLS +GLOBAL DEFAULT +8 sg4 diff --git a/ld/testsuite/ld-s390/tlspic_64.rd b/ld/testsuite/ld-s390/tlspic_64.rd index bc5df18..3fef928 100644 --- a/ld/testsuite/ld-s390/tlspic_64.rd +++ b/ld/testsuite/ld-s390/tlspic_64.rd @@ -73,7 +73,6 @@ Symbol table '.dynsym' contains [0-9]+ entries: .* NOTYPE LOCAL DEFAULT UND .* SECTION LOCAL DEFAULT +7 .* SECTION LOCAL DEFAULT +8 -.* SECTION LOCAL DEFAULT +9 .* TLS +GLOBAL DEFAULT +8 sg8 .* TLS +GLOBAL DEFAULT +8 sg3 .* TLS +GLOBAL DEFAULT +8 sg4 diff --git a/ld/testsuite/ld-scripts/empty-address-1.d b/ld/testsuite/ld-scripts/empty-address-1.d index 8b13014..99fac1e 100644 --- a/ld/testsuite/ld-scripts/empty-address-1.d +++ b/ld/testsuite/ld-scripts/empty-address-1.d @@ -4,5 +4,5 @@ 0+0 T _start #... 0+2000000 A __data_end -0+2000000 D __data_start +0+2000000 [ADT] __data_start #pass diff --git a/ld/testsuite/ld-scripts/empty-address-3c.d b/ld/testsuite/ld-scripts/empty-address-3c.d index 41e0afb..6001885 100644 --- a/ld/testsuite/ld-scripts/empty-address-3c.d +++ b/ld/testsuite/ld-scripts/empty-address-3c.d @@ -6,5 +6,5 @@ #... 0+1010 A __data_end #... -0+1010 D __data_start +0+1010 [ADT] __data_start #pass diff --git a/ld/testsuite/ld-scripts/empty-orphan.t b/ld/testsuite/ld-scripts/empty-orphan.t index 0f717a3..b57e164 100644 --- a/ld/testsuite/ld-scripts/empty-orphan.t +++ b/ld/testsuite/ld-scripts/empty-orphan.t @@ -17,6 +17,6 @@ SECTIONS .text : { *(.text) } > text_mem : text_phdr .data : { *(.data) } > data_mem : data_phdr .bss : { *(.bss) } > data_mem : data_phdr - /DISCARD/ : { *(.reginfo) } + /DISCARD/ : { *(.reginfo) *(.glue*) } /* .orphan_data is an orphan */ } diff --git a/ld/testsuite/ld-sh/shared-1.d b/ld/testsuite/ld-sh/shared-1.d index fbc4d6e..0250ea8 100644 --- a/ld/testsuite/ld-sh/shared-1.d +++ b/ld/testsuite/ld-sh/shared-1.d @@ -13,10 +13,10 @@ Relocation section '\.rela\.text' at offset 0x[0-9a-f]+ contains 1 entries: .* -000001b0 000000a5 R_SH_RELATIVE +000001b4 +0000019c +[0-9a-f]+ R_SH_RELATIVE +000001a0 Hex dump of section '\.rela\.text': - 0x0000019c 000001b4 000000a5 000001b0 .* + 0x00000188 000001a0 000000a5 0000019c .* Hex dump of section '\.text': - 0x000001a8 000001b4 00090009 00090009 .* + 0x00000194 000001a0 00090009 00090009 .* diff --git a/ld/testsuite/ld-sh/tlspic-2.d b/ld/testsuite/ld-sh/tlspic-2.d index 638501b..942fb2d 100644 --- a/ld/testsuite/ld-sh/tlspic-2.d +++ b/ld/testsuite/ld-sh/tlspic-2.d @@ -68,10 +68,6 @@ Relocation section '\.rela\.plt' at offset 0x[0-9a-f]+ contains 1 entries: Symbol table '\.dynsym' contains [0-9]+ entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name .* NOTYPE +LOCAL +DEFAULT UND * -.* SECTION LOCAL DEFAULT +7 * -.* SECTION LOCAL DEFAULT +8 * -.* SECTION LOCAL DEFAULT +9 * -.* SECTION LOCAL DEFAULT +11 * .* NOTYPE GLOBAL DEFAULT UND __tls_get_addr .* TLS +GLOBAL DEFAULT +8 sg1 #... diff --git a/ld/testsuite/ld-sparc/tlssunbin32.rd b/ld/testsuite/ld-sparc/tlssunbin32.rd index f382806..cf502c0 100644 --- a/ld/testsuite/ld-sparc/tlssunbin32.rd +++ b/ld/testsuite/ld-sparc/tlssunbin32.rd @@ -88,7 +88,7 @@ Symbol table '.symtab' contains 64 entries: .* TLS +LOCAL +DEFAULT +8 bl7 .* TLS +LOCAL +DEFAULT +8 bl8 .* OBJECT +LOCAL +HIDDEN +9 _DYNAMIC -.* OBJECT +LOCAL +HIDDEN +ABS _PROCEDURE_LINKAGE_TABLE_ +.* OBJECT +LOCAL +HIDDEN +10 _PROCEDURE_LINKAGE_TABLE_ .* OBJECT +LOCAL +HIDDEN +10 _GLOBAL_OFFSET_TABLE_ .* TLS +GLOBAL DEFAULT +7 sg8 .* TLS +GLOBAL DEFAULT +8 bg8 diff --git a/ld/testsuite/ld-sparc/tlssunbin64.rd b/ld/testsuite/ld-sparc/tlssunbin64.rd index d777972..6a42c90 100644 --- a/ld/testsuite/ld-sparc/tlssunbin64.rd +++ b/ld/testsuite/ld-sparc/tlssunbin64.rd @@ -88,7 +88,7 @@ Symbol table '.symtab' contains 64 entries: .* TLS +LOCAL +DEFAULT +8 bl7 .* TLS +LOCAL +DEFAULT +8 bl8 .* OBJECT +LOCAL +HIDDEN +9 _DYNAMIC -.* OBJECT +LOCAL +HIDDEN +ABS _PROCEDURE_LINKAGE_TABLE_ +.* OBJECT +LOCAL +HIDDEN +10 _PROCEDURE_LINKAGE_TABLE_ .* OBJECT +LOCAL +HIDDEN +10 _GLOBAL_OFFSET_TABLE_ .* TLS +GLOBAL DEFAULT +7 sg8 .* TLS +GLOBAL DEFAULT +8 bg8 diff --git a/ld/testsuite/ld-sparc/tlssunpic32.rd b/ld/testsuite/ld-sparc/tlssunpic32.rd index 05b19b7..0f99170 100644 --- a/ld/testsuite/ld-sparc/tlssunpic32.rd +++ b/ld/testsuite/ld-sparc/tlssunpic32.rd @@ -64,7 +64,6 @@ Symbol table '.dynsym' contains [0-9]+ entries: .* NOTYPE +LOCAL +DEFAULT +UND * .* SECTION LOCAL +DEFAULT +6 * .* SECTION LOCAL +DEFAULT +7 * -.* SECTION LOCAL +DEFAULT +8 * .* SECTION LOCAL +DEFAULT +10 * .* TLS +GLOBAL DEFAULT +7 sg8 .* TLS +GLOBAL DEFAULT +7 sg3 diff --git a/ld/testsuite/ld-sparc/tlssunpic64.rd b/ld/testsuite/ld-sparc/tlssunpic64.rd index b984eab..0a94292 100644 --- a/ld/testsuite/ld-sparc/tlssunpic64.rd +++ b/ld/testsuite/ld-sparc/tlssunpic64.rd @@ -64,7 +64,6 @@ Symbol table '.dynsym' contains [0-9]+ entries: .* NOTYPE +LOCAL +DEFAULT +UND * .* SECTION LOCAL +DEFAULT +6 * .* SECTION LOCAL +DEFAULT +7 * -.* SECTION LOCAL +DEFAULT +8 * .* SECTION LOCAL +DEFAULT +10 * .* TLS +GLOBAL DEFAULT +7 sg8 .* TLS +GLOBAL DEFAULT +7 sg3 diff --git a/ld/testsuite/ld-x86-64/tlsdesc.pd b/ld/testsuite/ld-x86-64/tlsdesc.pd index cd22fd5..bf3bc2f 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc.pd +++ b/ld/testsuite/ld-x86-64/tlsdesc.pd @@ -9,12 +9,12 @@ Disassembly of section .plt: -0000000000000470 <.*@plt-0x10>: - 470: ff 35 e2 0e 20 00 pushq 2100962\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> - 476: ff 25 e4 0e 20 00 jmpq \*2100964\(%rip\) # 201360 <_GLOBAL_OFFSET_TABLE_\+0x10> - 47c: 0f 1f 40 00 nopl 0x0\(%rax\) -0000000000000480 <.*@plt>: - 480: ff 35 d2 0e 20 00 pushq 2100946\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> - 486: ff 25 bc 0e 20 00 jmpq \*2100924\(%rip\) # 201348 <_DYNAMIC\+0x190> - 48c: 0f 1f 40 00 nopl 0x0\(%rax\) +[0-9a-f]+ <.*@plt-0x10>: + [0-9a-f]+: ff 35 .. .. 20 00 pushq .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> + [0-9a-f]+: ff 25 .. .. 20 00 jmpq \*.*\(%rip\) # 201360 <_GLOBAL_OFFSET_TABLE_\+0x10> + [0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\) +[0-9a-f]+ <.*@plt>: + [0-9a-f]+: ff 35 .. .. 20 00 pushq .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> + [0-9a-f]+: ff 25 .. .. 20 00 jmpq \*.*\(%rip\) # 201348 <_DYNAMIC\+0x190> + [0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\) diff --git a/ld/testsuite/ld-x86-64/tlsdesc.rd b/ld/testsuite/ld-x86-64/tlsdesc.rd index 14c632b..20aa075 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc.rd +++ b/ld/testsuite/ld-x86-64/tlsdesc.rd @@ -15,7 +15,7 @@ Section Headers: \[ 3\] .dynstr +.* \[ 4\] .rela.dyn +.* \[ 5\] .rela.plt +.* - \[ 6\] .plt +PROGBITS +0+470 0+470 0+20 10 +AX +0 +0 +4 + \[ 6\] .plt +PROGBITS +0+450 0+450 0+20 10 +AX +0 +0 +4 \[ 7\] .text +PROGBITS +0+1000 0+1000 0+154 00 +AX +0 +0 4096 \[ 8\] .tdata +PROGBITS +0+201154 0+1154 0+60 00 WAT +0 +0 +1 \[ 9\] .tbss +NOBITS +0+2011b4 0+11b4 0+20 00 WAT +0 +0 +1 @@ -59,7 +59,7 @@ Dynamic section at offset 0x[0-9a-f]+ contains 16 entries: 0x[0-9a-f]+ +\(PLTRELSZ\).* 0x[0-9a-f]+ +\(PLTREL\).* 0x[0-9a-f]+ +\(JMPREL\).* - 0x[0-9a-f]+ +\(TLSDESC_PLT\) +0x480 + 0x[0-9a-f]+ +\(TLSDESC_PLT\) +0x460 0x[0-9a-f]+ +\(TLSDESC_GOT\) +0x201348 0x[0-9a-f]+ +\(RELA\).* 0x[0-9a-f]+ +\(RELASZ\).* @@ -69,29 +69,28 @@ Dynamic section at offset 0x[0-9a-f]+ contains 16 entries: Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries: +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend -0+201308 0+12 R_X86_64_TPOFF64 +0+24 -0+201310 0+12 R_X86_64_TPOFF64 +0+30 -0+201318 0+12 R_X86_64_TPOFF64 +0+64 -0+201328 0+12 R_X86_64_TPOFF64 +0+50 -0+201330 0+12 R_X86_64_TPOFF64 +0+70 -0+201340 0+12 R_X86_64_TPOFF64 +0+44 -0+201320 0+700000012 R_X86_64_TPOFF64 +0+10 sg5 \+ 0 -0+201338 0+b00000012 R_X86_64_TPOFF64 +0+4 sg2 \+ 0 +0+201308 [0-9a-f]+ R_X86_64_TPOFF64 +0+24 +0+201310 [0-9a-f]+ R_X86_64_TPOFF64 +0+30 +0+201318 [0-9a-f]+ R_X86_64_TPOFF64 +0+64 +0+201328 [0-9a-f]+ R_X86_64_TPOFF64 +0+50 +0+201330 [0-9a-f]+ R_X86_64_TPOFF64 +0+70 +0+201340 [0-9a-f]+ R_X86_64_TPOFF64 +0+44 +0+201320 [0-9a-f]+ R_X86_64_TPOFF64 +0+10 sg5 \+ 0 +0+201338 [0-9a-f]+ R_X86_64_TPOFF64 +0+4 sg2 \+ 0 Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 5 entries: +Offset +Info +Type +Symbol's Value Symbol's Name \+ Addend -0+201398 0+800000024 R_X86_64_TLSDESC +0+ sg1 \+ 0 -0+201368 0+24 R_X86_64_TLSDESC +0+20 -0+2013a8 0+24 R_X86_64_TLSDESC +0+40 -0+201378 0+24 R_X86_64_TLSDESC +0+60 -0+201388 0+24 R_X86_64_TLSDESC +0+ +0+201398 [0-9a-f]+ R_X86_64_TLSDESC +0+ sg1 \+ 0 +0+201368 [0-9a-f]+ R_X86_64_TLSDESC +0+20 +0+2013a8 [0-9a-f]+ R_X86_64_TLSDESC +0+40 +0+201378 [0-9a-f]+ R_X86_64_TLSDESC +0+60 +0+201388 [0-9a-f]+ R_X86_64_TLSDESC +0+ -Symbol table '.dynsym' contains 16 entries: +Symbol table '.dynsym' contains [0-9]+ 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+1c +0 TLS +GLOBAL DEFAULT +8 sg8 +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +8 sg3 +[0-9]+: 0+c +0 TLS +GLOBAL DEFAULT +8 sg4 diff --git a/ld/testsuite/ld-x86-64/tlspic.rd b/ld/testsuite/ld-x86-64/tlspic.rd index 3198377..492cf6f 100644 --- a/ld/testsuite/ld-x86-64/tlspic.rd +++ b/ld/testsuite/ld-x86-64/tlspic.rd @@ -74,7 +74,6 @@ Symbol table '.dynsym' contains [0-9]+ entries: .* NOTYPE LOCAL DEFAULT UND * .* SECTION LOCAL DEFAULT +7 * .* SECTION LOCAL DEFAULT +8 * -.* SECTION LOCAL DEFAULT +9 * .* TLS +GLOBAL DEFAULT +8 sg8 .* TLS +GLOBAL DEFAULT +8 sg3 .* TLS +GLOBAL DEFAULT +8 sg4 |