x86: Remove _bfd_{i386,x86_64}_elf_convert_load
Instead of converting GOT relocations when sizing dynamic sections, we
convert GOT relocations during relocation check. Add a field, local_ref,
to elf_x86_link_hash_entry to indicate if symbol references are always
local with a new function to check if symbol references are always local,
which works in check_relocs.
* elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
r_type_p. Remove the converted argument. Replace
SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
the new relocation type via r_type_p.
(elf_i386_relocate_section): Likewise.
(elf_i386_finish_dynamic_symbol): Likewise.
(need_convert_load): Removed.
(check_relocs_failed): Updated.
(elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
instead of setting need_convert_load.
(_bfd_i386_elf_convert_load): Removed.
* elf64-x86-64.c (need_convert_load): Removed.
(check_relocs_failed): Updated.
(elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
Return the new relocation type via r_type_p.
(elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
instead of setting need_convert_load.
(elf_x86_64_check_relocs): Don't check PIC if relocation has
been converted.
(_bfd_x86_64_elf_convert_load): Removed.
(elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
with SYMBOL_REFERENCES_LOCAL_P.
(elf_x86_64_finish_dynamic_symbol): Likewise.
* elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
set convert_load.
(_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
(_bfd_x86_elf_link_symbol_references_local): New function.
* elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
(UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
SYMBOL_REFERENCES_LOCAL_P.
(elf_x86_link_hash_entry): Add local_ref.
(elf_x86_link_hash_table): Remove convert_load.
(_bfd_i386_elf_convert_load): Removed.
(_bfd_x86_64_elf_convert_load): Likewise.
(_bfd_x86_elf_link_symbol_references_local): New.