Fix an invalid free called when attempting to link a COFF object against an ELF archi...
[deliverable/binutils-gdb.git] / bfd / ChangeLog
index 44ce307b77e6cb84f5160903e5b2f26f0ae46c5e..662ef44cc6079da0256c42907b91b4dd3c16b222 100644 (file)
@@ -1,3 +1,347 @@
+2017-11-01  Alan Modra  <amodra@gmail.com>
+
+       PR 22374
+       * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
+       entry when just a dynamic reloc can serve.  Ensure no dynamic
+       relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
+       Expand and move the non_got_ref comment.
+       * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
+
+2017-11-01  Nick Clifton  <nickc@redhat.com>
+
+       PR 22369
+       * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
+       file.
+       * cofflink.c (coff_link_check_archive_element): Skip non-COFF
+       members of an archive.
+
+2017-10-31  Nick Clifton  <nickc@redhat.com>
+
+       PR 22373
+       * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
+       offset values.
+
+2017-10-30  Alan Modra  <amodra@gmail.com>
+
+       * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
+       elf target.
+
+       * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
+       relocs_compatible.
+       (bfd_elf_gc_sections): Likewise.
+
+2017-10-30  Alan Modra  <amodra@gmail.com>
+
+       PR 22269
+       * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
+       ensure non_got_ref is not set due to debug references.
+       (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling.  Use
+       SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
+       need for a plt entry.
+       (allocate_dynrelocs): Similarly for got entries.  Tidy code discarding
+       dynamic relocs when pic.  Remove bogus code attempting to handle
+       commons.
+       (elf32_hppa_relocate_section): Similarly.  Delete resolved_to_zero
+       and simplify.
+       (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
+       and SYMBOL_REFERENCES_LOCAL in GOT handling.
+
+2017-10-28  Alan Modra  <amodra@gmail.com>
+
+       PR 22300
+       * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
+       * elf32-hppa.c (elf_backend_relocs_compatible): Define.
+       * elf32-ppc.c (elf_backend_relocs_compatible): Define.
+       * elf64-ppc.c (elf_backend_relocs_compatible): Define.
+
+2017-10-25  Alan Modra  <amodra@gmail.com>
+
+       * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
+       optionally prefixed with "_".
+       * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
+
+2017-10-24  Andrew Waterman  <andrew@sifive.com>
+
+       * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
+       when rd is x0.
+
+2017-10-24  Renlin Li  <renlin.li@arm.com>
+
+       PR ld/21703
+       * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
+
+2017-10-23  Nick Clifton  <nickc@redhat.com>
+
+       PR 22319
+       * elflink.c (elf_link_output_extsym): Keep global undefined
+       symbols if they have been marked as needed.
+
+2017-10-23  Maciej W. Rozycki  <macro@imgtec.com>
+
+       * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
+       function.
+       (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
+       `_bfd_mips_elf_mkobject'.
+
+2017-10-22  Hans-Peter Nilsson  <hp@axis.com>
+
+       PR gas/22304
+       * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
+
+2017-10-19  Palmer Dabbelt  <palmer@dabbelt.com>
+
+       * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
+       (riscv_pcgp_lo_reloc): Likewise.
+       (riscv_pcgp_relocs): Likewise.
+       (riscv_init_pcgp_relocs): New function.
+       (riscv_free_pcgp_relocs): Likewise.
+       (riscv_record_pcgp_hi_reloc): Likewise.
+       (riscv_record_pcgp_lo_reloc): Likewise.
+       (riscv_delete_pcgp_hi_reloc): Likewise.
+       (riscv_use_pcgp_hi_reloc): Likewise.
+       (riscv_record_pcgp_lo_reloc): Likewise.
+       (riscv_find_pcgp_lo_reloc): Likewise.
+       (riscv_delete_pcgp_lo_reloc): Likewise.
+       (_bfd_riscv_relax_pc): Likewise.
+       (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
+       via the new functions above.
+
+2017-10-19  Palmer Dabbelt  <palmer@dabbelt.com>
+
+       * elfnn-riscv.c (R_RISCV_DELETE): New define.
+       (_bfd_riscv_relax_delete): New function.
+       (perform_relocation): Handle R_RISCV_DELETE.
+       (_bfd_riscv_relax_section): Likewise.
+
+2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/22263
+       * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
+       bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
+       bfd_link_executable for TLS check.
+       (tilegx_elf_check_relocs): Likewise.
+       (allocate_dynrelocs): Likewise.
+       (tilegx_elf_relocate_section): Likewise.
+
+2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/22263
+       * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
+       bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
+       bfd_link_executable for TLS check.
+       (tilepro_elf_check_relocs): Likewise.
+       (allocate_dynrelocs): Likewise.
+       (tilepro_elf_relocate_section): Likewise.
+
+2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/22263
+       * elfxx-sparc.c (sparc_elf_tls_transition): Replace
+       bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
+       bfd_link_executable for TLS check.
+       (_bfd_sparc_elf_check_relocs): Likewise.
+       (allocate_dynrelocs): Likewise.
+       (_bfd_sparc_elf_relocate_section): Likewise.
+
+2017-10-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
+       _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
+       * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
+
+2017-10-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
+       indirect and warning symbols.
+
+2017-10-17  Alan Modra  <amodra@gmail.com>
+
+       PR 22307
+       * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
+       against size left rather than comparing pointers.  Reorganise loop.
+
+2017-10-17  Alan Modra  <amodra@gmail.com>
+
+       PR 22306
+       * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
+       and error for any other size that doesn't cover the header word.
+
+2017-10-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
+       * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
+       (bfinfdpic_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
+       from comments.
+       (elf_m68k_remove_got_entry_type): Removed.
+       (elf_m68k_find_got_entry_ptr): Likewise.
+       (elf_m68k_remove_got_entry): Likewise.
+       (elf_m68k_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
+       * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
+       (ppc64_elf_gc_sweep_hook): Likewise.
+       * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
+       * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
+       * elflink.c (elf_link_add_object_symbols): Don't call
+       _bfd_elf_link_check_relocs here.
+       (gc_sweep_hook_fn): Removed.
+       (elf_gc_sweep): Remove gc_sweep_hook.
+       * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
+       * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
+       (elf_backend_gc_sweep_hook): Likewise.
+       * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
+       * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
+       * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
+       (elfNN_bed): Remove elf_backend_gc_sweep_hook.
+       * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
+       * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
+
+2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-i386.c (elf_i386_backend_data): Removed.
+       (get_elf_i386_backend_data): Likewise.
+       (elf_i386_arch_bed): Replace elf_i386_backend_data with
+       elf_x86_backend_data.
+       (elf_i386_get_synthetic_symtab): Likewise.
+       (elf_i386_nacl_arch_bed): Likewise.
+       (elf_i386_vxworks_arch_bed): Likewise.
+       (elf_i386_relocate_section): Check target_os instead of
+       is_vxworks.
+       (elf_i386_finish_dynamic_symbol): Likewise.
+       (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
+       Check target_os instead of is_vxworks.
+       (elf_i386_link_setup_gnu_properties): Remove normal_target and
+       is_vxworks.  Initialize plt0_pad_byte.
+       * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
+       (get_elf_x86_64_arch_data): Likewise.
+       (get_elf_x86_64_backend_data): Likewise.
+       (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
+       elf_x86_backend_data.
+       (elf_x86_64_get_synthetic_symtab): Likewise.
+       (elf_x86_64_nacl_arch_bed): Likewise.
+       (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
+       normal_target.  Initialize plt0_pad_byte.
+       * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
+       instead of is_vxworks.
+       (_bfd_x86_elf_size_dynamic_sections): Likewise.
+       (_bfd_x86_elf_finish_dynamic_sections): Likewise.
+       (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
+       (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
+       (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
+       Update normal_target.  Set up plt0_pad_byte.  Check target_os
+       instead of is_vxworks.
+       * elfxx-x86.h (elf_x86_target_os): New.
+       (elf_x86_backend_data): Likewise.
+       (get_elf_x86_backend_data): Likewise.
+       (elf_x86_link_hash_table): Remove is_vxworks.  Add plt0_pad_byte
+       and target_os.
+       (elf_x86_init_table): Remove normal_target and is_vxworks.  Add
+       plt0_pad_byte.
+
+2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
+       _bfd_x86_elf_finish_dynamic_sections.
+       * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
+       * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
+       function.
+       * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
+       prototype.
+
+2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/21384
+       * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
+       hide symbol which was forced to be dynamic.
+
+2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/22269
+       * elf32-cris.c (cris_elf_relocate_section): Don't generate
+       dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+       (cris_elf_check_relocs): Don't allocate dynamic relocation
+       if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+
+2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/22269
+       * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
+       if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+       (sh_elf_relocate_section): Don't generate dynamic relocation if
+       UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+
+2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/22269
+       * elf32-s390.c (allocate_dynrelocs): Discard dynamic
+       relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+       (elf_s390_relocate_section): Don't generate dynamic relocation
+       if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+       * elf64-s390.c (allocate_dynrelocs): Discard dynamic
+       relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+       (elf_s390_relocate_section): Don't generate dynamic relocation
+       if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+
+2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/22269
+       * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
+       dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+       (allocate_dynrelocs): Discard dynamic relocations if
+       UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+
 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/22269
This page took 0.028237 seconds and 4 git commands to generate.