[Bug ld/26067] Duplicated struct elf_dyn_relocs in ELF backends

2020-06-03 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26067

H.J. Lu  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |2.35
 Status|NEW |RESOLVED

--- Comment #4 from H.J. Lu  ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26067] Duplicated struct elf_dyn_relocs in ELF backends

2020-06-03 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26067

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ad172eaa4f5ff973890a6c37574946cecf0668b0

commit ad172eaa4f5ff973890a6c37574946cecf0668b0
Author: H.J. Lu 
Date:   Wed Jun 3 07:03:45 2020 -0700

ELF: Copy dyn_relocs in _bfd_elf_link_hash_copy_indirect

Copy dyn_relocs in _bfd_elf_link_hash_copy_indirect instead of in each
target backend.

PR ld/26067
* elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
dyn_relocs.
* elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
* elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
* elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
Likewise.
* elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
* elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
* elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
* elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
* elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
* elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
* elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
* elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
* elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
* elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
* elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
(elf_backend_copy_indirect_symbol): Likewise.
* elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
(elf_backend_copy_indirect_symbol): Likewise.
* elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26067] Duplicated struct elf_dyn_relocs in ELF backends

2020-06-03 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26067

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5dbc8b372f3a15fa4dce65d460a3cce7ed081f6c

commit 5dbc8b372f3a15fa4dce65d460a3cce7ed081f6c
Author: H.J. Lu 
Date:   Wed Jun 3 07:00:55 2020 -0700

ELF: Consolidate readonly_dynrelocs

All readonly_dynrelocs implementations are the same.  Consolidate them
to a single _bfd_elf_readonly_dynrelocs.

PR ld/26067
* elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
* elf32-arm.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
* elf32-csky.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
*  elf32-hppa.c(readonly_dynrelocs): Removed.
(alias_readonly_dynrelocs): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-lm32.c (readonly_dynrelocs): Removed.
(lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-m32r.c (readonly_dynrelocs): Removed.
(m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-metag.c (readonly_dynrelocs): Removed.
(elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-microblaze.c (readonly_dynrelocs): Removed.
(microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
* elf32-nds32.c (readonly_dynrelocs): Removed.
(nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-or1k.c (readonly_dynrelocs): Removed.
(or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
* elf32-ppc.c (readonly_dynrelocs): Removed.
(alias_readonly_dynrelocs): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(ppc_elf_adjust_dynamic_symbol): Likewise.
(maybe_set_textrel): Likewise.
* elf32-s390.c (readonly_dynrelocs): Removed.
(elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-sh.c (readonly_dynrelocs): Removed.
(sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-tic6x.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
* elf32-tilepro.c (readonly_dynrelocs): Removed.
(tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf64-ppc.c (readonly_dynrelocs): Removed.
(alias_readonly_dynrelocs): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(ppc64_elf_adjust_dynamic_symbol): Likewise.
(maybe_set_textrel): Likewise.
* elf64-s390.c (readonly_dynrelocs): Removed.
(elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elflink.c (_bfd_elf_readonly_dynrelocs): New.
* elfnn-aarch64.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
* elfnn-riscv.c (readonly_dynrelocs): Removed.
(riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elfxx-sparc.c (readonly_dynrelocs): Removed.
(_bfd_sparc_elf_adjust_dynamic_symbol): Replace
readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elfxx-tilegx.c (readonly_dynrelocs): Removed.
(tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elfxx-x86.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace 

[Bug ld/26067] Duplicated struct elf_dyn_relocs in ELF backends

2020-06-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26067

--- Comment #1 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=190eb1ddba41aad3a31edead9392473ae9d3bbe3

commit 190eb1ddba41aad3a31edead9392473ae9d3bbe3
Author: H.J. Lu 
Date:   Mon Jun 1 18:18:43 2020 -0700

ELF: Move dyn_relocs to struct elf_link_hash_entry

All ELF backends with shared library support have

  /* Track dynamic relocs copied for this symbol.  */
  struct elf_dyn_relocs *dyn_relocs;

in symbol hash entry.  Move dyn_relocs to struct elf_link_hash_entry
to reduce code duplication.

PR ld/26067
* elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
* elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
Updated.
* elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
(elf_arc_link_hash_newfunc): Updated.
* elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
(elf32_arm_link_hash_newfunc): Updated.
(elf32_arm_copy_indirect_symbol): Likewise.
(elf32_arm_check_relocs): Likewise.
(readonly_dynrelocs): Likewise.
(allocate_dynrelocs_for_symbol): Likewise.
* elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
(csky_elf_link_hash_newfunc): Updated.
(csky_allocate_dynrelocs): Likewise.
(readonly_dynrelocs): Likewise.
(csky_elf_copy_indirect_symbol): Likewise.
* elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
(hppa_link_hash_newfunc): Updated.
(elf32_hppa_copy_indirect_symbol): Likewise.
(elf32_hppa_hide_symbol): Likewise.
(elf32_hppa_adjust_dynamic_symbol): Likewise.
(allocate_dynrelocs): Likewise.
(elf32_hppa_relocate_section): Likewise.
* elf32-i386.c (elf_i386_check_relocs): Likewise.
* elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
(lm32_elf_link_hash_newfunc): Likewise.
(lm32_elf_link_hash_table_create): Updated.
(readonly_dynrelocs): Likewise.
(allocate_dynrelocs): Likewise.
(lm32_elf_copy_indirect_symbol): Likewise.
* elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
(m32r_elf_link_hash_newfunc): Likewise.
(m32r_elf_link_hash_table_create): Updated.
(m32r_elf_copy_indirect_symbol): Likewise.
(allocate_dynrelocs): Likewise.
* elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
(metag_link_hash_newfunc): Updated.
(elf_metag_copy_indirect_symbol): Likewise.
(readonly_dynrelocs): Likewise.
(allocate_dynrelocs): Likewise.
* elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
dyn_relocs.
(link_hash_newfunc): Updated.
(microblaze_elf_check_relocs): Likewise.
(microblaze_elf_copy_indirect_symbol): Likewise.
(readonly_dynrelocs): Likewise.
(allocate_dynrelocs): Likewise.
* elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
(nds32_elf_link_hash_newfunc): Updated.
(nds32_elf_copy_indirect_symbol): Likewise.
(readonly_dynrelocs): Likewise.
(allocate_dynrelocs): Likewise.
(nds32_elf_check_relocs): Likewise.
* elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
(link_hash_newfunc): Updated.
(nios2_elf32_copy_indirect_symbol): Likewise.
(nios2_elf32_check_relocs): Likewise.
(allocate_dynrelocs): Likewise.
* elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
(or1k_elf_link_hash_newfunc): Updated.
(readonly_dynrelocs): Likewise.
(allocate_dynrelocs): Likewise.
(or1k_elf_copy_indirect_symbol): Likewise.
* elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
(ppc_elf_link_hash_newfunc): Updated.
(ppc_elf_copy_indirect_symbol): Likewise.
(ppc_elf_check_relocs): Likewise.
(readonly_dynrelocs): Likewise.
(ppc_elf_adjust_dynamic_symbol): Likewise.
(allocate_dynrelocs): Likewise.
(ppc_elf_relocate_section): Likewise.
* elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
(link_hash_newfunc): Updated.
(elf_s390_copy_indirect_symbol): Likewise.
(readonly_dynrelocs): Likewise.
(elf_s390_adjust_dynamic_symbol): Likewise.
(allocate_dynrelocs): Likewise.
* elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
(sh_elf_link_hash_newfunc): Updated.
(readonly_dynrelocs): Likewise.