binutils-gdb/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d

101 lines
2.6 KiB
D
Raw Normal View History

.*: file format elf32-tradbigmips
Disassembly of section .text:
.* <other>:
.*: 3c1c0fc0 lui gp,0xfc0
.*: 279c7c40 addiu gp,gp,31808
.*: 0399e021 addu gp,gp,t9
.*: 27bdfff0 addiu sp,sp,-16
.*: afbe0008 sw s8,8\(sp\)
.*: 03a0f021 move s8,sp
.*: afbc0000 sw gp,0\(sp\)
bfd/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> * elfxx-mips.c (mips_got_page_range): New structure. (mips_got_page_entry): Likewise. (mips_got_info): Add page_gotno and got_page_entries fields. (mips_elf_got_per_bfd_arg): Add max_pages field. Delete primary_count and current_count fields. (mips_got_page_entry_hash, mips_got_page_entry_eq): New functions. (mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise. (mips_elf_get_got_for_bfd): New function, split out from mips_elf_make_got_per_bfd. Initialize the page_gotno and got_page_entries fields when creating a new GOT structure. (mips_elf_make_got_pages_per_bfd): New function. (mips_elf_merge_got_with): New function, split out from mips_elf_make_got_per_bfd. Merge page entries as well as non-page entries. Use the minimum of max_pages and the sum of the page_gotnos to estimate the number of page entries. (mips_elf_merge_gots): Use the minimum of max_pages and the bfd's page_gotno to estimate the number of page entries. Use the above functions. (mips_elf_multi_got): Add page entries as well as non-page entries to the individual per-bfd GOTs. Initialize got_per_bfd_arg.max_pages. Initialize the page_gotno and got_page_entries fields when creating a new primary GOT. Use the minimum of pages and page_gotno when adding the number of pages entries to local_gotno. (mips_elf_create_got_section): Initialize the page_gotno and got_page_entries fields of the GOT structure. (mips_elf_rel_relocation_p, mips_elf_read_rel_addend) (mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New functions, split out from... (_bfd_mips_elf_relocate_section): ...here. (_bfd_mips_elf_check_relocs): Record GOT page entries too. (_bfd_mips_relax_section): Use mips_elf_get_section_contents. (_bfd_mips_elf_always_size_sections): Use the smaller of the loadable_size- and page_gotno-derived estimates. ld/testsuite/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ld-mips-elf/got-page-1.d, ld-mips-elf/got-page-1.s, * ld-mips-elf/got-page-2.d, ld-mips-elf/got-page-2.s, * ld-mips-elf/got-page-3.d, ld-mips-elf/got-page-3a.s, * ld-mips-elf/got-page-3b.s, ld-mips-elf/got-page-3c.s, * ld-mips-elf/got-page-1.ld: New tests. * ld-mips-elf/mips-elf.exp: Run them. * ld-mips-elf/multi-got-1.d, ld-mips-elf/multi-got-no-shared.d, * ld-mips-elf/tls-hidden2-got.d, ld-mips-elf/tls-hidden2.d, * ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got, * ld-mips-elf/tls-hidden3.r, ld-mips-elf/tls-hidden4.got, * ld-mips-elf/tls-hidden4.r, ld-mips-elf/tls-multi-got-1.d, * ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r, * ld-mips-elf/tlsbin-o32.d, ld-mips-elf/tlsbin-o32.got, * 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.d, ld-mips-elf/tlslib-o32.got: Update for GOT allocation changes.
2007-11-14 21:46:15 +01:00
.*: 8f998018 lw t9,-32744\(gp\)
bfd/ * elf32-mips.c (elf_backend_hide_symbol): Delete. * elfn32-mips.c (elf_backend_hide_symbol): Likewise. * elf64-mips.c (elf_backend_hide_symbol): Likewise. * elfxx-mips.h (elf_backend_hide_symbol): Likewise. * elfxx-mips.c (mips_elf_link_hash_entry): Remove "forced_local" and add "needs_lazy_stub". (mips_elf_link_hash_newfunc): Update accordingly. (mips_elf_link_hash_table): Remove "computed_got_sizes" and add "lazy_stub_count". (_bfd_mips_elf_link_hash_table_create): Update accordingly. (mips_elf_output_extsym): Use hd->needs_lazy_stub to detect cases where a lazy stub is being used. (mips_elf_sort_hash_table_f): Use h->root.forced_local instead of h->forced_local. (mips_elf_record_global_got_symbol): Use _bfd_elf_link_hash_hide_symbol instead of _bfd_mips_elf_hide_symbol. Do not increment local_gotno here. (mips_elf_allocate_dynamic_relocations): Move before new first use. (mips_elf_check_recreate_got, mips_elf_recreate_got): New functions. (mips_elf_resolve_final_got_entries): Move earlier in file. Make at most two passes over the hash table. Use mips_elf_check_recreate_got to see if there are any indirect or warning entries and mips_elf_recreate_got to create a new GOT without them. Return a boolean success value. (mips_elf_count_forced_local_got_entries): New function. (mips_elf_make_got_per_bfd): Check h->root.forced_local instead of h->forced_local. (mips_elf_set_global_got_offset): Likewise. (mips_elf_set_no_stub): Replace with... (mips_elf_forbid_lazy_stubs): ...this new function. (mips_elf_resolve_final_got_entry): Delete. (mips_elf_multi_got): Fix formatting. Use mips_elf_forbid_lazy_stubs instead of mips_elf_set_no_stub. Move the code that sets global offsets and allocates dynamic relocations from the main _bfd_mips_elf_size_dynamic_sections loop to here. (_bfd_mips_elf_adjust_dynamic_symbol): Do not allocate room in .MIPS.stubs here; just set hmips->needs_lazy_stub and increment htab->lazy_stub_count. (_bfd_mips_elf_always_size_sections): Move the stub-estimation code to mips_elf_estimate_stub_size and the GOT-sizing code to mips_elf_lay_out_got. Do not call these functions here. (mips_elf_estimate_stub_size): New function, split out from _bfd_mips_elf_always_size_sections. Call mips_elf_resolve_final_got_entries earlier. Count the number of forced-local entries. Do not add stub sizes to loadable_size; after this patch, the stub sizes are already included in the main estimate. Allocate dynamic relocations here rather than in the main _bfd_mips_elf_size_dynamic_sections loop. (mips_elf_estimate_stub_size): New function, split out from _bfd_mips_elf_always_size_sections. (mips_elf_allocate_lazy_stub): New function. (mips_elf_lay_out_lazy_stubs): Likewise. (_bfd_mips_elf_size_dynamic_sections): Call mips_elf_estimate_stub_size, mips_elf_lay_out_got and mips_elf_lay_out_lazy_stubs. Do not handle the allocation of sreldyn specially. (_bfd_mips_elf_hide_symbol): Delete. ld/testsuite/ * ld-mips-elf/tlsdyn-o32-2.got, ld-mips-elf/tlsdyn-o32-3.got, ld-mips-elf/tlsdyn-o32-2.d, ld-mips-elf/tlsdyn-o32-3.d: Change the GOT layout as follows: BEFORE AFTER +0x08 %call16(__tls_get_addr) %call16(__tls_get_addr) +0x0c %tlsldm(tlsbin_ld) %gottprel(tlsvar_ie) +0x10 " " %tlsgd(tlsvar_gd) +0x14 %tlsgd(tlsvar_gd) " " +0x18 " " %tlsgd(tlsbin_gd) +0x1c %gottprel(tlsvar_ie) " " +0x20 %tlsgd(tlsbin_gd) %tlsldm(tlsbin_ld) +0x24 " " " " +0x28 %gottprel(tlsbin_ie) %gottprel(tlsbin_ie)
2008-08-07 21:57:28 +02:00
.*: 27848028 addiu a0,gp,-32728
.*: 0320f809 jalr t9
.*: 00000000 nop
.*: 8fdc0000 lw gp,0\(s8\)
.*: 00000000 nop
bfd/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> * elfxx-mips.c (mips_got_page_range): New structure. (mips_got_page_entry): Likewise. (mips_got_info): Add page_gotno and got_page_entries fields. (mips_elf_got_per_bfd_arg): Add max_pages field. Delete primary_count and current_count fields. (mips_got_page_entry_hash, mips_got_page_entry_eq): New functions. (mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise. (mips_elf_get_got_for_bfd): New function, split out from mips_elf_make_got_per_bfd. Initialize the page_gotno and got_page_entries fields when creating a new GOT structure. (mips_elf_make_got_pages_per_bfd): New function. (mips_elf_merge_got_with): New function, split out from mips_elf_make_got_per_bfd. Merge page entries as well as non-page entries. Use the minimum of max_pages and the sum of the page_gotnos to estimate the number of page entries. (mips_elf_merge_gots): Use the minimum of max_pages and the bfd's page_gotno to estimate the number of page entries. Use the above functions. (mips_elf_multi_got): Add page entries as well as non-page entries to the individual per-bfd GOTs. Initialize got_per_bfd_arg.max_pages. Initialize the page_gotno and got_page_entries fields when creating a new primary GOT. Use the minimum of pages and page_gotno when adding the number of pages entries to local_gotno. (mips_elf_create_got_section): Initialize the page_gotno and got_page_entries fields of the GOT structure. (mips_elf_rel_relocation_p, mips_elf_read_rel_addend) (mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New functions, split out from... (_bfd_mips_elf_relocate_section): ...here. (_bfd_mips_elf_check_relocs): Record GOT page entries too. (_bfd_mips_relax_section): Use mips_elf_get_section_contents. (_bfd_mips_elf_always_size_sections): Use the smaller of the loadable_size- and page_gotno-derived estimates. ld/testsuite/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ld-mips-elf/got-page-1.d, ld-mips-elf/got-page-1.s, * ld-mips-elf/got-page-2.d, ld-mips-elf/got-page-2.s, * ld-mips-elf/got-page-3.d, ld-mips-elf/got-page-3a.s, * ld-mips-elf/got-page-3b.s, ld-mips-elf/got-page-3c.s, * ld-mips-elf/got-page-1.ld: New tests. * ld-mips-elf/mips-elf.exp: Run them. * ld-mips-elf/multi-got-1.d, ld-mips-elf/multi-got-no-shared.d, * ld-mips-elf/tls-hidden2-got.d, ld-mips-elf/tls-hidden2.d, * ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got, * ld-mips-elf/tls-hidden3.r, ld-mips-elf/tls-hidden4.got, * ld-mips-elf/tls-hidden4.r, ld-mips-elf/tls-multi-got-1.d, * ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r, * ld-mips-elf/tlsbin-o32.d, ld-mips-elf/tlsbin-o32.got, * 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.d, ld-mips-elf/tlslib-o32.got: Update for GOT allocation changes.
2007-11-14 21:46:15 +01:00
.*: 8f998018 lw t9,-32744\(gp\)
.*: 2784801c addiu a0,gp,-32740
.*: 0320f809 jalr t9
.*: 00000000 nop
.*: 8fdc0000 lw gp,0\(s8\)
.*: 00000000 nop
bfd/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> * elfxx-mips.c (mips_got_page_range): New structure. (mips_got_page_entry): Likewise. (mips_got_info): Add page_gotno and got_page_entries fields. (mips_elf_got_per_bfd_arg): Add max_pages field. Delete primary_count and current_count fields. (mips_got_page_entry_hash, mips_got_page_entry_eq): New functions. (mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise. (mips_elf_get_got_for_bfd): New function, split out from mips_elf_make_got_per_bfd. Initialize the page_gotno and got_page_entries fields when creating a new GOT structure. (mips_elf_make_got_pages_per_bfd): New function. (mips_elf_merge_got_with): New function, split out from mips_elf_make_got_per_bfd. Merge page entries as well as non-page entries. Use the minimum of max_pages and the sum of the page_gotnos to estimate the number of page entries. (mips_elf_merge_gots): Use the minimum of max_pages and the bfd's page_gotno to estimate the number of page entries. Use the above functions. (mips_elf_multi_got): Add page entries as well as non-page entries to the individual per-bfd GOTs. Initialize got_per_bfd_arg.max_pages. Initialize the page_gotno and got_page_entries fields when creating a new primary GOT. Use the minimum of pages and page_gotno when adding the number of pages entries to local_gotno. (mips_elf_create_got_section): Initialize the page_gotno and got_page_entries fields of the GOT structure. (mips_elf_rel_relocation_p, mips_elf_read_rel_addend) (mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New functions, split out from... (_bfd_mips_elf_relocate_section): ...here. (_bfd_mips_elf_check_relocs): Record GOT page entries too. (_bfd_mips_relax_section): Use mips_elf_get_section_contents. (_bfd_mips_elf_always_size_sections): Use the smaller of the loadable_size- and page_gotno-derived estimates. ld/testsuite/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ld-mips-elf/got-page-1.d, ld-mips-elf/got-page-1.s, * ld-mips-elf/got-page-2.d, ld-mips-elf/got-page-2.s, * ld-mips-elf/got-page-3.d, ld-mips-elf/got-page-3a.s, * ld-mips-elf/got-page-3b.s, ld-mips-elf/got-page-3c.s, * ld-mips-elf/got-page-1.ld: New tests. * ld-mips-elf/mips-elf.exp: Run them. * ld-mips-elf/multi-got-1.d, ld-mips-elf/multi-got-no-shared.d, * ld-mips-elf/tls-hidden2-got.d, ld-mips-elf/tls-hidden2.d, * ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got, * ld-mips-elf/tls-hidden3.r, ld-mips-elf/tls-hidden4.got, * ld-mips-elf/tls-hidden4.r, ld-mips-elf/tls-multi-got-1.d, * ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r, * ld-mips-elf/tlsbin-o32.d, ld-mips-elf/tlsbin-o32.got, * 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.d, ld-mips-elf/tlslib-o32.got: Update for GOT allocation changes.
2007-11-14 21:46:15 +01:00
.*: 8f998018 lw t9,-32744\(gp\)
.*: 27848034 addiu a0,gp,-32716
.*: 0320f809 jalr t9
.*: 00000000 nop
.*: 8fdc0000 lw gp,0\(s8\)
.*: 00401021 move v0,v0
.*: 3c030000 lui v1,0x0
.*: 24638000 addiu v1,v1,-32768
.*: 00621821 addu v1,v1,v0
.*: 7c02283b rdhwr v0,\$5
.*: 8f838024 lw v1,-32732\(gp\)
.*: 00000000 nop
.*: 00621821 addu v1,v1,v0
.*: 8f838030 lw v1,-32720\(gp\)
.*: 00000000 nop
.*: 00621821 addu v1,v1,v0
.*: 7c02283b rdhwr v0,\$5
.*: 3c030000 lui v1,0x0
.*: 24639004 addiu v1,v1,-28668
.*: 00621821 addu v1,v1,v0
.*: 03c0e821 move sp,s8
.*: 8fbe0008 lw s8,8\(sp\)
.*: 03e00008 jr ra
.*: 27bd0010 addiu sp,sp,16
.*: 00000000 nop
.* <__start>:
.*: 3c1c0fc0 lui gp,0xfc0
.*: 279c7b90 addiu gp,gp,31632
.*: 0399e021 addu gp,gp,t9
.*: 27bdfff0 addiu sp,sp,-16
.*: afbe0008 sw s8,8\(sp\)
.*: 03a0f021 move s8,sp
.*: afbc0000 sw gp,0\(sp\)
bfd/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> * elfxx-mips.c (mips_got_page_range): New structure. (mips_got_page_entry): Likewise. (mips_got_info): Add page_gotno and got_page_entries fields. (mips_elf_got_per_bfd_arg): Add max_pages field. Delete primary_count and current_count fields. (mips_got_page_entry_hash, mips_got_page_entry_eq): New functions. (mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise. (mips_elf_get_got_for_bfd): New function, split out from mips_elf_make_got_per_bfd. Initialize the page_gotno and got_page_entries fields when creating a new GOT structure. (mips_elf_make_got_pages_per_bfd): New function. (mips_elf_merge_got_with): New function, split out from mips_elf_make_got_per_bfd. Merge page entries as well as non-page entries. Use the minimum of max_pages and the sum of the page_gotnos to estimate the number of page entries. (mips_elf_merge_gots): Use the minimum of max_pages and the bfd's page_gotno to estimate the number of page entries. Use the above functions. (mips_elf_multi_got): Add page entries as well as non-page entries to the individual per-bfd GOTs. Initialize got_per_bfd_arg.max_pages. Initialize the page_gotno and got_page_entries fields when creating a new primary GOT. Use the minimum of pages and page_gotno when adding the number of pages entries to local_gotno. (mips_elf_create_got_section): Initialize the page_gotno and got_page_entries fields of the GOT structure. (mips_elf_rel_relocation_p, mips_elf_read_rel_addend) (mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New functions, split out from... (_bfd_mips_elf_relocate_section): ...here. (_bfd_mips_elf_check_relocs): Record GOT page entries too. (_bfd_mips_relax_section): Use mips_elf_get_section_contents. (_bfd_mips_elf_always_size_sections): Use the smaller of the loadable_size- and page_gotno-derived estimates. ld/testsuite/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ld-mips-elf/got-page-1.d, ld-mips-elf/got-page-1.s, * ld-mips-elf/got-page-2.d, ld-mips-elf/got-page-2.s, * ld-mips-elf/got-page-3.d, ld-mips-elf/got-page-3a.s, * ld-mips-elf/got-page-3b.s, ld-mips-elf/got-page-3c.s, * ld-mips-elf/got-page-1.ld: New tests. * ld-mips-elf/mips-elf.exp: Run them. * ld-mips-elf/multi-got-1.d, ld-mips-elf/multi-got-no-shared.d, * ld-mips-elf/tls-hidden2-got.d, ld-mips-elf/tls-hidden2.d, * ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got, * ld-mips-elf/tls-hidden3.r, ld-mips-elf/tls-hidden4.got, * ld-mips-elf/tls-hidden4.r, ld-mips-elf/tls-multi-got-1.d, * ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r, * ld-mips-elf/tlsbin-o32.d, ld-mips-elf/tlsbin-o32.got, * 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.d, ld-mips-elf/tlslib-o32.got: Update for GOT allocation changes.
2007-11-14 21:46:15 +01:00
.*: 8f998018 lw t9,-32744\(gp\)
bfd/ * elf32-mips.c (elf_backend_hide_symbol): Delete. * elfn32-mips.c (elf_backend_hide_symbol): Likewise. * elf64-mips.c (elf_backend_hide_symbol): Likewise. * elfxx-mips.h (elf_backend_hide_symbol): Likewise. * elfxx-mips.c (mips_elf_link_hash_entry): Remove "forced_local" and add "needs_lazy_stub". (mips_elf_link_hash_newfunc): Update accordingly. (mips_elf_link_hash_table): Remove "computed_got_sizes" and add "lazy_stub_count". (_bfd_mips_elf_link_hash_table_create): Update accordingly. (mips_elf_output_extsym): Use hd->needs_lazy_stub to detect cases where a lazy stub is being used. (mips_elf_sort_hash_table_f): Use h->root.forced_local instead of h->forced_local. (mips_elf_record_global_got_symbol): Use _bfd_elf_link_hash_hide_symbol instead of _bfd_mips_elf_hide_symbol. Do not increment local_gotno here. (mips_elf_allocate_dynamic_relocations): Move before new first use. (mips_elf_check_recreate_got, mips_elf_recreate_got): New functions. (mips_elf_resolve_final_got_entries): Move earlier in file. Make at most two passes over the hash table. Use mips_elf_check_recreate_got to see if there are any indirect or warning entries and mips_elf_recreate_got to create a new GOT without them. Return a boolean success value. (mips_elf_count_forced_local_got_entries): New function. (mips_elf_make_got_per_bfd): Check h->root.forced_local instead of h->forced_local. (mips_elf_set_global_got_offset): Likewise. (mips_elf_set_no_stub): Replace with... (mips_elf_forbid_lazy_stubs): ...this new function. (mips_elf_resolve_final_got_entry): Delete. (mips_elf_multi_got): Fix formatting. Use mips_elf_forbid_lazy_stubs instead of mips_elf_set_no_stub. Move the code that sets global offsets and allocates dynamic relocations from the main _bfd_mips_elf_size_dynamic_sections loop to here. (_bfd_mips_elf_adjust_dynamic_symbol): Do not allocate room in .MIPS.stubs here; just set hmips->needs_lazy_stub and increment htab->lazy_stub_count. (_bfd_mips_elf_always_size_sections): Move the stub-estimation code to mips_elf_estimate_stub_size and the GOT-sizing code to mips_elf_lay_out_got. Do not call these functions here. (mips_elf_estimate_stub_size): New function, split out from _bfd_mips_elf_always_size_sections. Call mips_elf_resolve_final_got_entries earlier. Count the number of forced-local entries. Do not add stub sizes to loadable_size; after this patch, the stub sizes are already included in the main estimate. Allocate dynamic relocations here rather than in the main _bfd_mips_elf_size_dynamic_sections loop. (mips_elf_estimate_stub_size): New function, split out from _bfd_mips_elf_always_size_sections. (mips_elf_allocate_lazy_stub): New function. (mips_elf_lay_out_lazy_stubs): Likewise. (_bfd_mips_elf_size_dynamic_sections): Call mips_elf_estimate_stub_size, mips_elf_lay_out_got and mips_elf_lay_out_lazy_stubs. Do not handle the allocation of sreldyn specially. (_bfd_mips_elf_hide_symbol): Delete. ld/testsuite/ * ld-mips-elf/tlsdyn-o32-2.got, ld-mips-elf/tlsdyn-o32-3.got, ld-mips-elf/tlsdyn-o32-2.d, ld-mips-elf/tlsdyn-o32-3.d: Change the GOT layout as follows: BEFORE AFTER +0x08 %call16(__tls_get_addr) %call16(__tls_get_addr) +0x0c %tlsldm(tlsbin_ld) %gottprel(tlsvar_ie) +0x10 " " %tlsgd(tlsvar_gd) +0x14 %tlsgd(tlsvar_gd) " " +0x18 " " %tlsgd(tlsbin_gd) +0x1c %gottprel(tlsvar_ie) " " +0x20 %tlsgd(tlsbin_gd) %tlsldm(tlsbin_ld) +0x24 " " " " +0x28 %gottprel(tlsbin_ie) %gottprel(tlsbin_ie)
2008-08-07 21:57:28 +02:00
.*: 27848028 addiu a0,gp,-32728
.*: 0320f809 jalr t9
.*: 00000000 nop
.*: 8fdc0000 lw gp,0\(s8\)
.*: 00000000 nop
bfd/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> * elfxx-mips.c (mips_got_page_range): New structure. (mips_got_page_entry): Likewise. (mips_got_info): Add page_gotno and got_page_entries fields. (mips_elf_got_per_bfd_arg): Add max_pages field. Delete primary_count and current_count fields. (mips_got_page_entry_hash, mips_got_page_entry_eq): New functions. (mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise. (mips_elf_get_got_for_bfd): New function, split out from mips_elf_make_got_per_bfd. Initialize the page_gotno and got_page_entries fields when creating a new GOT structure. (mips_elf_make_got_pages_per_bfd): New function. (mips_elf_merge_got_with): New function, split out from mips_elf_make_got_per_bfd. Merge page entries as well as non-page entries. Use the minimum of max_pages and the sum of the page_gotnos to estimate the number of page entries. (mips_elf_merge_gots): Use the minimum of max_pages and the bfd's page_gotno to estimate the number of page entries. Use the above functions. (mips_elf_multi_got): Add page entries as well as non-page entries to the individual per-bfd GOTs. Initialize got_per_bfd_arg.max_pages. Initialize the page_gotno and got_page_entries fields when creating a new primary GOT. Use the minimum of pages and page_gotno when adding the number of pages entries to local_gotno. (mips_elf_create_got_section): Initialize the page_gotno and got_page_entries fields of the GOT structure. (mips_elf_rel_relocation_p, mips_elf_read_rel_addend) (mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New functions, split out from... (_bfd_mips_elf_relocate_section): ...here. (_bfd_mips_elf_check_relocs): Record GOT page entries too. (_bfd_mips_relax_section): Use mips_elf_get_section_contents. (_bfd_mips_elf_always_size_sections): Use the smaller of the loadable_size- and page_gotno-derived estimates. ld/testsuite/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ld-mips-elf/got-page-1.d, ld-mips-elf/got-page-1.s, * ld-mips-elf/got-page-2.d, ld-mips-elf/got-page-2.s, * ld-mips-elf/got-page-3.d, ld-mips-elf/got-page-3a.s, * ld-mips-elf/got-page-3b.s, ld-mips-elf/got-page-3c.s, * ld-mips-elf/got-page-1.ld: New tests. * ld-mips-elf/mips-elf.exp: Run them. * ld-mips-elf/multi-got-1.d, ld-mips-elf/multi-got-no-shared.d, * ld-mips-elf/tls-hidden2-got.d, ld-mips-elf/tls-hidden2.d, * ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got, * ld-mips-elf/tls-hidden3.r, ld-mips-elf/tls-hidden4.got, * ld-mips-elf/tls-hidden4.r, ld-mips-elf/tls-multi-got-1.d, * ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r, * ld-mips-elf/tlsbin-o32.d, ld-mips-elf/tlsbin-o32.got, * 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.d, ld-mips-elf/tlslib-o32.got: Update for GOT allocation changes.
2007-11-14 21:46:15 +01:00
.*: 8f998018 lw t9,-32744\(gp\)
.*: 2784801c addiu a0,gp,-32740
.*: 0320f809 jalr t9
.*: 00000000 nop
.*: 8fdc0000 lw gp,0\(s8\)
.*: 00000000 nop
bfd/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> * elfxx-mips.c (mips_got_page_range): New structure. (mips_got_page_entry): Likewise. (mips_got_info): Add page_gotno and got_page_entries fields. (mips_elf_got_per_bfd_arg): Add max_pages field. Delete primary_count and current_count fields. (mips_got_page_entry_hash, mips_got_page_entry_eq): New functions. (mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise. (mips_elf_get_got_for_bfd): New function, split out from mips_elf_make_got_per_bfd. Initialize the page_gotno and got_page_entries fields when creating a new GOT structure. (mips_elf_make_got_pages_per_bfd): New function. (mips_elf_merge_got_with): New function, split out from mips_elf_make_got_per_bfd. Merge page entries as well as non-page entries. Use the minimum of max_pages and the sum of the page_gotnos to estimate the number of page entries. (mips_elf_merge_gots): Use the minimum of max_pages and the bfd's page_gotno to estimate the number of page entries. Use the above functions. (mips_elf_multi_got): Add page entries as well as non-page entries to the individual per-bfd GOTs. Initialize got_per_bfd_arg.max_pages. Initialize the page_gotno and got_page_entries fields when creating a new primary GOT. Use the minimum of pages and page_gotno when adding the number of pages entries to local_gotno. (mips_elf_create_got_section): Initialize the page_gotno and got_page_entries fields of the GOT structure. (mips_elf_rel_relocation_p, mips_elf_read_rel_addend) (mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New functions, split out from... (_bfd_mips_elf_relocate_section): ...here. (_bfd_mips_elf_check_relocs): Record GOT page entries too. (_bfd_mips_relax_section): Use mips_elf_get_section_contents. (_bfd_mips_elf_always_size_sections): Use the smaller of the loadable_size- and page_gotno-derived estimates. ld/testsuite/ 2007-09-18 Richard Sandiford <richard@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ld-mips-elf/got-page-1.d, ld-mips-elf/got-page-1.s, * ld-mips-elf/got-page-2.d, ld-mips-elf/got-page-2.s, * ld-mips-elf/got-page-3.d, ld-mips-elf/got-page-3a.s, * ld-mips-elf/got-page-3b.s, ld-mips-elf/got-page-3c.s, * ld-mips-elf/got-page-1.ld: New tests. * ld-mips-elf/mips-elf.exp: Run them. * ld-mips-elf/multi-got-1.d, ld-mips-elf/multi-got-no-shared.d, * ld-mips-elf/tls-hidden2-got.d, ld-mips-elf/tls-hidden2.d, * ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got, * ld-mips-elf/tls-hidden3.r, ld-mips-elf/tls-hidden4.got, * ld-mips-elf/tls-hidden4.r, ld-mips-elf/tls-multi-got-1.d, * ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r, * ld-mips-elf/tlsbin-o32.d, ld-mips-elf/tlsbin-o32.got, * 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.d, ld-mips-elf/tlslib-o32.got: Update for GOT allocation changes.
2007-11-14 21:46:15 +01:00
.*: 8f998018 lw t9,-32744\(gp\)
.*: 27848034 addiu a0,gp,-32716
.*: 0320f809 jalr t9
.*: 00000000 nop
.*: 8fdc0000 lw gp,0\(s8\)
.*: 00401021 move v0,v0
.*: 3c030000 lui v1,0x0
.*: 24638000 addiu v1,v1,-32768
.*: 00621821 addu v1,v1,v0
.*: 7c02283b rdhwr v0,\$5
.*: 8f838024 lw v1,-32732\(gp\)
.*: 00000000 nop
.*: 00621821 addu v1,v1,v0
.*: 8f838030 lw v1,-32720\(gp\)
.*: 00000000 nop
.*: 00621821 addu v1,v1,v0
.*: 7c02283b rdhwr v0,\$5
.*: 3c030000 lui v1,0x0
.*: 24639004 addiu v1,v1,-28668
.*: 00621821 addu v1,v1,v0
.*: 03c0e821 move sp,s8
.*: 8fbe0008 lw s8,8\(sp\)
.*: 03e00008 jr ra
.*: 27bd0010 addiu sp,sp,16
.* <__tls_get_addr>:
.*: 03e00008 jr ra
.*: 00000000 nop
...