+2018-09-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Use
+ elfclass instead of bed->s->elfclass.
+
+2018-09-27 Jim Wilson <jimw@sifive.com>
+
+ * elfnn-riscv.c (riscv_init_pcgp_relocs): Add explanatory comment.
+ (riscv_free_pcgp_relocs, riscv_record_pcgp_reloc): Likewise.
+ (riscv_find_pcgp_hi_reloc, riscv_reocrd_pcgp_lo_reloc): Likewise.
+ (riscv_find_pcgp_lo_reloc): Likewise.
+ (riscv_delete_pcgp_hi_reloc, riscv_use_pcgp_hi_reloc): Delete.
+ (riscv_delete_pcgp_lo_reloc): Likewise.
+ (_bfd_riscv_relax_pc): Don't call riscv_use_pcgp_hi_reloc. Replace
+ calls to riscv_delete_pcgp_lo_reloc and riscv_delete_pcgp_hi_reloc
+ with TRUE. Mark abfd arg as ATTRIBUTE_UNUSED.
+
+2018-09-25 Jim Wilson <jimw@sifive.com>
+
+ * elfnn-riscv.c (riscv_make_plt_header): New arg output_bfd. Change
+ return type to bfd_boolean. If EF_RISCV_RVE call _bfd_error_handler
+ and return FALSE. Return TRUE at end.
+ (riscv_make_plt_entry): Likewise.
+ (riscv_elf_finish_dynamic_symbol): Update call to riscv_make_plt_entry.
+ (riscv_elf_finish_dynamic_sections): Update call to
+ riscv_make_plt_header.
+
+2018-09-24 Jim Wilson <jimw@sifive.com>
+
+ * elfnn-riscv.c (_bfd_riscv_relax_pc) <R_RISCV_PCREL_LO12_I>: New local
+ hi_sec_off which is symbol address with addend subtracted. Use in
+ riscv_find_pcgp_hi_reloc and riscv_record_pcgp_lo_reloc calls.
+
+ * elfnn-riscv.c (riscv_resolve_pcrel_lo_relocs): Add check for reloc
+ overflow with addend. Use reloc_dangerous instead of reloc_overflow.
+ Add strings for the two errors handled here.
+ (riscv_elf_relocate_section) In case R_RISCV_PCREL_LO12_I, rewrite
+ comment. Only give error with addend when used with section symbol.
+ In case bfd_reloc_dangerous, update error string.
+
+2018-09-24 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ PR gdb/20948
+ * elf.c (_bfd_elf_write_object_contents): Return from function
+ early if abfd->direction == both_direction.
+
+2018-09-21 Simon Marchi <simon.marchi@ericsson.com>
+
+ * configure.ac: Check for fls.
+ * elf32-nds32.c (fls): Only define if !HAVE_FLS.
+ * config.in: Re-generate.
+ * configure: Re-generate.
+
+2018-09-20 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * config.bfd <rs6000-*-aix5.[01], rs6000-*-aix[5-9]*>: Remove
+ duplicate `case' selectors.
+
+2018-09-20 Nelson Chu <nelson.chu1990@gmail.com>
+
+ * elf32-nds32.c (nds32_elf_relax_loadstore):
+ Remove the unused target features.
+ (bfd_elf32_nds32_set_target_option): Remove the unused parameters.
+ (nds32_elf_relax_piclo12, nds32_elf_relax_letlslo12,
+ nds32_elf_relax_letlsadd, nds32_elf_relax_letlsls,
+ nds32_elf_relax_pltgot_suff, nds32_elf_relax_got_suff
+ nds32_elf_relax_gotoff_suff, calculate_plt_memory_address,
+ calculate_plt_offset, calculate_got_memory_address,
+ nds32_elf_check_dup_relocs): Removed.
+ All callers changed.
+ * elf32-nds32.h: Remove the unused macros and defines.
+ (elf_nds32_link_hash_table): Remove the unused variable.
+ (bfd_elf32_nds32_set_target_option): Update prototype.
+ (nds32_elf_ex9_init): Removed.
+ * elf32-nds32.c (nds32_convert_32_to_16): Updated.
+ * elf32-nds32.c (HOWTO2, HOWTO3): Define new HOWTO macros
+ to initialize array nds32_elf_howto_table in any order
+ without lots of EMPTY_HOWTO.
+ (nds32_reloc_map): Updated.
+ * reloc.c: Add BFD_RELOC_NDS32_LSI.
+ * bfd-in2.h: Regenerated.
+ * bfd/libbfd.h: Regenerated.
+ * elf32-nds32.c (nds32_elf_relax_howto_table): Add R_NDS32_LSI.
+ (nds32_reloc_map): Likewise.
+ (nds32_elf_relax_flsi): New function.
+ (nds32_elf_relax_section): Support floating load/store relaxation.
+ * elf32-nds32.c (NDS32_GUARD_SEC_P, elf32_nds32_local_gp_offset):
+ New macro.
+ (struct elf_nds32_link_hash_entry): New `offset_to_gp' field.
+ (struct elf_nds32_obj_tdata): New `offset_to_gp' and `hdr_size' fields.
+ (elf32_nds32_allocate_local_sym_info, nds32_elf_relax_guard,
+ nds32_elf_is_target_special_symbol, nds32_elf_maybe_function_sym):
+ New functions.
+ (nds32_info_to_howto_rel): Add BFD_ASSERT.
+ (bfd_elf32_bfd_reloc_type_table_lookup, nds32_elf_link_hash_newfunc,
+ nds32_elf_link_hash_table_create, nds32_elf_relocate_section,
+ nds32_elf_relax_loadstore, nds32_elf_relax_lo12, nds32_relax_adjust_label,
+ bfd_elf32_nds32_set_target_option, nds32_fag_mark_relax): Updated.
+ (nds32_elf_final_sda_base): Improve it to find the better gp value.
+ (insert_nds32_elf_blank): Must consider `len' when inserting blanks.
+ * elf32-nds32.h (bfd_elf32_nds32_set_target_option): Update prototype.
+ (struct elf_nds32_link_hash_table): Add new variable `hyper_relax'.
+ * elf32-nds32.c (elf32_nds32_allocate_dynrelocs): New function.
+ (create_got_section): Likewise.
+ (allocate_dynrelocs, nds32_elf_size_dynamic_sections,
+ nds32_elf_relocate_section, nds32_elf_finish_dynamic_symbol): Updated.
+ (nds32_elf_check_relocs): Fix the issue that the shared library may
+ has TEXTREL entry in the dynamic section.
+ (nds32_elf_create_dynamic_sections): Enable to call readonly_dynrelocs
+ since the TEXTREL issue is fixed in the nds32_elf_check_relocs.
+ (nds32_elf_finish_dynamic_sections): Update and add DT_RELASZ
+ dynamic entry.
+ (calculate_offset): Remove the unused parameter `pic_ext_target' and
+ related codes.
+ All callers changed.
+ (elf_backend_dtrel_excludes_plt): Disable it temporarily since it
+ will cause some errors for our test cases.
+ * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Allow to link the
+ generic object.
+ * reloc.c: Add TLS relocations.
+ * libbfd.h: Regenerated.
+ * bfd-in2.h: Regenerated.
+ * elf32-nds32.h (struct section_id_list_t): New.
+ (elf32_nds32_lookup_section_id, elf32_nds32_check_relax_group,
+ elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model):
+ New prototypes.
+ (elf32_nds32_compute_jump_table_size, elf32_nds32_local_tlsdesc_gotent):
+ New macro.
+ (nds32_insertion_sort, bfd_elf32_nds32_set_target_option,
+ elf_nds32_link_hash_table): Updated.
+ * elf32-nds32.c (enum elf_nds32_tls_type): New.
+ (struct elf32_nds32_relax_group_t, struct relax_group_list_t): New.
+ (elf32_nds32_add_dynreloc, patch_tls_desc_to_ie, get_tls_type,
+ fls, ones32, list_insert, list_insert_sibling, dump_chain,
+ elf32_nds32_check_relax_group, elf32_nds32_lookup_section_id,
+ elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model): New functions.
+ (elf_nds32_obj_tdata): Add new fields.
+ (elf32_nds32_relax_group_ptr, nds32_elf_local_tlsdesc_gotent): New macros.
+ (nds32_elf_howto_table): Add TLS relocations.
+ (nds32_reloc_map): Likewise.
+ (nds32_elf_copy_indirect_symbol, nds32_elf_size_dynamic_sections,
+ nds32_elf_finish_dynamic_symbol, elf32_nds32_allocate_local_sym_info,
+ nds32_elf_relocate_section, bfd_elf32_nds32_set_target_option,
+ nds32_elf_check_relocs, allocate_dynrelocs): Updated.
+ (nds32_elf_relax_section): Call nds32_elf_unify_tls_model.
+ (dtpoff_base): Rename it to `gottpof' and then update it.
+
+2018-09-20 Alan Modra <amodra@gmail.com>
+
+ PR 23685
+ * peXXigen.c (pe_print_edata): Correct export address table
+ overflow checks. Check dataoff against section size too.
+
+2018-09-20 Alan Modra <amodra@gmail.com>
+
+ PR 23686
+ * dwarf2.c (read_section): Error when attempting to malloc
+ "(bfd_size_type) -1".
+ * syms.c (_bfd_stab_section_find_nearest_line): Bounds check
+ function_name. Bounds check reloc address. Formatting. Ensure
+ .stabstr zero terminated.
+
+2018-09-18 Nick Clifton <nickc@redhat.com>
+
+ PR 23657
+ * elfcode.h (elf_swap_shdr_in): Generate a warning message if an
+ ELF section has contents and size larger than the file size.
+
+2018-09-14 Maciej W. Rozycki <macro@mips.com>
+
+ PR ld/21375
+ * elfxx-mips.h (_bfd_mips_elf_hide_symbol): New prototype.
+ (_bfd_mips_elf_linker_flags): Update prototype.
+ * elf32-mips.c (elf_backend_hide_symbol): New macro.
+ * elf64-mips.c (elf_backend_hide_symbol): Likewise.
+ * elfn32-mips.c (elf_backend_hide_symbol): Likewise.
+ * elfxx-mips.c (mips_elf_link_hash_table): Add
+ `use_absolute_zero' and `gnu_target' members.
+ (mips_elf_record_global_got_symbol): Call
+ `_bfd_mips_elf_hide_symbol' rather than
+ `_bfd_elf_link_hash_hide_symbol'.
+ (mips_use_local_got_p): Return FALSE if the symbol is absolute.
+ (mips_elf_obtain_contents): Reorder function.
+ (mips_elf_nullify_got_load): New function.
+ (mips_elf_calculate_relocation): Add `contents' parameter.
+ Nullify GOT loads or if it is not possible, then redirect GOT
+ relocations to the `__gnu_absolute_zero' symbol, for references
+ that are supposed to resolve to zero.
+ (mips_elf_define_absolute_zero): New function.
+ (_bfd_mips_elf_check_relocs): Prepare for arrangements made in
+ `mips_elf_calculate_relocation' for references made via the GOT
+ that are supposed to resolve to zero.
+ (_bfd_mips_elf_hide_symbol): New function.
+ (_bfd_mips_elf_linker_flags): Add the `gnu_target' parameter,
+ set the `gnu_target' member of the MIPS hash table.
+ (MIPS_LIBC_ABI_ABSOLUTE): New enumeration constant.
+ (_bfd_mips_post_process_headers): Use it.
+
+2018-09-14 Maciej W. Rozycki <macro@mips.com>
+
+ * elfxx-mips.c (mips_elf_store_contents): New function...
+ (mips_elf_perform_relocation): ... factored out from here.
+
+2018-09-14 Lifang Xia <lifang_xia@c-sky.com>
+
+ * elf32-csky.c (csky_elf_howto_table): Fill special_function of
+ R_CKCORE_PCREL32.
+ (csky_elf_relocate_section): Add R_CKCORE_PCREL32 process.
+
+2018-09-14 Alan Modra <amodra@gmail.com>
+
+ PR 23425
+ * reloc.c (bfd_generic_get_relocated_section_contents): Zero reloc
+ fields in debug sections when reloc is against an undefined symbol
+ and called from bfd_simple_get_relocated_section_contents or
+ similar.
+ * dwarf2.c (find_abstract_instance): Return true for zero offset
+ DW_FORM_ref_addr without returning values.
+
+2018-09-06 Alan Modra <amodra@gmail.com>
+
+ PR 23570
+ * elf32-avr.c (elf_avr_special_sections): New.
+ (elf_backend_special_sections): Define.
+
+2018-09-04 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Do not issue an
+ error when an invalid relocation is passed; this is already done
+ by `_bfd_sparc_elf_info_to_howto_ptr'.
+
+2018-09-04 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Issue an
+ error when an invalid symbol index is retrieved in ELF64_R_SYM of
+ a relocation seen in an input file.
+
+2018-09-03 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+ Alan Modra <amodra@gmail.com>
+
+ PR 23595
+ elf.c (copy_elf_program_header): When first segment contains
+ only the headers and SHT_NOBITS sections, use segment p_filesz
+ to calculate header and padding size. Use filepos of the first
+ section otherwise.
+
+2018-08-31 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/23600
+ * archures.c (bfd_arch_get_compatible): Allow an IR object with
+ unknown architecture.
+
+2018-08-31 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (num_relocs_for_offset): New function.
+ (emit_relocs_for_offset): New function.
+ (use_global_in_relocs): New function, split out from..
+ (ppc_build_one_stub): ..here. Output relocations for notoc stubs.
+ (ppc_size_one_stub): Calculate reloc count for notoc stubs.
+ (ppc64_elf_size_stubs): Don't count undefined syms in stub_globals.
+
+2018-08-31 Alan Modra <amodra@gmail.com>
+
+ * reloc.c (BFD_RELOC_PPC64_REL16_HIGH, BFD_RELOC_PPC64_REL16_HIGHA),
+ (BFD_RELOC_PPC64_REL16_HIGHER, BFD_RELOC_PPC64_REL16_HIGHERA),
+ (BFD_RELOC_PPC64_REL16_HIGHEST, BFD_RELOC_PPC64_REL16_HIGHESTA):
+ Define.
+ * elf64-ppc.c (ppc64_elf_howto_raw): Add new REL16 howtos.
+ (ppc64_elf_reloc_type_lookup): Translate new REL16 relocs.
+ (ppc64_elf_check_relocs, ppc64_elf_relocate_section): Handle them.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+2018-08-31 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c: Correct _notoc stub comments.
+ (ppc_build_one_stub): Simplify output of branch for notoc
+ long branch stub. Don't include label offset of 8 bytes in
+ "off" calculation for notoc plt stub. Don't emit insns to get pc.
+ (build_offset): Emit insns to get pc here instead.
+ (size_offset): Add 4 extra insns.
+ (plt_stub_size): Adjust for "off" and size_offset changes.
+ (ppc_size_one_stub): Rearrange code into a switch, duplicating
+ some to better match ppc_build_one_stub.
+
+2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
+
+ * archures.c (bfd_architecture): New machine
+ bfd_mach_mips_gs264e.
+ * bfd-in2.h (bfd_architecture): Likewise.
+ * cpu-mips.c (enum I_xxx): Likewise.
+ (arch_info_struct): Likewise.
+ * elfxx-mips.c (_bfd_elf_mips_mach): Handle
+ E_MIPS_MACH_GS264E.
+ (mips_set_isa_flags): Likewise.
+ (mips_mach_extensions): Map bfd_mach_mips_gs264e to
+ bfd_mach_mips_gs464e extension.
+
+2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
+
+ * archures.c (bfd_architecture): New machine
+ bfd_mach_mips_gs464e.
+ * bfd-in2.h (bfd_architecture): Likewise.
+ * cpu-mips.c (enum I_xxx): Likewise.
+ (arch_info_struct): Likewise.
+ * elfxx-mips.c (_bfd_elf_mips_mach): Handle
+ E_MIPS_MACH_GS464E.
+ (mips_set_isa_flags): Likewise.
+ (mips_mach_extensions): Map bfd_mach_mips_gs464e to
+ bfd_mach_mips_gs464 extension.
+
+2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
+
+ * archures.c (bfd_architecture): Rename
+ bfd_mach_mips_loongson_3a to bfd_mach_mips_gs464.
+ * bfd-in2.h (bfd_architecture): Likewise.
+ * cpu-mips.c (enum I_xxx): Likewise.
+ (arch_info_struct): Likewise.
+ * elfxx-mips.c (_bfd_elf_mips_mach): Likewise.
+ (mips_set_isa_flags): Likewise.
+ (mips_mach_extensions): Likewise.
+ (bfd_mips_isa_ext_mach): Likewise.
+ (bfd_mips_isa_ext): Likewise.
+ (print_mips_isa_ext): Delete AFL_EXT_LOONGSON_3A.
+
+2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
+
+ * elfxx-mips.c (print_mips_ases): Add Loongson EXT2 extension.
+
+2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
+
+ * elfxx-mips.c (infer_mips_abiflags): Use ases instead of
+ isa_ext for infer ABI flags.
+ (print_mips_ases): Add Loongson EXT extension.
+
+2018-08-29 Chenghua Xu <paul.hua.gm@gmail.com>
+
+ * elfxx-mips.c (print_mips_ases): Add CAM extension.
+
+2018-08-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Don't mask
+ out the GNU_PROPERTY_X86_UINT32_VALID bit.
+
+2018-08-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/23499
+ * elf.c (_bfd_elf_get_symbol_version_string): Return
+ _("<corrupt>") for corrupt symbol version info.
+
+2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Handle
+ X86_COMPAT_ISA_1_USED, X86_COMPAT_ISA_1_NEEDED,
+ X86_UINT32_AND_LO, X86_UINT32_AND_HI, X86_UINT32_OR_LO,
+ X86_UINT32_OR_HI, X86_UINT32_OR_AND_LO and X86_UINT32_OR_AND_HI
+ instead of X86_ISA_1_USED, X86_ISA_1_NEEDED and X86_FEATURE_1_AND.
+ (_bfd_x86_elf_merge_gnu_properties): Likewise.
+ (_bfd_x86_elf_link_setup_gnu_properties): Add X86_FEATURE_2_NEEDED
+ instead of X86_ISA_1_NEEDED.
+ (_bfd_x86_elf_link_fixup_gnu_properties): Handle
+ X86_COMPAT_ISA_1_USED, X86_COMPAT_ISA_1_NEEDED, X86_UINT32_AND_LO,
+ X86_UINT32_AND_HI, X86_UINT32_OR_LO, X86_UINT32_OR_HI,
+ X86_UINT32_OR_AND_LO and X86_UINT32_OR_AND_HI instead of
+ X86_ISA_1_USED, X86_ISA_1_NEEDED and X86_FEATURE_1_AND.
+
+2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Mask out the
+ GNU_PROPERTY_X86_UINT32_VALID bit.
+ (_bfd_x86_elf_link_fixup_gnu_properties): Set the
+ GNU_PROPERTY_X86_UINT32_VALID bit for non-relocatable output.
+
+2018-08-23 Zenith423 <zenith432@users.sourceforge.net>
+
+ PR 23460
+ * plugin.c (struct plugin_list_entry): New structure.
+ (plugin_list): New variable.
+ (try_load_plugin): Place opened plugins on a list. Ensure that
+ the refcount in the dynamic loader is kept at 1.
+
+2018-08-23 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Revise "call lacks
+ nop" error message.
+
+2018-08-23 Nick Clifton <nickc@redhat.com>
+
+ * elf64-hppa.c (elf_hppa_final_link_relocate): Replace unworkable
+ code with an assertion.
+
+2018-08-23 Nick Clifton <nickc@redhat.com>
+
+ PR 23061
+ * coffgen.c (coff_pointerize_aux): Add table_end parameter. Use
+ it to prevent walking off the end of the table.
+ (coff_get_normalized_symtab): Pass internal_end pointer to
+ coff_pointerize_aux.
+
+2018-08-23 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Don't miss clearing
+ unresolved_reloc on ppc_stub_plt_call_notoc.
+
+2018-08-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/23536
+ * development.sh (experimental): New.
+
+2018-08-22 Helge Deller <deller@gmx.de>
+ Nick Clifton <nickc@redhat.com>
+
+ * elf-hppa.h (elf_hppa_fake_sections): Use SHT_PARISC_UNWIND as
+ the section type of the .PARISC.unwind section on 64-bit binaries
+ and SHT_PROGBITS for 32-bit binaries. Add a comment about it.
+ Add comment about the sh_entsize value.
+
+2018-08-22 Rafeal Auler <rafaelauler@gmail.com>
+
+ PR 23560
+ * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Always update the
+ stub's target, since it may have been changed after the layout.
+
+2018-08-21 John Darington <john@darrington.wattle.id.au>
+
+ * elf32-s12z.c (opru18_reloc): New function.
+ (elf_s12z_howto_table): Adjust Howto according to new knowledge.
+
+2018-08-21 mephi42 <mephi42@gmail.com>
+
+ PR binutils/23315
+ * mach-o.c (bfd_mach_o_mangle_symbols): Update n_type even if
+ data is already considered filled.
+
2018-08-21 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (HOW): Define.