+2017-11-20 Nick Clifton <nickc@redhat.com>
+
+ PR 22450
+ * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip
+ objects without a GNU_PROPERTY note section when looking for a bfd
+ onto which notes can be accumulated.
+
+2017-11-20 Alan Modra <amodra@gmail.com>
+
+ PR 22451
+ PR 22460
+ * elf.c (_bfd_elf_init_reloc_shdr): Delete "sec_hdr" parameter
+ and leave rel_hdr->sh_flags zero. Update calls.
+ (bfd_elf_set_group_contents): Check input rel/rela SHF_GROUP
+ flag when !gas before adding rel/rela section to group. Set
+ output rel/rela SHF_GROUP flags.
+
+2017-11-18 Jim Wilson <jimw@sifive.com>
+
+ * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
+ and to in error message.
+
+2017-11-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
+ "%F%P:", instead of "%F:", to linker callback in case of error.
+
+2017-11-16 Nick Clifton <nickc@redhat.com>
+
+ PR 22421
+ * elf.c (elfcore_grok_netbsd_procinfo): Check that the note is big enough.
+ (elfcore_grok_openbsd_procinfo): Likewise.
+ (elfcore_grok_nto_status): Likewise.
+
+2017-11-16 Nick Clifton <nickc@redhat.com>
+
+ * merge.c (sec_merge_emit): Always create padding buffer. Add
+ asserts to make sure that the buffer is long enough.
+
+2017-11-15 Alan Modra <amodra@gmail.com>
+
+ * bfd.c (union _bfd_doprnt_args): Add "Bad".
+ (_bfd_doprnt): Handle more flags.
+ (_bfd_doprnt_scan): Likewise. Tidy setting of args array.
+ (error_handler_internal): Init args type to Bad.
+
+2017-11-14 Alan Modra <amodra@gmail.com>
+
+ PR 22431
+ * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
+ non-empty dynamic section.
+ (ppc_build_one_stub): Take elf_gp from output bfd, not output
+ section owner.
+ (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
+
+2017-11-14 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
+ .eh_frame info.
+
+2017-11-13 Jan Beulich <jbeulich@suse.com>
+
+ * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
+ Define.
+ * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
+ (coff_write_object_contents): Likewise. Issue diagnostic for too
+ large alignment.
+
+2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22423
+ * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
+ PT_PHDR segment.
+
+2017-11-12 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (elf_link_add_object_symbols): Ignore anything but
+ defined and defweak symbols when setting up weakdefs.
+
+2017-11-12 Alan Modra <amodra@gmail.com>
+
+ * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
+ to keep dyn_relocs, clear to discard. Comment.
+ (allocate_dynrelocs): Always clear non_got_ref when clearing
+ dyn_relocs in non-pic case. Invert non_got_ref test. Also test
+ dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
+ dyn_relocs on undefined syms to handle for non-pic too.
+ (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
+ to keep dyn_relocs, clear to discard. Comment.
+ (allocate_dynrelocs): Always clear non_got_ref when clearing
+ dyn_relocs in non-pic case. Invert non_got_ref test. Also test
+ dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
+ dyn_relocs on undefined syms to handle for non-pic too.
+ (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
+ * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
+ dyn_relocs here. Don't bother setting non_got_ref. Comment.
+ (allocate_dynrelocs): Delete special handling of non-pic ELFv2
+ ifuncs. Move code deleting dyn_relocs on undefined symbols to
+ handle for non-pic too. Don't test non_got_ref. Do test
+ dynamic_adjusted and ELF_COMMON_DEF_P.
+
+2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
+
+ * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
+ * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
+ * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
+
+2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
+
+ * elf32-mips.c (elf32_mips_write_core_note): New function.
+ (elf_backend_write_core_note): New macro.
+ * elf64-mips.c (elf64_mips_write_core_note): New function.
+ (elf_backend_write_core_note): New macro.
+ * elfn32-mips.c (elf32_mips_write_core_note): New function.
+ (elf_backend_write_core_note): New macro.
+
+2017-11-07 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
+ statistics message.
+
+2017-11-07 Alan Modra <amodra@gmail.com>
+
+ * sysdep.h: Formatting, comment fixes.
+ (gettext, ngettext): Redefine when ENABLE_NLS.
+ (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
+ (_): Define using gettext.
+ (textdomain, bindtextdomain): Use safer "do nothing".
+ * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
+ (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
+
+2017-11-05 Alan Modra <amodra@gmail.com>
+
+ PR 22397
+ * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
+ after.
+
+2017-11-05 Alan Modra <amodra@gmail.com>
+
+ PR 22397
+ * bfd.c (union _bfd_doprnt_args): New.
+ (PRINT_TYPE): Add FIELD arg. Take value from args.
+ (_bfd_doprnt): Replace ap parameter with args. Adjust all
+ PRINT_TYPE invocations and reading of format args to suit.
+ Move "%%" handling out of switch handling args. Support
+ positional parameters.
+ (_bfd_doprnt_scan): New function.
+ (error_handler_internal): Call _bfd_doprnt_scan and read args.
+
+2017-11-04 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
+ (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
+ (ppc_elf_relocate_section): Don't output a dynamic relocation
+ for IE GOT entries in an executable.
+ * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
+ (ppc64_elf_size_dynamic_sections): Likewise.
+ (ppc64_elf_relocate_section): Likewise.
+
+2017-11-04 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
+ callers. Don't bother with SEC_ALLOC test. Return section pointer.
+ Move minfo call to..
+ (maybe_set_textrel): ..here.
+ * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
+ (maybe_set_textrel): Call minfo to print textrel warning to map file.
+
+2017-11-04 Alan Modra <amodra@gmail.com>
+
+ * elf32-hppa.c (enum _tls_type): Move.
+ (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
+ (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
+ Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
+ (got_entries_needed, got_relocs_needed): New functions.
+ (allocate_dynrelocs): Use them.
+ (elf32_hppa_size_dynamic_sections): Likewise.
+ (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
+ Correct code emitting relocs on GD/IE got entries. Report an
+ error when a symbol has both normal and TLS GOT relocs.
+
+2017-11-04 Alan Modra <amodra@gmail.com>
+
+ PR 22394
+ * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
+ for plabels when non-pic.
+ (maybe_set_textrel): New function.
+ (readonly_dynrelocs): Move and rewrite.
+ (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
+ relocs when def_regular or -z nocopyreloc. Handle non_got_ref
+ for functions. Expand non_got_ref comments.
+ (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
+
+2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
+ Don't use func_pointer_refcount. Don't set plt.refcount nor
+ non_got_ref for function pointer reference.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+ * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
+ func_pointer_refcount.
+ (_bfd_x86_elf_copy_indirect_symbol): Don't copy
+ func_pointer_refcount.
+ (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
+ * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
+ (elf_x86_link_hash_entry): Remove func_pointer_refcount.
+
+2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
+ Nick Clifton <nickc@redhat.com>
+
+ PR 22385
+ * coffgen.c (_bfd_coff_get_external_symbols): Check for an
+ overlarge raw syment count.
+ (coff_get_normalized_symtab): Likewise.
+
+2017-11-01 James Bowman <james.bowman@ftdichip.com>
+
+ * archures.c: Add bfd_mach_ft32b.
+ * cpu-ft32.c: Add arch_info_struct.
+ * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
+ DIFF32.
+ (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
+ DIFF32.
+ (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
+ (elf32_ft32_adjust_diff_reloc_value)
+ (elf32_ft32_adjust_reloc_if_spans_insn)
+ (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
+ (ft32_elf_relax_section): New function.
+ * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+2017-11-01 Nick Clifton <nickc@redhat.com>
+
+ PR 22376
+ * coffcode.h (coff_slurp_line_table): Check for an excessively
+ large line number count.
+
+2017-11-01 Nick Clifton <nickc@redhat.com>
+
+ PR 22373
+ * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
+ and offset in light of further possible bogus values.
+
+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
+ * elf32-microblaze.c (microblaze_elf_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
+ * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
+ relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
+ UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (elf_m68k_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-hppa.c (ensure_undef_dynamic): Don't make undefined
+ symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (allocate_dynrelocs): Discard dynamic relocations if
+ UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (elf32_hppa_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
+ * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
+ dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (allocate_fptr): Don't allocate function pointer if
+ UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (allocate_dynrel_entries): Don't allocate dynamic relocation
+ if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (set_got_entry): Don't set GOT entry if
+ UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (set_pltoff_entry): Don't set PLTOFF entry if
+ UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (elfNN_ia64_relocate_section): Don't install dynamic relocation
+ UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+
+2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22269
+ * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
+ dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (allocate_dynrelocs): Don't allocate dynamic relocations if
+ UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+
+2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22269
+ * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
+ dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (allocate_dynrelocs_for_symbol): Discard dynamic relocations
+ if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+
+2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22269
+ * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
+ relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (tilepro_elf_relocate_section): Don't generate dynamic
+ relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
+ relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+ (tilegx_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
+ * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
+ generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
+ true.
+ (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
+ if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
+
+2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
+ * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
+ * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
+
+2017-10-12 James Bowman <james.bowman@ftdichip.com>
+
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+ * elf32-ft32.c: Add HOWTO R_FT32_15.
+ * reloc.c: Add BFD_RELOC_FT32_15.
+
+2017-10-12 Nick Clifton <nickc@redhat.com>
+
+ * reloc.c (enum bfd_reloc_status): Start values at 2.
+ * bfd-in2.h: Regenerate.
+ * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
+ that a TRUE return indicates success. Compare the result of
+ calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
+ (build_one_stub): Change sense of tests against aarch64_relocate
+ return value.
+ (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
+ than FALSE, when an error is detected.
+ (elfNN_aarch64_final_link_relocate): Likewise.
+
+2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_backend_hide_symbol): New.
+ * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
+ * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
+ * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
+
+2017-10-12 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
+ elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
+ (bfd_elf_define_start_stop): Likewise.
+
+2017-10-12 Alan Modra <amodra@gmail.com>
+
+ * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
+ when executable rather than non-PIC.
+ * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
+ * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
+
+2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
+
+ * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
+ member.
+ * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
+ (elf_external_linux_prpsinfo64_ugid32): ... this.
+ (swap_linux_prpsinfo32_out): Rename to...
+ (swap_linux_prpsinfo32_ugid32_out): ... this.
+ (elf_external_linux_prpsinfo64_ugid16): New structure.
+ (swap_linux_prpsinfo64_ugid16_out): New function.
+ * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
+ (elf_backend_linux_prpsinfo64_ugid16): Define.
+ (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
+ * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
+ of the 64-bit Linux core PRPSINFO note.
+ * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
+
+2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
+
+ * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
+ member.
+ (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
+ * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
+ (elf_external_ppc_linux_prpsinfo32)
+ (swap_ppc_linux_prpsinfo32_out): Move to...
+ * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
+ (swap_linux_prpsinfo32_ugid32_out): ... these.
+ (elf_external_linux_prpsinfo32): Rename to...
+ (elf_external_linux_prpsinfo32_ugid16): ... this.
+ (swap_linux_prpsinfo32_out): Rename to...
+ (swap_linux_prpsinfo32_ugid16_out): ... this.
+ * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
+ (elf_backend_linux_prpsinfo32_ugid16): Define.
+ (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
+ * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
+ of the 32-bit Linux core PRPSINFO note.
+ * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+ * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
+
+2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
+
+ * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
+ `gap' member ahead of `pr_flag'.
+
+2017-10-11 Pedro Alves <palves@redhat.com>
+
+ * bfd.c (_doprnt): Rename to ...
+ (_bfd_doprnt): ... this.
+ (error_handler_internal): Adjust.
+
+2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
+ instead of incrementing it.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+
+2017-10-10 Renlin Li <renlin.li@arm.com>
+
+ PR ld/21402
+ * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
+ symbols into dynamic.
+
+2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22274
+ * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
+ (riscv_elf_link_hash_table_create): Initialize max_alignment to
+ (bfd_vma) -1.
+ (_bfd_riscv_relax_section): Cache the max alignment of output
+ sections if possible.
+
+2017-10-10 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
+ .opd whenever .opd is present and non-zero size. Move code
+ setting abiversion to/from output file earlier. Only set
+ u.opd.func_sec when --gc-sections. Read relocs and set up
+ u.opd.func_sec values here..
+ (ppc64_elf_check_relocs): ..rather than here. Simplify opd
+ section tests.
+ (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
+
+2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
+ isymbuf.
+
+2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
+ .interp section with "ld --no-dynamic-linker".
+
+2017-10-09 Alan Modra <amodra@gmail.com>
+
+ PR 22212
+ * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
+ funcinfo_hash_table and varinfo_hash_table.
+
+2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
+ in read-only section with minfo.
+ (sh_elf_size_dynamic_sections): Likewise.
+
+2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
+ a strayed comment.
+
+2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
+ this_hdr.sh_entsize only if section size > 0.
+
+2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
+
+2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
+ in read-only section with minfo.
+ (_bfd_sparc_elf_size_dynamic_sections): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
+ comments.
+
+2017-10-06 John Baldwin <jhb@FreeBSD.org>
+
+ * elf-bfd.h (struct elf_backend_data): Add
+ `elf_backend_grok_freebsd_prstatus'.
+ * elf.c (elfcore_grok_freebsd_note): Call
+ `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
+ present.
+ * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
+ function.
+ (elf_backend_grok_freebsd_prstatus): Define.
+ * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
+ (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
+ and has_non_got_reloc with zero_undefweak.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+ * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
+ zero_undefweak to 1.
+ (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
+ has_non_got_reloc with zero_undefweak.
+ * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
+ has_got_reloc and has_non_got_reloc with zero_undefweak.
+ (elf_x86_link_hash_entry): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
+ (VERIFY_COPY_RELOC): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (VERIFY_COPY_RELOC): New.
+ * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
+ * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
+ * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
+ * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
+ * elf32-i386.c (elf_i386_relocate_section): Use it.
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (X86_SIZE_TYPE_P): New.
+ (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
+ * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
+ (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
+ * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
+ (PLT_LOCAL_IFUNC_P): Likewise.
+ * elf32-i386.c (elf_i386_relocate_section): Use them.
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
+ * elf32-i386.c (elf_i386_relocate_section): Use it.
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
+ * elf32-i386.c (elf_i386_relocate_section): Use it.
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (X86_PCREL_TYPE_P): New.
+ (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
+ * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
+ (X86_PCREL_TYPE_P): This.
+ (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
+ Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
+ (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
+ X86_PCREL_TYPE_P.
+ * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
+
+2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
+ * elf32-i386.c (elf_i386_tls_transition): Use it.
+ * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
+
+2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
+ Dump dynamic relocation in read-only section with minfo if
+ needed.
+ (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
+ (maybe_set_textrel): Likewise.
+ (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
+ read-only section with minfo.
+
+2017-10-05 John Baldwin <jhb@FreeBSD.org>
+
+ * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
+
+2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
+ in read-only section with minfo.
+ (tilepro_elf_size_dynamic_sections): Likewise.
+ * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
+ (tilegx_elf_size_dynamic_sections): Likewise.
+
+2017-10-05 Pedro Alves <palves@redhat.com>
+
+ PR 22245
+ * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
+ ellipsis parameter. Split out bfd_error_on_input code to..
+ (bfd_set_input_error): .. New function.
+ * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
+ * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
+ * bfd-in2.h: Regenerate.
+
+2017-10-05 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
+ fini_array error value.
+
+2017-10-05 Alan Modra <amodra@gmail.com>
+
+ PR 21167
+ * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
+ groups.
+ (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
+ flag from section.
+ (elf_fake_sections): Adjust calls. Exit immediately on failure.
+ (bfd_elf_set_group_contents): Add associated reloc section indices
+ to group contents.
+
+2017-10-04 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
+ classify symbols for ELFv2.
+
+2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
+
+ PR 22245
+ * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
+ undergoes default promotion.
+ * bfd-in2.h: Regenerate.
+
+2017-10-02 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+
+2017-10-01 Alan Modra <amodra@gmail.com>
+
+ PR 21957
+ * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
+ (add_line_info): Always put end_sequence last.
+
+2017-10-01 Alan Modra <amodra@gmail.com>
+
+ PR 22047
+ * dwarf2.c (read_section): Allocate buffer with extra byte for
+ bfd_simple_get_relocated_section_contents rather than copying
+ afterwards.
+
+2017-09-29 Alan Modra <amodra@gmail.com>
+
+ * merge.c (merge_strings): Return FALSE on malloc failure.
+ (_bfd_merge_sections): Return failures from record_section and
+ merge_strings.
+
+2017-09-28 Alan Modra <amodra@gmail.com>
+
+ PR 22220
+ * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
+ a case where plugin_notice isn't called.
+
+2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
+
+ * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
+ comparison.
+
+2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22199
+ * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
+ output_bfd to info->callbacks->minfo.
+
+2017-09-26 Nick Clifton <nickc@redhat.com>
+
+ PR 22172
+ * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
+ assertion failure if elf_x86_64_rtype_to_howto has already issued
+ an error message.
+
+2017-09-26 Alan Modra <amodra@gmail.com>
+
+ PR 22210
+ * dwarf2.c (read_formatted_entries): Use read_attribute_value to
+ read data.
+
+2017-09-26 Nick Clifton <nickc@redhat.com>
+
+ PR 22210
+ * dwarf2.c (read_formatted_entries): Fail early if we know that
+ the loop parsing data entries will overflow the end of the
+ section.
+
+2017-09-26 Alan Modra <amodra@gmail.com>
+
+ PR 22209
+ * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
+ (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
+ to stash->info_ptr_memory, and check die_ref is within that memory.
+ Set info_ptr_end correctly when another CU is refd. Check die_ref
+ for DW_FORM_ref4 etc. is within CU.
+
+2017-09-26 Alan Modra <amodra@gmail.com>
+
+ PR 22205
+ * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
+ (read_formatted_entries): Init "fe".
+ (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
+
+2017-09-26 Alan Modra <amodra@gmail.com>
+
+ PR 22204
+ * dwarf2.c (decode_line_info): Ensure line_ptr stays within
+ bounds in inner loop.
+
+2017-09-25 Alan Modra <amodra@gmail.com>
+
+ PR 22202
+ * dwarf1.c (parse_die): Sanity check pointer against section limit
+ before dereferencing.
+ (parse_line_table): Likewise.
+
+2017-09-25 Alan Modra <amodra@gmail.com>
+
+ PR 22201
+ * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
+ has string form.
+ (parse_comp_unit): Likewise.
+
+2017-09-25 Alan Modra <amodra@gmail.com>
+
+ PR 22200
+ * dwarf2.c (read_formatted_entries): Error on format_count zero.
+
+2017-09-24 Alan Modra <amodra@gmail.com>
+
+ PR 22197
+ * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
+ within section bounds.
+
+2017-09-24 Alan Modra <amodra@gmail.com>
+
+ PR 22191
+ * dwarf2.c (decode_line_info): Properly free line sequences on error.
+
+2017-09-24 Alan Modra <amodra@gmail.com>
+
+ PR 22187
+ * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
+ pname param. Return status. Make name const. Don't abort,
+ return an error. Formatting. Exit if current info_ptr matches
+ orig_info_ptr. Update callers.
+ (scan_unit_for_symbols): Start at nesting_level of zero. Make
+ nested_funcs an array of structs for extensibility. Formatting.
+
+2017-09-24 Alan Modra <amodra@gmail.com>
+
+ PR 22186
+ * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
+ rather than dividing by zero.
+
+2017-09-24 Alan Modra <amodra@gmail.com>
+
+ PR 22169
+ * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
+
+2017-09-24 Alan Modra <amodra@gmail.com>
+
+ PR 22167
+ * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
+
+2017-09-24 Alan Modra <amodra@gmail.com>
+
+ PR 22166
+ * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
+ SHT_GNU_verneed section for sanity. Don't zalloc memory for
+ verref.
+
+2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/22170
+ * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
+ corrupted PLT.
+
+2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/22163
+ * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
+ -1 if bfd_canonicalize_dynamic_reloc returns 0.
+
+2017-09-22 Pedro Alves <palves@redhat.com>
+ Alan Modra <amodra@gmail.com>
+
+ * version.h: Add comment.
+
+2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
+ NT_S390_GS_BC, correct the previously swapped invocations of
+ elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
+
+2017-09-19 Alan Modra <amodra@gmail.com>
+
+ PR 21441
+ * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
+ size.
+
+2017-09-19 Alan Modra <amodra@gmail.com>
+
+ PR 22150
+ * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
+ symbols before calculating verrefs. Don't renumber dynsyms
+ after gc. Exclude .gnu.version when zero or one dynsym.
+ Localize some vars and reindent.
+
+2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22148
+ * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
+ return from bfd_canonicalize_dynamic_reloc.
+
+2017-09-15 Alan Modra <amodra@gmail.com>
+
+ PR 22116
+ * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
+ overflows bfd_size_type.
+
+2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22135
+ * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
+ to indicate if conversion is performed.
+ (elf_i386_check_relocs): Cache section contents and relocations
+ if conversion is performed.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
+ contents and relocations if conversion is performed.
+
+2017-09-14 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/22113
+ * peXXigen.c (pe_print_idata): Extend check for HintName vector
+ entries.
+
+2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h: Fix a typo in comments.
+
+2017-09-09 Kamil Rytarowski <n54@gmx.com>
+
+ * elf32-nds32.c: Rename __BIT() to N32_BIT().
+
+2017-09-09 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppp.c (plt_stub_pad): Handle positive and negative
+ plt_stub_align.
+
+2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): Update usage of
+ UNDEFINED_WEAK_RESOLVED_TO_ZERO.
+ (elf_i386_finish_dynamic_symbol): Likewise.
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
+ (elf_x86_64_finish_dynamic_symbol): Likewise.
+ * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
+ (_bfd_x86_elf_fixup_symbol): Likewise.
+
+2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
+ check has_non_got_reloc.
+
+2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22115
+ * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
+ Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
+ * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
+ linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
+ * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
+ and linker_def on __ehdr_start if it is referenced and not
+ defined.
+ (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
+ and return TRUE when building executable, if a symbol has
+ non-GOT/non-PLT relocations in text section or there is no
+ dynamic linker.
+ * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
+
+2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h: Update comments.
+
+2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
+ elf_x86_plt_layout_table with elf_x86_init_table.
+ * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
+ Likewise.
+ * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
+ Likewise.
+ * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
+ (elf_x86_init_table): This.
+ (_bfd_x86_elf_link_setup_gnu_properties): Replace
+ elf_x86_plt_layout_table with elf_x86_init_table.
+
+2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
+ elf64.lo together with elfxx-x86.lo for 64-bit BFD.
+ * configure: Regenerated.
+ * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
+ and r_sym fields of plt_layout.
+ * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
+ Likewise.
+ * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
+ (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
+ r_info nor r_sym fields.
+ (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
+ fields of htab.
+ * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
+
+2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
+
+ * (_bfd_riscv_relax_align): Call bfd_set_error and
+ print an error message when unable to relax a .align directive.
+
+2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
+
+ * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
+ (riscv_record_pcrel_hi_reloc): Add absolute argument.
+ (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
+ R_RISCV_PCREL_HI20 relocs, and pass the result to
+ riscv_record_pcrel_hi_reloc.
+
+2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * 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.
+
+2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
+ (elf_x86_64_info_to_howto): Get the real relocation type by
+ masking out R_X86_64_converted_reloc_bit.
+ (elf_x86_64_check_tls_transition): Get the real relocation type
+ by masking out R_X86_64_converted_reloc_bit.
+ (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
+ instead of setting converted_reloc.
+ (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
+ instead of converted_reloc. Get the real relocation type by
+ masking out R_X86_64_converted_reloc_bit.
+ (elf_x86_64_link_setup_gnu_properties): Verify that the value of
+ R_X86_64_converted_reloc_bit is valid.
+ * elfxx-x86.h (converted_reloc): Removed.
+
+2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
+ when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
+ to get the relocation type again.
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
+ r_type when calling elf_x86_64_tls_transition. Don't use
+ ELF32_R_TYPE to get the relocation type again.
+
+2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
+ converted_reloc.
+
2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec