elf: Cache ".interp" section pointer in elf_link_hash_table
Cache ".interp" section pointer in elf_link_hash_table so that a backend
can use it to avoid calling bfd_get_linker_section.
* elf-bfd.h (elf_link_hash_table): Add interp.
* elf-m10300.c (_bfd_mn10300_elf_late_size_sections): Use the
interp field in elf_link_hash_table.
* elf32-arc.c (elf_arc_late_size_sections): Likewise.
* elf32-arm.c (elf32_arm_late_size_sections): Likewise.
* elf32-bfin.c (elf32_bfinfdpic_late_size_sections): Likewise.
(bfin_late_size_sections): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_late_size_sections): Likewise.
* elf32-cris.c (elf_cris_late_size_sections): Likewise.
* elf32-csky.c (csky_elf_late_size_sections): Likewise.
* elf32-frv.c (elf32_frvfdpic_late_size_sections): Likewise.
* elf32-hppa.c (elf32_hppa_late_size_sections): Likewise.
* elf32-lm32.c (lm32_elf_late_size_sections): Likewise.
* elf32-m32r.c (m32r_elf_late_size_sections): Likewise.
* elf32-m68k.c (elf_m68k_late_size_sections): Likewise.
* elf32-metag.c (elf_metag_late_size_sections): Likewise.
* elf32-nds32.c (nds32_elf_late_size_sections): Likewise.
* elf32-or1k.c (or1k_elf_late_size_sections): Likewise.
* elf32-ppc.c (ppc_elf_late_size_sections): Likewise.
* elf32-s390.c (elf_s390_late_size_sections): Likewise.
* elf32-score.c (s3_bfd_score_elf_late_size_sections): Likewise.
* elf32-score7.c (s7_bfd_score_elf_late_size_sections): Likewise.
* elf32-sh.c (sh_elf_late_size_sections): Likewise.
* elf32-tic6x.c (elf32_tic6x_late_size_sections): Likewise.
* elf32-tilepro.c (tilepro_elf_late_size_sections): Likewise.
* elf32-vax.c (elf_vax_late_size_sections): Likewise.
* elf32-xtensa.c (elf_xtensa_late_size_sections): Likewise.
* elf64-alpha.c (elf64_alpha_late_size_sections): Likewise.
* elf64-hppa.c (elf64_hppa_late_size_sections): Likewise.
* elf64-ppc.c (ppc64_elf_late_size_sections): Likewise.
* elf64-s390.c (elf_s390_late_size_sections): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_late_size_sections): Likewise.
* elfnn-ia64.c (elfNN_ia64_late_size_sections): Likewise.
* elfnn-kvx.c (elfNN_kvx_late_size_sections): Likewise.
* elfnn-loongarch.c (loongarch_elf_late_size_sections): Likewise.
* elfnn-riscv.c (riscv_elf_late_size_sections): Likewise.
* elfxx-mips.c (_bfd_mips_elf_late_size_sections): Likewise.
* elfxx-tilegx.c (tilegx_elf_late_size_sections): Likewise.
* elflink.c (_bfd_elf_link_create_dynamic_sections): Cache the
pointer to ".interp" section in the interp field in
elf_link_hash_table.
(bfd_elf_size_dynamic_sections): Use the interp field in
elf_link_hash_table.
* elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Use the
interp field in elf_link_hash_table.
(_bfd_sparc_elf_late_size_sections): Likewise. Don't set
interp.
* elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove interp.
* elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Check
htab->elf.interp instead of htab->interp.
(_bfd_x86_elf_link_setup_gnu_properties): Use htab->elf.interp.
* elfxx-x86.h (elf_x86_link_hash_table): Remove interp.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
41 files changed