12019-12-31 Alan Modra <amodra@gmail.com> 2 3 * vms-alpha.c (_bfd_vms_slurp_eisd): Don't overflow when checking 4 offset. Don't overflow when checking rec_size, and do allow 5 rec_size to the end of the buffer. Ensure eisd->type can be 6 accessed, not just the first 32 bytes. Don't call 7 _bfd_vms_save_counted_string with zero length remaining. Fail 8 on empty string section name. 9 (_bfd_vms_slurp_egsd): Formatting. Catch more reads past end 10 of record size. Correct remaining length calculation. Fail 11 on empty string section name. Consolidate error paths. 12 132019-12-30 Alan Modra <amodra@gmail.com> 14 15 * vms-alpha.c (alpha_vms_free_private): New function, extracted.. 16 (vms_close_and_cleanup): ..from here. 17 (alpha_vms_object_p): Call alpha_vms_free_private on failure. 18 192019-12-30 Alan Modra <amodra@gmail.com> 20 21 * coffgen.c (coff_real_object_p): Free malloc'd memory on failure. 22 232019-12-30 Alan Modra <amodra@gmail.com> 24 25 * archive.c (do_slurp_bsd_armap): Use bfd_alloc rather than 26 bfd_zalloc when memory is all written after the call. 27 (do_slurp_coff_armap): Likewise. Set bfd_error on ridiculously 28 large allocations that overflow bfd_size_type. Use just one 29 bfd_release on error exit. 30 (_bfd_slurp_extended_name_table): Use bfd_alloc for extended_names, 31 clear last byte rather than the entire array. Use bfd_alloc for 32 string table. Rearrange and simplify code copying file names. 33 342019-12-29 Alan Modra <amodra@gmail.com> 35 36 * vms-alpha.c (_bfd_vms_slurp_egsd): Make base_addr a bfd_vma. 37 Limit alignment power. Correct and simplify alignment expression. 38 (evax_bfd_print_relocation_records): Avoid signed shift left. 39 402019-12-29 Alan Modra <amodra@gmail.com> 41 42 * vms-misc.c (_bfd_vms_save_sized_string): Add abfd param, make 43 size a size_t. Use bfd_alloc rather than bfd_malloc. 44 (_bfd_vms_save_counted_string): Similarly. 45 * vms.h (_bfd_vms_save_sized_string): Update prototype. 46 (_bfd_vms_save_counted_string): Likewise. 47 * vms-alpha.c (_bfd_vms_slurp_ehdr): Adjust 48 _bfd_vms_save_counted_string and bfd_vms_save_sized_string calls. 49 (_bfd_vms_slurp_egsd, parse_module): Likewise. 50 (_bfd_vms_slurp_eisd): Likewise. Check return status. 51 (alpha_vms_bfd_link_hash_table_free): New function. 52 (alpha_vms_bfd_link_hash_table_create): Arrange to call it. 53 (vms_close_and_cleanup): Free more memory. Don't release tdata. 54 552019-12-29 Alan Modra <amodra@gmail.com> 56 57 * coffcode.h (coff_close_and_cleanup): Redefine to.. 58 * coffgen.c (_bfd_coff_close_and_cleanup): ..this. New function. 59 * libcoff-in.h (_bfd_coff_close_and_cleanup): Declare. 60 * libcoff.h: Regenerate. 61 622019-12-29 Hannes Domani <ssbssa@yahoo.de> 63 Alan Modra <amodra@gmail.com> 64 65 PR 15350 66 * bfd.c (bfd_update_compression_header): Write zlib header for 67 formats other than ELF too. 68 692019-12-26 Alan Modra <amodra@gmail.com> 70 71 * som.c (setup_sections): Don't overflow space_strings_size. Use 72 bfd_malloc2 to catch overflow of size calculation. 73 (som_prep_for_fixups): Use bfd_zalloc2 to catch overflow of size 74 calculation. 75 (som_build_and_write_symbol_table): Similarly use bfd_zmalloc2. 76 (som_slurp_symbol_table): Similarly use bfd_zmalloc2, bfd_malloc2, 77 and bfd_zalloc2. 78 (bfd_som_attach_aux_hdr): Use size_t vars for string length. 79 (som_bfd_count_ar_symbols): Use bfd_malloc2 to catch overflow of 80 size calculation. Use size_t vars for length and catch overflow. 81 (som_slurp_armap): Use bfd_alloc2 to catch overflow of size 82 calculation. 83 (som_bfd_ar_write_symbol_stuff): Similarly use bfd_zmalloc2 and 84 bfd_malloc2. Perform size calculations in bfd_size_type. 85 862019-12-26 Hannes Domani <ssbssa@yahoo.de> 87 88 * peicode.h (pe_bfd_read_buildid): Free data. 89 902019-12-23 Alan Modra <amodra@gmail.com> 91 92 * vms-alpha.c (add_symbol): Add "max" parameter. Error on string 93 length larger than max. 94 (_bfd_vms_slurp_egsd): Ensure record is at least large enough to 95 read string length byte, error if not. Pass size to add_symbol. 96 (_bfd_vms_slurp_etir): Don't read past end of buffer when reading 97 type and length. Allow read of last byte in buffer. 98 992019-12-23 Alan Modra <amodra@gmail.com> 100 101 * wasm-module.c (wasm_read_leb128): Don't allow oversize shifts. 102 Catch value overflow. Sign extend only on terminating byte. 103 1042019-12-20 Alan Modra <amodra@gmail.com> 105 106 * xtensa-isa.c (xtensa_insnbuf_from_chars): Avoid signed overflow. 107 1082019-12-20 Alan Modra <amodra@gmail.com> 109 110 * libhppa.h (hppa_field_adjust, bfd_hppa_insn2fmt): Delete forward 111 declaration. Move ATTRIBUTE_UNUSED to definition. 112 (sign_extend, low_sign_extend, sign_unext, low_sign_unext), 113 (re_assemble_3, re_assemble_12, re_assemble_14, re_assemble_16), 114 (re_assemble_17, re_assemble_21, re_assemble_22): Likewise. Make 115 args and return value unsigned. Use unsigned variables. 116 (hppa_rebuild_insn): Similarly. 117 1182019-12-20 Alan Modra <amodra@gmail.com> 119 120 * format.c (bfd_check_format_matches): Free matching_vector when 121 not returning matching target strings. 122 1232019-12-20 Alan Modra <amodra@gmail.com> 124 125 * coff-alpha.c (alpha_ecoff_read_ar_hdr): Free ar_hdr on error return. 126 1272019-12-18 Alan Modra <amodra@gmail.com> 128 129 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Don't overflow when 130 checking symbol count against section size. Guard against strlen 131 running off end of buffer by allocating one more byte and zeroing. 132 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise. 133 1342019-12-18 Alan Modra <amodra@gmail.com> 135 136 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Use size_t for vars. 137 * elf64-ppc.c (sym_exists_at): Use size_t for lo, hi and mid. 138 1392019-12-18 Alan Modra <amodra@gmail.com> 140 141 * elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): Avoid signed overflow. 142 * elf32-hppa.c (final_link_relocate): Likewise. 143 * elf32-ppc.c (_bfd_elf_ppc_at_tls_transform): Likewise. 144 (_bfd_elf_ppc_at_tprel_transform, is_insn_ds_form): Likewise. 145 (is_insn_dq_form, ppc_elf_relocate_section): Likewise. 146 * elf64-ppc.c (ok_lo_toc_insn, ppc64_elf_edit_toc): Likewise. 147 (ppc64_elf_relocate_section): Likewise. 148 * elfxx-mips.c (mips_elf_perform_relocation): Likewise. 149 * netbsd.h (N_SET_FLAGS): Likewise. 150 1512019-12-17 Alan Modra <amodra@gmail.com> 152 153 * coff-tic80.c: Delete file. 154 * cpu-tic80.c: Delete file. 155 * archures.c: Remove tic80 support. 156 * coffcode.h: Likewise. 157 * coffswap.h: Likewise. 158 * targets.c: Likewise. 159 * config.bfd: Likewise. 160 * configure.ac: Likewise. 161 * Makefile.am: Likewise. 162 * Makefile.in: Regenerate. 163 * bfd-in2.h: Regenerate. 164 * configure: Regenerate. 165 * po/SRC-POTFILES.in: Regenerate. 166 1672019-12-13 Alan Modra <amodra@gmail.com> 168 169 PR 25237 170 * elf.c: (assign_file_positions_for_load_sections): Attempt to 171 keep meaningless p_offset for PT_LOAD segments without file 172 contents within file size. 173 1742019-12-12 Alan Modra <amodra@gmail.com> 175 176 * libbfd.c (bfd_get): Don't cast result of bfd_get_8. 177 * bfd-in2.h: Regenerate. 178 1792019-12-11 Alan Modra <amodra@gmail.com> 180 181 * elf32-rx.c (elf32_rx_relax_section): Avoid signed overflow. 182 * libaout.h (N_SET_INFO, N_SET_FLAGS): Likewise. 183 * netbsd.h (write_object_contents): Likewise. 184 * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Likewise. 185 * libhppa.h (HPPA_R_CONSTANT): Don't signed extend with shifts. 186 (stm32l4xx_create_replacing_stub_vldm): Don't truncate high bits 187 with shifts. 188 * elf32-nds32.h (R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG): Define 189 using 1u shifted left. Ditto for other macros. 190 * mmo.c (LOP): Make unsigned. 191 1922019-12-11 Alan Modra <amodra@gmail.com> 193 194 * libbfd.c (bfd_get_8): Return a bfd_vma. 195 (bfd_get_signed_8): Return a bfd_signed_vma. 196 * bfd-in2.h: Regenerate. 197 1982019-12-11 Alan Modra <amodra@gmail.com> 199 200 * xtensa-modules.c (Field_* functions): Don't mask using shifts. 201 (Operand_soffsetx4_decode, Operand_simm4_decode), 202 (Operand_simm8_decode, Operand_simm8x256_decode), 203 (Operand_simm12b_decode, Operand_label8_decode), 204 (Operand_label12_decode, Operand_soffset_decode), 205 (Operand_xt_wbr15_label_decode, Operand_xt_wbr18_label_decode): Don't 206 sign extend using shifts. 207 (Operand_immrx4_decode, Operand_uimm16x4_decode): Avoid UB in 208 constant. 209 2102019-12-11 Alan Modra <amodra@gmail.com> 211 212 * cpu-ia64-opc.c (ext_imms_scaled): Avoid undefined left shift 213 of negative values by using unsigned vars. 214 2152019-12-07 Alan Modra <amodra@gmail.com> 216 217 PR 25236 218 * elflink.c (_bfd_elf_link_assign_sym_version): Assign versions 219 for ELF_COMMON_DEF_P symbols. 220 (elf_link_output_extsym, _bfd_elf_add_default_symbol): Adjust to 221 suit. 222 2232019-12-05 Sandra Loosemore <sandra@codesourcery.com> 224 225 Only give FDE encoding warnings if --eh-frame-hdr was specified. 226 227 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Make 228 FDE encoding warning conditional. 229 2302019-12-05 Nick Clifton <nickc@redhat.com> 231 232 PR 25029 233 * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Ignore empty sections 234 when computing the sizes stored in the headers. 235 2362019-12-03 Alan Modra <amodra@gmail.com> 237 238 PR 25230 239 * dwarf2.c (struct dwarf2_debug_file): Add line_table and 240 abbrev_offsets. 241 (struct abbrev_offset_entry): New. 242 (hash_abbrev, eq_abbrev, del_abbrev): New functions. 243 (read_abbrevs): Check whether we have already read abbrevs at 244 given offset, and add new offset/abbrev to hash table. 245 (decode_line_info): Keep line table at offset zero in file struct. 246 Return this for a cu reusing the same dir/file list. 247 (find_abstract_instance): Find cu for DW_FORM_GNU_ref_alt. 248 (_bfd_dwarf2_slurp_debug_info): Create offset/abbrev hash tables. 249 (_bfd_dwarf2_cleanup_debug_info): Adjust deletion of lines and 250 abbrevs. 251 2522019-12-03 Alan Modra <amodra@gmail.com> 253 254 PR 25230 255 * dwarf2.c (struct dwarf2_debug_file): New struct. 256 (struct dwarf2_debug): Delete fields now in dwarf2_debug_file. 257 Add f, alt fields. 258 (struct comp_unit): Add file field. 259 (read_indirect_string, read_indirect_line_string): Adjust to suit. 260 (read_alt_indirect_string, read_alt_indirect_ref): Likewise. 261 (read_debug_ranges, find_abstract_instance, read_rangelist): Likewise. 262 (_bfd_dwarf2_stash_syms, place_sections): Likewise. 263 (stash_maybe_update_info_hash_tablse): Likewise. 264 (stash_verify_info_hash_table): Likewise. 265 (_bfd_dwarf2_slurp_debug_info): Likewise. 266 (_bfd_dwarf2_find_symbol_bias): Likewise. 267 (_bfd_dwarf2_find_nearest_line): Likewise. 268 (_bfd_dwarf2_cleanup_debug_info): Likewise. 269 (read_abbrevs): Add file param and adjust. Update calls. 270 (stash_comp_unit): Likewise. 271 (decode_line_info): Delete stash param and adjust. Update calls. 272 (comp_unit_find_nearest_line): Likewise. 273 (comp_unit_maybe_decode_line_info): Likewise. 274 (comp_unit_find_line): Likewise. 275 (parse_comp_unit): Add file and info_ptr param and adjust. Update 276 calls. 277 2782019-12-03 Alan Modra <amodra@gmail.com> 279 280 * dwarf2.c (read_indirect_string): Don't duplicate offset check 281 done in read_section. 282 (read_indirect_line_string): Likewise. 283 (read_alt_indirect_string): Likewise. 284 (read_alt_indirect_ref): Likewise. 285 (read_abbrevs): Likewise. Free memory on all failure paths. 286 Use correct unsigned type for pointer difference comparison. 287 2882019-12-03 Alan Modra <amodra@gmail.com> 289 290 * dwarf2.c (struct dwarf2_debug): Update comments. Remove sec 291 and sec_info_ptr. 292 (_bfd_dwarf2_slurp_debug_info): Don't set sec or sec_info_ptr. 293 (stash_comp_unit): Likewise. 294 (read_alt_indirect_ref): Return NULL not FALSE. 295 2962019-12-03 Alan Modra <amodra@gmail.com> 297 298 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Correct function comment. 299 3002019-11-27 Alan Modra <amodra@gmail.com> 301 302 PR 23652 303 * dwarf2.c (_bfd_dwarf2_stash_syms): Break out of loop on finding 304 matching section. 305 (_bfd_dwarf2_find_nearest_line): Return an int, with value 2 when 306 returning info from the symbol table. Do the _bfd_elf_find_function 307 search also when !found. Call _bfd_dwarf2_stash_syms regardless of 308 symbols. 309 * elf64-alpha.c (elf64_alpha_find_nearest_line): Accept dwarf2 310 result of 1 only. 311 * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Likewise. 312 * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. 313 * libbfd.h: Regenerate. 314 3152019-11-27 Alan Modra <amodra@gmail.com> 316 317 PR 23652 318 * dwarf2.c (_bfd_dwarf2_stash_syms): New function. 319 (_bfd_dwarf2_find_nearest_line): Use it here, passing syms to 320 _bfd_elf_find_function. Call _bfd_elf_find_function in cases 321 where _bfd_elf_find_nearest_line would do so. 322 * elf.c (_bfd_elf_find_nearest_line): Omit _bfd_elf_find_function 323 for dwarf2. 324 * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Similarly. Tidy. 325 * elf32-arm.c (elf32_arm_maybe_function_sym): New function. 326 (elf_backend_maybe_function_sym): Define. 327 (arm_elf_find_function, elf32_arm_find_nearest_line): Delete. 328 (bfd_elf32_find_nearest_line): Don't define. 329 * elfnn-aarch64.c (elfNN_aarch64_maybe_function_sym): New function. 330 (elf_backend_maybe_function_sym): Define. 331 (aarch64_elf_find_function, elfNN_aarch64_find_nearest_line): Delete. 332 (bfd_elfNN_find_nearest_line): Don't define. 333 3342019-11-27 Alan Modra <amodra@gmail.com> 335 336 * elf32-sh.c (sh_reloc): Use a bfd_vma insn. 337 (sh_reloc <R_SH_IND12W>): Divide calculated relocation value 338 by two before applying to insn. Correct overflow test. 339 * coff-sh.c (sh_reloc): Likewise. 340 3412019-11-26 Nick Clifton <nickc@redhat.com> 342 343 * elf32-sh.c (sh_elf_reloc): Use a signed_vma when checking for a 344 negative relocated value. 345 * coff-sh.c (sh_reloc): Likewise. 346 3472019-11-25 Alan Modra <amodra@gmail.com> 348 349 * archures.c (bfd_octets_per_byte): Tail call 350 bfd_arch_mach_octets_per_byte. 351 * coff-arm.c (OCTETS_PER_BYTE): Define. 352 (coff_arm_reloc): Introduce new "octets" temp. Use OCTETS_PER_BYTE 353 with section. Correct "addr". Remove ATTRIBUTE_UNUSED. 354 * coff-i386.c (coff_i386_reloc): Similarly. 355 * coff-mips.c (mips_reflo_reloc): Similarly. 356 * coff-x86_64.c (coff_amd64_reloc): Similarly. 357 * elf32-msp430.c (OCTETS_PER_BYTE): Define. 358 (rl78_sym_diff_handler): Use OCTETS_PER_BYTE, with section. 359 * elf32-nds32.c (nds32_elf_get_relocated_section_contents): Similarly. 360 * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Similarly. 361 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Similarly. 362 * elf32-s12z.c (opru18_reloc): Similarly. 363 * elf32-sh.c (sh_elf_reloc): Similarly. 364 * elf32-spu.c (spu_elf_rel9): Similarly. 365 * elf32-xtensa.c (bfd_elf_xtensa_reloc): Similarly. 366 * elf64-ppc.c (ppc64_elf_ha_reloc, ppc64_elf_brtaken_reloc), 367 (ppc64_elf_toc64_reloc): Similarly. 368 * bfd.c (bfd_get_section_limit): Pass section to bfd_octets_per_byte. 369 * cofflink.c (_bfd_coff_link_input_bfd), 370 (_bfd_coff_reloc_link_order): Likewise. 371 * elf.c (_bfd_elf_section_offset): Likewise. 372 * elflink.c (resolve_section, bfd_elf_perform_complex_relocation), 373 (elf_link_input_bfd, elf_reloc_link_order, elf_fixup_link_order), 374 (bfd_elf_final_link): Likewise. 375 * elf.c (_bfd_elf_make_section_from_shdr): Don't strncmp twice 376 to set SEC_ELF_OCTETS. 377 * reloc.c (bfd_perform_relocation): Tidy SEC_ELF_OCTETS special case. 378 (bfd_install_relocation): Likewise. 379 (_bfd_final_link_relocate): Don't recalculate octets. 380 * syms.c (_bfd_stab_section_find_nearest_line): Introduc new 381 "octets" temp. 382 * bfd-in2.h: Regenerate. 383 3842019-11-25 Christian Eggers <ceggers@gmx.de> 385 386 * section.c (struct bfd_section): New flag SEC_ELF_OCTETS. 387 * archures.c (bfd_octets_per_byte): New parameter sec. 388 If section is not NULL and SEC_ELF_OCTETS is set, one octet es 389 returned [ELF targets only]. 390 * bfd.c (bfd_get_section_limit): Provide section parameter to 391 bfd_octets_per_byte. 392 * bfd-in2.h: regenerate. 393 * binary.c (binary_set_section_contents): Move call to 394 bfd_octets_per_byte into section loop. Provide section parameter 395 to bfd_octets_per_byte. 396 * coff-arm.c (coff_arm_reloc): Provide section parameter 397 to bfd_octets_per_byte. 398 * coff-i386.c (coff_i386_reloc): likewise. 399 * coff-mips.c (mips_reflo_reloc): likewise. 400 * coff-x86_64.c (coff_amd64_reloc): likewise. 401 * cofflink.c (_bfd_coff_link_input_bfd): likewise. 402 (_bfd_coff_reloc_link_order): likewise. 403 * elf.c (_bfd_elf_section_offset): likewise. 404 (_bfd_elf_make_section_from_shdr): likewise. 405 Set SEC_ELF_OCTETS for sections with names .gnu.build.attributes, 406 .debug*, .zdebug* and .note.gnu*. 407 * elf32-msp430.c (rl78_sym_diff_handler): Provide section parameter 408 to bfd_octets_per_byte. 409 * elf32-nds.c (nds32_elf_get_relocated_section_contents): likewise. 410 * elf32-ppc.c (ppc_elf_addr16_ha_reloc): likewise. 411 * elf32-pru.c (pru_elf32_do_ldi32_relocate): likewise. 412 * elf32-s12z.c (opru18_reloc): likewise. 413 * elf32-sh.c (sh_elf_reloc): likewise. 414 * elf32-spu.c (spu_elf_rel9): likewise. 415 * elf32-xtensa.c (bfd_elf_xtensa_reloc): likewise 416 * elf64-ppc.c (ppc64_elf_brtaken_reloc): likewise. 417 (ppc64_elf_addr16_ha_reloc): likewise. 418 (ppc64_elf_toc64_reloc): likewise. 419 * elflink.c (bfd_elf_final_link): likewise. 420 (bfd_elf_perform_complex_relocation): likewise. 421 (elf_fixup_link_order): likewise. 422 (elf_link_input_bfd): likewise. 423 (elf_link_sort_relocs): likewise. 424 (elf_reloc_link_order): likewise. 425 (resolve_section): likewise. 426 * linker.c (_bfd_generic_reloc_link_order): likewise. 427 (bfd_generic_define_common_symbol): likewise. 428 (default_data_link_order): likewise. 429 (default_indirect_link_order): likewise. 430 * srec.c (srec_set_section_contents): likewise. 431 (srec_write_section): likewise. 432 * syms.c (_bfd_stab_section_find_nearest_line): likewise. 433 * reloc.c (_bfd_final_link_relocate): likewise. 434 (bfd_generic_get_relocated_section_contents): likewise. 435 (bfd_install_relocation): likewise. 436 For section which have SEC_ELF_OCTETS set, multiply output_base 437 and output_offset with bfd_octets_per_byte. 438 (bfd_perform_relocation): likewise. 439 4402019-11-21 Alan Modra <amodra@gmail.com> 441 442 * elf32-arm.c (elf32_arm_size_stubs): Exclude dynamic library 443 BFDs that have not been loaded. 444 4452019-11-19 Alan Modra <amodra@gmail.com> 446 447 PR 25197 448 * coffgen.c (coff_find_nearest_line_with_names): Check that C_FILE 449 u.syment.n_value does point at another C_FILE sym and not into 450 some auxent that happens to look like a C_FILE. Properly check 451 for integer overflow and avoid possible pointer wrap-around. 452 Simplify pr17512 checks. 453 4542019-11-19 Alan Modra <amodra@gmail.com> 455 456 PR 25200 457 * reloc.c (bfd_default_reloc_type_lookup): Don't BFD_FAIL. 458 * elf.c (_bfd_elf_validate_reloc): Don't segfault on NULL howto. 459 4602019-11-18 Alan Modra <amodra@gmail.com> 461 462 * elf-bfd.h (struct elf_backend_data <elf_backend_init_file_header>): 463 Rename from elf_backend_post_process_headers. 464 (_bfd_elf_post_process_headers): Delete. 465 (_bfd_elf_init_file_header): Declare. 466 * elf.c (_bfd_elf_compute_section_file_positions): Call new function 467 in place of prep_headers and elf_backend_post_process_headers. 468 (_bfd_elf_init_file_header): Renamed from prep_headers with 469 updated args and made global. Delete dead code. 470 (_bfd_elf_post_process_headers): Delete. 471 * elf32-arm.c (elf32_arm_init_file_header): Rename from 472 elf32_arm_post_process_headers and call _bfd_elf_init_file_header. 473 Return status. 474 (elf_backend_init_file_header): Define. 475 (elf_backend_post_process_headers): Don't define. 476 * elf32-i386.c (elf_i386_fbsd_init_file_header): Similarly. 477 * elf32-m68hc1x.c (elf32_m68hc11_init_file_header): Similarly. 478 * elf32-metag.c (elf_metag_init_file_header): Similarly. 479 * elf32-spu.c (spu_elf_init_file_header 480 * elf32-visium.c (visium_elf_init_file_header 481 * elf64-alpha.c (elf64_alpha_fbsd_init_file_header 482 * elf64-hppa.c (elf64_hppa_init_file_header 483 * elf64-ia64-vms.c (elf64_vms_init_file_header 484 * elfnn-aarch64.c (elfNN_aarch64_init_file_header 485 * elfnn-ia64.c (elfNN_hpux_init_file_header 486 * elfxx-mips.c (_bfd_mips_init_file_header 487 * elfxx-mips.h (_bfd_mips_post_process_headers): Delete. 488 (_bfd_mips_init_file_header): Declare. 489 (elf_backend_post_process_headers): Delete. 490 (elf_backend_init_file_header): Define. 491 * elfxx-target.h (elf_backend_post_process_headers): Delete. 492 (elf_backend_init_file_header): Define and use. 493 * elf32-m68hc12.c (elf_backend_init_file_header): Define. 494 (elf_backend_post_process_headers): Don't define. 495 * elf32-m68hc1x.h (elf32_m68hc11_post_process_headers): Delete. 496 (elf32_m68hc11_init_file_header): Declare. 497 * elf32-ppc.c (elf_backend_post_process_headers): Remove 498 unnecessary undef. 499 5002019-11-18 Alan Modra <amodra@gmail.com> 501 502 * elf-bfd.h (struct elf_backend_data <elf_backend_modify_headers>): 503 Rename from elf_backend_modify_program_headers. 504 (_bfd_elf_modify_headers): Declare. 505 * elf.c (assign_file_positions_except_relocs): Set 506 elf_program_header_size. Always call elf_backend_modify_headers. 507 Extract code modifying file header.. 508 (_bfd_elf_modify_headers): ..to here. New function. 509 * elf32-arm.c (elf_backend_modify_headers): Renamed from 510 elf_backend_modify_program_headers. 511 * elf32-i386.c: Similarly. 512 * elf64-x86-64.c: Similarly. 513 * elfxx-target.h: Similarly. Default elf_backend_modify_headers 514 to _bfd_elf_modify_headers. 515 * elf-nacl.h (nacl_modify_headers): Rename from 516 nacl_modify_program_headers. 517 * elf-nacl.c (nacl_modify_headers): Rename from 518 nacl_modify_program_headers and call _bfd_elf_modify_headers. 519 * elf32-rx.c (elf32_rx_modify_headers): Similarly. 520 * elf32-spu.c (spu_elf_modify_headers): Similarly. 521 * elfnn-ia64.c (elfNN_ia64_modify_headers): Similarly. 522 * elf32-sh.c (elf_backend_modify_program_headers): Don't undef. 523 5242019-11-18 Alan Modra <amodra@gmail.com> 525 526 PR 25196 527 * bfd.c (bfd_error_type): Add bfd_error_sorry. 528 (bfd_errmsgs): Likewise. 529 * elf.c (rewrite_elf_program_header): Don't abort on confused 530 lma/alignment. Replace bfd_error_bad_value with bfd_error_sorry. 531 (_bfd_elf_validate_reloc): Use bfd_error_sorry. 532 (_bfd_elf_final_write_processing): Likewise. 533 * bfd-in2.h: Regenerate. 534 5352019-11-12 Jim Wilson <jimw@sifive.com> 536 537 PR 25181 538 * elfnn-riscv.c (_bfd_riscv_relax_call): Always add max_alignment to 539 foff. If sym_sec->output_section and sec->output_section are the same 540 and not *ABS* then set max_alignment to that section's alignment. 541 5422019-11-07 Alan Modra <amodra@gmail.com> 543 544 * cpu-cr16c.c: Delete. 545 * elf32-cr16c.c: Delete. 546 * Makefile.am, 547 * archures.c, 548 * config.bfd, 549 * configure.ac, 550 * reloc.c, 551 * targets.c: Remove cr16c support. 552 * Makefile.in, 553 * bfd-in2.h, 554 * configure, 555 * libbfd.h, 556 * po/SRC-POTFILES.in: Regenerate. 557 5582019-11-05 Tim Rühsen <tim.ruehsen@gmx.de> 559 560 * doc/chew.c (add_to_definition): Use correct type when 561 calculating size of array reallocation. 562 (nextword): Always initialise the word return parameter. 563 (compile): Check return value of nextword(). 564 5652019-10-30 Keith Seitz <keiths@redhat.com> 566 567 * elf-bfd.h (elf_backend_data) <elf_backend_core_find_build_id>: 568 New field. 569 (_bfd_elf32_core_find_build_id, _bfd_elf64_core_find_build_id): 570 New functions. 571 (elf_read_notes): Add declaration. 572 * elf.c (elf_read_notes): Move elf-bfd.h. 573 (_bfd_elf_core_find_build_id): New function. 574 (bfd_section_from_phdr): Scan core file PT_LOAD segments for 575 build-id if none is known. 576 (elf_parse_notes): For core files, scan for notes. 577 * elfcore.h (elf_core_file_matches_executable_p): If both 578 BFDs have identical build-ids, then they match. 579 (_bfd_elf_core_find_build_id): New function. 580 * elfxx-target.h (elf_backend_core_find_build_id): Define. 581 (elfNN_bed): Add elf_backend_core_find_build_id. 582 5832019-10-29 Andrew Eikum <aeikum@codeweavers.com> 584 585 * libcoff-in.h (struct pe_tdata): Add dos_message field. 586 * libcoff.h: Regenerate. 587 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Copy the 588 dos_message field rather than initialising it. 589 (_bfd_XX_bfd_copy_private_bfd_data_common): Copy the dos_message 590 field. 591 * peicode.h (pe_mkobject): Initialise the dos_message field. 592 (pe_mkobject_hook): Copy the dos_message field. 593 (pe_bfd_object_p): Copy the dos_message field. 594 5952019-10-25 Alan Modra <amodra@gmail.com> 596 597 PR 4499 598 * elf-nacl.c (nacl_modify_segment_map): Set no_sort_lma for all 599 PT_LOAD segments. 600 * elf32-spu.c (spu_elf_modify_segment_map): Likewise on overlay 601 PT_LOAD segments. 602 * elf.c (elf_sort_segments): New function. 603 (assign_file_positions_except_relocs): Use shortcuts to elfheader 604 and elf_tdata. Seek to e_phoff not sizeof_ehdr to write program 605 headers. Move PT_PHDR check.. 606 (assign_file_positions_for_non_load_sections): ..and code setting 607 PT_PHDR p_vaddr and p_paddr, and code setting __ehdr_start value.. 608 (assign_file_positions_for_load_sections): ..to here. Sort 609 PT_LOAD headers. Delete header_pad code. Use actual number of 610 headers rather than allocated in calculating size for program 611 headers. Don't assume program headers follow ELF file header. 612 Simplify pt_load_count code. Only set "off" for PT_LOAD or 613 PT_NOTE in cores. 614 (rewrite_elf_program_header): Set p_vaddr_offset for segments 615 that include file and program headers. 616 (copy_elf_program_header): Likewise, replacing header_size code. 617 6182019-10-21 Alan Modra <amodra@gmail.com> 619 620 PR 452 621 * archive.c (normalize): Return file unchanged when 622 BFD_ARCHIVE_FULL_PATH. 623 (_bfd_construct_extended_name_table): Pass abfd, the output 624 bfd, to normalize. 625 (_bfd_archive_bsd44_construct_extended_name_table): Likewise. 626 * bfd.c (struct bfd): Make flags a full flagword. 627 (BFD_ARCHIVE_FULL_PATH): Define. 628 * bfd-in2.h: Regenerate. 629 6302019-10-20 John David Anglin <danglin@gcc.gnu.org> 631 632 * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Provide 8-byte 633 minimum alignment for .plt section. 634 6352019-10-19 John David Anglin <danglin@gcc.gnu.org> 636 637 * elf32-hppa.c: Revise import stub sequences. 638 (LONG_BRANCH_STUB_SIZE): Define. 639 (LONG_BRANCH_SHARED_STUB_SIZE): Define. 640 (IMPORT_STUB_SIZE): Define. 641 (IMPORT_SHARED_STUB_SIZE): Define. 642 (EXPORT_STUB_SIZE): Define. 643 (plt_stub): Revise to not use register %r22. 644 (LDO_R1_R22): Define. 645 (LDW_R22_R21): Define. 646 (LDW_R22_R19): Define. 647 (hppa_build_one_stub): Update stub generation and use new defines. 648 (hppa_size_one_stub): Likewise. 649 6502019-10-17 Nelson Chu <nelson.chu@sifive.com> 651 652 * elfnn-riscv.c (riscv_elf_relocate_section): Report the error message 653 that user should recompile their code with `fPIC` when linking non-pic 654 code into shared library. 655 656 * elfnn-riscv.c (riscv_elf_relocate_section): Use asprintf to extend 657 the error message if needed, and then store the result into the 658 `msg_buf`. Finally, remember to free the unused `msg_buf`. All error 659 message for the dangerous relocation should be set before we call the 660 callback function. If we miss the error message since linker runs out 661 of memory, we should set the default error message for the error. 662 6632019-10-16 Alan Modra <amodra@gmail.com> 664 665 PR 13616 666 * cpu-powerpc.c (bfd_arch_ppc_nop_fill): New function, use it 667 for all ppc arch info. 668 * linker.c (default_data_link_order): Pass info->big_endian to 669 arch_info->fill function. 670 6712019-10-15 Alan Modra <amodra@gmail.com> 672 673 * elf32-m68hc1x.c (reloc_warning): Add printf attribute. 674 (elf32_m68hc11_relocate_section): Don't use a variable for format 675 strings. Delete some unnecessary xgettext:c-format comments. 676 6772019-10-15 Alan Modra <amodra@gmail.com> 678 679 PR 24955 680 * elf32-arm.c (set_cmse_veneer_addr_from_implib): Use bfd_malloc 681 rather than xmalloc. 682 * elf32-m68hc1x.c (reloc_warning): New function. 683 (elf32_m68hc11_relocate_section): Use it here. Cast bfd_vma values 684 corresponding to %lx in format strings. 685 * elf32-nds32.c (nds32_insertion_sort): Use a stack temporary. 686 6872019-10-15 Alan Modra <amodra@gmail.com> 688 689 PR 25100 690 * elf64-ppc.c (sfpr_define): Delete dead code that triggered a warning. 691 6922019-10-15 Alan Modra <amodra@gmail.com> 693 694 * bfd.c (bfd_check_compression_header): Check for powers of two 695 with x == (x & -x). 696 6972019-10-14 Alan Modra <amodra@gmail.com> 698 699 * syms.c (struct indexentry): Add idx field. 700 (cmpindexentry): Final sort on idx. 701 (_bfd_stab_section_find_nearest_line): Set idx. 702 7032019-10-14 Alan Modra <amodra@gmail.com> 704 705 * dwarf2.c (struct lookup_funcinfo): Add idx field. 706 (compare_lookup_funcinfos): Perform final sort on idx. 707 (build_lookup_funcinfo_table): Set idx. 708 (compare_sequences): Perform final sort on num_lines. 709 (build_line_info_table): Set num_lines and line_info_lookup earlier. 710 (sort_line_sequences): Set num_lines for sort. 711 7122019-10-14 Alan Modra <amodra@gmail.com> 713 714 * elflink.c (elf_sort_symbol): Sort on type and name as well. 715 (elf_link_add_object_symbols): Style fix. 716 7172019-10-14 Alan Modra <amodra@gmail.com> 718 719 * elf.c (_bfd_elf_map_sections_to_segments): Init target_index 720 for sections about to be sorted. 721 (assign_file_positions_for_load_sections): Likewise. 722 (elf_sort_sections): Don't bother optimising both TOEND case. 723 * elflink.c (bfd_elf_final_link): Reset target_index. 724 7252019-10-14 Alan Modra <amodra@gmail.com> 726 727 * elflink.c (elf_get_linked_section_vma): Delete. 728 (compare_link_order): Use elf_linked_to_section and sort by lma, 729 size, and id. 730 (elf_fixup_link_order): Use size_t variables where appropriate. 731 Make use of elf_linked_to_section. Formatting. Properly align 732 sections. 733 7342019-10-14 Alan Modra <amodra@gmail.com> 735 736 * elf-strtab.c (strrevcmp): Comment. 737 * merge.c (strrevcmp): Likewise. 738 * elf64-ppc.c (compare_symbols): Correct final pointer comparison. 739 Comment on why comparing pointers ensures a stable sort. 740 * elflink.c (struct elf_symbol): Add void* to union. 741 (elf_sort_elf_symbol): Ensure a stable sort with pointer comparison. 742 (elf_sym_name_compare): Likewise. 743 (bfd_elf_match_symbols_in_sections): Style fix. 744 (elf_link_sort_cmp1): Comment. 745 7462019-10-14 Alan Modra <amodra@gmail.com> 747 748 PR 24955 749 * elflink.c (elf_output_implib): Don't use xmalloc. Don't ignore 750 return value of bfd_alloc2. 751 * peXXigen.c (_bfd_XXi_write_codeview_record): Don't use xmalloc. 752 * pef.c (bfd_pef_print_symbol): Likewise. Don't ignore return 753 value of bfd_get_section_contents. 754 * som.c (som_write_space_strings): Don't use xmalloc. 755 (som_write_symbol_strings): Likewise. 756 7572019-10-11 Max Filippov <jcmvbkbc@gmail.com> 758 759 * dwarf2.c (stash_maybe_enable_info_hash_tables): Only set 760 stash->info_hash_status = STASH_INFO_HASH_ON when 761 stash_maybe_update_info_hash_tables succeeds. 762 7632019-10-09 Alan Modra <amodra@gmail.com> 764 765 PR 25070 766 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Catch overflow of 767 total_size calculation. 768 7692019-10-08 Alan Modra <amodra@gmail.com> 770 771 PR 25078 772 * dwarf2.c (find_abstract_instance): Delete orig_info_ptr, add 773 recur_count. Error on recur_count reaching 100 rather than 774 info_ptr matching orig_info_ptr. Adjust calls. 775 7762019-10-07 Jozef Lawrynowicz <jozef.l@mittosystems.com> 777 778 * elf32-msp430.c (elf32_msp430_merge_mspabi_attributes): Rename to.. 779 (elf32_msp430_merge_msp430_attributes): Add support for merging 780 the GNU object attribute for data region. 781 7822019-10-07 Alan Modra <amodra@gmail.com> 783 784 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Do allocate 785 space for local got non-tls relocs when PIE. 786 7872019-10-07 Alan Modra <amodra@gmail.com> 788 789 * elflink.c (elf_fixup_link_order): Don't attempt to find 790 an elf_section for linker created bfd sections. 791 7922019-10-07 Alan Modra <amodra@gmail.com> 793 794 * elf32-ppc.c (ppc_elf_tls_optimize): Don't process R_PPC_TLSLD 795 with non-local symbol. Don't double count __tls_get_addr calls 796 with marker relocs. 797 * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise. 798 7992019-10-07 Alan Modra <amodra@gmail.com> 800 801 * elf32-ppc.c (nomark_tls_get_addr): Rename from has_tls_get_addr_call 802 throughout. 803 * elf64-ppc.c (nomark_tls_get_addr): Likewise. 804 8052019-10-04 Alan Modra <amodra@gmail.com> 806 807 * elf64-ppc.c (ppc64_elf_check_relocs): Move initialisation of vars. 808 (ppc64_elf_tls_optimize): Correct is_local condition. 809 (allocate_got): Don't reserve dynamic relocations for any of the 810 tls got relocs in PIEs when the symbol is local. 811 (allocate_dynrelocs): Correct validity test for local sym using 812 tlsld_got slot. 813 (ppc64_elf_size_dynamic_sections): Don't reserve dynamic relocations 814 for any of the tls got relocs in PIEs. 815 (ppc64_elf_layout_multitoc): Likewise. 816 (ppc64_elf_relocate_section): Correct validity test for local sym 817 using tlsld_got slot. Don't emit dynamic relocations for any of 818 the tls got relocs in PIEs when the symbol is local. 819 * elf32-ppc.c (ppc_elf_tls_optimize): Correct is_local condition. 820 (got_relocs_needed): Delete. 821 (allocate_dynrelocs): Correct validity test for local sym using 822 tlsld_got slot. Don't reserve dynamic relocations for any of the 823 tls got relocs in PIEs when the symbol is local. 824 (ppc_elf_size_dynamic_sections): Don't reserve dynamic relocations 825 for any of the tls got relocs in PIEs. 826 (ppc_elf_relocate_section): Correct validity test for local sym 827 using tlsld_got slot. Don't emit dynamic relocations for any of 828 the tls got relocs in PIEs when the symbol is local. 829 8302019-10-04 Szabolcs Nagy <szabolcs.nagy@arm.com> 831 832 PR ld/22263 833 PR ld/25056 834 * elf32-arm.c (elf32_arm_tls_transition): Use bfd_link_dll instead of 835 bfd_link_pic for TLS checks. 836 (elf32_arm_final_link_relocate): Likewise. 837 (allocate_dynrelocs_for_symbol): Likewise. 838 8392019-10-04 Szabolcs Nagy <szabolcs.nagy@arm.com> 840 841 PR ld/25062 842 * elf32-arm.c (elf32_arm_final_link_relocate): Sign extend data. 843 8442019-09-30 Nick Alcock <nick.alcock@oracle.com> 845 846 * elf-bfd.h (bfd_section_is_ctf): New inline function. 847 * elf.c (special_sections_c): Add ".ctf". 848 (assign_file_positions_for_non_load_sections): Note that 849 compressed debugging sections etc are not assigned here. Treat 850 CTF sections like SEC_ELF_COMPRESS sections when is_linker_output: 851 sh_offset -1. 852 (assign_file_positions_except_relocs): Likewise. 853 (find_section_in_list): Note that debugging and CTF sections, as 854 well as reloc sections, are assigned later. 855 (_bfd_elf_assign_file_positions_for_non_load): CTF sections get 856 their size and contents updated. 857 (_bfd_elf_set_section_contents): Skip CTF sections: unlike 858 compressed sections, they have no uncompressed content to copy at 859 this stage. 860 * elflink.c (elf_link_swap_symbols_out): Call the examine_strtab 861 callback right before the strtab is written out. 862 (bfd_elf_final_link): Don't cache the section contents of CTF 863 sections: they are not populated yet. Call the emit_ctf callback 864 right at the end, after all the symbols and strings are flushed 865 out. 866 8672019-07-13 Nick Alcock <nick.alcock@oracle.com> 868 869 * elf-strtab.c (_bfd_elf_strtab_len): New. 870 (_bfd_elf_strtab_str): Likewise. 871 * bfd-elf.h: Declare them. 872 8732019-07-13 Nick Alcock <nick.alcock@oracle.com> 874 875 * elf-bfd.h (bfd_elf_get_str_section): Add. 876 * elf.c (bfd_elf_get_str_section): No longer static. 877 8782019-09-26 Alan Modra <amodra@gmail.com> 879 880 PR 24262 881 * Makefile.am (AM_CPPFLAGS): Add -DLIBDIR. 882 * plugin.c (load_plugin): Search both ${libdir}/bfd-plugins and 883 ${bindir}/../lib/bfd-plugins if different. 884 * Makefile.in: Regenerate. 885 8862019-09-23 Alan Modra <amodra@gmail.com> 887 888 * elf64-ppc.c (ppc64_elf_check_relocs): Use bfd_link_executable 889 in choosing between different actions for shared library and 890 non-shared library cases. Delete ELIMINATE_COPY_RELOCS test. 891 (dec_dynrel_count): Likewise. Account for ifunc special case. 892 (ppc64_elf_adjust_dynamic_symbol): Copy relocs are for executables, 893 not non-pic. 894 (allocate_dynrelocs): Comment fixes. Delete ELIMINATE_COPY_RELOCS 895 test. 896 8972019-09-23 Alan Modra <amodra@gmail.com> 898 899 * Makefile.am (SOURCE_HFILES): Add many missing .h files. 900 * Makefile.in: Regenerate. 901 * po/SRC-POTFILES.in: Regenerate. 902 9032019-09-23 Alan Modra <amodra@gmail.com> 904 905 * bfd-in.h (bfd_symbol, bfd_section_already_linked), 906 (bfd_elf_version_tree): Delete forward declarations. 907 Move other forward decls and remaining elf function decl later. 908 (bfd_section_already_linked_table_init), 909 (bfd_section_already_linked_table_free), 910 (_bfd_handle_already_linked, _bfd_nearby_section), 911 (_bfd_fix_excluded_sec_syms): Move to bfdlink.h. 912 9132019-09-23 Alan Modra <amodra@gmail.com> 914 915 * bfd-in.h: Move ecoff function declarations.. 916 * ecoff-bfd.h: ..to here, new file. 917 * ecoff.c: Include ecoff-bfd.h. 918 * ecofflink.c: Likewise. 919 * elf64-alpha.c: Likewise. 920 * elfxx-mips.c: Likewise. 921 * bfd-in2.h: Regenerate. 922 9232019-09-23 Alan Modra <amodra@gmail.com> 924 925 * bfd-in.h (enum notice_asneeded_action): Move to bfdlink.h. 926 Move most other elf declarations.. 927 * elf-bfd.h: ..to here. 928 * bfd-in2.h: Regenerate. 929 9302019-09-23 Alan Modra <amodra@gmail.com> 931 932 * bfd-in.h: Move m68k function declaration.. 933 * cpu-m68k.h: ..to here, new file.. 934 * elf32-m68k.h: ..and here, new file. 935 * elf32-m68k.c: Include cpu-m68k.h and elf32-m68k.h. 936 * bfd-in2.h: Regenerate. 937 9382019-09-23 Alan Modra <amodra@gmail.com> 939 940 * bfd-in.h: Move bfin function declaration.. 941 * elf32-bfin.h: ..to here, new file. 942 * elf32-bfin.c: Include elf32-bfin.h. 943 * bfd-in2.h: Regenerate. 944 9452019-09-23 Alan Modra <amodra@gmail.com> 946 947 * bfd-in.h: Move cr16 function declaration.. 948 * elf32-cr16.h: ..to here, new file. 949 * elf32-cr16.c: Include elf32-cr16.h. 950 * bfd-in2.h: Regenerate. 951 9522019-09-23 Alan Modra <amodra@gmail.com> 953 954 * bfd-in.h (bfd_sunos_get_needed_list), 955 (bfd_sunos_record_link_assignment), 956 (bfd_sunos_size_dynamic_sections), 957 (bfd_i386linux_size_dynamic_sections), 958 (bfd_sparclinux_size_dynamic_sections): Delete obsolete decls. 959 * bfd-in2.h: Regenerate. 960 9612019-09-23 Alan Modra <amodra@gmail.com> 962 963 * bfd-in.h: Move xcoff function declarations.. 964 * xcofflink.h: ..to here, new file. 965 * xcofflink.c: Include xcofflink.h. 966 * coff-rs6000.c (bfd_xcoff_ar_archive_set_magic): Delete unused func. 967 * bfd-in2.h: Regenerate. 968 9692019-09-23 Alan Modra <amodra@gmail.com> 970 971 * bfd-in.h: Delete coff forward refs and move coff declaration.. 972 * coff-bfd.h: ..to here. 973 * bfd-in2.h: Regenerate. 974 9752019-09-23 Alan Modra <amodra@gmail.com> 976 977 * bfd-in.h: Move arm declaraions.. 978 * cpu-arm.h: ..to here, new file.. 979 * coff-arm.h: ..and here, new file.. 980 * elf32-arm.h: ..and here, new file. 981 * cpu-arm.c: Include cpu-arm.h. 982 * coff-arm.c: Include cpu-arm.h and coff-arm.h. 983 * elf32-arm.c: Include cpu-arm.h and elf32-arm.h. 984 * pe-arm.c: Move function rename defines later. 985 * pe-arm-wince.c: Likewise and include sysdep.h and bfd.h early. 986 * bfd-in2.h: Regenerate. 987 9882019-09-23 Alan Modra <amodra@gmail.com> 989 990 * bfd-in.h: Move tic6x function declaration.. 991 * elf32-tic6x.h: ..to here. 992 * bfd-in2.h: Regenerate. 993 9942019-09-23 Alan Modra <amodra@gmail.com> 995 996 * bfd-in.h: Move aarch64 declarations and defines.. 997 * cpu-aarch64.h: ..to here, new file.. 998 * elfxx-aarch64.h: ..and here. 999 * cpu-aarch64.c: Include cpu-aarch64.h. 1000 * elfnn-aarch64.c: Likewise. 1001 * bfd-in2.h: Regenerate. 1002 10032019-09-23 Alan Modra <amodra@gmail.com> 1004 1005 * bfd-in.h: Delete ticoff function declarations. 1006 * coff-tic54x.c (bfd_ticoff_set_section_load_page), 1007 (bfd_ticoff_get_section_load_page): Make static. 1008 * bfd-in2.h: Regenerate. 1009 10102019-09-23 Alan Modra <amodra@gmail.com> 1011 1012 * bfd-in.h: Move h8300 function declaration to.. 1013 * cpu-h8300.h: ..here, new file. 1014 * cpu-h8300.c: Include cpu-h8300.h. 1015 * elf32-h8300.c: Likewise. 1016 * bfd-in2.h: Regenerate. 1017 10182019-09-23 Alan Modra <amodra@gmail.com> 1019 1020 * bfd-in.h: Move ia64 function declarations.. 1021 * elfxx-ia64.h: ..to here. 1022 * bfd-in2.h: Regenerate. 1023 10242019-09-23 Alan Modra <amodra@gmail.com> 1025 1026 * bfd-in.h: Move v850 function declarations.. 1027 * elf32-v850.h: ..to here, new file. 1028 * elf32-v850.c: Include elf32-v850.h. 1029 * bfd-in2.h: Regenerate. 1030 10312019-09-23 Alan Modra <amodra@gmail.com> 1032 1033 * bfd-in.h: Move mips function declaration to.. 1034 * elfxx-mips.h: ..here. 1035 * bfd-in2.h: Regenerate. 1036 10372019-09-23 Alan Modra <amodra@gmail.com> 1038 1039 * bfd-in.h: Move csky function declarations to.. 1040 * elf32-csky.h: ..here, new file. 1041 * elf32-csky.c: Include elf32-csky.h. 1042 * bfd-in2.h: Regenerate. 1043 10442019-09-20 Nelson Chu <nelson.chu@sifive.com> 1045 1046 * elfnn-riscv.c (riscv_pcgp_hi_reloc): Add new field undefined_weak. 1047 (riscv_record_pcgp_hi_reloc): New parameter undefined_weak. 1048 Set undefined_weak field from it. 1049 (relax_func_t): New parameter undefined_weak. 1050 (_bfd_riscv_relax_call): New ignored parameter undefined_weak. 1051 (_bfd_riscv_relax_tls_le): Likewise. 1052 (_bfd_riscv_relax_align): Likewise. 1053 (_bfd_riscv_relax_delete): Likewise. 1054 (_bfd_riscv_relax_lui): New parameter undefined_weak. If true, 1055 allow relaxing. For LO12* relocs, set rs1 to x0 when undefined_weak. 1056 (_bfd_riscv_relax_pc): New parameter undefined_weak. For LO12* relocs, 1057 set undefined_weak from hi_reloc. If true, allow relaxing. For LO12* 1058 relocs, set rs1 to x0 when undefined_weak and change to non-pcrel 1059 reloc. 1060 (_bfd_riscv_relax_section): New local undefined_weak. Set for 1061 undef weak relocs that can be relaxed. Pass to relax_func call. 1062 10632019-09-20 Alan Modra <amodra@gmail.com> 1064 1065 * bfd-in.h (bfd_section_name, bfd_section_size, bfd_section_vma), 1066 (bfd_section_lma, bfd_section_alignment, bfd_section_flags), 1067 (bfd_section_userdata, bfd_is_com_section, discarded_section), 1068 (bfd_get_section_limit_octets, bfd_get_section_limit): Delete macros. 1069 * bfd.c (bfd_get_section_limit_octets, bfd_get_section_limit), 1070 (bfd_section_list_remove, bfd_section_list_append), 1071 (bfd_section_list_prepend, bfd_section_list_insert_after), 1072 (bfd_section_list_insert_before, bfd_section_removed_from_list): 1073 New inline functions. 1074 * section.c (bfd_is_und_section, bfd_is_abs_section), 1075 (bfd_is_ind_section, bfd_is_const_section, bfd_section_list_remove), 1076 (bfd_section_list_append, bfd_section_list_prepend), 1077 (bfd_section_list_insert_after, bfd_section_list_insert_before), 1078 (bfd_section_removed_from_list): Delete macros. 1079 (bfd_section_name, bfd_section_size, bfd_section_vma), 1080 (bfd_section_lma, bfd_section_alignment, bfd_section_flags), 1081 (bfd_section_userdata, bfd_is_com_section, bfd_is_und_section), 1082 (bfd_is_abs_section, bfd_is_ind_section, bfd_is_const_section), 1083 (discarded_section): New inline functions. 1084 * bfd-in2.h: Regenerate. 1085 10862019-09-20 Alan Modra <amodra@gmail.com> 1087 1088 * bfd-in.h (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name), 1089 (bfd_asymbol_bfd, bfd_asymbol_flavour, bfd_set_asymbol_name): Delete. 1090 * bfd.c (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name), 1091 (bfd_asymbol_bfd, bfd_set_asymbol_name): New inline functions. 1092 * targets.c (bfd_asymbol_flavour): Likewise. 1093 * bfd-in2.h: Regenerate. 1094 10952019-09-20 Alan Modra <amodra@gmail.com> 1096 1097 * archive.c (bfd_generic_archive_p): Use bfd_set_thin_archive. 1098 * bfd-in.h (bfd_get_filename, bfd_get_cacheable, bfd_get_format), 1099 (bfd_get_target, bfd_get_flavour, bfd_family_coff, bfd_big_endian), 1100 (bfd_little_endian, bfd_header_big_endian, bfd_header_little_endian), 1101 (bfd_get_file_flags, bfd_applicable_file_flags), 1102 (bfd_applicable_section_flags, bfd_has_map, bfd_is_thin_archive), 1103 (bfd_valid_reloc_types, bfd_usrdata, bfd_get_start_address), 1104 (bfd_get_symcount, bfd_get_outsymbols, bfd_count_sections), 1105 (bfd_get_dynamic_symcount, bfd_get_symbol_leading_char): Delete. 1106 * bfd/bfd.c (bfd_get_filename, bfd_get_cacheable, bfd_get_format), 1107 (bfd_get_file_flags, bfd_get_start_address, bfd_get_symcount), 1108 (bfd_get_dynamic_symcount, bfd_get_outsymbols, bfd_count_sections), 1109 (bfd_has_map, bfd_is_thin_archive, bfd_set_thin_archive), 1110 (bfd_usrdata, bfd_set_usrdata): New inline functions. 1111 * targets.c (bfd_get_target, bfd_get_flavour), 1112 (bfd_applicable_file_flags, bfd_family_coff, bfd_big_endian), 1113 (bfd_little_endian, bfd_header_big_endian), 1114 (bfd_header_little_endian, bfd_applicable_section_flags), 1115 (bfd_get_symbol_leading_char): New inline functions. 1116 * bfd-in2.h: Regenerate. 1117 11182019-09-20 Alan Modra <amodra@gmail.com> 1119 1120 * elf64-ppc.c (ppc64_glibc_dynamic_reloc): New function. 1121 (ppc64_elf_relocate_section): Warn if emitting unsupported dynamic 1122 relocations. 1123 11242019-09-18 Alan Modra <amodra@gmail.com> 1125 1126 * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), 1127 (bfd_get_section_lma, bfd_get_section_alignment), 1128 (bfd_get_section_size, bfd_get_section_flags), 1129 (bfd_get_section_userdata): Delete. 1130 (bfd_section_name, bfd_section_size, bfd_section_vma), 1131 (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. 1132 (bfd_section_flags, bfd_section_userdata): New. 1133 (bfd_is_com_section): Rename parameter. 1134 * section.c (bfd_set_section_userdata, bfd_set_section_vma), 1135 (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), 1136 (bfd_set_section_size): Delete bfd parameter, rename section parameter. 1137 (bfd_set_section_lma): New. 1138 * bfd-in2.h: Regenerate. 1139 * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, 1140 update callers. 1141 * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, 1142 * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, 1143 * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, 1144 * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, 1145 * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, 1146 * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, 1147 * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, 1148 * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, 1149 * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, 1150 * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, 1151 * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, 1152 * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, 1153 * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, 1154 * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, 1155 * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, 1156 * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, 1157 * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, 1158 * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, 1159 * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, 1160 * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, 1161 * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, 1162 * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, 1163 * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, 1164 * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, 1165 * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, 1166 * xcofflink.c: Update throughout for bfd section macro and function 1167 changes. 1168 11692019-09-18 Alan Modra <amodra@gmail.com> 1170 1171 * bfd-in.h (bfd_asymbol_section): Rename from bfd_get_section. 1172 (bfd_get_output_section): Delete. 1173 (bfd_asymbol_base): Delete. 1174 (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name), 1175 (bfd_asymbol_bfd, bfd_asymbol_flavour): Tidy. 1176 (bfd_set_asymbol_name): New macro. 1177 * bfd-in2.h: Regenerate. 1178 * aout-cris.c: Update throughout to use bfd_asymbol_section. 1179 * aoutx.h: Likewise. 1180 * cofflink.c: Likewise. 1181 * dwarf2.c: Likewise. 1182 * ecoff.c: Likewise. 1183 * elf.c: Likewise. 1184 * elf32-arm.c: Likewise. 1185 * elf32-mips.c: Likewise. 1186 * elf32-score.c: Likewise. 1187 * elf32-score7.c: Likewise. 1188 * elfn32-mips.c: Likewise. 1189 * elfnn-aarch64.c: Likewise. 1190 * elfxx-mips.c: Likewise. 1191 * linker.c: Likewise. 1192 * pdp11.c: Likewise. 1193 * elf64-mmix.c (mmix_elf_reloc): Part expand bfd_get_output_section. 1194 11952019-09-18 Simon Marchi <simon.marchi@polymtl.ca> 1196 1197 * Makefile.in: Re-generate. 1198 * configure: Re-generate. 1199 * doc/Makefile.in: Re-generate. 1200 12012019-09-18 Alan Modra <amodra@gmail.com> 1202 1203 * aoutx.h (slurp_symbol_table): Don't set symcount using bfd_get 1204 macros. 1205 * pdp11.c (slurp_symbol_table): Likewise. 1206 * som.c (som_slurp_symbol_table): Likewise. 1207 * coff-ppc.c (ppc_bfd_coff_final_link): Likewise. 1208 * coffcode.h (coff_slurp_symbol_table): Likewise. 1209 * cofflink.c (_bfd_coff_final_link): Likewise. 1210 * ecoff.c (ecoff_slurp_symbolic_header): Likewise. 1211 (_bfd_ecoff_slurp_symbolic_info): Likewise. 1212 (_bfd_ecoff_slurp_symbol_table): Likewise. 1213 (_bfd_ecoff_bfd_final_link): Likewise. 1214 * elf.c (_bfd_elf_canonicalize_symtab): Likewise. 1215 * elflink.c (elf_link_output_symstrtab): Likewise. 1216 (bfd_elf_final_link): Likewise. 1217 * peicode.h (pe_ILF_build_a_bfd): Likewise. 1218 * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. 1219 * aoutx.h (some_aout_object_p, slurp_symbol_table): Don't set 1220 start_address or symcount using bfd_get macros. 1221 * coffgen.c (coff_real_object_p): Likewise. 1222 * pdp11.c (some_aout_object_p, slurp_symbol_table): Likewise. 1223 * som.c (som_object_setup, som_slurp_symbol_table): Likewise. 1224 * elfcore.h (elf_core_file_p): Don't set start_address using 1225 bfd_get macro. 1226 * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Don't set dynsymcount 1227 using bfd_get macro. 1228 * bfd.c (bfd_set_file_flags): Don't set flags using bfd_get macro. 1229 * linker.c (bfd_generic_link_read_symbols): Don't set outsymbols 1230 or symcount using bfd_get macros. 1231 (_bfd_generic_final_link, generic_add_output_symbol): Likewise. 1232 * syms.c (bfd_set_symtab): Likewise. 1233 * vms-alpha.c (alpha_vms_bfd_final_link): Likewise. 1234 * archive.c (do_slurp_bsd_armap): Don't set has_armap using 1235 bfd_has_map macro. 1236 (do_slurp_coff_armap, bfd_slurp_armap): Likewise. 1237 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise. 1238 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise. 1239 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise. 1240 * ecoff.c (_bfd_ecoff_slurp_armap): Likewise. 1241 * som.c (som_slurp_armap): Likewise. 1242 12432019-09-18 Alan Modra <amodra@gmail.com> 1244 1245 * archures.c (bfd_get_arch): Make param const. 1246 (bfd_get_mach, bfd_arch_bits_per_byte): Likewise. 1247 (bfd_arch_bits_per_address, bfd_octets_per_byte): Likewise. 1248 * bfd-in2.h: Regenerate. 1249 12502019-09-18 Alan Modra <amodra@gmail.com> 1251 1252 * bfd-in.h (carsym.name): Make const. 1253 * reloc.c (struct reloc_howto_struct.name): Likewise. 1254 * targets.c (bfd_target.name): Likewise.! 1255 * bfd.c (bfd_get_sign_extend_vma): Make variable const. 1256 * som.c (som_bfd_fill_in_ar_symbols): Use an intermediary variable 1257 when setting carsym.name. 1258 * bfd-in2.h: Regenerate. 1259 12602019-09-18 Alan Modra <amodra@gmail.com> 1261 1262 * mach-o.c (bfd_mach_o_fat_member_init): Likewise. Replace 1263 xstrdup and xmalloc with bfd_strdup and bfd_malloc. Return an 1264 error status. Adjust calls. 1265 * vms-lib.c (_bfd_vms_lib_get_module): Test mhd->id earlier. 1266 Close bfd on failure. Replace xstrdup/bfd_alloc use with 1267 bfd_malloc. Use bfd_set_filename. 1268 12692019-09-18 Alan Modra <amodra@gmail.com> 1270 1271 * elf64-ppc.c (must_be_dyn_reloc): Return 0 for TOC16 relocs. 1272 (ppc64_elf_check_relocs): Support dynamic/copy relocs for TOC16. 1273 (ppc64_elf_adjust_dynamic_symbol): Don't keep dynamic reloc when 1274 needs_copy even if all relocs are in rw sections. 1275 (dec_dynrel_count): Handle TOC16 relocs. 1276 (ppc64_elf_relocate_section): Support dynamic relocs for TOC16. 1277 (ppc64_elf_finish_dynamic_symbol): Adjust to handle needs_copy 1278 semantic change. 1279 12802019-09-16 Phil Blundell <pb@pbcl.net> 1281 1282 * version.m4: Set version to 2.33.50. 1283 * Makefile.in, configure, doc/Makefile.in: Regenerated. 1284 12852019-09-11 Tom Tromey <tom@tromey.com> 1286 1287 * opncls.c (bfd_set_filename): New function. 1288 * bfd-in2.h: Regenerate. 1289 12902019-09-11 Alan Modra <amodra@gmail.com> 1291 1292 * targets.c (struct bfd_target): Add _bfd_group_name. 1293 (BFD_JUMP_TABLE): Likewise. 1294 * coffgen.c (bfd_coff_group_name): New function. 1295 * elf.c (bfd_elf_group_name): New function. 1296 * linker.c (_bfd_nolink_bfd_group_name): New function. 1297 * section.c (bfd_generic_group_name): New function. 1298 * elf-bfd.h (bfd_elf_group_name): Declare. 1299 * libbfd-in.h (_bfd_nolink_bfd_group_name): Declare. 1300 * libcoff-in.h (bfd_coff_group_name): Declare. 1301 * aout-target.h (MY_bfd_group_name): Define. 1302 * aout-tic30.c (MY_bfd_group_name): Define. 1303 * bfd.c (bfd_group_name): Define. 1304 * binary.c (binary_bfd_group_name): Define. 1305 * coff-alpha.c (_bfd_ecoff_bfd_group_name): Define. 1306 * coff-mips.c (_bfd_ecoff_bfd_group_name): Define. 1307 * coff-rs6000.c (_bfd_xcoff_bfd_group_name): Define. 1308 * coffcode.h (coff_bfd_group_name): Define. 1309 * elfxx-target.h (bfd_elfNN_bfd_group_name): Define. 1310 * i386msdos.c (msdos_bfd_group_name): Define. 1311 * ihex.c (ihex_bfd_group_name): Define. 1312 * mach-o-target.c (bfd_mach_o_bfd_group_name): Define. 1313 * mmo.c (mmo_bfd_group_name): Define. 1314 * pef.c (bfd_pef_bfd_group_name): Define. 1315 * plugin.c (bfd_plugin_bfd_group_name): Define. 1316 * ppcboot.c (ppcboot_bfd_group_name): Define. 1317 * som.c (som_bfd_group_name): Define. 1318 * srec.c (srec_bfd_group_name): Define. 1319 * tekhex.c (tekhex_bfd_group_name): Define. 1320 * verilog.c (verilog_bfd_group_name): Define. 1321 * vms-alpha.c (vms_bfd_group_name, alpha_vms_bfd_group_name): Define. 1322 * xsym.c (bfd_sym_bfd_group_name): Define. 1323 * coff64-rs6000.c (rs6000_xcoff64_vec): Init new field. 1324 (rs6000_xcoff64_aix_vec): Likewise. 1325 * bfd-in2.h: Regenerate. 1326 * libbfd.h: Regenerate. 1327 * libcoff.h: Regenerate. 1328 13292019-09-10 Nick Clifton <nickc@redhat.com> 1330 1331 PR 24907 1332 * archures.c (bfd_arch_info_type): Add max_reloc_offset_into_insn 1333 field. 1334 (bfd_default_arch_struct): Initialise the new field. 1335 * bfd-in2.h: Regenerate. 1336 * cpu-aarch64.c: Initialise the new field. 1337 * cpu-alpha.c: Likewise. 1338 * cpu-arc.c: Likewise. 1339 * cpu-arm.c: Likewise. 1340 * cpu-avr.c: Likewise. 1341 * cpu-bfin.c: Likewise. 1342 * cpu-bpf.c: Likewise. 1343 * cpu-cr16.c: Likewise. 1344 * cpu-cr16c.c: Likewise. 1345 * cpu-cris.c: Likewise. 1346 * cpu-crx.c: Likewise. 1347 * cpu-csky.c: Likewise. 1348 * cpu-d10v.c: Likewise. 1349 * cpu-d30v.c: Likewise. 1350 * cpu-dlx.c: Likewise. 1351 * cpu-epiphany.c: Likewise. 1352 * cpu-fr30.c: Likewise. 1353 * cpu-frv.c: Likewise. 1354 * cpu-ft32.c: Likewise. 1355 * cpu-h8300.c: Likewise. 1356 * cpu-hppa.c: Likewise. 1357 * cpu-i386.c: Likewise. 1358 * cpu-ia64.c: Likewise. 1359 * cpu-iamcu.c: Likewise. 1360 * cpu-ip2k.c: Likewise. 1361 * cpu-iq2000.c: Likewise. 1362 * cpu-k1om.c: Likewise. 1363 * cpu-l1om.c: Likewise. 1364 * cpu-lm32.c: Likewise. 1365 * cpu-m10200.c: Likewise. 1366 * cpu-m10300.c: Likewise. 1367 * cpu-m32c.c: Likewise. 1368 * cpu-m32r.c: Likewise. 1369 * cpu-m68hc11.c: Likewise. 1370 * cpu-m68hc12.c: Likewise. 1371 * cpu-m68k.c: Likewise. 1372 * cpu-m9s12x.c: Likewise. 1373 * cpu-m9s12xg.c: Likewise. 1374 * cpu-mcore.c: Likewise. 1375 * cpu-mep.c: Likewise. 1376 * cpu-metag.c: Likewise. 1377 * cpu-microblaze.c: Likewise. 1378 * cpu-mips.c: Likewise. 1379 * cpu-mmix.c: Likewise. 1380 * cpu-moxie.c: Likewise. 1381 * cpu-msp430.c: Likewise. 1382 * cpu-mt.c: Likewise. 1383 * cpu-nds32.c: Likewise. 1384 * cpu-nfp.c: Likewise. 1385 * cpu-nios2.c: Likewise. 1386 * cpu-ns32k.c: Likewise. 1387 * cpu-or1k.c: Likewise. 1388 * cpu-pdp11.c: Likewise. 1389 * cpu-pj.c: Likewise. 1390 * cpu-plugin.c: Likewise. 1391 * cpu-powerpc.c: Likewise. 1392 * cpu-pru.c: Likewise. 1393 * cpu-riscv.c: Likewise. 1394 * cpu-rl78.c: Likewise. 1395 * cpu-rs6000.c: Likewise. 1396 * cpu-rx.c: Likewise. 1397 * cpu-s12z.c: Likewise. 1398 * cpu-s390.c: Likewise. 1399 * cpu-score.c: Likewise. 1400 * cpu-sh.c: Likewise. 1401 * cpu-sparc.c: Likewise. 1402 * cpu-spu.c: Likewise. 1403 * cpu-tic30.c: Likewise. 1404 * cpu-tic4x.c: Likewise. 1405 * cpu-tic54x.c: Likewise. 1406 * cpu-tic6x.c: Likewise. 1407 * cpu-tic80.c: Likewise. 1408 * cpu-tilegx.c: Likewise. 1409 * cpu-tilepro.c: Likewise. 1410 * cpu-v850.c: Likewise. 1411 * cpu-v850_rh850.c: Likewise. 1412 * cpu-vax.c: Likewise. 1413 * cpu-visium.c: Likewise. 1414 * cpu-wasm32.c: Likewise. 1415 * cpu-xc16x.c: Likewise. 1416 * cpu-xgate.c: Likewise. 1417 * cpu-xstormy16.c: Likewise. 1418 * cpu-xtensa.c: Likewise. 1419 * cpu-z80.c: Likewise. 1420 * cpu-z8k.c: Likewise. 1421 14222019-09-09 Phil Blundell <pb@pbcl.net> 1423 1424 binutils 2.33 branch created. 1425 14262019-09-06 Alan Modra <amodra@gmail.com> 1427 1428 * aout-target.h (object_p): Formatting. 1429 * bfd-in.h (bfd_get_filename): Don't cast to char*. 1430 * corefile.c (generic_core_file_matches_executable_p): Constify 1431 variables and remove cast. 1432 * bfd-in2.h: Regenerate. 1433 14342019-09-05 Alan Modra <amodra@gmail.com> 1435 1436 * elf64-ppc.c (ppc64_elf_check_relocs): Interpret an addend in 1437 GOT_PCREL and PLT_PCREL relocs as affecting the value stored 1438 in the GOT/PLT entry rather than affecting the offset to that 1439 GOI/PLT entry. 1440 (ppc64_elf_edit_toc, ppc64_elf_relocate_section): Likewise. 1441 14422019-09-05 Alan Modra <amodra@gmail.com> 1443 1444 * elf64-ppc.c (xlate_pcrel_opt): Handle prefix loads and stores 1445 in second instruction. 1446 (ppc64_elf_relocate_section): Likewise. 1447 14482019-09-05 Alan Modra <amodra@gmail.com> 1449 1450 PR 24955 1451 * libbfd-in.h (bfd_strdup): New inline function. 1452 * archive.c (_bfd_get_elt_at_filepos): Use bfd_strdup. Close 1453 bfd on error. 1454 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Use bfd_strdup. 1455 * opncls.c (bfd_fopen): Use bfd_strdup. Close fd and stream 1456 on error. 1457 (bfd_openstreamr): Use bfd_strdup. 1458 (bfd_openr_iovec, bfd_openw, bfd_create): Likewise. 1459 * plugin.c (try_load_plugin): Use bfd_malloc. 1460 * libbfd.h: Regenerate. 1461 14622019-09-02 Alan Modra <amodra@gmail.com> 1463 1464 PR 11983 1465 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Free debug_filename 1466 on success. Tidy. 1467 (read_alt_indirect_string): Likewise. 1468 (read_alt_indirect_ref): Likewise. 1469 14702019-08-31 Jim Wilson <jimw@sifive.com> 1471 1472 PR 23825 1473 * elfnn-riscv.c (riscv_elf_create_dynamic_sections): Add SEC_LOAD, 1474 SEC_DATA, and SEC_HAS_CONTENTS to .tdata.dyn section. 1475 14762019-08-30 Jim Wilson <jimw@sifive.com> 1477 1478 * elfnn-riscv.c (riscv_elf_relocate_section): For unresolvable reloc 1479 error, call bfd_set_error, set ret to FALSE, and goto out label. 1480 14812019-08-30 H.J. Lu <hongjiu.lu@intel.com> 1482 1483 PR ld/24951 1484 * archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS, 1485 BFD_DECOMPRESS and BFD_COMPRESS_GABI flags for thin archive. 1486 14872019-08-29 Alan Modra <amodra@gmail.com> 1488 1489 PR 24697 1490 * elf32-ppc.c (ppc_elf_check_relocs): Call bad_shared_reloc 1491 when !bfd_link_executable for R_PPC_EMB_SDA2I16 and 1492 R_PPC_EMB_SDA2REL. Don't call bad_shared_reloc for any other 1493 reloc. 1494 14952019-08-29 Alan Modra <amodra@gmail.com> 1496 1497 * elf64-ppc.c (xlate_pcrel_opt): Add poff parameter. Allow offset 1498 on second insn, return it in poff. 1499 (ppc64_elf_relocate_section): Add offset to paddi addend for 1500 PCREL_OPT. 1501 15022019-08-28 Jim Wilson <jimw@sifive.com> 1503 1504 * elfnn-riscv.c (_bfd_riscv_relax_lui): Add check to exclude abs 1505 section when setting max_alignment. Update comment. 1506 (_bfd_riscv_relax_pc): Likewise. 1507 15082019-08-29 Alan Modra <amodra@gmail.com> 1509 1510 PR 24891 1511 * bfd.c (struct bfd): Add no_element_cache. 1512 * archive.c (_bfd_get_elt_at_filepos): Don't add element to 1513 archive cache when no_element_cache. 1514 (bfd_generic_archive_p): Set no_element_cache when opening first 1515 element to check format. Close first element too. 1516 (do_slurp_bsd_armap): Don't zero ardata->cache here. 1517 * bfd-in2.h: Regenerate. 1518 15192019-08-24 Alan Modra <amodra@gmail.com> 1520 1521 * elf64-ppc.c (ppc64_elf_edit_toc): Exclude undefined weak 1522 symbols from GOT optimisation. 1523 15242019-08-23 Stafford Horne <shorne@gmail.com> 1525 1526 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Use correct value for 1527 PLT GOT entries. 1528 15292019-08-23 Nick Clifton <nickc@redhat.com> 1530 1531 PR 24456 1532 * elf.c (bfd_section_from_shdr): Issue an informative warning 1533 message and continue processing other sections after encountering 1534 a reloc section for a section which already has other relocs 1535 associated with it. 1536 15372019-08-23 Alan Modra <amodra@gmail.com> 1538 1539 PR 24933 1540 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Don't exit 1541 on error without freeing plts[] contents. 1542 15432019-08-22 Dennis Zhang <dennis.zhang@arm.com> 1544 1545 * cpu-arm.c: New entries for Cortex-M35P, Cortex-A77, Cortex-A76AE. 1546 15472019-08-22 Nick Clifton <nickc@redhat.com> 1548 1549 PR 24922 1550 * pei-x86_64.c (pex64_xdata_print_uwd_codes): Add checks before 1551 reading data from extra records. 1552 15532019-08-22 Tamar Christina <tamar.christina@arm.com> 1554 1555 PR ld/24601 1556 * elfnn-aarch64.c (aarch64_relocate): Handle weak TLS and undefined TLS. 1557 Also Pass input_bfd to _bfd_aarch64_elf_resolve_relocation. 1558 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use it. 1559 * elfxx-aarch64.h (_bfd_aarch64_elf_resolve_relocation): Emit warning 1560 for weak TLS. 1561 15622019-08-22 Alan Modra <amodra@gmail.com> 1563 1564 * elf32-arm.c (cmse_scan): Don't use ARM_GET_SYM_CMSE_SPCL, 1565 instead recognize CMSE_PREFIX in symbol name. 1566 (elf32_arm_gc_mark_extra_sections): Likewise. 1567 (elf32_arm_filter_cmse_symbols): Don't test ARM_GET_SYM_CMSE_SPCL. 1568 (elf32_arm_swap_symbol_in): Don't invoke ARM_SET_SYM_CMSE_SPCL. 1569 15702019-08-20 Dennis Zhang <dennis.zhang@arm.com> 1571 1572 * cpu-aarch64.c: New entries for Cortex-A34, Cortex-A65, 1573 Cortex-A77, cortex-A65AE, and Cortex-A76AE. 1574 15752019-08-20 Tamar Christina <tamar.christina@arm.com> 1576 1577 * elf32-arm.c (elf32_thumb2_plt_entry, elf32_arm_plt_thumb_stub, 1578 elf32_arm_stub_long_branch_v4t_thumb_thumb, 1579 elf32_arm_stub_long_branch_v4t_thumb_arm, 1580 elf32_arm_stub_short_branch_v4t_thumb_arm, 1581 elf32_arm_stub_long_branch_v4t_thumb_arm_pic, 1582 elf32_arm_stub_long_branch_v4t_thumb_thumb_pic, 1583 elf32_arm_stub_long_branch_v4t_thumb_tls_pic): Change nop to branch to 1584 previous instruction. 1585 15862019-08-19 Tom Tromey <tromey@adacore.com> 1587 1588 * dwarf2.c (_bfd_dwarf2_find_symbol_bias): Create hash table 1589 holding symbols. 1590 15912019-08-19 Alan Modra <amodra@gmail.com> 1592 1593 * elf64-ppc.c (struct ppc64_elf_obj_tdata): Rename has_gotrel 1594 to has_optrel. 1595 (struct _ppc64_elf_section_data): Likewise. 1596 (ppc64_elf_check_relocs): Set has_optrel for more relocs. 1597 (ppc64_elf_edit_toc): Do ha/lo insn checks in GOT loop rather 1598 than TOC loop. Check PLT16 insns too. 1599 16002019-08-16 H.J. Lu <hongjiu.lu@intel.com> 1601 1602 PR ld/24905 1603 * elf64-x86-64.c (elf_x86_64_check_relocs): Move PIC check for 1604 PC-relative relocations back to ... 1605 (elf_x86_64_relocate_section): Here. 1606 16072019-08-16 Martin Liska <mliska@suse.cz> 1608 1609 PR ld/24912 1610 * elflink.c: Report error only for not relocatable. 1611 * linker.c (_bfd_generic_link_add_one_symbol): Do not handle 1612 here lto_slim_object as it's handled in caller. 1613 16142019-08-16 Alan Modra <amodra@gmail.com> 1615 1616 * elf32-ppc.c (ppc_elf_relocate_section): Optimize unaligned relocs. 1617 16182019-08-15 Jim Wilson <jimw@sifive.com> 1619 1620 * elfnn-riscv.c (perform_relocation) <R_RISCV_RVC_LUI>: If 1621 RISCV_CONST_HIGH_PART (value) is zero, then convert c.lui instruction 1622 to c.li instruction, and use ENCODE_RVC_IMM to set value. 1623 16242019-08-15 Tom Tromey <tromey@adacore.com> 1625 1626 * dwarf2.c (scan_unit_for_symbols): Check for end of CU, not end 1627 of section. 1628 16292019-08-14 Alan Modra <amodra@gmail.com> 1630 1631 PR 24623 1632 * dwarf2.c (stash_comp_unit): New function, extracted from.. 1633 (_bfd_dwarf2_find_nearest_line): ..here. 1634 (find_abstract_instance): Parse comp units and decode line info 1635 as needed. 1636 16372019-08-14 Alan Modra <amodra@gmail.com> 1638 1639 * dwarf2.c (comp_unit_maybe_decode_line_info): Declare. 1640 (comp_unit_find_nearest_line): Use it here.. 1641 (_bfd_dwarf2_find_symbol_bias): ..and here. 1642 16432019-08-14 Alan Modra <amodra@gmail.com> 1644 1645 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Remove addr_size parameter. 1646 * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. 1647 * coffgen.c (coff_find_nearest_line_with_names): Adjust 1648 _bfd_dwarf2_find_nearest_line calls. 1649 * elf.c (_bfd_elf_find_nearest_line, _bfd_elf_find_line): Likewise. 1650 * elf32-arm.c (elf32_arm_find_nearest_line): Likewise. 1651 * elf64-alpha.c (elf64_alpha_find_nearest_line): Likewise. 1652 * elfnn-aarch64.c (elfNN_aarch64_find_nearest_line): Likewise. 1653 * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Likewise. 1654 * mach-o.c (bfd_mach_o_find_nearest_line): Likewise. 1655 * libbfd.h: Regenerate. 1656 16572019-08-09 Mihailo Stojanovic <mihailo.stojanovic@rt-rk.com> 1658 1659 * elf-bfd.h (struct elf_backend_data): New members. 1660 * elflink.c (_bfd_elf_link_create_dynamic_sections): Create 1661 .gnu.hash section if necessary. 1662 (struct collect_gnu_hash_codes): New member. 1663 (elf_gnu_hash_process_symidx): New function name. 1664 (elf_renumber_gnu_hash_syms): Ignore local and undefined 1665 symbols. Record xlat location for every symbol which should have 1666 a .MIPS.xhash entry. 1667 (bfd_elf_size_dynamic_sections): Add DT_GNU_HASH dynamic tag to 1668 dynamic section if necessary. 1669 (GNU_HASH_SECTION_NAME): New define. 1670 (bfd_elf_size_dynsym_hash_dynstr): Get .MIPS.xhash section. 1671 Update the section size info. 1672 * elfxx-mips.c (struct mips_elf_hash_sort_data): New members. 1673 (struct mips_elf_link_hash_entry): New member. 1674 (mips_elf_link_hash_newfunc): Initialize .MIPS.xhash translation 1675 table location. 1676 (mips_elf_sort_hash_table): Initialize the pointer to the 1677 .MIPS.xhash section. 1678 (mips_elf_sort_hash_table_f): Populate the .MIPS.xhash 1679 translation table entry with the symbol dynindx. 1680 (_bfd_mips_elf_section_from_shdr): Add SHT_MIPS_XHASH. 1681 (_bfd_mips_elf_fake_sections): Initialize .MIPS.xhash section 1682 info. 1683 (_bfd_mips_elf_create_dynamic_sections): Create .MIPS.xhash 1684 section. 1685 (_bfd_mips_elf_size_dynamic_sections): Add DT_MIPS_XHASH tag to 1686 dynamic section. 1687 (_bfd_mips_elf_finish_synamic_sections): Add DT_MIPS_XHASH. 1688 (_bfd_mips_elf_final_write_processing): Set .MIPS.xhash section 1689 sh_link info. 1690 (_bfd_mips_elf_get_target_dtag): Get DT_MIPS_XHASH tag. 1691 (MIPS_LIBC_ABI_XHASH): New ABI version enum value. 1692 (_bfd_mips_post_process_headers): Mark the ABI version as 1693 MIPS_LIBC_ABI_XHASH if there exists a .MIPS.xhash section, 1694 but not a .hash section. 1695 (_bfd_mips_elf_record_xhash_symbol): New function. Record a 1696 position in the translation table, associated with the hash 1697 entry. 1698 * elfxx-mips.h (literal_reloc_p): Define 1699 elf_backend_record_xhash_symbol backend hook. 1700 * elfxx-target.h: Initialize elf_backend_record_xhash_symbol 1701 backend hook. 1702 17032019-08-07 Jose E. Marchesi <jose.marchesi@oracle.com> 1704 1705 * elf64-bpf.c (bpf_elf_relocate_section): New function. 1706 (bpf_elf_insn_disp_reloc): Delete function. 1707 (elf_backend_relocate_section): Define. 1708 17092019-08-07 Alan Modra <amodra@gmail.com> 1710 1711 PR 24644 1712 * archive64.c (_bfd_archive_64_bit_slurp_armap): Properly check 1713 for overflow in expressions involving nsymz. 1714 17152019-08-01 Ilia Diachkov <ilia.diachkov@optimitech.com> 1716 1717 * elfnn-riscv.c (_bfd_riscv_relax_lui): Set lui relax safety area to 1718 two pages in relro presence. 1719 17202019-08-01 Max Filippov <jcmvbkbc@gmail.com> 1721 1722 * elf32-xtensa.c (insn_num_slots, get_rsr_lend_opcode) 1723 (get_wsr_lbeg_opcode): New functions. 1724 (check_loop_aligned): Detect relaxed loops and adjust loop_len 1725 and insn_len for the first actual instruction of the loop. 1726 17272019-07-30 Alan Modra <amodra@gmail.com> 1728 1729 PR 24768 1730 * bfd.c (struct bfd): Add lto_slim_object flag. 1731 * bfd-in2.h: Regenerate. 1732 17332019-07-29 Martin Liska <mliska@suse.cz> 1734 1735 PR 24768 1736 * archive.c (_bfd_compute_and_write_armap): Come up with 1737 report_plugin_err variable. 1738 * bfd-in2.h (struct bfd): Add lto_slim_object flag. 1739 * elf.c (struct lto_section): New. 1740 (_bfd_elf_make_section_from_shdr): Parse content of 1741 .gnu_lto_.lto section. 1742 * elflink.c: Report error for a missing LTO plugin. 1743 * linker.c (_bfd_generic_link_add_one_symbol): Likewise. 1744 17452019-07-28 Alan Modra <amodra@gmail.com> 1746 1747 PR 24857 1748 PR 24339 1749 * elflink.c (elf_link_add_object_symbols): Report an informative 1750 error on finding local symbols with index equal or greater than 1751 symbol table sh_info. Correct comment. Allow such symbols in 1752 dynamic objects. Abort on NULL section for symbol. 1753 17542019-07-26 Alan Modra <amodra@gmail.com> 1755 1756 * elf-bfd.h (struct output_elf_obj_tdata): Delete "linker" field. 1757 (elf_linker): Don't define. 1758 * elflink.c (bfd_elf_final_link): Don't set elf_linker. 1759 17602019-07-25 YunQiang Su <syq@debian.org> 1761 1762 PR 24832 1763 * elfxx-mips.c (mips_set_isa_flags): Default to MIPS 3 for 64-bit 1764 mips inputs. 1765 17662019-07-24 Claudiu Zissulescu <claziss@synopsys.com> 1767 1768 * elf32-arc.c (bfd_get_32_me): Add a small description, fix 1769 formating. 1770 (reloc_type_to_name): Fix formating. 1771 (arc_elf_object_p): Likewise. 1772 (debug_arc_reloc): Likewise. 1773 (arc_do_relocation): Likewise. 1774 17752019-07-24 Claudiu Zissulescu <claziss@synopsys.com> 1776 1777 * elf32-arc.c (bfd_get_32_me): New function. 1778 (bfd_put_32_me): Likewise. 1779 (arc_elf_relax_section): Likewise. 1780 (bfd_elf32_bfd_relax_section): Define. 1781 17822019-07-24 Alan Modra <amodra@gmail.com> 1783 1784 * elf-bfd.h (struct elf_backend_data): Return bfd_boolean from 1785 elf_backend_final_write_processing, don't pass linker arg. 1786 (_bfd_elf_final_write_processing): Update prototype. 1787 * elf.c (_bfd_elf_write_object_contents): Adjust call. 1788 (_bfd_elf_final_write_processing): Return error on incompatible 1789 OSABI and has_gnu_osabi. Remove linker arg. 1790 * elf-nacl.h (nacl_final_write_processing): Update prototype. 1791 * elf-vxworks.h (elf_vxworks_final_write_processing): Likewise. 1792 * elfxx-mips.h (_bfd_mips_final_write_processing): Likewise. 1793 (_bfd_mips_elf_final_write_processing): Likewise. 1794 * elf-hppa.h (elf_hppa_final_write_processing): Return status 1795 and remove linker arg. 1796 * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise. 1797 * elf-nacl.c (nacl_final_write_processing): Likewise. 1798 * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise. 1799 * elf32-arc.c (arc_elf_final_write_processing): Likewise. 1800 * elf32-arm.c (arm_final_write_processing): Likewise. 1801 (elf32_arm_final_write_processing): Likewise. 1802 (elf32_arm_nacl_final_write_processing): Likewise. 1803 (elf32_arm_vxworks_final_write_processing): Likewise. 1804 * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise. 1805 * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise. 1806 * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise. 1807 * elf32-cris.c (cris_elf_final_write_processing): Likewise. 1808 * elf32-h8300.c (elf32_h8_final_write_processing): Likewise. 1809 * elf32-lm32.c (lm32_elf_final_write_processing): Likewise. 1810 * elf32-m32r.c (m32r_elf_final_write_processing): Likewise. 1811 * elf32-m68k.c (elf_m68k_final_write_processing): Likewise. 1812 * elf32-mips.c (mips_vxworks_final_write_processing): Likewise. 1813 * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise. 1814 * elf32-nds32.c (nds32_elf_final_write_processing): Likewise. 1815 * elf32-or1k.c (or1k_elf_final_write_processing): Likewise. 1816 * elf32-pj.c (pj_elf_final_write_processing): Likewise. 1817 * elf32-ppc.c (ppc_final_write_processing): Likewise. 1818 (ppc_elf_final_write_processing): Likewise. 1819 (ppc_elf_vxworks_final_write_processing): Likewise. 1820 * elf32-sparc.c (sparc_final_write_processing): Likewise. 1821 (elf32_sparc_final_write_processing): Likewise. 1822 (elf32_sparc_vxworks_final_write_processing): Likewise. 1823 * elf32-v850.c (v850_elf_final_write_processing): Likewise. 1824 * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise. 1825 * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise. 1826 * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise. 1827 * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise. 1828 * elfxx-mips.c (_bfd_mips_final_write_processing): Likewise. 1829 (_bfd_mips_elf_final_write_processing): Likewise. 1830 18312019-07-24 Alan Modra <amodra@gmail.com> 1832 1833 * elf-vxworks.c (elf_vxworks_final_write_processing): Don't return 1834 early. 1835 * elf32-arc.c (arc_elf_final_write_processing): Likewise. 1836 * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise. 1837 18382019-07-24 Alan Modra <amodra@gmail.com> 1839 1840 * elf32-visium.c (visium_elf_post_process_headers): Don't set 1841 EI_OSABI header byte here. 1842 (ELF_OSABI): Define. 1843 18442019-07-23 Alan Modra <amodra@gmail.com> 1845 1846 * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_mbind. 1847 * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_mbind. 1848 (get_program_header_size): Formatting. Only test SH_GNU_MBIND 1849 when elf_gnu_osabi_mbind is set. 1850 (_bfd_elf_map_sections_to_segments): Likewise. 1851 (_bfd_elf_init_private_section_data): Likewise. 1852 (_bfd_elf_final_write_processing): Update comment. 1853 * elf64-hppa.c (elf64_hppa_special_sections): Move .tbss entry. 1854 (elf_backend_special_sections): Define without .tbss for linux. 1855 18562019-07-23 Alan Modra <amodra@gmail.com> 1857 1858 * elf-bfd.h (enum elf_gnu_osabi): Rename from elf_gnu_symbols. 1859 Remove none, any, all enums. 1860 (struct elf_obj_tdata): Rename has_gnu_symbols field to has_gnu_osabi. 1861 (_bfd_elf_final_write_processing): Declare. 1862 * elf.c (_bfd_elf_write_object_contents): Unconditionally call 1863 elf_backend_final_write_processing. 1864 (_bfd_elf_post_process_headers): Move body of function to.. 1865 (_bfd_elf_final_write_processing): ..here, but set EI_OSABI byte 1866 only when not already set. Adjust for rename. 1867 * elfxx-target.h (elf_backend_final_write_processing): Default to 1868 _bfd_elf_final_write_processing. 1869 * elf-hppa.h (elf_hppa_final_write_processing): Call 1870 _bfd_elf_final_write_processing. 1871 * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise. 1872 * elf-nacl.c (nacl_final_write_processing): Likewise. 1873 * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise. 1874 * elf32-arc.c (arc_elf_final_write_processing): Likewise. 1875 * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise. 1876 * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise. 1877 * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise. 1878 * elf32-cris.c (cris_elf_final_write_processing): Likewise. 1879 * elf32-h8300.c (elf32_h8_final_write_processing): Likewise. 1880 * elf32-lm32.c (lm32_elf_final_write_processing): Likewise. 1881 * elf32-m32r.c (m32r_elf_final_write_processing): Likewise. 1882 * elf32-m68k.c (elf_m68k_final_write_processing): Likewise. 1883 * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise. 1884 * elf32-nds32.c (nds32_elf_final_write_processing): Likewise. 1885 * elf32-or1k.c (or1k_elf_final_write_processing): Likewise. 1886 * elf32-pj.c (pj_elf_final_write_processing): Likewise. 1887 * elf32-v850.c (v850_elf_final_write_processing): Likewise. 1888 * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise. 1889 * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise. 1890 * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise. 1891 * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise. 1892 * elf32-arm.c (arm_final_write_processing): Split out from.. 1893 (elf32_arm_final_write_processing): ..here. Call 1894 _bfd_elf_final_write_processing. 1895 (elf32_arm_nacl_final_write_processing): Adjust. 1896 * elfxx-mips.c (_bfd_mips_final_write_processing): Split out from.. 1897 (_bfd_mips_elf_final_write_processing): ..here. Call 1898 _bfd_elf_final_write_processing. 1899 * elfxx-mips.h (_bfd_mips_final_write_processing): Declare. 1900 * elf32-mips.c (mips_vxworks_final_write_processing): Adjust. 1901 * elf32-ppc.c (ppc_final_write_processing): Split out from.. 1902 (ppc_elf_final_write_processing): ..here. Call 1903 _bfd_elf_final_write_processing. 1904 (ppc_elf_vxworks_final_write_processing): Adjust. 1905 * elf32-sparc.c (sparc_final_write_processing): Split out from.. 1906 (elf32_sparc_final_write_processing): ..here. Call 1907 _bfd_elf_final_write_processing. 1908 (elf32_sparc_vxworks_final_write_processing): Adjust. 1909 * elf32-d10v.c (elf_backend_final_write_processing): Don't define. 1910 * elf32-d30v.c (elf_backend_final_write_processing): Don't define. 1911 * elf32-m68hc11.c (elf_backend_final_write_processing): Don't define. 1912 * elf32-m68hc12.c (elf_backend_final_write_processing): Don't define. 1913 * elf32-s12z.c (elf_backend_final_write_processing): Don't define. 1914 * elf32-i386.c (elf_i386_check_relocs): Don't set has_gnu_symbols. 1915 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. 1916 * elflink.c (elf_link_add_object_symbols): Likewise. 1917 (elf_link_output_symstrtab): Set has_gnu_osabi for symbols here 1918 instead. 1919 19202019-07-23 Omar Majid <omajid@redhat.com> 1921 1922 * coffcode.h (coff_set_arch_mach_hook): Handle I386_APPLE_MAGIC, 1923 I386_FREEBSD_MAGIC, I386_LINUX_MAGIC, I386_NETBSD_MAGIC, 1924 AMD64_APPLE_MAGIC, AMD64_FREEBSD_MAGIC, AMD64_LINUX_MAGIC, 1925 AMD64_NETBSD_MAGIC. 1926 * peXXigen.c: Add comment about source of .NET magic numbers. 1927 19282019-07-19 Alan Modra <amodra@gmail.com> 1929 1930 * reloc.c (BFD_RELOC_PPC64_TPREL34, BFD_RELOC_PPC64_DTPREL34), 1931 (BFD_RELOC_PPC64_GOT_TLSGD34, BFD_RELOC_PPC64_GOT_TLSLD34), 1932 (BFD_RELOC_PPC64_GOT_TPREL34, BFD_RELOC_PPC64_GOT_DTPREL34), 1933 (BFD_RELOC_PPC64_TLS_PCREL): New pcrel tls relocs. 1934 * elf64-ppc.c (ppc64_elf_howto_raw): Add howtos for pcrel tls relocs. 1935 (ppc64_elf_reloc_type_lookup): Translate pcrel tls relocs. 1936 (must_be_dyn_reloc, dec_dynrel_count): Add R_PPC64_TPREL64. 1937 (ppc64_elf_check_relocs): Support pcrel tls relocs. 1938 (ppc64_elf_tls_optimize, ppc64_elf_relocate_section): Likewise. 1939 * bfd-in2.h: Regenerate. 1940 * libbfd.h: Regenerate. 1941 19422019-07-18 Alan Modra <amodra@gmail.com> 1943 1944 * elf64-ppc.c (ppc64_elf_relocate_section): Don't bother selecting 1945 a TLS section symbol for edited relocs. Tighten TLS symbol/reloc 1946 match test. 1947 19482019-07-18 Alan Modra <amodra@gmail.com> 1949 1950 * elf64-ppc.c (TLS_EXPLICIT): Define as 256. 1951 (ppc64_elf_check_relocs): Don't store TLS_EXPLICIT even if char 1952 is more than 8 bits. 1953 (ppc64_elf_tls_optimize): Likewise. Make tls_set, tls_clear, and 1954 tls_type vars unsigned int. 1955 (ppc64_elf_relocate_section): Use r_type rather than TLS_EXPLICIT 1956 to select r_type edit. 1957 19582019-07-18 Alan Modra <amodra@gmail.com> 1959 1960 * elf32-ppc.c (TLS_GDIE): Rename from TLS_TPRELGD throughout file. 1961 Correct comment. 1962 * elf64-ppc.c (TLS_GDIE): Likewise. 1963 19642019-07-18 Alan Modra <amodra@gmail.com> 1965 1966 * elf64-ppc.c (ppc64_elf_tls_optimize): Correct test for allowed 1967 range of tp-relative offsets. 1968 19692019-07-15 Alan Modra <amodra@gmail.com> 1970 1971 * elflink.c (_bfd_elf_fix_symbol_flags): If the def for an 1972 alias is no longer bfd_link_hash_defined, clear the alias. 1973 19742019-07-13 Alan Modra <amodra@gmail.com> 1975 1976 * elflink.c (_bfd_elf_omit_section_dynsym_default): Don't keep 1977 tls_sec. 1978 (_bfd_elf_init_1_index_section): Prefer not using TLS sections. 1979 (_bfd_elf_init_2_index_sections): Likewise. 1980 * elf64-ppc.c (ppc64_elf_relocate_section): When emitting dynamic 1981 relocations for local TLS symbols, use STN_UNDEF as the relocation 1982 symbol. 1983 * elf32-ppc.c (ppc_elf_relocate_section): Likewise, and don't 1984 leave TLS symbol value in the addend. 1985 19862019-07-08 Alan Modra <amodra@gmail.com> 1987 1988 PR 24785 1989 * elf32-ppc.c (_bfd_elf_ppc_set_arch): Sanity check .PPC.EMB.apuinfo 1990 size before reading first word. 1991 19922019-07-02 Nick Clifton <nickc@redhat.com> 1993 1994 PR 24717 1995 * elf.c (is_debuginfo_file): New function. 1996 (assign_file_positions_for_non_load_sections): Do not warn about 1997 allocated sections outside of loadable segments if they are found 1998 in a debuginfo file. 1999 * elf-bfd.h (is_debuginfo_file): Prototype. 2000 20012019-07-02 Nick Clifton <nickc@redhat.com> 2002 2003 PR 24753 2004 * compress.c (bfd_get_full_section_contents): Do not complain 2005 about linker created sections that are larger than the file size. 2006 20072019-07-02 Christophe Lyon <christophe.lyon@linaro.org> 2008 2009 * bfd/elf32-arm.c (CMSE_STUB_NAME): New define. 2010 (elf32_arm_get_stub_entry): Do not try to emit long-branch stubs 2011 for CMSE stubs. 2012 (arm_dedicated_stub_output_section_name): Use CMSE_STUB_NAME. 2013 20142019-07-02 Srinath Parvathaneni <srinath.parvathaneni@arm.com> 2015 2016 * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Mark debug 2017 sections when .text section contain secure entry functions 2018 is marked. 2019 20202019-07-01 Nick Clifton <nickc@redhat.com> 2021 2022 PR 23839 2023 * elf32-arm.c (elf32_arm_update_relocs): Do not include the 2024 section VMA in the offset used to update exidx relocs. 2025 20262019-06-28 Nick Clifton <nickc@redhat.com> 2027 2028 PR 24708 2029 * elf.c (_bfd_elf_slurp_version_tables): Check for an excessively 2030 large version reference section. 2031 * compress.c (bfd_get_full_section_contents): Check for an 2032 uncompressed section whose size is larger than the file size. 2033 20342019-06-28 Alan Modra <amodra@gmail.com> 2035 2036 * format.c (bfd_check_format_matches): Don't match plugin target 2037 if another target matches. Expand comment. 2038 * targets.c (_bfd_target_vector): Move plugin_vec after all other 2039 non-corefile targets, outside !SELECT_VECS. 2040 * config.bfd: Don't handle targ=plugin here. 2041 * configure.ac: Don't add plugin to enable_targets or handle in 2042 target loop setting selvecs and other target vars. 2043 * configure: Regenerate. 2044 20452019-06-26 Nick Clifton <nickc@redhat.com> 2046 2047 PR 24703 2048 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add error 2049 messages for failures. 2050 * mach-o.c (bfd_mach_o_canonicalize_relocs): Set an bfd error code 2051 if returning an error value. 2052 20532019-06-25 Jan Beulich <jbeulich@suse.com> 2054 2055 * elf-properties.c (elf_find_and_remove_property): Rename last 2056 parameter. Mention it in comment. 2057 20582019-06-24 Ilia Diachkov <ilia.diachkov@optimitech.com> 2059 2060 * elfnn-riscv.c (_bfd_riscv_relax_lui): Delete early exit when 2061 SEC_MERGE or SEC_CODE flags are set. 2062 (_bfd_riscv_relax_section): New local symtype. Set sym_sec and 2063 symtype consistently. Don't include sec_addr (sym_sec) in symval. 2064 Add check for SEC_INFO_TYPE_MERGE and call _bfd_merged_section_offset. 2065 Add sec_addr (sym_sec) after handling merge sections. 2066 20672019-06-24 H.J. Lu <hongjiu.lu@intel.com> 2068 2069 PR ld/24721 2070 * elf-properties.c (elf_merge_gnu_property_list): Remove the 2071 property after reporting property removal. 2072 20732019-06-23 Alan Modra <amodra@gmail.com> 2074 2075 PR 24704 2076 * elf64-ppc.c (R_PPC64_GOT16_DS): Don't set has_gotrel. 2077 (ppc64_elf_edit_toc): Don't remove R_PPC64_GOT16_DS got entries. 2078 Reduce range of offsets allowed for other GOT relocs. 2079 20802019-06-23 Alan Modra <amodra@gmail.com> 2081 2082 PR 24689 2083 * elfcode.h (elf_object_p): Warning fix. 2084 20852019-06-21 Alan Modra <amodra@gmail.com> 2086 2087 PR 24689 2088 * elfcode.h (elf_object_p): Check type of e_shstrndx section. 2089 20902019-06-19 Alan Modra <amodra@gmail.com> 2091 2092 PR 24697 2093 * elf32-ppc.c (ppc_elf_relocate_section): Don't read insn for 2094 R_PPC_EMB_RELSDA. Mask low bit of R_PPC_EMB_SDA21 r_offset. 2095 20962019-06-19 Alan Modra <amodra@gmail.com> 2097 2098 * elf64-ppc.c (ppc64_elf_inline_plt): Correct st_other test for 2099 functions that require r2 valid to use local entry. 2100 (ppc64_elf_size_stubs, ppc64_elf_relocate_section): Likewise. 2101 21022019-06-17 Szabolcs Nagy <szabolcs.nagy@arm.com> 2103 2104 * elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs): Remove. 2105 (elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table traversal 2106 with elfNN_aarch64_allocate_local_dynrelocs. 2107 21082019-06-14 Szabolcs Nagy <szabolcs.nagy@arm.com> 2109 2110 * elfnn-aarch64.c: Enable MOVW_PREL relocs for ELF32. 2111 21122019-06-14 Alan Modra <amodra@gmail.com> 2113 2114 * Makefile.in: Regenerate. 2115 * configure: Regenerate. 2116 21172019-06-14 Alan Modra <amodra@gmail.com> 2118 2119 * elf64-ppc.c: Fix comments involving paddi. 2120 21212019-06-12 Adam Lackorzymski <adam@os.inf.tu-dresden.de> 2122 2123 PR 24643 2124 * elf32-arm.c (arm_elf_find_function): Fail if the symol table is 2125 absent, or the bfd is not in the ELF formart. 2126 * elfnn-aarch64.c (aarch64_elf_find_function): Likewise. 2127 21282019-06-10 Christos Zoulas <christos@zoulas.com> 2129 2130 PR 24650 2131 * elf.c (elfcore_make_auxv_note_section): New function. 2132 (elfcore_grok_note): Use it. 2133 (elfcore_grok_freebsd_note): Likewise. 2134 (elfcore_grok_openbsd_note): Likewise. 2135 (elfcore_grok_netbsd_note): Likewise. Plus add support for 2136 NT_NETBSDCORE_AUXV notes. 2137 21382019-06-06 Sudakshina Das <sudi.das@arm.com> 2139 2140 * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Set 2141 alignment of the new gnu property section. 2142 21432019-06-06 Sudakshina Das <sudi.das@arm.com> 2144 2145 * bfd-in.h: Change comment. 2146 * bfd-in2.h: Regenerate. 2147 * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update warning. 2148 * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): 2149 Likwise. 2150 21512019-05-28 Faraz Shahbazker <fshahbazker@wavecomp.com> 2152 2153 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_PCHI16>: 2154 Remove overflow check. 2155 21562019-05-28 Alan Modra <amodra@gmail.com> 2157 2158 PR 24596 2159 * cofflink.c (coff_link_check_archive_element): Don't assume 2160 element is a coff object file after calling add_archive_element. 2161 21622019-05-28 Alan Modra <amodra@gmail.com> 2163 2164 PR 24596 2165 * elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Don't 2166 attempt to set sh_entsize for excluded PLT section. 2167 21682019-05-28 Alan Modra <amodra@gmail.com> 2169 2170 PR 24596 2171 * elf64-alpha.c (elf64_alpha_relocate_section): Don't attempt 2172 to emit R_ALPHA_GOTTPREL in PIEs, for which no space is 2173 allocated in alpha_dynamic_entries_for_reloc. 2174 21752019-05-28 Alan Modra <amodra@gmail.com> 2176 2177 PR 24596 2178 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Don't segfault 2179 on NULL output_section. 2180 * elflink.c (elf_final_link_free): Don't free -1 symshndxbuf. 2181 21822019-05-28 Alan Modra <amodra@gmail.com> 2183 2184 PR 24596 2185 * elf32-m68k.c (elf_m68k_get_got_entry): Don't create a new 2186 entry when MUST_FIND. Abort when MUST_FIND not found. 2187 (elf_m68k_get_bfd2got_entry): Likewise. 2188 (elf_m68k_relocate_section): Remove now useless assert. 2189 21902019-05-28 Alan Modra <amodra@gmail.com> 2191 2192 PR 24596 2193 * elf64-hppa.c (elf64_hppa_finalize_dynreloc): Get the output bfd 2194 from bfd_link_info, not an output section owner. 2195 (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd): Likewise. 2196 (elf_hppa_final_link_relocate): Likewise. 2197 21982019-05-28 Alan Modra <amodra@gmail.com> 2199 2200 PR 24596 2201 * aout-tic30.c (MY_bfd_final_link): Don't segfault on missing 2202 create_object_symbols_section, obj_textsec, obj_datasec or 2203 obj_bsssec. Fix other errors in placement. 2204 * config.bfd: Obsolete tic30-aout. 2205 22062019-05-28 Alan Modra <amodra@gmail.com> 2207 2208 PR 24596 2209 * dwarf2.c (save_section_vma, section_vma_same): Check for NULL 2210 end of section list as well as section_count. 2211 * xcofflink.c (xcoff_link_add_symbols): Fix temporarily changed 2212 section list before returning error. 2213 22142019-05-27 Alan Modra <amodra@gmail.com> 2215 2216 * elf.c (bfd_elf_set_group_contents): Exit on zero size section. 2217 22182019-05-27 Alan Modra <amodra@gmail.com> 2219 2220 PR 24596 2221 * linker.c (_bfd_generic_link_output_symbols): Heed BSF_KEEP. 2222 22232019-05-24 Szabolcs Nagy <szabolcs.nagy@arm.com> 2224 2225 * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): New function. 2226 (struct elf_aarch64_link_hash_table): Add variant_pcs member. 2227 (elfNN_aarch64_allocate_dynrelocs): Update variant_pcs. 2228 (elfNN_aarch64_size_dynamic_sections): Add DT_AARCH64_VARIANT_PCS. 2229 (elf_backend_merge_symbol_attribute): Define. 2230 22312019-05-24 Alan Modra <amodra@gmail.com> 2232 2233 * po/SRC-POTFILES.in: Regenerate. 2234 22352019-05-24 Alan Modra <amodra@gmail.com> 2236 2237 * elf64-ppc.c: Comment on powerxx _notoc stub variants. 2238 (LI_R11_0, LIS_R11, ORI_R11_R11_0, SLDI_R11_R11_34): Define. 2239 (PADDI_R12_PC, PLD_R12_PC, D34, HA34): Define. 2240 (struct ppc_link_hash_table): Add powerxx_stubs. 2241 (ppc64_elf_check_relocs): Set powerxx_stubs. 2242 (build_powerxx_offset, size_powerxx_offset), 2243 (num_relocs_for_powerxx_offset), 2244 (emit_relocs_for_powerxx_offset): New functions. 2245 (plt_stub_size): Size powerxx stubs. 2246 (ppc_build_one_stub): Emit powerxx stubs. 2247 (ppc_size_one_stub): Size powerxx stubs. Omit .eh_frame for 2248 powerxx stubs. 2249 22502019-05-24 Alan Modra <amodra@gmail.com> 2251 2252 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_gotrel for 2253 R_PPC64_GOT_PCREL34. 2254 (xlate_pcrel_opt): New function. 2255 (ppc64_elf_edit_toc): Handle R_PPC64_GOT_PCREL34. 2256 (ppc64_elf_relocate_section): Edit GOT indirect to GOT relative 2257 for R_PPC64_GOT_PCREL34. Implement R_PPC64_PCREL_OPT optimisation. 2258 22592019-05-24 Alan Modra <amodra@gmail.com> 2260 2261 * reloc.c (BFD_RELOC_PPC64_D34, BFD_RELOC_PPC64_D34_LO), 2262 (BFD_RELOC_PPC64_D34_HI30, BFD_RELOC_PPC64_D34_HA30), 2263 (BFD_RELOC_PPC64_PCREL34, BFD_RELOC_PPC64_GOT_PCREL34), 2264 (BFD_RELOC_PPC64_PLT_PCREL34), 2265 (BFD_RELOC_PPC64_ADDR16_HIGHER34, BFD_RELOC_PPC64_ADDR16_HIGHERA34), 2266 (BFD_RELOC_PPC64_ADDR16_HIGHEST34, BFD_RELOC_PPC64_ADDR16_HIGHESTA34), 2267 (BFD_RELOC_PPC64_REL16_HIGHER34, BFD_RELOC_PPC64_REL16_HIGHERA34), 2268 (BFD_RELOC_PPC64_REL16_HIGHEST34, BFD_RELOC_PPC64_REL16_HIGHESTA34), 2269 (BFD_RELOC_PPC64_D28, BFD_RELOC_PPC64_PCREL28): New reloc enums. 2270 * elf64-ppc.c (PNOP): Define. 2271 (ppc64_elf_howto_raw): Add reloc howtos for new relocations. 2272 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc numbers. 2273 (ppc64_elf_ha_reloc): Adjust addend for highera34 and highesta34 2274 relocs. 2275 (ppc64_elf_prefix_reloc): New function. 2276 (struct ppc_link_hash_table): Add notoc_plt. 2277 (is_branch_reloc): Add R_PPC64_PLTCALL_NOTOC. 2278 (is_plt_seq_reloc): Add R_PPC64_PLT_PCREL34, 2279 R_PPC64_PLT_PCREL34_NOTOC, and R_PPC64_PLTSEQ_NOTOC. 2280 (ppc64_elf_check_relocs): Handle pcrel got and plt relocs. Set 2281 has_pltcall for section on seeing R_PPC64_PLTCALL_NOTOC. Handle 2282 possible need for dynamic relocs on non-pcrel powerxx relocs. 2283 (dec_dynrel_count): Handle non-pcrel powerxx relocs. 2284 (ppc64_elf_inline_plt): Handle R_PPC64_PLTCALL_NOTOC. 2285 (toc_adjusting_stub_needed): Likewise. 2286 (ppc64_elf_tls_optimize): Handle R_PPC64_PLTSEQ_NOTOC. 2287 (ppc64_elf_relocate_section): Handle new powerxx relocs. 2288 * bfd-in2.h: Regenerate. 2289 * libbfd.h: Regenerate. 2290 22912019-05-23 Jose E. Marchesi <jose.marchesi@oracle.com> 2292 2293 * config.bfd (targ_cpu): Process bpf-*-none only if BFD64. 2294 * configure.ac: Set target_size=64 for bpf_elf64_le_vec and 2295 bpf_elf64_be_vec. 2296 * configure: Regenerate. 2297 22982019-05-23 Jose E. Marchesi <jose.marchesi@oracle.com> 2299 2300 * configure: Regenerated. 2301 * Makefile.am (ALL_MACHINES): Add cpu-bpf.lo. 2302 (ALL_MACHINES_CFILES): Add cpu-bpf.c. 2303 (BFD64_BACKENDS): Add elf64-bpf.lo. 2304 (BFD64_BACKENDS_CFILES): Add elf64-bpf.c. 2305 * Makefile.in (SOURCE_HFILES): Regenerate. 2306 * config.bfd (targ_cpu): Handle bpf-*-* targets. 2307 * cpu-bpf.c: New file. 2308 * elf64-bpf.c: Likewise. 2309 * targets.c (_bfd_target_vector): Add bpf_elf64_be_vec and 2310 bpf_elf64_le_vec. 2311 * archures.c: Define architecture bfd_arch_bpf and machine 2312 bfd_arch_bpf. 2313 * reloc.c: Define BFD relocations used by the BPF target. 2314 * bfd-in2.h: Regenerated. 2315 * libbfd.h: Likewise. 2316 23172019-05-22 Alan Modra <amodra@gmail.com> 2318 2319 * elf32-arm.c (arm_allocate_glue_section_space): Clear section 2320 contents. 2321 23222019-05-22 Alan Modra <amodra@gmail.com> 2323 2324 * vms-alpha.c (_bfd_vms_write_etir): Don't attempt further 2325 processing on "size error in section". 2326 23272019-05-22 Alan Modra <amodra@gmail.com> 2328 2329 * som.c (som_bfd_free_cached_info): Call 2330 _bfd_generic_close_and_cleanup. 2331 23322019-05-21 Faraz Shahbazker <fshahbazker@wavecomp.com> 2333 2334 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Generate error 2335 for TLS_TPREL_HI16(/LO16) relocations in shared library. 2336 23372019-05-21 Faraz Shahbazker <fshahbazker@wavecomp.com> 2338 2339 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Add NULL pointer 2340 checks. Search the RELA table for n64 relocations. 2341 23422019-05-21 Matthew Fortune <matthew.fortune@mips.com> 2343 Faraz Shahbazker <fshahbazker@wavecomp.com> 2344 2345 * elfxx-mips.c (LA25_BC): New macro. 2346 (mips_elf_link_hash_table)<compact_branches>: New field. 2347 (STUB_JALRC): New macro. 2348 (mipsr6_o32_exec_plt0_entry_compact): New array. 2349 (mipsr6_n32_exec_plt0_entry_compact): Likewise. 2350 (mipsr6_n64_exec_plt0_entry_compact): Likewise. 2351 (mipsr6_exec_plt_entry_compact): Likewise. 2352 (mips_elf_create_la25_stub): Use BC instead of J for stubs 2353 when compact_branches is true. 2354 (_bfd_mips_elf_finish_dynamic_symbol): Choose the compact 2355 PLT for MIPSR6 with compact_branches. Do not reorder the 2356 compact branches PLT. Switch the lazy stub for MIPSR6 2357 with compact_branches to use JALRC. 2358 (mips_finish_exec_plt): Choose the compact PLT0 for MIPSR6 2359 when compact_branches is true. 2360 (_bfd_mips_elf_compact_branches): New function. 2361 * elfxx-mips.h (_bfd_mips_elf_compact_branches): New prototype. 2362 23632019-05-21 Tamar Christina <tamar.christina@arm.com> 2364 2365 PR ld/24373 2366 * elfnn-aarch64.c (_bfd_aarch64_erratum_843419_branch_to_stub): 2367 Fix print formatter. 2368 23692019-05-21 Andre Vieira <andre.simoesdiasvieira@arm.com> 2370 2371 PR 24460 2372 * elf32-arm.c (get_value_helper): Remove. 2373 (elf32_arm_final_link_relocate): Fix branch future relocations. 2374 23752019-05-21 Tamar Christina <tamar.christina@arm.com> 2376 2377 PR ld/24373 2378 * bfd-in.h (enum erratum_84319_opts): New 2379 (bfd_elf64_aarch64_set_options, bfd_elf32_aarch64_set_options): Change 2380 int to enum erratum_84319_opts. 2381 * bfd-in2.h: Regenerate. 2382 * elfnn-aarch64.c (struct elf_aarch64_link_hash_table): Change 2383 fix_erratum_843419 to use new enum, remove fix_erratum_843419_adr. 2384 (_bfd_aarch64_add_stub_entry_after): Conditionally create erratum stub. 2385 (aarch64_size_one_stub): Conditionally size erratum 843419 stubs. 2386 (_bfd_aarch64_resize_stubs): Amend comment. 2387 (elfNN_aarch64_size_stubs): Don't generate stubs when no workaround 2388 requested. 2389 (bfd_elfNN_aarch64_set_options): Use new fix_erratum_843419 enum. 2390 (_bfd_aarch64_erratum_843419_branch_to_stub): Implement selection of 2391 erratum workaround. 2392 (clear_erratum_843419_entry): Update erratum conditional. 2393 23942019-05-21 Senthil Kumar Selvaraj <senthilkumar.selvaraj@microchip.com> 2395 2396 PR ld/24571 2397 * bfd/elf32-avr.c (elf32_avr_relax_section): Adjust range check 2398 when computing distance_short_enough. 2399 24002019-05-21 Senthil Kumar Selvaraj <senthilkumar.selvaraj@microchip.com> 2401 2402 PR ld/24564 2403 * bfd/elf32-avr.c (avr_relative_distance_considering_wrap_around): 2404 Wrap around even if distance equals avr_pc_wrap_around. 2405 24062019-05-20 Nick Clifton <nickc@redhat.com> 2407 2408 * po/fr.po: Updated French translation. 2409 24102019-05-16 Andre Vieira <andre.simoesdiasvieira@arm.com> 2411 2412 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add case for Tag_MVE_arch. 2413 24142019-05-16 Alan Modra <amodra@gmail.com> 2415 2416 * elf32-arm.c (elf32_arm_write_section): Revert last change. 2417 24182019-05-15 Alan Modra <amodra@gmail.com> 2419 2420 * elf32-arm.c (elf32_arm_write_section): Don't leave 2421 error case of STM32L4XX_ERRATUM_BRANCH_TO_VENEER with 2422 unitialised section contents. 2423 24242019-05-14 Jamey Hicks <jamey.hicks@gmail.com> 2425 2426 PR 19921 2427 * verilog.c: (VerilogDataWidth): New variable. 2428 (verilog_write_record): Emit bytes in VerilogDataWidth bundles. 2429 24302019-05-08 Nick Clifton <nickc@redhat.com> 2431 2432 PR 24523 2433 * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Return TRUE 2434 rather than FALSE if encountering a non-ELF file. 2435 24362019-05-06 Alan Modra <amodra@gmail.com> 2437 2438 * elf32-pj.c (pj_elf_reloc): Don't report undefined weak as an error. 2439 24402019-05-06 Alan Modra <amodra@gmail.com> 2441 2442 * reloc.c (BFD_RELOC_PPC64_TPREL16_HIGH, BFD_RELOC_PPC64_TPREL16_HIGHA), 2443 (BFD_RELOC_PPC64_DTPREL16_HIGH, BFD_RELOC_PPC64_DTPREL16_HIGHA): 2444 Sort before BFD_RELOC_PPC64_DTPREL16_HIGHESTA entry. 2445 * libbfd.h: Regenerate. 2446 * bfd-in2.h: Regenerate. 2447 24482019-05-04 Alan Modra <amodra@gmail.com> 2449 2450 PR 24511 2451 * syms.c (coff_section_type): Only allow '.', '$' and numeric 2452 following the standard section names. 2453 (bfd_decode_symclass): Prioritize section flag tests in 2454 decode_section_type before name tests in coff_section_type. 2455 * plugin.c (bfd_plugin_canonicalize_symtab): Init fake_section 2456 and fake_common_section using BFD_FAKE_SECTION. Use "fake" as 2457 their names and choose standard .text section flags for 2458 fake_section. 2459 24602019-05-02 Nick Clifton <nickc@redhat.com> 2461 2462 PR 24493 2463 * coffcode.h (styp_to_sec_flags): Treat .gnu.debuglink and 2464 .gnu.debugaltlink sections as debugging sections. 2465 24662019-04-30 Alan Modra <amodra@gmail.com> 2467 2468 * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add has_gotrel. 2469 (struct _ppc64_elf_section_data): Likewise. 2470 (ppc64_elf_check_relocs): Set above fields. 2471 (ppc64_elf_edit_toc): Add a pass over GOT relocs. 2472 (ppc64_elf_relocate_section): Edit GOT indirect to GOT relative 2473 when possible. 2474 24752019-04-26 H.J. Lu <hongjiu.lu@intel.com> 2476 2477 PR ld/24486 2478 * elflink.c (elf_link_output_extsym): Don't complain undefined 2479 weak dynamic reference. 2480 24812019-04-25 Sudakshina Das <sudi.das@arm.com> 2482 2483 * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): Remove. 2484 (PLT_BTI_TLSDESC_ENTRY_SIZE): Remove. 2485 (PLT_PAC_ENTRY_SIZE, PLT_BTI_PAC_ENTRY_SIZE): Remove. 2486 (PLT_BTI_SMALL_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): Update. 2487 (elfNN_aarch64_small_plt0_pac_entry): Remove. 2488 (elfNN_aarch64_small_plt0_bti_pac_entry): Remove. 2489 (elfNN_aarch64_small_plt0_bti_entry): Update. 2490 (elfNN_aarch64_small_plt_bti_entry): Update. 2491 (elfNN_aarch64_small_plt_pac_entry): Update. 2492 (elfNN_aarch64_tlsdesc_small_plt_bti_entry): Update. 2493 (setup_plt_values): Setup new entries. 2494 (elfNN_aarch64_finish_dynamic_sections): Remove size change. 2495 (elfNN_aarch64_plt_sym_val): Likewise. 2496 24972019-04-22 Jim Wilson <jimw@sifive.com> 2498 2499 * elfnn-riscv.c (PRSTATUS_SIZE) [ARCH_SIZE==32]: Change from 0 to 204. 2500 25012019-04-19 Alan Modra <amodra@gmail.com> 2502 2503 * elf32-s12z.c (elf_backend_can_gc_sections): Don't define 2504 25052019-04-17 H.J. Lu <hongjiu.lu@intel.com> 2506 2507 * elf64-x86-64.c (elf_x86_64_need_pic): Suggest -fPIE when not 2508 building shared object. 2509 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Likewise. 2510 25112019-04-17 H.J. Lu <hongjiu.lu@intel.com> 2512 2513 PR ld/24458 2514 * elfxx-x86.h (SYMBOL_DEFINED_NON_SHARED_P): Also check x86 2515 linker_def. 2516 25172019-04-15 Thomas Preud'homme <thomas.preudhomme@arm.com> 2518 2519 * reloc.c (BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM): New internal 2520 relocation. 2521 * bfd-in2.h: Regenerate. 2522 * libbfd.h: Likewise. 2523 25242019-04-15 Sudakshina Das <sudi.das@arm.com> 2525 2526 * reloc.c (BFD_RELOC_ARM_THUMB_LOOP12): New. 2527 * bfd-in2.h: Regenerated. 2528 * libbfd.h: Regenerated. 2529 25302019-04-15 Sudakshina Das <sudi.das@arm.com> 2531 2532 * reloc.c (BFD_RELOC_THUMB_PCREL_BFCSEL): New relocation. 2533 * bfd-in2.h: Regenerated. 2534 * libbfd.h: Likewise. 2535 25362019-04-15 Sudakshina Das <sudi.das@arm.com> 2537 2538 * reloc.c (BFD_RELOC_ARM_THUMB_BF13): New. 2539 * bfd-in2.h: Regenerated. 2540 * libbfd.h: Regenerated. 2541 * elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF13. 2542 (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF13 2543 and R_ARM_THM_BF12 together. 2544 (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF13. 2545 25462019-04-15 Sudakshina Das <sudi.das@arm.com> 2547 2548 * reloc.c (BFD_RELOC_ARM_THUMB_BF19): New 2549 * libbfd.h: Regenerated. 2550 * bfd-in2.h: Regenerated. 2551 * bfd-elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF18. 2552 (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF19 2553 and R_ARM_THM_BF18 together. 2554 (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF19. 2555 25562019-04-15 Sudakshina Das <sudi.das@arm.com> 2557 2558 * reloc.c (BFD_RELOC_ARM_THUMB_BF17): New enum. 2559 * bfd-in2.h: Regenerated. 2560 * libbfd.h: Regenerated. 2561 * bfd-elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF16. 2562 (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF17 2563 and R_ARM_THM_BF16 together. 2564 (get_value_helper): New reloc helper. 2565 (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF16. 2566 25672019-04-15 Sudakshina Das <sudi.das@arm.com> 2568 2569 * reloc.c (BFD_RELOC_THUMB_PCREL_BRANCH5): New enum. 2570 * bfd-in2.h: Regenerate. 2571 * libbfd.h: Regenerate. 2572 25732019-04-15 Thomas Preud'homme <thomas.preudhomme@arm.com> 2574 2575 * archures.c (bfd_mach_arm_8_1M_MAIN): Define. 2576 * bfd-in2.h: Regenerate. 2577 * cpu-arm.c (arch_info_struct): Add entry for Armv8.1-M Mainline. 2578 * elf32-arm.c (using_thumb_only): Return true for Armv8.1-M Mainline 2579 and update assert. 2580 (using_thumb2): Likewise. 2581 (using_thumb2_bl): Update assert. 2582 (arch_has_arm_nop): Likewise. 2583 (bfd_arm_get_mach_from_attributes): Add case for Armv8.1-M Mainline. 2584 (tag_cpu_arch_combine): Add logic for Armv8.1-M Mainline merging. 2585 25862019-04-11 H.J. Lu <hongjiu.lu@intel.com> 2587 2588 * elf-linker-x86.h (elf_x86_cet_report): New. 2589 (elf_linker_x86_params): Add cet_report. 2590 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report 2591 missing IBT and SHSTK properties if needed. 2592 25932019-04-11 H.J. Lu <hongjiu.lu@intel.com> 2594 2595 PR ld/24436 2596 * elf-m10300.c (mn10300_elf_check_relocs): Remove BFD_ASSERT of 2597 "h != NULL". Don't check "h != NULL" before calling. 2598 bfd_elf_gc_record_vtentry. 2599 * elf32-arm.c (elf32_arm_check_relocs): Likewise. 2600 * elf32-bfin.c (bfin_check_relocs): Likewise. 2601 * elf32-cris.c (cris_elf_check_relocs): Likewise. 2602 * elf32-csky.c (csky_elf_check_relocs): Likewise. 2603 * elf32-d10v.c (elf32_d10v_check_relocs): Likewise. 2604 * elf32-dlx.c (elf32_dlx_check_relocs): Likewise. 2605 * elf32-fr30.c (fr30_elf_check_relocs): Likewise. 2606 * elf32-frv.c (elf32_frv_check_relocs): Likewise. 2607 * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. 2608 * elf32-i386.c (elf_i386_check_relocs): Likewise. 2609 * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise. 2610 * elf32-m32r.c (m32r_elf_check_relocs): Likewise. 2611 * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. 2612 * elf32-m68k.c (elf_m68k_check_relocs): Likewise. 2613 * elf32-mcore.c (mcore_elf_check_relocs): Likewise. 2614 * elf32-metag.c (elf_metag_check_relocs): Likewise. 2615 * elf32-or1k.c (or1k_elf_check_relocs): Likewise. 2616 * elf32-ppc.c (ppc_elf_check_relocs): Likewise. 2617 * elf32-s390.c (elf_s390_check_relocs): Likewise. 2618 * elf32-sh.c (sh_elf_check_relocs): Likewise. 2619 * elf32-v850.c (v850_elf_check_relocs): Likewise. 2620 * elf32-vax.c (elf_vax_check_relocs): Likewise. 2621 * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. 2622 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise. 2623 * elf64-mmix.c (mmix_elf_check_relocs): Likewise. 2624 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. 2625 * elf64-s390.c (elf_s390_check_relocs): Likewise. 2626 * elf64-x86-64.c (elf_s390_check_relocs): Likewise. 2627 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. 2628 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. 2629 * elflink.c (bfd_elf_gc_record_vtinherit): Check for corrupt 2630 VTENTRY entry. 2631 26322019-04-11 Alan Modra <amodra@gmail.com> 2633 2634 PR 24435 2635 * elflink.c (elf_link_add_object_symbols): Don't read partial 2636 dynamic entries from fuzzed objects. 2637 26382019-04-11 Tamar Christina <tamar.christina@arm.com> 2639 2640 PR ld/24302 2641 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Don't emit 2642 DT_TLSDESC_GOT and DT_TLSDESC_PLT when DF_BIND_NOW. 2643 (elfNN_aarch64_finish_dynamic_sections): Don't write PLT if DF_BIND_NOW. 2644 26452019-04-10 Michael Forney <mforney@mforney.org> 2646 2647 PR 24427 2648 * doc/chew.c (free_words): Correctly free "push_text" strings. 2649 26502019-04-08 H.J. Lu <hongjiu.lu@intel.com> 2651 2652 * config.bfd: Remove i[3-7]86-*-kaos* and i[3-7]86-*-chaos targets. 2653 26542019-04-08 Alan Modra <amodra@gmail.com> 2655 2656 * configure.ac (elfxx_x86): Define and use. 2657 * configure: Regenerate. 2658 26592019-04-06 H.J. Lu <hongjiu.lu@intel.com> 2660 2661 * elf-linker-x86.h: New file. 2662 * elf32-i386.c (elf_i386_convert_load_reloc): Use htab->params 2663 to get x86-specific linker options. 2664 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise. 2665 (elf_x86_64_check_relocs): Likewise. 2666 (elf_x86_64_relocate_section): Likewise. 2667 (elf_x86_64_link_setup_gnu_properties): Likewise. 2668 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Likewise. 2669 (_bfd_x86_elf_link_setup_gnu_properties): Likewise. 2670 (_bfd_elf_linker_x86_set_options): New function. 2671 * elfxx-x86.h: Include "elf-linker-x86.h". 2672 (elf_x86_link_hash_table): Add params. 2673 26742019-04-03 Alan Modra <amodra@gmail.com> 2675 2676 * coff-i386.c, * coff-x86_64.c, * coffgen.c, * dwarf2.c, 2677 * elf-m10200.c, * elf.c, * elf32-arm.c, * elf32-bfin.c, 2678 * elf32-csky.c, * elf32-m32r.c, * elf32-microblaze.c, * elf32-pru.c, 2679 * elf32-rx.c, * elf32-xgate.c, * elf64-sparc.c, * elfnn-ia64.c, 2680 * elfxx-riscv.c, * elfxx-sparc.c, * linker.c, * mach-o.c, 2681 * pe-x86_64.c, * pei-x86_64.c, * plugin.c: Whitespace fixes. 2682 26832019-04-02 Jim Wilson <jimw@sifive.com> 2684 2685 PR 24389 2686 * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Move read of 2687 ELF header flags to after check for ELF object file. Loop through 2688 sections looking for code sections, if none, then skip ABI checks. 2689 26902019-03-30 Andrew Waterman <andrew@sifive.com> 2691 2692 * elfnn-riscv.c (_bfd_riscv_relax_call): Only check ARCH_SIZE for 2693 rd == X_RA case. 2694 26952019-03-29 Max Filippov <jcmvbkbc@gmail.com> 2696 2697 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Add 2698 info->export_dynamic to the conditional. 2699 27002019-03-28 Alan Modra <amodra@gmail.com> 2701 2702 PR 24392 2703 * configure.ac: Invoke AC_CHECK_SIZEOF(int). 2704 * configure: Regenerate. 2705 * coffgen.c (coff_get_reloc_upper_bound): Replace gcc diagnostic 2706 workaround with SIZEOF_LONG vs. SIZEOF_INT check. 2707 * elf.c (_bfd_elf_get_reloc_upper_bound): Likewise. 2708 * elf64-sparc.c (elf64_sparc_get_reloc_upper_bound): Likewise. 2709 * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise. 2710 27112019-03-21 Jim Wilson <jimw@sifive.com> 2712 2713 PR 24365 2714 * elfnn-riscv.c (riscv_elf_relocate_section): For STT_SECTION check, 2715 verify sym non-NULL before using. Add identical check using h. 2716 27172019-03-21 Sudakshina Das <sudi.das@arm.com> 2718 2719 * elf-bfd.h (struct elf_backend_data): Add argument to 2720 merge_gnu_properties. 2721 * elf-properties.c (elf_merge_gnu_properties): Add argument to 2722 itself and while calling bed->merge_gnu_properties. 2723 (elf_merge_gnu_property_list): Update the calls for 2724 elf_merge_gnu_properties. 2725 * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update handling 2726 of --force-bti warning and add argument. 2727 * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Add 2728 warning. 2729 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Add argument. 2730 * elfxx-x86.h (_bfd_x86_elf_merge_gnu_properties): Likewise in 2731 declaration. 2732 27332019-03-20 Sudakshina Das <sudi.das@arm.com> 2734 2735 * elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define. 2736 * elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare. 2737 (elf_backend_fixup_gnu_properties): Define for AArch64. 2738 27392019-03-18 Alan Modra <amodra@gmail.com> 2740 2741 PR 24355 2742 * elf32-ppc.c (ppc_finish_symbols): Don't call write_glink_stub 2743 for local iplt syms with ent->plt.offset == -1. Remove ineffective 2744 attempt at writing glink stubs only once. 2745 27462019-03-16 Alan Modra <amodra@gmail.com> 2747 2748 PR 24337 2749 * elf.c (_bfd_elf_rela_local_sym): Revert last change. 2750 (_bfd_elf_rel_local_sym): Likewise. 2751 * elflink.c (elf_link_input_bfd): Use bfd_und_section for 2752 section of symbols with unrecognized shndx. 2753 27542019-03-15 H.J. Lu <hongjiu.lu@intel.com> 2755 2756 PR ld/24267 2757 * coffgen.c (_bfd_coff_section_already_linked): Skip discarded 2758 section. 2759 * cofflink.c (coff_link_add_symbols): Check for symbols defined 2760 in discarded section. 2761 27622019-03-15 Alan Modra <amodra@gmail.com> 2763 2764 PR 24339 2765 * elflink.c (elf_link_add_object_symbols): Bail out on a local 2766 symbol after globals if elf_bad_symtab is not set. 2767 27682019-03-15 Alan Modra <amodra@gmail.com> 2769 2770 PR 24337 2771 * elf.c (_bfd_elf_rela_local_sym): Don't segfault on NULL sec. 2772 (_bfd_elf_rel_local_sym): Likewise. 2773 27742019-03-15 Alan Modra <amodra@gmail.com> 2775 2776 PR 24336 2777 * elflink.c (elf_link_read_relocs_from_section): Handle fuzzed 2778 object files with sh_size not a multiple of sh_entsize. 2779 27802019-03-15 H.J. Lu <hongjiu.lu@intel.com> 2781 2782 PR ld/24338 2783 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for corrupt 2784 input with bad relocation. 2785 278622019-03-15 H.J. Lu <hongjiu.lu@intel.com> 2787 2788 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent. 2789 27902019-03-14 Nick Clifton <nickc@redhat.com> 2791 2792 PR 24334 2793 * dwarf2.c (struct dwarf2_debug): Add sec_vma_count field. 2794 (save_section_vma): Initialise field to the number of entries in 2795 the sec_vma table. 2796 (section_vma_same): Check that the number of entries in the 2797 sec_vma table matches the number of sections in the bfd. 2798 27992019-03-14 Nick Clifton <nickc@redhat.com> 2800 2801 PR 24333 2802 * elflink.c (_bfd_elf_add_default_symbol): Add a check for a NULL 2803 section owner pointer when adding the default symbol. 2804 28052019-03-14 Nick Clifton <nickc@redhat.com> 2806 2807 PR 24332 2808 * elflink.c (elf_link_add_object_symbols): Add new local variable 2809 extversym_end. Initialise it to point to the end of the version 2810 symbol table, if present. Check it when initialising and updating 2811 the ever pointer. 2812 28132019-03-13 Sudakshina Das <sudi.das@arm.com> 2814 2815 * elfnn-aarch64.c (PLT_PAC_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): New. 2816 (PLT_BTI_PAC_ENTRY_SIZE, PLT_BTI_PAC_SMALL_ENTRY_SIZE): New. 2817 (setup_plt_values): Account for PAC or PAC and BTI enabled PLTs. 2818 (elfNN_aarch64_size_dynamic_sections): Add checks for PLT_BTI_PAC 2819 and PLT_PAC_PLT. 2820 (elfNN_aarch64_finish_dynamic_sections): Account for PLT_BTI_PAC. 2821 (get_plt_type): Add case for DT_AARCH64_PAC_PLT. 2822 (elfNN_aarch64_plt_sym_val): Add cases for PLT_BTI_PAC and PLT_PAC. 2823 28242019-03-13 Sudakshina Das <sudi.das@arm.com> 2825 Szabolcs Nagy <szabolcs.nagy@arm.com> 2826 2827 * bfd-in.h (aarch64_plt_type, aarch64_enable_bti_type): New. 2828 (aarch64_bti_pac_info): New. 2829 (bfd_elf64_aarch64_set_options): Add aarch64_bti_pac_info argument. 2830 (bfd_elf32_aarch64_set_options): Likewise. 2831 * bfd-in2.h: Regenerate 2832 * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): New. 2833 (PLT_BTI_SMALL_ENTRY_SIZE, PLT_BTI_TLSDESC_ENTRY_SIZE): New. 2834 (elfNN_aarch64_small_plt0_bti_entry): New. 2835 (elfNN_aarch64_small_plt_bti_entry): New. 2836 (elfNN_aarch64_tlsdesc_small_plt_bti_entry): New. 2837 (elf_aarch64_obj_tdata): Add no_bti_warn and plt_type fields. 2838 (elf_aarch64_link_hash_table): Add plt0_entry, plt_entry and 2839 tlsdesc_plt_entry_size fields. 2840 (elfNN_aarch64_link_hash_table_create): Initialise the new fields. 2841 (setup_plt_values): New helper function. 2842 (bfd_elfNN_aarch64_set_options): Use new bp_info to set plt sizes and 2843 bti enable type. 2844 (elfNN_aarch64_allocate_dynrelocs): Use new size members instead of 2845 fixed macros. 2846 (elfNN_aarch64_size_dynamic_sections): Likewise and add checks. 2847 (elfNN_aarch64_create_small_pltn_entry): Use new generic pointers 2848 to plt stubs instead of fixed ones and update filling them according 2849 to the need for bti. 2850 (elfNN_aarch64_init_small_plt0_entry): Likewise. 2851 (elfNN_aarch64_finish_dynamic_sections): Likewise. 2852 (get_plt_type, elfNN_aarch64_get_synthetic_symtab): New. 2853 (elfNN_aarch64_plt_sym_val): Update size accordingly. 2854 (elfNN_aarch64_link_setup_gnu_properties): Set up plts if BTI GNU NOTE 2855 is set. 2856 (bfd_elfNN_get_synthetic_symtab): Define. 2857 (elfNN_aarch64_merge_gnu_properties): Give out warning with --force-bti 2858 and mising BTI NOTE SECTION. 2859 2860 28612019-03-13 Sudakshina Das <sudi.das@arm.com> 2862 2863 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Exclude 2864 linker created inputs from merge. 2865 * elfnn-aarch64.c (struct elf_aarch64_obj_tdata): Add field for 2866 GNU_PROPERTY_AARCH64_FEATURE_1_AND properties. 2867 (elfNN_aarch64_link_setup_gnu_properties): New. 2868 (elfNN_aarch64_merge_gnu_properties): New. 2869 (elf_backend_setup_gnu_properties): Define for AArch64. 2870 (elf_backend_merge_gnu_properties): Likewise. 2871 * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Define. 2872 (_bfd_aarch64_elf_parse_gnu_properties): Define. 2873 (_bfd_aarch64_elf_merge_gnu_properties): Define. 2874 * elfxx-aarch64.h (_bfd_aarch64_elf_link_setup_gnu_properties): Declare. 2875 (_bfd_aarch64_elf_parse_gnu_properties): Declare. 2876 (_bfd_aarch64_elf_merge_gnu_properties): Declare. 2877 (elf_backend_parse_gnu_properties): Define for AArch64. 2878 28792019-03-13 H.J. Lu <hongjiu.lu@intel.com> 2880 2881 PR ld/24322 2882 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Properly 2883 merge GNU_PROPERTY_X86_FEATURE_1_[IBT|SHSTK]. 2884 28852019-03-12 Alan Modra <amodra@gmail.com> 2886 2887 * coffcode.h (buy_and_read): Delete unnecessary forward decl. Add 2888 nmemb parameter. Use bfd_alloc2. 2889 (coff_slurp_line_table): Use bfd_alloc2. Update buy_and_read calls. 2890 Delete assertion. 2891 (coff_slurp_symbol_table): Use bfd_alloc2 and bfd_zalloc2. 2892 (coff_slurp_reloc_table): Use bfd_alloc2. Update buy_and_read calls. 2893 * coffgen.c (coff_get_reloc_upper_bound): Ensure size calculation 2894 doesn't overflow. 2895 * elf.c (bfd_section_from_shdr): Use bfd_zalloc2. Style fix. 2896 (assign_section_numbers): Style fix. 2897 (swap_out_syms): Use bfd_malloc2. 2898 (_bfd_elf_get_reloc_upper_bound): Ensure size calculation doesn't 2899 overflow. 2900 (_bfd_elf_make_empty_symbol): Style fix. 2901 (elfobj_grok_stapsdt_note_1): Formatting. 2902 * elfcode.h (elf_object_p): Use bfd_alloc2. 2903 (elf_write_relocs, elf_write_shdrs_and_ehdr): Likewise. 2904 (elf_slurp_symbol_table): Use bfd_zalloc2. 2905 (elf_slurp_reloc_table): Use bfd_alloc2. 2906 (_bfd_elf_bfd_from_remote_memory): Use bfd_malloc2. 2907 * elf64-sparc (elf64_sparc_get_reloc_upper_bound): Ensure 2908 size calculation doesn't overflow. 2909 (elf64_sparc_get_dynamic_reloc_upper_bound): Likewise. 2910 * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise. 2911 * pdp11.c (get_reloc_upper_bound): Copy aoutx.h version. 2912 29132019-03-08 Alan Modra <amodra@gmail.com> 2914 2915 PR 24311 2916 * merge.c (merge_strings): Return secinfo. Don't pad section 2917 to alignment here. 2918 (_bfd_merge_sections): Pad section to alignment here, if input 2919 sections contributing to merged output all pad to alignment. 2920 Formatting. 2921 29222019-03-06 Nick Clifton <nickc@redhat.com> 2923 2924 * dwarf2.c (_bfd_dwarf2_find_symbol_bias): Check for a NULL symbol 2925 table pointer. 2926 * coffgen.c (coff_find_nearest_line_with_names): Do not call 2927 _bfd_dwarf2_find_symbol_bias if there is no symbol table available. 2928 29292019-03-01 Andreas Krebbel <krebbel@linux.ibm.com> 2930 2931 This reverts commit 5a12586d44fa8d5dfc74cbca4f2f36a273a16335. 2932 2019-01-14 Maamoun Tarsha <maamountk@hotmail.com> 2933 2934 PR 20113 2935 * elf32-s390.c (allocate_dynrelocs): Update comment. 2936 29372019-02-28 Tamar Christina <tamar.christina@arm.com> 2938 2939 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Correct CIE parse. 2940 29412019-02-28 Nick Clifton <nickc@redhat.com> 2942 2943 PR 24273 2944 * elf.c (bfd_elf_string_from_elf_section): Check for a string 2945 section that is not NUL terminated. 2946 29472019-02-27 H.J. Lu <hongjiu.lu@intel.com> 2948 2949 PR ld/24276 2950 * elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined 2951 by linker when checking copy reloc on protected symbol. 2952 29532019-02-24 Alan Modra <amodra@gmail.com> 2954 2955 PR 24144 2956 * pdp11.c (set_section_contents): Revert 2015-02-24 change. 2957 29582019-02-20 Eric Tsai <erictsai@cadence.com> 2959 2960 * elf32-xtensa.c (is_resolvable_asm_expansion): Scan output 2961 sections between the call site and call destination and adjust 2962 call distance by the largest alignment. 2963 29642019-02-20 Alan Hayward <alan.hayward@arm.com> 2965 2966 * elf-bfd.h (elfcore_write_aarch_pauth): Add declaration. 2967 * elf.c (elfcore_grok_aarch_pauth): New function. 2968 (elfcore_grok_note): Check for NT_ARM_PAC_MASK. 2969 (elfcore_write_aarch_pauth): New function. 2970 (elfcore_write_register_note): Check for AArch64 pauth section. 2971 29722019-02-20 Alan Modra <amodra@gmail.com> 2973 2974 PR 24225 2975 * elf32-nios2.c (nios2_elf32_relocate_section): Check asprintf 2976 return value. 2977 29782019-02-20 Michael Roitzsch <reactorcontrol@icloud.com> 2979 2980 * configure.ac (SHARED_LIBADD): Add -liberty -lintl for all 2981 Darwin hosts, not just or1k. 2982 * configure: Regenerate. 2983 29842019-02-20 Alan Modra <amodra@gmail.com> 2985 2986 PR 24236 2987 * archive64.c (_bfd_archive_64_bit_slurp_armap): Move code adding 2988 sentinel NUL to string buffer nearer to loop where it is used. 2989 Don't go past sentinel when scanning strings, and don't write 2990 NUL again. 2991 * archive.c (do_slurp_coff_armap): Simplify string handling to 2992 archive64.c style. 2993 29942019-02-19 Alan Modra <amodra@gmail.com> 2995 2996 PR 24235 2997 * pei-x86_64.c (pex64_bfd_print_pdata_section): Correct checks 2998 attempting to prevent read past end of section. 2999 30002019-02-18 Alan Modra <amodra@gmail.com> 3001 3002 PR 24225 3003 * elf32-nios2.c (nios2_elf32_relocate_section): Use asprintf and 3004 PRIx64 to generate warning messages. Print local sym names too. 3005 30062019-02-09 Vineet Gupta <vgupta@synopsys.com> 3007 3008 * elf32-arc (INIT_SYM_STRING): Delete. 3009 (FINI_SYM_STRING): Likewise. 3010 (init_str): Likewise. 3011 (fini_str): Likewise. 3012 30132019-02-08 Alan Modra <amodra@gmail.com> 3014 3015 * elf32-ppc.c (ppc_elf_relocate_section): Add %X to "unsupported 3016 for bss-plt" warning to make it an error. 3017 30182019-02-07 Eric Botcazou <ebotcazou@adacore.com> 3019 3020 PR ld/18841 3021 * elf32-sparc.c (elf32_sparc_reloc_type_class): Return 3022 reloc_class_ifunc for ifunc symbols. 3023 * elf64-sparc.c (elf64_sparc_reloc_type_class): Likewise. 3024 30252019-02-07 Eric Botcazou <ebotcazou@adacore.com> 3026 3027 * elf32-visium.c (visium_elf_howto_parity_reloc): Minor tweak. 3028 <R_VISIUM_PC16>: Use explicit range test to detect an overflow. 3029 30302019-02-07 Nick Clifton <nickc@redhat.com> 3031 3032 * config.bfd: Move the powerpc-lynxos and powerpc-windiss targets 3033 into the definitely obsolete list. 3034 30352019-02-05 H.J. Lu <hongjiu.lu@intel.com> 3036 3037 PR ld/24151 3038 * elf64-x86-64.c (elf_x86_64_need_pic): Check 3039 SYMBOL_DEFINED_NON_SHARED_P instead of def_regular. 3040 (elf_x86_64_relocate_section): Move PIC check for PC-relative 3041 relocations to ... 3042 (elf_x86_64_check_relocs): Here. 3043 (elf_x86_64_finish_dynamic_symbol): Use SYMBOL_DEFINED_NON_SHARED_P 3044 to check if a symbol is defined in a non-shared object. 3045 * elfxx-x86.h (SYMBOL_DEFINED_NON_SHARED_P): New. 3046 30472019-01-21 Sergio Durigan Junior <sergiodj@redhat.com> 3048 3049 * elf32-arm.c (elf32_arm_final_link_relocate): Use 'llabs' instead 3050 of 'labs' (and fix GCC warning). 3051 30522019-01-25 Nick Clifton <nickc@redhat.com> 3053 3054 * po/ru.po: Updated Russian translation. 3055 30562019-01-23 Nick Clifton <nickc@redhat.com> 3057 3058 * po/fr.po: Updated French translation. 3059 30602019-01-21 Nick Clifton <nickc@redhat.com> 3061 3062 * po/pt.po: Updated Portuguese translation. 3063 * po/uk.po: Updated Ukranian translation. 3064 30652019-01-21 Yuri Chornoivan <yurchor@ukr.net> 3066 3067 PR 24108 3068 * elf32-nds32.c (nds32_relocate_section): Add space between words 3069 in error message. 3070 * elfnn-riscv.c (riscv_version_mismatch): Fix spelling mistake in 3071 error message. 3072 (riscv_i_or_e_p): Likewise. 3073 (riscv_merge_arch_attr_info): Likewise. 3074 30752019-01-19 Nick Clifton <nickc@redhat.com> 3076 3077 * version.m4: Reset to 2.32.51 3078 * configure: Regenerate. 3079 * po/bfd.pot: Regenerate. 3080 30812018-06-24 Nick Clifton <nickc@redhat.com> 3082 3083 2.32 branch created. 3084 30852019-01-16 Kito Cheng <kito@andestech.com> 3086 3087 * elf-attrs.c (vendor_obj_attr_size): Return 0 if size is 0 even 3088 for OBJ_ATTR_PROC. 3089 30902019-01-16 Kito Cheng <kito@andestech.com> 3091 Nelson Chu <nelson@andestech.com> 3092 3093 * elfnn-riscv.c (in_subsets): New. 3094 (out_subsets): Likewise. 3095 (merged_subsets): Likewise. 3096 (riscv_std_ext_p): Likewise. 3097 (riscv_non_std_ext_p): Likewise. 3098 (riscv_std_sv_ext_p): Likewise. 3099 (riscv_non_std_sv_ext_p): Likewise. 3100 (riscv_version_mismatch): Likewise. 3101 (riscv_i_or_e_p): Likewise. 3102 (riscv_merge_std_ext): Likewise. 3103 (riscv_merge_non_std_and_sv_ext): Likewise. 3104 (riscv_merge_arch_attr_info): Likewise. 3105 (riscv_merge_attributes): Likewise. 3106 (_bfd_riscv_elf_merge_private_bfd_data): Merge attribute. 3107 3108 * elfnn-riscv.c (riscv_elf_obj_attrs_arg_type): New. 3109 (elf_backend_obj_attrs_vendor): Define. 3110 (elf_backend_obj_attrs_section_type): Likewise. 3111 (elf_backend_obj_attrs_section): Likewise. 3112 (elf_backend_obj_attrs_arg_type): Define as 3113 riscv_elf_obj_attrs_arg_type. 3114 * elfxx-riscv.c (riscv_estimate_digit): New. 3115 (riscv_estimate_arch_strlen1): Likewise. 3116 (riscv_estimate_arch_strlen): Likewise. 3117 (riscv_arch_str1): Likewise. 3118 (riscv_arch_str): Likewise. 3119 * elfxx-riscv.h (riscv_arch_str): Declare. 3120 31212019-01-14 John Darrington <john@darrington.wattle.id.au> 3122 3123 * bfd-in2.h [BFD_RELOC_S12Z_OPR]: New reloc. 3124 * libbfd.h: regen. 3125 * elf32-s12z.c (eld_s12z_howto_table): R_S12Z_OPR takes non zero 3126 source field. (md_apply_fix): Apply final fix 3127 to BFD_RELOC_S12Z_OPR. 3128 * reloc.c[BFD_RELOC_S12Z_OPR]: New reloc. 3129 31302019-01-14 Maamoun Tarsha <maamountk@hotmail.com> 3131 3132 PR 20113 3133 * elf32-s390.c (allocate_dynrelocs): Update comment. 3134 31352019-01-09 Andrew Paprocki <andrew@ishiboo.com> 3136 3137 * warning.m4: Adjust egrep pattern for non-GNU compilers. 3138 * configure: Regenerate. 3139 31402019-01-08 Alan Modra <amodra@gmail.com> 3141 3142 PR 23699 3143 PR 24065 3144 * ihex.c (ihex_write_object_contents): Properly check 32-bit 3145 address range. 3146 31472019-01-05 Yoshinori Sato <ysato@users.sourceforge.jp> 3148 3149 * bfd/archures.c: Add bfd_mach_rx_v2 and bfd_mach_rx_v3. 3150 * bfd/bfd-in2.h: Regenerate. 3151 * bfd/cpu-rx.c (arch_info_struct): Add RXv2 and RXv3 entry. 3152 * bfd/elf32-rx.c (elf32_rx_machine): Add RXv2 and RXv3 support. 3153 31542019-01-04 Lifang Xia <lifang_xia@c-sky.com> 3155 3156 * config.bfd (csky-*-elf* | csky-*-linux*): Modify the csky 3157 default target, little endian target is more suitable. 3158 31592019-01-04 Alan Modra <amodra@gmail.com> 3160 3161 PR 24061 3162 PR 21786 3163 * coff-rs6000.c (GET_VALUE_IN_FIELD): Add base parameter and 3164 adjust all callers. 3165 (EQ_VALUE_IN_FIELD): Likewise. 3166 * coff64-rs6000.c (GET_VALUE_IN_FIELD): Likewise. 3167 31682019-01-01 Alan Modra <amodra@gmail.com> 3169 3170 Update year range in copyright notice of all files. 3171 3172For older changes see ChangeLog-2018 3173 3174Copyright (C) 2019 Free Software Foundation, Inc. 3175 3176Copying and distribution of this file, with or without modification, 3177are permitted in any medium without royalty provided the copyright 3178notice and this notice are preserved. 3179 3180Local Variables: 3181mode: change-log 3182left-margin: 8 3183fill-column: 74 3184version-control: never 3185End: 3186