23cc69b663
* elfxx-mips.c (mips_got_info): Add a "reloc_only_gotno" field. (mips_elf_got_section): Delete. (mips_elf_sort_hash_table): Use g->reloc_only_gotno to decide how many reloc-only entries there are. (mips_elf_count_got_symbols): Adjust g->reloc_only_gotno as well as g->global_gotno. (mips_elf_make_got_per_bfd): Initialize reloc_only_gotno. (mips_elf_multi_got): Likewise. Use gg->reloc_only_gotno rather than gg->assigned_gotno to store the number of reloc-only GOT entries. (mips_elf_create_got_section): Remove the MAYBE_EXCLUDE parameter. Initialize reloc_only_gotno. (mips_elf_calculate_relocation): Check htab->got_info instead of dynobj when deciding whether to call mips_elf_adjust_gp, (_bfd_mips_elf_create_dynamic_sections): Adjust the call to mips_elf_create_got_section. (mips_elf_record_relocs): Likewise. Remove redundant "dynobj == NULL" code. Do not use mips_elf_create_got_section or mips_elf_record_global_got_symbol for R_MIPS_32, R_MIPS_REL32 and R_MIPS_64; limit global_got_area to GGA_RELOC_ONLY instead. (_bfd_mips_elf_finish_dynamic_symbol): Use htab->sgot instead of mips_elf_got_section. (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Likewise. Move the initial assignment of G to the block that uses it; it is used for an unrelated purpose later. ld/testsuite/ * ld-mips-elf/tls-hidden4.got, ld-mips-elf/tls-hidden4.r: We have removed an unused GOT entry that was allocated for the R_MIPS_32 relocation against "undef", so adjust addresses down by 4 bytes. * ld-mips-elf/got-dump-1.d, ld-mips-elf/got-dump-2.d: We have changed the order of the GOT entries so that reloc-only ones come last. "undef" is only referred to by dynamic relocations, so it now comes after "glob". * ld-mips-elf/mips16-pic-2.dd, ld-mips-elf/mips16-pic-2.gd, ld-mips-elf/mips16-pic-2.nd, ld-mips-elf/mips16-pic-2.rd: We have removed two unused local GOT entries that were originally created as global entries for the hidden symbols "used2" and "used3". "used4" and "used5" are only referred to by relocations, so they now come after "used6" and "used7".
26 lines
920 B
Makefile
26 lines
920 B
Makefile
#name: GOT dump (readelf -A) test 2
|
|
#source: got-dump-2.s
|
|
#as: -mips3 -EB -64
|
|
#ld: -Tgot-dump-2.ld -shared -melf64btsmip
|
|
#readelf: -A
|
|
|
|
Primary GOT:
|
|
Canonical gp value: 0001236000008000
|
|
|
|
Reserved entries:
|
|
Address Access Initial Purpose
|
|
0001236000000010 -32752\(gp\) 0000000000000000 Lazy resolver
|
|
0001236000000018 -32744\(gp\) 8000000000000000 Module pointer \(GNU extension\)
|
|
|
|
Local entries:
|
|
Address Access Initial
|
|
0001236000000020 -32736\(gp\) 0001236000000000
|
|
0001236000000028 -32728\(gp\) 0001236000000008
|
|
|
|
Global entries:
|
|
Address Access Initial Sym.Val. Type Ndx Name
|
|
0001236000000030 -32720\(gp\) 0001235000000020 0001235000000020 FUNC UND extern
|
|
0001236000000038 -32712\(gp\) 0001235000000000 0001235000000000 FUNC 7 glob
|
|
0001236000000040 -32704\(gp\) 0000000000000000 0000000000000000 NOTYPE UND undef
|
|
|