2021-03-30 Alan Modra * elflink.c (elf_link_add_object_symbols): Don't set h->indx unless is_elf_hash_table. 2021-03-29 Alan Modra * aoutx.h (aout_link_write_symbols): Don't cast boolean expression to bfd_boolean. * elf32-or1k.c (or1k_set_got_and_rela_sizes): Dont compare booleans against FALSE. * elf32-arc.c (name_for_global_symbol): Don't compare boolean to TRUE. (is_reloc_PC_relative): Don't use "boolean_condition ? TRUE : FALSE". (is_reloc_SDA_relative, is_reloc_for_GOT): Likewise. (is_reloc_for_PLT, is_reloc_for_TLS): Likewise. * elf32-arm.c (stm32l4xx_need_create_replacing_stub): Likewise. * elf32-nds32.c (insert_nds32_elf_blank): Likewise. * elf32-rx.c (rx_set_section_contents): Likewise. * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise. * elfxx-mips.c (_bfd_mips_elf_ignore_undef_symbol): Likewise. * mach-o.c (bfd_mach_o_read_command): Likewise. * targets.c (bfd_get_target_info): Likewise. 2021-03-29 Alan Modra * coff-z80.c (z80_is_local_label_name): Return bfd_boolean. * elf32-z80.c (z80_is_local_label_name): Likewise. * elf32-spu.c (spu_elf_modify_headers): Likewise. * elf32-nds32.h (struct elf_nds32_link_hash_table ): Change type to int. * vms-lib.c (_bfd_vms_lib_write_archive_contents): Correct test for error return from vms_write_data_block. 2021-03-29 Alan Modra * elf32-i386.c (elf_i386_finish_local_dynamic_symbol): Return int. * elf64-ia64-vms.c (elf64_ia64_local_dyn_info_free): Likewise. (elf64_ia64_local_dyn_sym_thunk): Likewise. * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol): Likewise. * elfnn-aarch64.c (elfNN_aarch64_allocate_local_ifunc_dynrelocs), (elfNN_aarch64_finish_local_dynamic_symbol): Likewise. * elfnn-ia64.c (elfNN_ia64_local_dyn_info_free): Likewise. (elfNN_ia64_local_dyn_sym_thunk): Likewise. * elfnn-riscv.c (allocate_local_ifunc_dynrelocs): Likewise. (riscv_pcrel_reloc_eq): Likewise. (riscv_elf_finish_local_dynamic_symbol): Likewise. * elfxx-sparc.c (allocate_local_dynrelocs): Likewise. (finish_local_dynamic_symbol): Likewise. * elfxx-x86.c (elf_x86_allocate_local_dynreloc): Likewise. * elfxx-mips.c (mips_elf_resolve_got_page_ref): Likewise. (mips_elf_count_got_symbols): Change return type to bfd_boolean. 2021-03-29 Alan Modra * elflink.c (elf_link_output_symstrtab): Make flinfo parameter a void pointer. (bfd_elf_final_link): Delete out_sym_func typedef and don't cast elf_link_output_symstrtab when calling output_arch_syms and output_arch_local_syms. * elf-bfd.h (struct elf_backend_data ): Change return type of func arg to match elf_link_output_symstrtab. * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Correct return type. * elf32-nds32.c (nds32_elf_output_symbol_hook): Correct return type. (nds32_elf_output_arch_syms): Correct func return type. 2021-03-29 Alan Modra * elf-m10200.c (mn10200_elf_relocate_section): Return int. * elf-m10300.c (mn10300_elf_relocate_section): Likewise. * elf32-arc.c (elf_arc_relocate_section): Likewise. * elf32-arm.c (elf32_arm_relocate_section): Likewise. * elf32-avr.c (elf32_avr_relocate_section): Likewise. * elf32-bfin.c (bfin_relocate_section): Likewise. (bfinfdpic_relocate_section): Likewise. * elf32-cr16.c (elf32_cr16_relocate_section): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. * elf32-crx.c (elf32_crx_relocate_section): Likewise. * elf32-csky.c (csky_elf_relocate_section): Likewise. * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. * elf32-epiphany.c (epiphany_elf_relocate_section): Likewise. * elf32-fr30.c (fr30_elf_relocate_section): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-ft32.c (ft32_elf_relocate_section): Likewise. * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. * elf32-i386.c (elf_i386_relocate_section): Likewise. * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. * elf32-lm32.c (lm32_elf_relocate_section): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. * elf32-m68hc1x.h (elf32_m68hc11_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-mep.c (mep_elf_relocate_section): Likewise. * elf32-metag.c (elf_metag_relocate_section): Likewise. * elf32-microblaze.c (microblaze_elf_relocate_section): Likewise. * elf32-moxie.c (moxie_elf_relocate_section): Likewise. * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. * elf32-mt.c (mt_elf_relocate_section): Likewise. * elf32-nds32.c (nds32_elf_relocate_section): Likewise. * elf32-nios2.c (nios2_elf32_relocate_section): Likewise. * elf32-or1k.c (or1k_elf_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-pru.c (pru_elf32_relocate_section): Likewise. * elf32-rl78.c (rl78_elf_relocate_section): Likewise. * elf32-rx.c (rx_elf_relocate_section): Likewise. * elf32-s390.c (elf_s390_relocate_section): Likewise. * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. (_bfd_score_elf_relocate_section): Likewise. * elf32-score.h (s7_bfd_score_elf_relocate_section): Likewise. * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise. * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section): Likewise. * elf32-vax.c (elf_vax_relocate_section): Likewise. * elf32-visium.c (visium_elf_relocate_section): Likewise. * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. * elf32-z80.c (z80_elf_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise. (elf64_alpha_relocate_section): Likewise. * elf64-bpf.c (bpf_elf_relocate_section): Likewise. * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise. * elf64-mmix.c (mmix_elf_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise. * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise. * elfnn-riscv.c (riscv_elf_relocate_section): Likewise. * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. * elfxx-mips.h (_bfd_mips_elf_relocate_section): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. * elfxx-sparc.h (_bfd_sparc_elf_relocate_section): Likewise. * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise. * elfxx-tilegx.h (tilegx_elf_relocate_section): Likewise. 2021-03-26 Keith Seitz * elfcore.h (_bfd_elf_core_find_build_id): Seek file offset of program headers after calling elf_read_notes. 2021-03-23 Jan Beulich * dwarf2.c (read_indexed_string): Rename index to idx. 2021-03-22 Martin Liska * bfd-in.h (startswith): Add startswith function. (CONST_STRNEQ): Remove. * bfd-in2.h (startswith): Regenerate with make headers. * archive.c (bfd_slurp_armap): Replace usage of CONST_STRNEQ with startswith. (_bfd_slurp_extended_name_table): Likewise. * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise. * bfd.c (bfd_get_sign_extend_vma): Likewise. (bfd_convert_section_size): Likewise. (bfd_convert_section_contents): Likewise. * coff-stgo32.c (go32exe_create_stub): Likewise. (go32exe_check_format): Likewise. * coffcode.h (styp_to_sec_flags): Likewise. (GNU_DEBUGALTLINK): Likewise. * coffgen.c (_bfd_coff_section_already_linked): Likewise. (coff_gc_sweep): Likewise. (bfd_coff_gc_sections): Likewise. * cofflink.c (coff_link_add_symbols): Likewise. (process_embedded_commands): Likewise. * compress.c (bfd_is_section_compressed_with_header): Likewise. (bfd_init_section_decompress_status): Likewise. * dwarf2.c (find_debug_info): Likewise. (place_sections): Likewise. * ecoff.c (_bfd_ecoff_slurp_armap): Likewise. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise. * elf.c (_bfd_elf_make_section_from_shdr): Likewise. (assign_section_numbers): Likewise. (elfcore_grok_win32pstatus): Likewise. * elf32-arm.c (cmse_scan): Likewise. (elf32_arm_gc_mark_extra_sections): Likewise. (elf32_arm_size_dynamic_sections): Likewise. (is_arm_elf_unwind_section_name): Likewise. * elf32-bfin.c (bfin_size_dynamic_sections): Likewise. * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise. * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. * elf32-csky.c (csky_elf_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise. * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise. * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-metag.c (elf_metag_size_dynamic_sections): Likewise. * elf32-msp430.c (msp430_elf_relax_delete_bytes): Likewise. * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise. * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise. * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf32-tic6x.c (is_tic6x_elf_unwind_section_name): Likewise. (elf32_tic6x_size_dynamic_sections): Likewise. * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise. (xtensa_is_insntable_section): Likewise. (xtensa_is_littable_section): Likewise. (xtensa_is_proptable_section): Likewise. (xtensa_property_section_name): Likewise. (xtensa_callback_required_dependence): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. * elf64-ia64-vms.c (is_unwind_section_name): Likewise. (get_reloc_section): Likewise. (elf64_ia64_size_dynamic_sections): Likewise. (elf64_ia64_object_p): Likewise. * elf64-mmix.c (mmix_elf_add_symbol_hook): Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elflink.c (elf_link_add_object_symbols): Likewise. (_bfd_elf_gc_mark_extra_sections): Likewise. (bfd_elf_parse_eh_frame_entries): Likewise. (_bfd_elf_section_already_linked): Likewise. * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise. * elfnn-ia64.c (is_unwind_section_name): Likewise. (elfNN_ia64_size_dynamic_sections): Likewise. (elfNN_ia64_object_p): Likewise. * elfxx-mips.c (FN_STUB_P): Likewise. (CALL_STUB_P): Likewise. (CALL_FP_STUB_P): Likewise. (_bfd_mips_elf_section_from_shdr): Likewise. (_bfd_mips_elf_fake_sections): Likewise. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_final_write_processing): Likewise. (_bfd_mips_elf_final_link): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elfxx-x86.c (elf_i386_is_reloc_section): Likewise. (elf_x86_64_is_reloc_section): Likewise. * hpux-core.c (thread_section_p): Likewise. * libcoff.h (bfd_pei_p): Likewise. * linker.c (REAL): Likewise. (unwrap_hash_lookup): Likewise. (_bfd_generic_link_add_one_symbol): Likewise. * mmo.c (mmo_internal_write_section): Likewise. * osf-core.c (osf_core_core_file_p): Likewise. * pef.c (bfd_pef_print_symbol): Likewise. * pei-x86_64.c (pex64_print_all_pdata_sections): Likewise. * som.c (som_slurp_symbol_table): Likewise. (som_slurp_armap): Likewise. * wasm-module.c (wasm_compute_custom_section_file_position): Likewise. 2021-03-22 Jan Beulich * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Add missing language translation wrapping to _bfd_error_handler() invocations. 2021-03-21 Alan Modra * bfd-in.h (startswith): New inline. (CONST_STRNEQ): Use startswith. * bfd-in2.h: Regenerate. 2021-03-20 Alan Modra PR 27590 * elf.c (_bfd_elf_make_section_from_shdr): Remove SHF_EXCLUDE test for .gnu.debuglto*. 2021-03-18 H.J. Lu PR ld/27590 * elf.c (_bfd_elf_make_section_from_shdr): Treat .gnu.debuglto_.debug_ section as debugging section unless it is marked with SHF_EXCLUDE. * elflink.c (elf_create_symbuf): Revert commit 994b2513281. (bfd_elf_match_symbols_in_sections): Ignore section symbols when matching non-debugging sections or linkonce section with comdat section. 2021-03-18 H.J. Lu PR ld/27587 * dwarf2.c (read_attribute_value): Check version >= 3 for DW_FORM_ref_addr. 2021-03-16 Nick Clifton * peXXigen.c (_bfd_XXi_swap_aux_out): Avoid potential buffer overrun by using sizeof of the destination x_fname field as the limit for a memcpy. 2021-03-16 Kuan-Lin Chen * elfxx-riscv.c (riscv_std_z_ext_strtab): Add zba, zbb and zbc. 2021-03-12 Clément Chigot * reloc.c (BFD_RELOC_PPC_TLS_LE, BFD_RELOC_PPC_TLS_IE, BFD_RELOC_PPC_TLS_M, BFD_RELOC_PPC_TLS_ML, BFD_RELOC_PPC64_TLS_GD, BFD_RELOC_PPC64_TLS_LD, BFD_RELOC_PPC64_TLS_LE, BFD_RELOC_PPC64_TLS_IE, BFD_RELOC_PPC64_TLS_M, BFD_RELOC_PPC64_TLS_ML): New relocations. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * coff-rs6000.c (xcoff_calculate_relocation): Call xcoff_reloc_type_tls for TLS relocations. (xcoff_howto_table): Implement TLS relocations. (_bfd_xcoff_reloc_type_lookup): Add cases TLS relocations. (xcoff_reloc_type_tls): New function. * coff64-rs6000.c (xcoff_calculate_relocation): Likewise. (xcoff_howto_table): Likewise. (_bfd_xcoff_reloc_type_lookup): Likewise. * coffcode.h (sec_to_styp_flags): Handle TLS sections. (styp_to_sec_flags): Likewise. (coff_compute_section_file_positions): Avoid file offset optimisation for .data when the previous section is .tdata. (coff_write_object_contents): Handle TLS sections. * coffswap.h (coff_swap_aouthdr_out): Add support for new fields in aouthdr. * libxcoff.h (xcoff_reloc_type_tls): Add prototype. * xcofflink.c (xcoff_link_add_symbols): Handle XMC_UL. (xcoff_need_ldrel_p): Add cases for TLS relocations. (xcoff_create_ldrel): Add l_symndx for TLS sections. 2021-03-12 Clément Chigot * reloc.c (BFD_RELOC_PPC_TOC16_HI, BFD_RELOC_PPC_TOC16_LO): New relocations. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * coff-rs6000.c (xcoff_calculate_relocation): Call xcoff_reloc_type_toc for R_TOCU and R_TOCL. (xcoff_howto_table): Remove src_mask for TOC relocations. Add R_TOCU and R_TOCL howtos. (_bfd_xcoff_reloc_type_lookup): Add cases for BFD_RELOC_PPC_TOC16_HI and BFD_RELOC_PPC_TOC16_LO. (xcoff_reloc_type_toc): Compute the whole offset. Implement R_TOCU and R_TOCL. * coff64-rs6000.c (xcoff64_calculate_relocation): Likewise. (xcoff64_howto_table): Likewise. (xcoff64_reloc_type_lookup): Likewise. 2021-03-12 Clément Chigot * coff-rs6000.c (xcoff_calculate_relocation): Correct and add new relocations. (xcoff_howto_table): Likewise. (xcoff_rtype2howto): Increase r_type maximum value. (xcoff_ppc_relocate_section): Reuse predefined HOWTOs instead of create a new one from scratch. Enable only some relocations to have a changing r_size. * coff64-rs6000.c (xcoff64_calculate_relocation): Likewise. (xcoff64_howto_table): Likewise. (xcoff64_rtype2howto): Likewise. (xcoff64_ppc_relocate_section): Likewise. * libxcoff.h (XCOFF_MAX_CALCULATE_RELOCATION): Fix value. 2021-03-12 Clément Chigot * coff64-rs6000.c (xcoff64_ppc_relocate_section): Move. 2021-03-12 Clément Chigot * coff64-rs6000.c (xcoff64_write_object_contents): Remove. * coffcode.h (coff_write_object_contents): Add bfd_mach_ppc_620 support for o_cputype field. Avoid creating an empty a.out header for XCOFF64. 2021-03-12 Clément Chigot * coff64-rs6000.c (xcoff64_create_csect_from_smclas): Add missing smclass. 2021-03-11 Nelson Chu * elfnn-riscv.c (riscv_elf_link_hash_table): New boolean restart_relax, used to check if we need to run the whole relaxations from relax pass 0 to 2 again. (riscv_elf_link_hash_table_create): Init restart_relax to FALSE. (_bfd_riscv_relax_align): Remove obsolete sec_flg0 set. (_bfd_riscv_relax_delete): Set again to TRUE if we do delete the code. (bfd_elfNN_riscv_restart_relax_sections): New function. Called by after_allocation to check if we need to run the whole relaxations again. (_bfd_riscv_relax_section): We will only enter into the relax pass 3 when the restart_relax is FALSE; At last set restart_relax to TRUE if again is TRUE, too. * elfxx-riscv.h (bfd_elf32_riscv_restart_relax_sections): Declaration. (bfd_elf64_riscv_restart_relax_sections): Likewise. 2021-03-10 Jan Beulich * cofflink.c (_bfd_coff_write_global_sym): Range-check symbol offset. 2021-03-10 Alan Modra Jan Beulich * elf.c (bfd_elf_generic_reloc): Make references between debug sections use section relative values. 2021-03-09 Jan Beulich * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Diagnose out of range RVA. 2021-03-05 H.J. Lu PR ld/27425 PR ld/27432 * bfd.c (_bfd_get_link_info): New function. * elf-bfd.h (output_elf_obj_tdata): Add link_info. (elf_link_info): New. * libbfd-in.h (_bfd_get_link_info): New prototype. * coff-x86_64.c (coff_amd64_reloc): Also subtract __ImageBase for R_AMD64_IMAGEBASE when generating x86-64 ELF executable. * pe-x86_64.c: Include "coff/internal.h" and "libcoff.h". (pex64_link_add_symbols): New function. (coff_bfd_link_add_symbols): New macro. * libbfd.h: Regenerated. 2021-03-05 Craig Blackmore Andrew Burgess * elf-bfd.h (elfcore_write_riscv_csr): Declare. * elf.c (elfcore_grok_riscv_csr): New function. (elfcore_grok_note): Handle NT_RISCV_CSR. (elfcore_write_riscv_csr): New function. (elfcore_write_register_note): Handle '.reg-riscv-csr'. 2021-03-05 Craig Blackmore Andrew Burgess * elfnn-riscv.c (PRPSINFO_PR_FNAME_LENGTH): Define. (PRPSINFO_PR_PSARGS_LENGTH): Define. (riscv_write_core_note): New function. (riscv_elf_grok_psinfo): Make use of two new length defines. (elf_backend_write_core_note): Define. 2021-03-05 Craig Blackmore Andrew Burgess * elf-bfd.h (elfcore_write_gdb_tdesc): Declare new function. * elf.c (elfcore_grok_gdb_tdesc): New function. (elfcore_grok_note): Handle NT_GDB_TDESC. (elfcore_write_gdb_tdesc): New function. (elfcore_write_register_note): Handle NT_GDB_TDESC. 2021-03-05 Nick Clifton PR 27521 * dwarf2.c (is_str_attr): Add DW_FORM_strx* forms. (read_indexed_string): Placeholder function. (read_attribute_value): Handle DW_FORM_strx* and DW_FORM_addrx* forms. 2021-03-05 Alan Modra * reloc.c (bfd_perform_relocation): Revert 2021-01-12 and 2020-09-16 changes. * coff-x86_64.c (coff_amd64_reloc): Do more or less the same adjustments here instead. Separate pc-relative adjustments from symbol related adjustments. Tidy comments and formatting. 2021-03-04 Jan Beulich * coffcode.h (sec_to_styp_flags): Don't set IMAGE_SCN_LNK_* in final PE images. 2021-03-04 Alan Modra * rs6000-core.c (rs6000coff_core_p): Correct prototype. 2021-03-03 Alan Modra PR 27500 * elflink.c (_bfd_elf_gc_mark_rsec): Do special start/stop processing not when start/stop symbol section is unmarked but on first time a start/stop symbol is processed. 2021-03-03 Alan Modra * reloc.c: Include x86_64.h rather than internal.h. 2021-03-02 Nick Clifton PR 27484 * dwarf2.c (scan_unit_for_symbols): Scan twice, once to accumulate function and variable tags and a second time to resolve their attributes. 2021-03-02 Nick Alcock * elf-strtab.c (_bfd_elf_strtab_str): Skip strings with zero refcount. 2021-03-02 Alan Modra PR 27451 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore synthesized linker defined start/stop symbols when start_stop_gc. 2021-03-02 Alan Modra * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimise got indirect to pc-relative or toc-relative for undefined symbols. 2021-03-01 Alan Modra Fangrui Song * elflink.c (_bfd_elf_gc_mark_rsec): Ignore synthesized linker defined start/stop symbols when start_stop_gc. (bfd_elf_gc_mark_dynamic_ref_symbol): Likewise. (bfd_elf_define_start_stop): Don't modify ldscript_def syms. * linker.c (bfd_generic_define_start_stop): Likewise. 2021-02-25 Alan Modra PR 27441 * elf-bfd.h (struct elf_link_hash_entry): Add ref_ir_nonweak. * elflink.c (elf_link_add_object_symbols): Set ref_ir_nonweak and use when deciding an as-needed library should be loaded instead of using the binding of the library definition. 2021-02-24 Alan Modra PR 27459 * coff-stgo32.c (go32exe_check_format): Sanity check size of header to avoid a buffer overflow. 2021-02-22 Alan Modra * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Remove BFD_RELOC_16. * coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise. 2021-02-19 Nelson Chu PR 27158 * elfnn-riscv.c (perform_relocation): Updated encoding macros. (_bfd_riscv_relax_call): Likewise. (_bfd_riscv_relax_lui): Likewise. * elfxx-riscv.c (howto_table): Likewise. 2021-02-18 Nelson Chu * Makefile.am: Added cpu-riscv.h. * Makefile.in: Regenerated. * po/SRC-POTFILES.in: Regenerated. * cpu-riscv.h: Added to support spec versions controlling. Also added extern arrays and functions for cpu-riscv.c. (enum riscv_spec_class): Define all spec classes here uniformly. (struct riscv_spec): Added for all specs. (RISCV_GET_SPEC_CLASS): Added to reduce repeated code. (RISCV_GET_SPEC_NAME): Likewise. (RISCV_GET_ISA_SPEC_CLASS): Added to get ISA spec class. (RISCV_GET_PRIV_SPEC_CLASS): Added to get privileged spec class. (RISCV_GET_PRIV_SPEC_NAME): Added to get privileged spec name. * cpu-riscv.c (struct priv_spec_t): Replaced with struct riscv_spec. (riscv_get_priv_spec_class): Replaced with RISCV_GET_PRIV_SPEC_CLASS. (riscv_get_priv_spec_name): Replaced with RISCV_GET_PRIV_SPEC_NAME. (riscv_priv_specs): Moved below. (riscv_get_priv_spec_class_from_numbers): Likewise, updated. (riscv_isa_specs): Moved from include/opcode/riscv.h. * elfnn-riscv.c: Included cpu-riscv.h. (riscv_merge_attributes): Initialize in_priv_spec and out_priv_spec. * elfxx-riscv.c: Included cpu-riscv.h and opcode/riscv.h. (RISCV_UNKNOWN_VERSION): Moved from include/opcode/riscv.h. * elfxx-riscv.h: Removed extern functions to cpu-riscv.h. 2021-02-17 Alan Modra * wasm-module.c: Guard include of limits.h. (CHAR_BIT): Provide backup define. (wasm_read_leb128): Use CHAR_BIT to size "result" in bits. Correct signed overflow checking. 2021-02-17 Nelson Chu PR 27200 * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Delay copying the elf flags from input BFD to output BFD, until we have checked if the input BFD has no code section or not. Also fix the problem that we only check the first section rather than the entire sections for input BFD. 2021-02-16 Alan Modra * libbfd.c (_bfd_read_unsigned_leb128): Avoid excessive shift. (_bfd_safe_read_leb128, _bfd_read_signed_leb128): Likewise. 2021-02-15 Jan Beulich * doc/Makefile.am: Replace "cp -p" by "$(LN_S)". * doc/Makefile.in: Re-generate. 2021-02-15 Alan Modra * elf32-nds32.c (nds32_get_section_contents): Replace bfd_malloc_and_get_section with bfd_get_full_section_contents. (nds32_elf_relax_delete_blanks): Init contents. (nds32_elf_relax_section, nds32_relax_fp_as_gp): Likewise. 2021-02-15 Alan Modra * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use bfd_get_full_section_contents. 2021-02-14 Alan Modra * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Apply all fixes to bfd_generic_get_relocated_section_contents since this function was split out. 2021-02-11 Alan Modra * config.bfd: Remove ia64 from obsolete list. 2021-02-11 Alan Modra PR ld/22269 * elfnn-ia64.c: Revert 2017-10-14 git commit db41f6eb5234. 2021-02-11 Alan Modra PR 27294 * elf32-avr.c (avr_elf32_load_records_from_section): Use bfd_malloc_and_get_section. Use bfd_byte* vars and remove then unnecessary casts. 2021-02-11 Alan Modra PR 27291 * section.c (bfd_get_section_contents): Avoid possible overflow when range checking offset and count. (bfd_set_section_contents): Likewise. 2021-02-03 Nick Alcock * configure.ac (SHARED_LIBADD): Remove explicit -lintl population in favour of LIBINTL. * configure: Regenerated. 2021-02-09 Alan Modra * config.bfd (arm*-*-symbianelf*): Move from obsolete to removed. * configure.ac: Delete symbian entries. * elf-bfd.h (enum elf_target_os): Delete is_symbian. * elf32-arm.c: Remove symbian support. Formatting. * targets.c: Delete symbian entries. * configure: Regenerate. 2021-02-04 H.J. Lu PR ld/19609 * elf64-x86-64.c (elf_x86_64_relocate_section): Provide more info when failed to convert GOTPCREL relocation. 2021-02-04 Nelson Chu * elfxx-riscv.c (riscv_parse_prefixed_ext): Removed zb*. 2021-02-04 Alan Modra PR 27311 * elflink.c (elf_link_add_object_symbols): Don't pull in as-needed libraries for IR references on pass over libraries after LTO recompilation. 2021-02-03 Alan Modra PR 27311 * elflink.c (_bfd_elf_add_default_symbol): Revert last two changes. (elf_link_add_object_symbols): Here too. Don't pull in as-needed libraries when H is an indirect symbol after calling _bfd_elf_add_default_symbol. 2021-02-03 Alan Modra PR 27311 * elflink.c (_bfd_elf_add_default_symbol): Clear override when undecorated symbol will have a different version. 2021-02-02 Alan Modra PR 27311 * elflink.c (_bfd_elf_add_default_symbol): Add override parameter. Use when handling default versioned symbol. Rename existing override variable to nondef_override and use for non-default versioned symbol. (elf_link_add_object_symbols): Adjust call to suit. Don't pull in as-needed libraries when override is set. 2021-02-01 Emery Hemingway * config.bfd: Add *-*-genode* as a target for AArch64 and x86. 2021-02-01 Egor Vishnyakov PR 27254 * elf32-rl78.c (rl78_elf_relocate_section): Fix calculation of offset for the R_RL78_RH_SADDR relocation. 2021-01-29 Alan Modra PR 27271 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't segfault on symbols defined in absolute or other special sections. 2021-01-28 Alan Modra PR 27259 * elflink.c (_bfd_elf_gc_mark_extra_sections): Use linker_mark to prevent endless looping of linked-to sections. 2020-12-17 Mihails Strasuns * bfd-elf.h (elfcore_write_file_note): New function. * elf.c (elfcore_write_file_note): New function. 2021-01-26 Alan Modra * elf32-ft32.c (ft32_reloc_type_lookup): Don't miss ft32_reloc_map[0]. 2021-01-24 H.J. Lu PR binutils/27231 * dwarf2.c (read_rnglists): Ignore empty range when parsing line number tables. 2021-01-23 H.J. Lu PR binutils/27231 * dwarf2.c (read_rnglists): Advance rngs_ptr after _bfd_safe_read_leb128 when parsing DW_RLE_offset_pair. 2021-01-20 Alan Modra * elf32-ppc.c: Delete outdated comment. (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define. * elf64-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define. 2021-01-20 Alan Modra * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't assume section symbols are present. 2021-01-19 Alan Modra * elf64-ppc.c (elf_hash_entry): New inline function. Use throughout to replace casts. (branch_reloc_hash_match): Remove const from params. (use_local_plt): New function. (allocate_dynrelocs, ppc_build_one_stub, ppc_size_one_stub), (build_global_entry_stubs_and_plt, ppc64_elf_relocate_section): Use use_local_plt. * elf32-ppc.c (use_local_plt): New function. (allocate_dynrelocs, ppc_elf_relocate_section), (write_global_sym_plt): Use use_local_plt. 2021-01-17 H.J. Lu PR ld/27193 * elflink.c (elf_create_symbuf): Also ignore section symbols. 2021-01-16 H.J. Lu PR ld/23169 * elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): Don't check pointer_equality_needed. 2021-01-15 H.J. Lu * elf-linker-x86.h (elf_linker_x86_params): Add report_relative_reloc. * elf32-i386.c (elf_i386_relocate_section): Call _bfd_x86_elf_link_report_relative_reloc to report relative relocations for -z report-relative-reloc. (elf_i386_finish_dynamic_symbol): Likewse. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewse. (elf_x86_64_finish_dynamic_symbol): Likewse. * elfxx-x86.c (_bfd_x86_elf_link_report_relative_reloc): New function. * elfxx-x86.h (_bfd_x86_elf_link_report_relative_reloc): New prototype. 2021-01-16 Alan Modra * compress.c (decompress_contents): Tidy inflateEnd result test. 2021-01-16 Alan Modra PR 26002 * elflink.c (elf_link_output_extsym): Use version 1 in .gnu.version for undefined unversioned symbols. 2021-01-15 Nelson Chu * elfnn-riscv.c (riscv_relax_delete_bytes): Fixed the indent that caused the by previous commit accidentally. 2021-01-15 Nelson Chu * elfnn-riscv.c: Indent, labels and GNU coding standards tidy, also aligned the code. 2021-01-15 Nelson Chu * elfnn-riscv.c (riscv_merge_attributes): Fix typos of messages. 2021-01-15 Nelson Chu * elfnn-riscv.c: Comments tidy and improvement. * elfxx-riscv.c: Likewise. * elfxx-riscv.h: Likewise. 2021-01-14 H.J. Lu PR ld/26688 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC section for R_BFIN_FUNCDESC. 2021-01-14 Nick Clifton * elf.c (elfcore_grok_win32pstatus): Check for a note type of 0. 2021-01-13 Alan Modra * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. 2021-01-13 Alan Modra PR 27160 * section.c (struct bfd_section): Remove pattern field. (BFD_FAKE_SECTION): Adjust to suit. * bfd-in2.h: Regenerate. * elflink.c (compare_link_order, elf_fixup_link_order): Delete. (bfd_elf_final_link): Don't call elf_fixup_link_order. 2021-01-12 H.J. Lu PR binutils/26792 * configure.ac: Use GNU_MAKE_JOBSERVER. * aclocal.m4: Regenerated. * configure: Likewise. 2021-01-12 H.J. Lu PR ld/27171 * reloc.c (bfd_perform_relocation): Adjust R_AMD64_DIR64 and R_AMD64_DIR32 relocations for PE/x86-64 inputs. 2021-01-11 H.J. Lu PR ld/27173 * configure: Regenerated. 2021-01-11 Nick Clifton * po/fr.po: Updated French translation. * po/pt.po: Updated Portuguese translation. * po/sr.po: Updated Serbian translation. * po/uk.po: Updated Ukranian translation. 2021-01-09 H.J. Lu * configure: Regenerated. 2021-01-09 H.J. Lu PR ld/27166 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle -z lam-u48 and -z lam-u57. 2021-01-09 Nick Clifton * version.m4: Change to 2.36.50. * configure: Regenerate. * po/bfd.pot: Regenerate. 2021-01-09 Nick Clifton * 2.36 release branch crated. 2021-01-08 H.J. Lu * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Also set LAM_U57 when setting LAM_U48. 2021-01-08 H.J. Lu PR ld/26256 PR ld/27160 * elflink.c (elf_fixup_link_order): Verify that fixing up SHF_LINK_ORDER doesn't increase the output section size. 2021-01-09 Alan Modra * configure: Regenerate. 2021-01-07 Samuel Thibault * configure: Regenerate. 2021-01-07 H.J. Lu PR 27109 * aix386-core.c (core_aix386_vec): Initialize keep_unused_section_symbol to TARGET_KEEP_UNUSED_SECTION_SYMBOLS. * aout-target.h (MY (vec)): Likewise. * binary.c (binary_vec): Likewise. * cisco-core.c (core_cisco_be_vec): Likewise. (core_cisco_le_vec): Likewise. * coff-alpha.c (alpha_ecoff_le_vec): Likewise. * coff-i386.c (TARGET_SYM): Likewise. (TARGET_SYM_BIG): Likewise. * coff-ia64.c (TARGET_SYM): Likewise. * coff-mips.c (mips_ecoff_le_vec): Likewise. (mips_ecoff_be_vec): Likewise. (mips_ecoff_bele_vec): Likewise. * coff-rs6000.c (rs6000_xcoff_vec): Likewise. (powerpc_xcoff_vec): Likewise. * coff-sh.c (sh_coff_small_vec): Likewise. (sh_coff_small_le_vec): Likewise. * coff-tic30.c (tic30_coff_vec): Likewise. * coff-tic54x.c (tic54x_coff0_vec): Likewise. (tic54x_coff0_beh_vec): Likewise. (tic54x_coff1_vec): Likewise. (tic54x_coff1_beh_vec): Likewise. (tic54x_coff2_vec): Likewise. (tic54x_coff2_beh_vec): Likewise. * coff-x86_64.c (TARGET_SYM): Likewise. (TARGET_SYM_BIG): Likewise. * coff64-rs6000.c (rs6000_xcoff64_vec): Likewise. (rs6000_xcoff64_aix_vec): Likewise. * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): Likewise. (CREATE_BIGHDR_COFF_TARGET_VEC): Likewise. (CREATE_LITTLE_COFF_TARGET_VEC): Likewise. * elfxx-target.h (TARGET_BIG_SYM): Likewise. (TARGET_LITTLE_SYM): Likewise. * hppabsd-core.c (core_hppabsd_vec): Likewise. * hpux-core.c (core_hpux_vec): Likewise. * i386msdos.c (i386_msdos_vec): Likewise. * ihex.c (ihex_vec): Likewise. * irix-core.c (core_irix_vec): Likewise. * mach-o-target.c (TARGET_NAME): Likewise. * mmo.c (mmix_mmo_vec): Likewise. * netbsd-core.c (core_netbsd_vec): Likewise. * osf-core.c (core_osf_vec): Likewise. * pdp11.c (MY (vec)): Likewise. * pef.c (pef_vec): Likewise. (pef_xlib_vec): Likewise. * plugin.c (plugin_vec): Likewise. * ppcboot.c (powerpc_boot_vec): Likewise. * ptrace-core.c (core_ptrace_vec): Likewise. * sco5-core.c (core_sco5_vec): Likewise. * som.c (hppa_som_vec): Likewise. * srec.c (srec_vec): Likewise. (symbolsrec_vec): Likewise. * tekhex.c (tekhex_vec): Likewise. * trad-core.c (core_trad_vec): Likewise. * verilog.c (verilog_vec): Likewise. * vms-alpha.c (alpha_vms_vec): Likewise. * vms-lib.c (alpha_vms_lib_txt_vec): Likewise. * wasm-module.c (wasm_vec): Likewise. * xsym.c (sym_vec): Likewise. * elf.c (ignore_section_sym): Return TRUE if BSF_SECTION_SYM_USED isn't set. (elf_map_symbols): Don't include ignored section symbols. * elfcode.h (elf_slurp_symbol_table): Also set BSF_SECTION_SYM_USED on STT_SECTION symbols. * elflink.c (bfd_elf_final_link): Generated section symbols only when emitting relocations or reqired. * elfxx-x86.h (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New. * syms.c (BSF_SECTION_SYM_USED): New. * targets.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New. (bfd_target): Add keep_unused_section_symbols. (bfd_keep_unused_section_symbols): New. * bfd-in2.h: Regenerated. 2021-01-07 Nick Clifton PR 25713 * bfdio.c (_bfd_real_fopen): For Win32 convert relative paths to absolute paths and check to see if they are longer than MAX_PATH. 2021-01-07 Philipp Tomsich * elfxx-riscv.c (riscv_std_z_ext_strtab): Added zihintpause. 2021-01-07 Claire Xenia Wolf Jim Wilson Andrew Waterman Maxim Blinov Kito Cheng Nelson Chu * elfxx-riscv.c (riscv_std_z_ext_strtab): Added zba, zbb and zbc. 2021-01-06 H.J. Lu * elf32-bfin.c (bfin_check_relocs): Check bfd_link_hash_indirect. (bfinfdpic_check_relocs): Likewise. 2021-01-06 Alan Modra * elf32-score.c (s3_bfd_score_info_to_howto): Report an error on unknown r_type. * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise. 2021-01-06 Alan Modra * config.bfd (sparc-*-solaris2*): Add sparc_elf32_vec. (sparc64-*-solaris2*): Add sparc_elf64_vec and sparc_elf32_vec. 2021-01-06 Marcus Comstedt * config.bfd: Added targets riscv64be*-*-*, riscv32be*-*-* and riscvbe*-*-*. Also added riscv_elf[32|64]_be_vec. * configure.ac: Handle riscv_elf[32|64]_be_vec. * configure: Regenerate. * elfnn-riscv.c: Include and define CHAR_BIT for riscv_is_insn_reloc. (riscv_get_insn): RISC-V instructions are always little endian, but bfd_get may be used for big-endian, so add new riscv_get_insn to handle the insturctions. (riscv_put_insn): Likewsie. (riscv_is_insn_reloc): Check if we are relocaing an instruction. (perform_relocation): Call riscv_is_insn_reloc to decide if we should use riscv_[get|put]_insn or bfd_[get|put]. (riscv_zero_pcrel_hi_reloc): Use riscv_[get|put]_insn, bfd_[get|put]l32 or bfd_[get|put]l16 for code. (riscv_elf_relocate_section): Likewise. (riscv_elf_finish_dynamic_symbol): Likewise. (riscv_elf_finish_dynamic_sections): Likewise. (_bfd_riscv_relax_call): Likewise. (_bfd_riscv_relax_lui): Likewise. (_bfd_riscv_relax_align): Likewise. (_bfd_riscv_relax_pc): Likewise. (riscv_elf_object_p): Handled for big endian. (TARGET_BIG_SYM, TARGET_BIG_NAME): Defined. * targets.c: Add riscv_elf[32|64]_be_vec. (_bfd_target_vector): Likewise. 2021-01-05 Alan Modra * elflink.c (bfd_elf_link_record_dynamic_symbol): Handle no_export for relocatable executable. 2021-01-05 Alan Modra * vms-alpha.c (_bfd_vms_slurp_egsd): Read flags after size check. 2021-01-05 Nelson Chu * elfnn-riscv.c (allocate_dynrelocs): When we are generating pde, make sure gp symbol is output as a dynamic symbol. 2021-01-04 H.J. Lu PR ld/26256 * elflink.c (compare_link_order): Place unordered sections before ordered sections. (elf_fixup_link_order): Add a link info argument. Allow mixed ordered and unordered input sections for non-relocatable link. Sort the consecutive bfd_indirect_link_order sections with the same pattern. Change the offsets of the bfd_indirect_link_order sections only. (bfd_elf_final_link): Pass info to elf_fixup_link_order. * section.c (bfd_section): Add pattern. (BFD_FAKE_SECTION): Initialize pattern to NULL. * bfd-in2.h: Regenerated. 2021-01-04 Alexander Fedotov * elf32-arm.c (elf32_arm_print_private_bfd_data): Prefix hex value of private flags with 0x. * elfnn-aarch64.c (elfNN_aarch64_print_private_bfd_data): Likewise. 2021-01-04 Alan Modra PR 26822 * elflink.c (elf_link_input_bfd): Use the file base name in linker generated STT_FILE symbols. 2021-01-04 Nelson Chu * elfxx-riscv.c (riscv_compare_subsets): Removed static. * elfxx-riscv.h: Add declaration. * elfnn-riscv.c (riscv_merge_multi_letter_ext): Use riscv_compare_subsets to check the orders. (riscv_skip_prefix): Removed. (riscv_prefix_cmp): Removed. 2021-01-04 Alan Modra PR 26741 * elfxx-riscv.c (riscv_parse_prefixed_ext): Free subset after calculating subset version length. 2021-01-01 Nicolas Boulenguez * xcofflink.c: Correct spelling in comments. 2021-01-01 Alan Modra Update year range in copyright notice of all files. For older changes see ChangeLog-2020 Copyright (C) 2021 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Local Variables: mode: change-log left-margin: 8 fill-column: 74 version-control: never End: