Traverse x86 loc_hash_table only if it is used.
* elf32-i386.c (elf_i386_output_arch_local_syms): Traverse
loc_hash_table only if has_loc_hash_table is set.
* elf64-x86-64.c (elf_x86_64_output_arch_local_syms): Likewise.
* elfxx-x86.c (_bfd_elf_x86_get_local_sym_hash): Set
has_loc_hash_table.
(_bfd_x86_elf_late_size_sections): Traverse loc_hash_table only
if has_loc_hash_table is set.
* elfxx-x86.h (elf_x86_link_hash_table): Move plt0_pad_byte and
add has_loc_hash_table.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
if (htab == NULL)
return false;
- /* Fill PLT and GOT entries for local STT_GNU_IFUNC symbols. */
- htab_traverse (htab->loc_hash_table,
- elf_i386_finish_local_dynamic_symbol,
- info);
+ /* Fill PLT and GOT entries for local STT_GNU_IFUNC symbols if
+ needed. */
+ if (htab->has_loc_hash_table)
+ htab_traverse (htab->loc_hash_table,
+ elf_i386_finish_local_dynamic_symbol,
+ info);
return true;
}
if (htab == NULL)
return false;
- /* Fill PLT and GOT entries for local STT_GNU_IFUNC symbols. */
- htab_traverse (htab->loc_hash_table,
- elf_x86_64_finish_local_dynamic_symbol,
- info);
+ /* Fill PLT and GOT entries for local STT_GNU_IFUNC symbols if
+ needed. */
+ if (htab->has_loc_hash_table)
+ htab_traverse (htab->loc_hash_table,
+ elf_x86_64_finish_local_dynamic_symbol,
+ info);
return true;
}
ret->elf.dynindx = -1;
ret->plt_got.offset = (bfd_vma) -1;
*slot = ret;
+ htab->has_loc_hash_table = 1;
}
return &ret->elf;
}
elf_link_hash_traverse (&htab->elf, elf_x86_allocate_dynrelocs,
info);
- /* Allocate .plt and .got entries, and space for local symbols. */
- htab_traverse (htab->loc_hash_table, elf_x86_allocate_local_dynreloc,
- info);
+ /* Allocate .plt and .got entries, and space for local symbols if
+ needed. */
+ if (htab->has_loc_hash_table)
+ htab_traverse (htab->loc_hash_table, elf_x86_allocate_local_dynreloc,
+ info);
/* For every jump slot reserved in the sgotplt, reloc_count is
incremented. However, when we reserve space for TLS descriptors,
/* TRUE if inputs call ___tls_get_addr. This is only used for i386. */
unsigned int has_tls_get_addr_call : 1;
- /* Value used to fill the unused bytes of the first PLT entry. This
- is only used for i386. */
- bfd_byte plt0_pad_byte;
+ /* TRUE if loc_hash_table is used. */
+ unsigned int has_loc_hash_table : 1;
/* TRUE if GOT is referenced. */
unsigned int got_referenced : 1;
function address. */
unsigned int pcrel_plt : 1;
+ /* Value used to fill the unused bytes of the first PLT entry. This
+ is only used for i386. */
+ bfd_byte plt0_pad_byte;
+
bfd_vma (*r_info) (bfd_vma, bfd_vma);
bfd_vma (*r_sym) (bfd_vma);
bool (*is_reloc_section) (const char *);