4 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
9 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to
10 unsigned when using with RISCV_ITYPE.
11 (_bfd_riscv_relax_call): Use an unsigned foff.
17 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO),
18 (CRINFO_RELVADDR): Make unsigned.
19 (mips_elf_nullify_got_load): Use unsigned constant when shifting
25 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u"
26 variable and rewrite signed overflow check.
27 * elf32-mep.c: Regenerate.
28 (mep_final_link_relocate): Delete "s".
33 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
34 that might shift values into sign bit.
39 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma,
40 and similarly for variables dealing with overflow.
45 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits
46 without undefined behaviour. Tidy excess casts.
50 * elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
51 alignment from reloc addend after reloc type R_MN10300_ALIGN is
58 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits
59 without undefined behaviour.
64 * dwarf2.c (scan_unit_for_symbols): Add member entries to the
70 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last
71 element when count is zero. bfd_realloc when shrinking.
76 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write
82 * ecofflink.c (WRITE): Really don't write zero size chunks.
87 * linker.c (bfd_generic_define_common_symbol): Force the alignment
88 to 1 if the section has now alignment requirement.
92 * elf32-csky.c (csky_archs): Fix arch names.
93 (csky_find_arch_with_name): New.
94 (elf32_csky_merge_attributes): New.
95 (csky_elf_merge_private_bfd_data): Add process of merge
97 (elf32_csky_obj_attrs_arg_type): New.
98 (elf32_csky_obj_attrs_handle_unknown): New.
99 (elf_backend_obj_attrs_vendor): Define.
100 (elf_backend_obj_attrs_section): Define.
101 (elf_backend_obj_attrs_arg_type): Define.
102 (elf_backend_obj_attrs_section_type): Define.
107 * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value
108 for undefined symbols which will not generate extra warning
109 messages about truncated relocs.
113 * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
114 and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
115 (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
116 unresolved reloc checks.
121 * som.c (som_bfd_copy_private_section_data): Issue error when a
122 subspace is specified without its containing space.
127 * elflink.c: Include limits.h.
128 (CHAR_BIT): Provide fallback define.
129 (set_symbol_value): Correct complex reloc comment.
130 (undefined_reference): Set bfd_error.
131 (BINARY_OP_HEAD, BINARY_OP_TAIL): Split out from..
133 (eval_symbol): Limit shifts. Force unsigned for left shift.
134 Catch divide by zero.
135 * configure.ac (AC_CHECK_HEADERS): Combine, sort and add limits.h.
136 * configure: Regenerate.
137 * config.in: Regenerate.
142 * reloc.c (bfd_check_overflow): Return early if zero bitsize.
146 * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
147 on sym_sec not being output.
152 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Correct "dynamic".
157 * elf32-avr.c (avr_final_link_relocate): Fix undefined shift
159 (avr_elf32_load_records_from_section): Use bfd_get_16 and
160 bfd_get_32 to load values from potentially unaligned pointers.
163 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Test for and
164 ignore local symbols.
165 (elf64_alpha_relax_got_load): Do not check for local dynamic
167 (OP_LDA, OP_LDAH, OP_LDQ, OP_BR, OP_BSR): Use unsigned constant
169 (INSN_A) Cast the A parameter to unsigned.
170 (INSN_AB): Define in terms of INSN_A.
171 (INSN_ABC): Likewise.
172 (INSN_ABO): Likewise.
176 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
177 unsigned long constant when creating a mask to test for alignment
183 * elf32-xtensa.c (find_removed_literal): Don't bsearch empty map.
188 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early
189 when section is empty.
194 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
205 * elf64-ppc.c (is_tls_get_addr): Avoid UB &h->elf when h is NULL.
206 (ppc64_elf_tls_setup): Likewise.
207 (branch_reloc_hash_match): Likewise.
208 (build_plt_stub): Likewise.
209 (ppc64_elf_relocate_section): Likewise.
214 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
219 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
220 sstubs->contents != NULL.
225 * som.c (som_prep_for_fixups): Return early when no symbols.
230 * ecofflink.c (WRITE): Don't write size 0 chunks.
234 * bfdio.c (bfd_get_file_size): Don't segv on NULL adata.
239 * vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
243 * archures.c (bfd_mach_xbpf): Define.
244 * bfd-in2.h: Regenerate.
245 * cpu-bpf.c (bfd_xbpf_arch) New.
246 (bfd_bpf_arch) Update next in list field to point to xbpf arch.
250 * archures.c (bfd_mach_ck860): Define.
254 * dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
255 and dwarf_rnglists_size fields.
256 (dwarf_debug_sections): Add debug_rnglists.
257 (dwarf_debug_section_enum): Likewise.
258 (read_debug_rnglists): New function.
259 (read_rangelist): New function to call either read_ranges or
260 read_rnglists. Rename original function to...
261 (read_ranges): ...this.
262 (read_rnglists): New function.
267 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check
268 is_elf_hash_table before accessing elf fields.
273 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
279 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
280 before accessing elf fields.
285 * som.c (som_compute_checksum): XOR 32-bit words in header,
286 not unsigned long sized words.
291 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
292 amount copied for elf_segment_map defined with one element
298 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
299 bfd_get_x size function to read addends out of fields. Apply
300 rightshift adjustment too. Don't apply the now unnecessary
301 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
302 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
303 Correct R_ARM_THM_JUMP6 addend.
308 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
309 before start of section.
313 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
314 before accessing elf_hash_table_id.
315 * elf32-arc.c (elf_arc_hash_table): Likewise.
316 * elf32-arm.c (elf32_arm_hash_table): Likewise.
317 * elf32-avr.c (avr_link_hash_table): Likewise.
318 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
319 * elf32-cris.c (elf_cris_hash_table): Likewise.
320 * elf32-csky.c (csky_elf_hash_table): Likewise.
321 * elf32-frv.c (frvfdpic_hash_table): Likewise.
322 * elf32-hppa.c (hppa_link_hash_table): Likewise.
323 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
324 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
325 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
326 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
327 * elf32-metag.c (metag_link_hash_table): Likewise.
328 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
329 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
330 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
331 * elf32-s390.c (elf_s390_hash_table): Likewise.
332 * elf32-sh.c (sh_elf_hash_table): Likewise.
333 * elf32-spu.c (spu_hash_table): Likewise.
334 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
335 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
336 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
337 * elf64-hppa.c (hppa_link_hash_table): Likewise.
338 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
339 * elf64-s390.c (elf_s390_hash_table): Likewise.
340 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
341 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
342 * elfxx-mips.c (mips_elf_hash_table): Likewise.
343 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
344 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
348 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
349 int. Use '%u' format with _bfd_error_handler to render it.
354 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
355 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
360 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
361 accessing elf_hash_table_id.
366 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
367 accessing elf_hash_table_id.
371 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
372 (read_formatted_entries): Likewise. And skip zero entry.
376 * bfd-in2.h (bfd_mach_ck860): New.
377 * cpu-csky.c (arch_info_struct): Add item for CK860.
381 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
382 high part tprel16 relocs.
383 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
384 Clear do_tls_opt on odd instructions.
385 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
386 Don't sanity check them here.
387 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
388 high part tprel16 relocs.
389 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
390 Clear do_tls_opt on odd instructions.
391 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
396 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
397 * configure: Regenerate.
402 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
403 versioned symbols, which are defined in shared objects, in
408 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
409 the data map if there are entries in it.
410 (_bfd_aarch64_erratum_843419_scan): Likewise.
414 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
415 last byte of debug dir, not first.
420 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
421 field in the ELF header of the compressed sections.
426 * elf-bfd.h (struct bfd_elf_section_data): Add
427 has_secondary_relocs field.
428 * elf.c (_bfd_elf_copy_special_section_fields): Set the
429 has_secondary_relocs field for sections which have associated
431 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
432 on sections which have associated secondary relocs.
436 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
437 small common section.
438 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
439 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
440 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
441 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
442 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
443 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
444 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
445 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
446 * elf32-v850.c (v850_elf_check_relocs): Likewise.
447 (v850_elf_add_symbol_hook): Likewise.
448 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
449 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
450 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
451 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
456 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
458 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
459 on small common section.
460 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
461 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
462 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
463 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
464 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
465 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
469 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
470 rather than another copy of primes. Increase maximum default
475 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
479 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
480 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
481 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
482 optimization when --no-pcrel-optimize.
487 * bfd.c (struct bfd): Add read_only.
488 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
489 Set read_only on warning.
490 (elf_object_p): Sanity check program header alignment. Set
491 read_only on warning.
492 * bfd-in2.h: Regenerate.
496 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
497 win32pstatus note type to avoid signedness comparison warning.
501 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
502 win32pstatus notes, and return TRUE so we continue rather than
503 stopping as if it was an error.
507 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
511 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
512 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
513 appropriate size constraint for each win32pstatus note type.
517 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
518 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
523 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
524 (elfcore_grok_win32pstatus): Use.
528 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
529 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
530 offsets used to read NOTE_INFO_PROCESS.
534 * po/ru.po: Updated Russian translation.
535 * po/sr.po: Updated Serbian translation.
539 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
540 DISP16 and DISP32 relocations.
544 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
545 (bpf_elf_howto_table): Use it here.
546 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
547 instruction and data relocations.
551 * vms-lib.c (vms_traverse_index): Sanity check size remaining
552 before accessing vms_idx or vms_elfidx.
557 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
558 size against file size. Correct LONG_MAX limit check.
559 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
560 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
561 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
562 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
563 bfd_malloc_and_get_section.
568 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
569 IR symbols to become dynamic.
570 (elf_link_add_object_symbols): Don't exclude IR symbols when
571 deciding whether an as-needed shared library is needed.
576 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
578 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
582 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
583 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
584 Don't define _STRUCTURED_PROC.
585 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
586 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
587 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
588 * configure, config.in: Regenerate.
589 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
590 * Makefile.in, doc/Makefile.in: Regenerate.
594 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
595 (elf_link_hash_table): Add sym_cache.
596 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
597 (elf32_arm_check_relocs): Updated.
598 (elf32_arm_size_dynamic_sections): Likewise.
599 * elf32-bfin.c (bfin_link_hash_table): Removed.
600 (bfin_link_hash_newfunc): Updated.
601 (bfin_hash_table): Removed.
602 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
603 (csky_elf_check_relocs): Updated.
604 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
605 (elf32_hppa_check_relocs): Updated.
606 * elf32-i386.c (elf_i386_tls_transition): Updated.
607 (elf_i386_convert_load_reloc): Likewise.
608 (elf_i386_check_relocs): Likewise.
609 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
610 (m32r_elf_hash_table): Updated.
611 (m32r_elf_link_hash_table_create): Likewise.
612 (m32r_elf_create_dynamic_sections): Likewise.
613 (m32r_elf_adjust_dynamic_symbol): Likewise.
614 (allocate_dynrelocs): Likewise.
615 (m32r_elf_size_dynamic_sections): Likewise.
616 (m32r_elf_relocate_section): Likewise.
617 (m32r_elf_finish_dynamic_symbol): Likewise.
618 (m32r_elf_check_relocs): Likewise.
619 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
621 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
622 (elf_m68k_check_relocs): Updated.
623 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
624 (elf_metag_check_relocs): Updated.
625 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
626 (microblaze_elf_check_relocs): Updated.
627 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
628 (nds32_elf_create_dynamic_sections): Likewise.
629 (nds32_elf_adjust_dynamic_symbol): Likewise.
630 (nds32_elf_check_relocs): Likewise.
631 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
632 srelbss and aym_cache.
633 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
634 (nios2_elf32_check_relocs): Updated.
635 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
636 (or1k_elf_check_relocs): Updated.
637 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
638 (ppc_elf_check_relocs): Updated.
639 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
640 (elf_s390_check_relocs): Updated.
641 (elf_s390_finish_dynamic_sections): Likewise.
642 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
644 (sh_elf_create_dynamic_sections): Updated.
645 (sh_elf_adjust_dynamic_symbol): Likewise.
646 (sh_elf_size_dynamic_sections): Likewise.
647 (sh_elf_check_relocs): Likewise.
648 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
649 (elf32_tic6x_check_relocs): Updated.
650 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
651 (tilepro_elf_hash_table): Updated.
652 (tilepro_elf_link_hash_table_create): Likewise.
653 (tilepro_elf_check_relocs): Likewise.
654 (tilepro_elf_adjust_dynamic_symbol): Likewise.
655 (allocate_dynrelocs): Likewise.
656 (tilepro_elf_size_dynamic_sections): Likewise.
657 (tilepro_elf_relocate_section): Likewise.
658 (tilepro_elf_finish_dynamic_symbol): Likewise.
659 (tilepro_finish_dyn): Likewise.
660 (tilepro_elf_finish_dynamic_sections): Likewise.
661 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
662 (ppc64_elf_before_check_relocs): Updated.
663 (ppc64_elf_check_relocs): Likewise.
664 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
665 (elf_s390_check_relocs): Updated.
666 (elf_s390_relocate_section): Likewise.
667 (elf_s390_finish_dynamic_sections): Likewise.
668 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
669 (elf_x86_64_check_relocs): Likewise.
670 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
672 (elfNN_aarch64_check_relocs): Updated.
673 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
674 (riscv_elf_check_relocs): Updated.
675 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
676 (mips_elf_resolve_got_page_ref): Updated.
677 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
678 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
680 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
681 (tilegx_elf_check_relocs): Updated.
682 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
686 * elflink.c (bfd_elf_final_link): Give local symbols a name if
688 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
689 return TRUE if making ET_REL output.
693 * elf-bfd.h (elf_backend_data): Add
694 `elf_backend_elfsym_local_is_section' member.
695 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
697 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
698 * elflink.c (bfd_elf_final_link): Use it to determine whether
699 set the `.symtab' section's `sh_info' value to the index of the
700 first non-local or non-section symbol.
701 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
703 (elf_backend_elfsym_local_is_section): New macro.
704 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
706 (elf_backend_elfsym_local_is_section): New macro.
710 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
711 defined in excluded sections.
715 * elf.c (assign_section_numbers): Comment. Don't segfault on
716 discarded sections when setting linked-to section for generic
718 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
722 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
724 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
729 * config.bfd: Move xc16x target to the obsolete list.
733 * binary.c (binary_get_section_contents): Seek using offset
734 from section's file position.
738 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
743 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
744 type for the first function argument. Rename pointers to reflect
745 that they have distinct types.
749 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
753 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
754 (select_alt_stub): New function.
755 (ppc_get_stub_entry): Use it here.
756 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
758 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
759 merge notoc stubs with other varieties when power10_stubs is "auto".
760 Instead dup the stub hash table entry.
761 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
762 tests of power10_stubs.
767 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
772 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
773 check for aux entries that overflow the buufer.
777 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
778 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
784 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
785 objects both before and after normal object files.
786 * elflink.c (_bfd_elf_section_already_linked): Likewise.
790 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
791 * elf64-ppc.c (struct ppc_link_hash_table): Delete
793 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
794 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
795 uses of power10_stubs.
799 * coff-ppc.c: Delete.
802 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
803 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
805 (coff_write_object_contents): Remove PPC_PE code.
806 * config.bfd: Move powerpcle-pe to removed targets.
807 * configure.ac: Remove powerpc PE entries.
808 * libcoff-in.h (ppc_allocate_toc_section): Delete.
809 (ppc_process_before_allocation): Delete.
810 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
811 * targets.c: Remove powerpc PE vectors.
812 * po/SRC-POTFILES.in: Regenerate.
813 * libcoff.h: Regenerate.
814 * Makefile.in: Regenerate.
815 * configure: Regenerate.
819 * po/fr.po: Updated French translation.
823 * xcofflink.c (xcoff_mark): Don't mark const sections.
824 (bfd_xcoff_record_link_assignment): Add FIXME.
825 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
826 sections being discarded by linker script.
830 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
831 time, uid, gid and mode for deterministic archive.
832 (xcoff_write_archive_contents_big): Likewise.
836 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
841 * po/pt.po: Updated Portuguese translation.
842 * po/uk.po: Updated Ukranian translation.
846 * version.m4: Set version to 2.35.50.
847 * configure: Regenerate.
848 * po/bbfd.pot: Regenerate.
852 Binutils 2.35 branch created.
857 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
858 raw syment index before dereferencing.
862 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
866 * config.bfd: Obsolete xc16x.
870 * archures.c (bfd_mach_i386_nacl): Removed.
871 (bfd_mach_i386_i386_nacl): Likewise.
872 (bfd_mach_x86_64_nacl): Likewise.
873 (bfd_mach_x64_32_nacl): Likewise.
874 * config.bfd: Remove *-*-nacl* targets.
875 * configure.ac: Remove x86 NaCl target vectors.
876 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
877 (bfd_x64_32_nacl_arch): Likewise.
878 (bfd_x86_64_nacl_arch): Likewise.
879 (bfd_i386_nacl_arch): Likewise.
880 (bfd_x64_32_arch_intel_syntax): Updated.
881 * elf32-i386.c: Don't include "elf-nacl.h".
882 (elf_i386_nacl_plt): Removed.
883 (elf_i386_nacl_plt0_entry): Likewise.
884 (elf_i386_nacl_plt_entry): Likewise.
885 (elf_i386_nacl_pic_plt0_entry): Likewise.
886 (elf_i386_nacl_pic_plt_entry): Likewise.
887 (elf_i386_nacl_eh_frame_plt): Likewise.
888 (elf_i386_nacl_plt): Likewise.
889 (elf32_i386_nacl_elf_object_p): Likewise.
890 (elf_i386_get_synthetic_symtab): Updated.
891 (elf_i386_link_setup_gnu_properties): Likewise.
892 * elf64-x86-64.c: Don't include "elf-nacl.h".
893 (elf_x86_64_nacl_plt): Removed.
894 (elf64_x86_64_nacl_elf_object_p): Likewise.
895 (elf_x86_64_nacl_plt0_entry): Likewise.
896 (elf_x86_64_nacl_plt_entry): Likewise.
897 (elf_x86_64_nacl_eh_frame_plt): Likewise.
898 (elf_x86_64_nacl_plt): Likewise.
899 (elf32_x86_64_nacl_elf_object_p): Likewise.
900 (elf_x86_64_get_synthetic_symtab): Updated.
901 (elf_x86_64_link_setup_gnu_properties): Likewise.
902 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
903 * targets.c: Remove x86 NaCl target vectors.
904 * bfd-in2.h: Regenerated.
905 * configure: Likewise.
909 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
910 _bfd_elf_add_dynamic_tags.
914 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
915 return value of bfd_bread. Don't read more than requested length.
916 Sanity check length. Properly terminate file name.
920 * arc-got.h: Use C style comments.
921 * coff-z80.c: Likewise.
922 * elf32-csky.c: Likewise.
923 * peXXigen.c: Likewise.
924 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
929 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
930 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
934 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
935 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
936 (riscv_get_priv_spec_name): Move to..
937 * cpu-riscv.c: ..here.
938 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
939 Use %u to print unsigned numbers.
943 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
944 default architecture.
949 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
950 _bfd_elf_add_dynamic_tags.
955 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
956 _bfd_elf_add_dynamic_tags.
960 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
961 shifts without undefined behaviour.
965 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
967 (_bfd_elf_add_dynamic_tags): New.
968 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
969 _bfd_elf_add_dynamic_tags.
970 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
971 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
972 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
973 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
974 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
975 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
976 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
977 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
979 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
980 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
981 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
982 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
983 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
984 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
985 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
986 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
987 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
989 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
990 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
991 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
992 _bfd_elf_maybe_vxworks_add_dynamic_tags.
993 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
994 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
996 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
997 (_bfd_x86_elf_size_dynamic_sections): Likewise.
998 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
999 dt_reloc_sz and dt_reloc_ent.
1000 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
1001 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
1003 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
1004 etab.dt_pltgot_required.
1005 (elf32_hppa_size_dynamic_sections): Call
1006 _bfd_elf_add_dynamic_tags.
1007 * elf32-metag.c (elf_metag_link_hash_table_create): Set
1008 etab.dt_pltgot_required.
1009 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
1010 * elf32-sh.c (sh_elf_link_hash_table_create): Set
1011 root.dt_pltgot_required for FDPIC output.
1012 (sh_elf_size_dynamic_sections): Call
1013 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1014 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
1015 elf.dt_pltgot_required.
1016 (elf_xtensa_size_dynamic_sections): Call
1017 _bfd_elf_add_dynamic_tags.
1018 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
1019 root.dt_pltgot_required.
1020 (elf64_hppa_size_dynamic_sections): Call
1021 _bfd_elf_add_dynamic_tags.
1022 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
1023 root.dt_pltgot_required.
1024 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
1025 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
1026 * elflink.c (_bfd_elf_add_dynamic_tags): New.
1030 * mach-o.c: Support the new load commands by reading a linkedit
1031 data command for them.
1035 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
1036 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
1037 (riscv_get_priv_spec_class): Likewise.
1038 (riscv_get_priv_spec_name): Likewise.
1039 (riscv_get_priv_spec_class_from_numbers): New function, convert
1040 the version numbers into string, then call riscv_get_priv_spec_class
1041 to get the priv spec class.
1042 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
1043 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
1044 (riscv_get_priv_spec_name): Likewise.
1045 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
1046 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
1047 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
1048 of input and output objects form their priv spec attributes by
1049 riscv_get_priv_spec_class_from_numbers. Report warning rather than
1050 errors when linking objects with differnet priv spec versions. We do
1051 know v1.9.1 may have conflicts to other versions, so report the
1052 warning, too. After that, update the output priv spec version to the
1057 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
1058 priv attributes, we will check the conflicts for all of them (major,
1059 minor and revision), and then set the priv_attrs_merged to TRUE to
1060 indicate that we have handled all of the priv attributes. Remove
1061 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
1066 * configure.ac: Disable plugins by default for some targets.
1067 * plugin.c: Comment typo fix.
1068 * configure: Regenerate.
1072 * plugin.c (try_load_plugin): Suppress the error message about
1073 being unable to open a plugin if creating a list of viable
1078 * aout-tic30.c: Delete file.
1079 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
1080 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
1081 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
1082 (xc16x-*-elf): Sort properly.
1083 * configure.ac: Remove tic30_aout_vec.
1084 * targets.c: Likewise.
1085 * Makefile.in: Regenerate.
1086 * configure: Regenerate.
1087 * po/SRC-POTFILES.in: Regenerate.
1091 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
1092 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
1093 (elf32xtensa_abi): New global variable.
1094 (xtensa_abi_choice): New function.
1095 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
1096 XSHAL_ABI to select PLT code.
1100 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
1101 field of bfd_link_info.
1105 * config.bfd: Obsolete powerpcle-*-pe targets.
1110 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
1111 symbols that were defined in discarded sections.
1112 * cofflink.c (coff_link_check_archive_element): Likewise.
1113 (coff_link_add_symbols): Set indx to -3 for symbols defined in
1115 (_bfd_coff_write_global_sym): Don't emit such symbols.
1116 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
1117 libcoff.h: Regenerate.
1122 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
1126 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
1127 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
1128 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
1134 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
1135 Clear verinfo.verdef.
1140 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
1141 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
1142 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
1144 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
1145 Set ifunc_resolvers if there are FUNC resolvers.
1146 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
1147 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
1148 with elf.ifunc_resolvers.
1149 (write_plt_relocs_for_local_syms): Likewise.
1150 (ppc64_elf_relocate_section): Likewise.
1151 (ppc64_elf_finish_dynamic_sections): Likewise.
1152 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
1154 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1155 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
1156 instead of readonly_dynrelocs_against_ifunc.
1157 * elfxx-x86.h (elf_x86_link_hash_table): Remove
1158 readonly_dynrelocs_against_ifunc.
1162 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1163 maybe_local_ifunc_resolver field.
1164 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
1165 cases where maybe_local_ifunc_resolver was set.
1166 (ppc64_elf_relocate_section): Likewise.
1167 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
1172 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
1174 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
1176 (elf32_arm_size_dynamic_sections): Updated. Clear
1177 root.tlsdesc_plt for DF_BIND_NOW.
1178 (elf32_arm_finish_dynamic_sections): Updated.
1179 (elf32_arm_output_arch_local_syms): Likewise.
1180 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
1181 Clear root.tlsdesc_plt for DF_BIND_NOW.
1182 (nds32_elf_finish_dynamic_sections): Updated.
1183 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
1184 dt_tlsdesc_plt and dt_tlsdesc_got.
1185 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
1186 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1187 tlsdesc_plt and dt_tlsdesc_got.
1188 (elfNN_aarch64_allocate_dynrelocs): Updated.
1189 (elfNN_aarch64_finish_dynamic_sections): Likewise.
1190 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
1191 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
1193 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1194 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1195 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1196 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
1201 * elf32-tic6x.c (elf32_bed): Defined the default to
1206 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
1208 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
1209 root.splt/root.srelplt.
1210 (elf64_hppa_create_dynamic_sections): Likewise.
1211 (elf64_hppa_size_dynamic_sections): Likewise.
1212 (elf64_hppa_finish_dynamic_symbol): Likewise.
1213 (elf_hppa_final_link): Likewise.
1214 (elf_hppa_final_link_relocate): Likewise.
1218 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
1219 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1224 * elf-bfd.h (elf_target_os): New.
1225 (elf_link_hash_table): Add target_os.
1226 (elf_backend_data): Add target_os.
1227 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
1228 symbian_p and nacl_p.
1229 (create_got_section): Updated.
1230 (elf32_arm_create_dynamic_sections): Likewise.
1231 (arm_type_of_stub): Likewise.
1232 (elf32_arm_create_or_find_stub_sec): Likewise.
1233 (elf32_arm_allocate_plt_entry): Likewise.
1234 (elf32_arm_populate_plt_entry): Likewise.
1235 (elf32_arm_final_link_relocate): Likewise.
1236 (elf32_arm_check_relocs): Likewise.
1237 (allocate_dynrelocs_for_symbol): Likewise.
1238 (elf32_arm_finish_dynamic_symbol): Likewise.
1239 (elf32_arm_finish_dynamic_sections): Likewise.
1240 (elf32_arm_output_plt_map_1): Likewise.
1241 (elf32_arm_output_arch_local_syms): Likewise.
1242 (elf32_arm_add_symbol_hook): Likewise.
1243 (elf32_arm_nacl_link_hash_table_create): Likewise.
1244 (elf32_arm_vxworks_link_hash_table_create): Likewise.
1245 (elf32_arm_symbian_link_hash_table_create): Likewise.
1246 (ELF_TARGET_OS): New.
1247 * elf32-i386.c (elf_i386_arch_bed): Removed.
1248 (elf_backend_arch_data): Likewise.
1249 (elf_i386_solaris_arch_bed): Likewise.
1250 (elf_i386_nacl_arch_bed): Likewise.
1251 (elf_i386_vxworks_arch_bed): Likewise.
1252 (elf_i386_relocate_section): Updated.
1253 (elf_i386_finish_dynamic_sections): Likewise.
1254 (elf_i386_get_synthetic_symtab): Likewise.
1255 (elf_i386_link_setup_gnu_properties): Likewise.
1256 (ELF_TARGET_OS): New.
1257 * elf32-mips.c (ELF_TARGET_OS): New.
1258 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
1259 (ppc_elf_create_got): Updated.
1260 (ppc_elf_create_dynamic_sections): Likewise.
1261 (ppc_elf_check_relocs): Likewise.
1262 (ppc_elf_adjust_dynamic_symbol): Likewise.
1263 (ppc_elf_size_dynamic_sections): Likewise.
1264 (ppc_elf_relocate_section): Likewise.
1265 (ppc_elf_finish_dynamic_sections): Likewise.
1266 (ppc_elf_vxworks_link_hash_table_create): Likewise.
1267 (ELF_TARGET_OS): New.
1268 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
1269 (sh_elf_link_hash_table_create): Updated.
1270 (sh_elf_create_dynamic_sections): Likewise.
1271 (allocate_dynrelocs): Likewise.
1272 (sh_elf_size_dynamic_sections): Likewise.
1273 (sh_elf_relocate_section): Likewise.
1274 (sh_elf_finish_dynamic_symbol): Likewise.
1275 (sh_elf_finish_dynamic_sections): Likewise.
1276 (ELF_TARGET_OS): New.
1277 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
1279 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1280 (ELF_TARGET_OS): New.
1281 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
1282 (elf_x86_64_solaris_arch_bed): Likewise.
1283 (elf_x86_64_nacl_arch_bed): Likewise.
1284 (elf_x86_64_finish_dynamic_sections): Updated.
1285 (elf_x86_64_get_synthetic_symtab): Likewise.
1286 (elf_x86_64_link_setup_gnu_properties): Likewise.
1287 (ELF_TARGET_OS): New.
1288 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
1290 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
1291 (MIPS_ELF_REL_DYN_NAME): Updated.
1292 (ELF_MIPS_GP_OFFSET): Likewise.
1293 (mips_elf_create_local_got_entry): Likewise.
1294 (mips_elf_allocate_dynamic_relocations): Likewise.
1295 (mips_elf_count_got_symbols): Likewise.
1296 (is_gott_symbol): Likewise.
1297 (mips_elf_calculate_relocation): Likewise.
1298 (mips_elf_create_dynamic_relocation): Likewise.
1299 (_bfd_mips_elf_check_relocs): Likewise.
1300 (allocate_dynrelocs): Likewise.
1301 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
1302 (mips_elf_lay_out_got): Likewise.
1303 (mips_elf_set_plt_sym_value): Likewise.
1304 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1305 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1306 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1307 (_bfd_mips_elf_final_link): Likewise.
1308 (_bfd_mips_init_file_header): Likewise.
1309 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
1311 (allocate_dynrelocs): Likewise.
1312 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1313 (_bfd_sparc_elf_relocate_section): Likewise.
1314 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1315 (sparc_finish_dyn): Likewise.
1316 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1317 * elfxx-target.h (ELF_TARGET_OS): New.
1318 (elfNN_bed): Add ELF_TARGET_OS.
1319 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1320 (_bfd_x86_elf_link_hash_table_create): Likewise.
1321 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1322 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1323 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1324 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1325 * elfxx-x86.h (elf_x86_target_os): Removed.
1326 (elf_x86_backend_data): Likewise.
1327 (get_elf_x86_backend_data): Likewise.
1328 (elf_x86_link_hash_table): Remove target_os.
1333 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
1334 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
1335 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
1336 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
1337 * elf64-ppc.c: Update throughout for reloc renaming.
1338 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
1339 * libbfd.h: Regenerate.
1340 * bfd-in2.h: Regenerate.
1345 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
1350 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
1355 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
1356 priv_may_conflict, in_priv_zero and out_priv_zero to decide
1357 whether the object can be linked according to it's priv
1358 attributes. The object without any priv spec attributes can
1359 be linked with others. If the first input object doesn't contain
1360 any priv attributes, then we need to copy the setting from the
1361 next input one. Also report more detailed error messages to user.
1365 Extend pdp11-aout symbol table format to accommodate .stab
1366 symbols and implement correct handling of them.
1368 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
1369 (N_STAB, is_stab): Needed new function is_stab to disambiguate
1370 normal vs. .stab symbol table type values, replacing N_STAB mask.
1371 (translate_from_native_sym_flags): Determine correct section for
1372 different .stab types.
1373 (translate_to_native_sym_flags): Leave .stab types intact.
1374 (translate_symbol_table): Error if symbol indicates overlay;
1375 store desc field from .stab symbols.
1376 (write_syms): Output desc field with symbol.
1377 (aout_link_check_ar_symbols): Skip .stab symbols.
1378 (aout_link_add_symbols): Correctly distinguish .stab symbols.
1379 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
1380 (aout_link_write_symbols): Write 0 for desk and ovly fields;
1381 correctly distinguish .stab symbols and select calculate their
1382 section and value; and copy desc and ovly fields from input symbol
1387 * aoutx.h (translate_symbol_table): Comment had external and
1389 * pdp11.c (translate_symbol_table): Likewise.
1393 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
1394 (is_x86_elf): Check elf.hash_table_id instead of target_id.
1395 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
1400 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
1401 in debug section against symbol defined in shared library to 0.
1402 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
1403 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
1404 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
1405 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
1406 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
1407 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1408 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
1409 * elf32-sh.c (sh_elf_check_relocs): Likewise.
1410 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1411 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1412 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1413 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1414 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1415 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
1417 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
1418 there is non-GOT reference.
1419 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
1420 non-alloced sections.
1424 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
1426 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
1428 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
1429 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
1430 other size that doesn't qcover the header word.
1431 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
1432 string table, and zero it.
1433 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
1434 message and set bfd_error on finding an invalid name string offset.
1435 (add_to_stringtab): INLINE -> inline
1436 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
1438 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
1439 any relocs that could not be recognised.
1440 92744f05809 PR 20929 - Check for relocs without an associated symbol.
1441 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
1442 name exists and is long enough, before attempting to see if it is
1444 c3864421222 - Correct case for N_SO being the last symbol.
1445 50455f1ab29 PR 20891 - Handle the case where the main file name
1446 and the directory name are both empty.
1447 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
1448 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
1449 range string table offsets.
1450 531336e3a0b PR 20909 - Fix off-by-one error in check for an
1451 illegal string offset.
1452 (aout_link_includes_newfunc): Add comment.
1453 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
1454 on unexpected relocation type rather than ASSERT.
1459 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
1460 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
1465 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
1466 non-alloced sections.
1470 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
1471 dynamic relocations for non SEC_ALLOC sections.
1475 * aout64.c (BMAGIC, QMAGIC): Do not define.
1476 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
1477 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
1478 to check the file format.
1479 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
1480 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
1481 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
1485 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
1486 relocations for non SEC_ALLOC sections.
1490 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
1491 * elf32-arm.c (maybe_set_textrel): Removed.
1492 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
1493 with _bfd_elf_maybe_set_textrel.
1494 * elf32-csky.c (maybe_set_textrel): Removed.
1495 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
1496 with _bfd_elf_maybe_set_textrel.
1497 * elf32-hppa.c (maybe_set_textrel): Removed.
1498 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
1499 with _bfd_elf_maybe_set_textrel.
1500 * elf32-lm32.c (maybe_set_textrel): Removed.
1501 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
1502 with _bfd_elf_maybe_set_textrel.
1503 * elf32-m32r.c (maybe_set_textrel): Removed.
1504 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
1505 with _bfd_elf_maybe_set_textrel.
1506 * elf32-metag.c (maybe_set_textrel): Removed.
1507 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
1508 with _bfd_elf_maybe_set_textrel.
1509 * elf32-nds32.c (maybe_set_textrel): Removed.
1510 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
1511 with _bfd_elf_maybe_set_textrel.
1512 * elf32-or1k.c (maybe_set_textrel): Removed.
1513 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
1514 with _bfd_elf_maybe_set_textrel.
1515 * elf32-ppc.c (maybe_set_textrel): Removed.
1516 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
1517 with _bfd_elf_maybe_set_textrel.
1518 * elf32-s390.c (maybe_set_textrel): Removed.
1519 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1520 with _bfd_elf_maybe_set_textrel.
1521 * elf32-sh.c (maybe_set_textrel): Removed.
1522 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
1523 with _bfd_elf_maybe_set_textrel.
1524 * elf32-tic6x.c (maybe_set_textrel): Removed.
1525 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
1526 with _bfd_elf_maybe_set_textrel.
1527 * elf32-tilepro.c (maybe_set_textrel): Removed.
1528 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
1529 with _bfd_elf_maybe_set_textrel.
1530 * elf64-ppc.c (maybe_set_textrel): Removed.
1531 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
1532 with _bfd_elf_maybe_set_textrel.
1533 * elf64-s390.c (maybe_set_textrel): Removed.
1534 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1535 with _bfd_elf_maybe_set_textrel.
1536 * elfnn-aarch64.c (maybe_set_textrel): Removed.
1537 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
1538 with _bfd_elf_maybe_set_textrel.
1539 * elfnn-riscv.c (maybe_set_textrel): Removed.
1540 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
1541 with _bfd_elf_maybe_set_textrel.
1542 * elfxx-sparc.c (maybe_set_textrel): Removed.
1543 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
1544 with _bfd_elf_maybe_set_textrel.
1545 * elfxx-tilegx.c (maybe_set_textrel): Removed.
1546 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
1547 with _bfd_elf_maybe_set_textrel.
1548 * elfxx-x86.c (maybe_set_textrel): Removed.
1549 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
1550 with _bfd_elf_maybe_set_textrel.
1551 * elflink.c (_bfd_elf_maybe_set_textrel): New.
1556 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
1558 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
1559 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
1560 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
1561 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
1563 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
1564 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
1565 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
1566 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1567 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
1568 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
1569 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1570 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
1571 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
1572 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1573 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
1574 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1575 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
1576 (elf_backend_copy_indirect_symbol): Likewise.
1577 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
1578 (elf_backend_copy_indirect_symbol): Likewise.
1579 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
1584 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
1585 * elf32-arm.c (readonly_dynrelocs): Removed.
1586 (maybe_set_textrel): Replace readonly_dynrelocs with
1587 _bfd_elf_readonly_dynrelocs.
1588 * elf32-csky.c (readonly_dynrelocs): Removed.
1589 (maybe_set_textrel): Replace readonly_dynrelocs with
1590 _bfd_elf_readonly_dynrelocs.
1591 * elf32-hppa.c(readonly_dynrelocs): Removed.
1592 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1593 _bfd_elf_readonly_dynrelocs.
1594 (maybe_set_textrel): Likewise.
1595 * elf32-lm32.c (readonly_dynrelocs): Removed.
1596 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1597 with _bfd_elf_readonly_dynrelocs.
1598 (maybe_set_textrel): Likewise.
1599 * elf32-m32r.c (readonly_dynrelocs): Removed.
1600 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1601 with _bfd_elf_readonly_dynrelocs.
1602 (maybe_set_textrel): Likewise.
1603 * elf32-metag.c (readonly_dynrelocs): Removed.
1604 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
1605 with _bfd_elf_readonly_dynrelocs.
1606 (maybe_set_textrel): Likewise.
1607 * elf32-microblaze.c (readonly_dynrelocs): Removed.
1608 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1609 with _bfd_elf_readonly_dynrelocs.
1610 * elf32-nds32.c (readonly_dynrelocs): Removed.
1611 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1612 with _bfd_elf_readonly_dynrelocs.
1613 (maybe_set_textrel): Likewise.
1614 * elf32-or1k.c (readonly_dynrelocs): Removed.
1615 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1616 with _bfd_elf_readonly_dynrelocs.
1617 * elf32-ppc.c (readonly_dynrelocs): Removed.
1618 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1619 _bfd_elf_readonly_dynrelocs.
1620 (ppc_elf_adjust_dynamic_symbol): Likewise.
1621 (maybe_set_textrel): Likewise.
1622 * elf32-s390.c (readonly_dynrelocs): Removed.
1623 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1624 with _bfd_elf_readonly_dynrelocs.
1625 (maybe_set_textrel): Likewise.
1626 * elf32-sh.c (readonly_dynrelocs): Removed.
1627 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
1628 _bfd_elf_readonly_dynrelocs.
1629 (maybe_set_textrel): Likewise.
1630 * elf32-tic6x.c (readonly_dynrelocs): Removed.
1631 (maybe_set_textrel): Replace readonly_dynrelocs with
1632 _bfd_elf_readonly_dynrelocs.
1633 * elf32-tilepro.c (readonly_dynrelocs): Removed.
1634 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1635 with _bfd_elf_readonly_dynrelocs.
1636 (maybe_set_textrel): Likewise.
1637 * elf64-ppc.c (readonly_dynrelocs): Removed.
1638 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1639 _bfd_elf_readonly_dynrelocs.
1640 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1641 (maybe_set_textrel): Likewise.
1642 * elf64-s390.c (readonly_dynrelocs): Removed.
1643 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1644 with _bfd_elf_readonly_dynrelocs.
1645 (maybe_set_textrel): Likewise.
1646 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
1647 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
1648 (maybe_set_textrel): Replace readonly_dynrelocs with
1649 _bfd_elf_readonly_dynrelocs.
1650 * elfnn-riscv.c (readonly_dynrelocs): Removed.
1651 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1652 with _bfd_elf_readonly_dynrelocs.
1653 (maybe_set_textrel): Likewise.
1654 * elfxx-sparc.c (readonly_dynrelocs): Removed.
1655 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
1656 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
1657 (maybe_set_textrel): Likewise.
1658 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
1659 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1660 with _bfd_elf_readonly_dynrelocs.
1661 (maybe_set_textrel): Likewise.
1662 * elfxx-x86.c (readonly_dynrelocs): Removed.
1663 (maybe_set_textrel): Replace readonly_dynrelocs with
1664 _bfd_elf_readonly_dynrelocs.
1665 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1669 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
1670 -fsanitize=undefined.
1676 * peicode.h (pe_ILF_make_a_section): Align data for compilers
1678 (pe_ILF_build_a_bfd): Likewise.
1683 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
1684 core files as well as objects.
1689 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
1690 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
1692 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
1693 (elf_arc_link_hash_newfunc): Updated.
1694 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
1695 (elf32_arm_link_hash_newfunc): Updated.
1696 (elf32_arm_copy_indirect_symbol): Likewise.
1697 (elf32_arm_check_relocs): Likewise.
1698 (readonly_dynrelocs): Likewise.
1699 (allocate_dynrelocs_for_symbol): Likewise.
1700 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
1701 (csky_elf_link_hash_newfunc): Updated.
1702 (csky_allocate_dynrelocs): Likewise.
1703 (readonly_dynrelocs): Likewise.
1704 (csky_elf_copy_indirect_symbol): Likewise.
1705 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
1706 (hppa_link_hash_newfunc): Updated.
1707 (elf32_hppa_copy_indirect_symbol): Likewise.
1708 (elf32_hppa_hide_symbol): Likewise.
1709 (elf32_hppa_adjust_dynamic_symbol): Likewise.
1710 (allocate_dynrelocs): Likewise.
1711 (elf32_hppa_relocate_section): Likewise.
1712 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1713 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
1714 (lm32_elf_link_hash_newfunc): Likewise.
1715 (lm32_elf_link_hash_table_create): Updated.
1716 (readonly_dynrelocs): Likewise.
1717 (allocate_dynrelocs): Likewise.
1718 (lm32_elf_copy_indirect_symbol): Likewise.
1719 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
1720 (m32r_elf_link_hash_newfunc): Likewise.
1721 (m32r_elf_link_hash_table_create): Updated.
1722 (m32r_elf_copy_indirect_symbol): Likewise.
1723 (allocate_dynrelocs): Likewise.
1724 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
1725 (metag_link_hash_newfunc): Updated.
1726 (elf_metag_copy_indirect_symbol): Likewise.
1727 (readonly_dynrelocs): Likewise.
1728 (allocate_dynrelocs): Likewise.
1729 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
1731 (link_hash_newfunc): Updated.
1732 (microblaze_elf_check_relocs): Likewise.
1733 (microblaze_elf_copy_indirect_symbol): Likewise.
1734 (readonly_dynrelocs): Likewise.
1735 (allocate_dynrelocs): Likewise.
1736 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
1737 (nds32_elf_link_hash_newfunc): Updated.
1738 (nds32_elf_copy_indirect_symbol): Likewise.
1739 (readonly_dynrelocs): Likewise.
1740 (allocate_dynrelocs): Likewise.
1741 (nds32_elf_check_relocs): Likewise.
1742 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
1743 (link_hash_newfunc): Updated.
1744 (nios2_elf32_copy_indirect_symbol): Likewise.
1745 (nios2_elf32_check_relocs): Likewise.
1746 (allocate_dynrelocs): Likewise.
1747 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
1748 (or1k_elf_link_hash_newfunc): Updated.
1749 (readonly_dynrelocs): Likewise.
1750 (allocate_dynrelocs): Likewise.
1751 (or1k_elf_copy_indirect_symbol): Likewise.
1752 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
1753 (ppc_elf_link_hash_newfunc): Updated.
1754 (ppc_elf_copy_indirect_symbol): Likewise.
1755 (ppc_elf_check_relocs): Likewise.
1756 (readonly_dynrelocs): Likewise.
1757 (ppc_elf_adjust_dynamic_symbol): Likewise.
1758 (allocate_dynrelocs): Likewise.
1759 (ppc_elf_relocate_section): Likewise.
1760 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1761 (link_hash_newfunc): Updated.
1762 (elf_s390_copy_indirect_symbol): Likewise.
1763 (readonly_dynrelocs): Likewise.
1764 (elf_s390_adjust_dynamic_symbol): Likewise.
1765 (allocate_dynrelocs): Likewise.
1766 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
1767 (sh_elf_link_hash_newfunc): Updated.
1768 (readonly_dynrelocs): Likewise.
1769 (allocate_dynrelocs): Likewise.
1770 (sh_elf_copy_indirect_symbol): Likewise.
1771 (sh_elf_check_relocs): Likewise.
1772 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
1773 (elf32_tic6x_link_hash_newfunc): Likewise.
1774 (elf32_tic6x_link_hash_table_create): Updated.
1775 (readonly_dynrelocs): Likewise.
1776 (elf32_tic6x_check_relocs): Likewise.
1777 (elf32_tic6x_allocate_dynrelocs): Likewise.
1778 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
1780 (link_hash_newfunc): Updated.
1781 (tilepro_elf_copy_indirect_symbol): Likewise.
1782 (tilepro_elf_check_relocs): Likewise.
1783 (allocate_dynrelocs): Likewise.
1784 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
1785 (ppc64_elf_copy_indirect_symbol): Updated.
1786 (ppc64_elf_check_relocs): Likewise.
1787 (readonly_dynrelocs): Likewise.
1788 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1789 (dec_dynrel_count): Likewise.
1790 (allocate_dynrelocs): Likewise.
1791 (ppc64_elf_relocate_section): Likewise.
1792 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1793 (link_hash_newfunc): Updated.
1794 (elf_s390_copy_indirect_symbol): Likewise.
1795 (readonly_dynrelocs): Likewise.
1796 (allocate_dynrelocs): Likewise.
1797 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1798 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1800 (elfNN_aarch64_link_hash_newfunc): Updated.
1801 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1802 (readonly_dynrelocs): Likewise.
1803 (need_copy_relocation_p): Likewise.
1804 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1805 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1806 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1807 (link_hash_newfunc): Updated.
1808 (riscv_elf_copy_indirect_symbol): Likewise.
1809 (riscv_elf_check_relocs): Likewise.
1810 (readonly_dynrelocs): Likewise.
1811 (allocate_dynrelocs): Likewise.
1812 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1814 (link_hash_newfunc): Updated.
1815 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1816 (_bfd_sparc_elf_check_relocs): Likewise.
1817 (readonly_dynrelocs): Likewise.
1818 (allocate_dynrelocs): Likewise.
1819 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1820 (link_hash_newfunc): Updated.
1821 (tilegx_elf_copy_indirect_symbol): Likewise.
1822 (tilegx_elf_check_relocs): Likewise.
1823 (readonly_dynrelocs): Likewise.
1824 (allocate_dynrelocs): Likewise.
1825 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1826 (readonly_dynrelocs): Likewise.
1827 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1828 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1832 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1833 command against cmd_length, not the end of record. For
1834 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1835 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1840 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1841 R_BPF_INSN_{32,64} relocations.
1845 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1846 addreses in .long (used in testsuites) and .stab values.
1851 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1852 Check bfd_link_dll when issue a DT_TEXTREL warning.
1853 * elfxx-x86.c (maybe_set_textrel): Likewise.
1854 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1858 * plugin.c (try_load_plugin): Extend error message when a plugin
1863 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1868 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1869 attributes from shared libraries, and do not return an error if
1875 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1877 (_bfd_delete_bfd): Free the copy.
1878 (_bfd_new_bfd): Free nbfd->memory on error.
1882 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1883 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1884 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1885 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1886 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1887 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1888 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1889 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1890 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1891 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1892 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1893 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1894 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1895 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1896 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1897 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1898 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1899 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1900 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1901 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1905 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1906 get_default_version. It is used to find the default version for
1907 the specific extension.
1908 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1909 default_major_version and default_minor_version. Add new bfd_boolean
1910 parameter *use_default_version. Set it to TRUE if we need to call
1911 the callback rps->get_default_version to find the default version.
1912 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1913 the default version in riscv_parsing_subset_version, and then call
1914 riscv_add_subset to add the subset into subset list.
1915 (riscv_parse_prefixed_ext): Likewise.
1916 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1917 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1918 strings rather than characters.
1919 riscv_merge_arch_attr_info): The callback function get_default_version
1920 is only needed for assembler, so set it to NULL int the linker.
1921 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1922 * elfxx-riscv.h: Updated.
1927 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1928 use bfd_set_filename.
1929 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1930 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1931 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1932 (bfd_create): Likewise.
1933 (_bfd_delete_bfd): Don't free filename.
1934 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1935 return pointer to the copy or NULL on alloc fail.
1936 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1937 result of bfd_set_filename.
1938 * bfd-in2.h: Regenerate.
1943 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1944 section size against file size.
1945 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1950 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1951 and memset when allocating memory for the sections_being_created
1956 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1958 (or1k_elf_relocate_section): Access srelgot via
1959 htab->root.srelgot. Add assertions for srelgot->contents.
1960 Introduce local variable for srelgot to not reuse global
1962 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1963 (or1k_set_got_and_rela_sizes): New function.
1964 (or1k_initial_exec_offset): New function.
1965 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1966 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1968 (or1k_elf_check_relocs): Use OR to set TLS access.
1969 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1971 (or1k_elf_size_dynamic_sections): Use
1972 or1k_set_got_and_rela_sizes to set sizes.
1973 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1974 (TCB_SIZE): New macro.
1975 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1976 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1977 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1978 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1979 (tpoff): Add dynamic boolean argument.
1980 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1984 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1985 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1986 cases with BFD_RELOC_AARCH64_JUMP26.
1987 (elfNN_aarch64_check_relocs): Likewise.
1991 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1992 bfd_get_filename rather than accessing bfd->filename directly.
1993 * aout-target.h (MY (object_p)): Likewise.
1994 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1995 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1996 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1997 (_bfd_archive_bsd44_construct_extended_name_table),
1998 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1999 (_bfd_bsd_write_armap): Likewise.
2000 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
2001 * cache.c (bfd_open_file): Likewise.
2002 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
2003 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
2004 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2005 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2006 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
2007 * elf32-nds32.c (nds32_elf_output_symbol_hook),
2008 (patch_tls_desc_to_ie): Likewise.
2009 * elf32-spu.c (sort_bfds, print_one_overlay_section),
2010 (spu_elf_auto_overlay): Likewise.
2011 * elf64-hppa.c (elf_hppa_final_link): Likewise.
2012 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
2013 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
2014 * elflink.c (bfd_elf_size_dynamic_sections),
2015 (elf_link_input_bfd): Likewise.
2016 * linker.c (_bfd_generic_link_output_symbols): Likewise.
2017 * mach-o.c (bfd_mach_o_follow_dsym),
2018 (bfd_mach_o_close_and_cleanup): Likewise.
2019 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
2020 (find_separate_debug_file, get_build_id_name): Likewise.
2021 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2022 * plugin.c (bfd_plugin_open_input): Likewise.
2023 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
2024 * som.c (som_write_armap): Likewise.
2025 * srec.c (srec_write_record, srec_write_symbols): Likewise.
2026 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
2027 (_bfd_vms_lib_write_archive_contents): Likewise.
2028 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2033 * bfdio.c (_bfd_real_fopen): Typo fix.
2038 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
2039 for the sections_being_created array.
2043 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
2044 they can be freed without also freeing internal_relocs.
2049 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
2050 separators into DOS style when creating a WIN32 fullpath.
2054 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
2055 to initialize RISC-V tdata.
2059 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
2064 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
2068 * elf64-ppc.c: Rename powerxx to power10 throughout.
2073 * coffgen.c (coff_get_normalized_symtab): Check that buffer
2074 contains required number of auxents before processing any auxent.
2075 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
2076 file name from auxents for PE.
2080 * aout-cris.c (DEFAULT_ARCH): Delete define.
2081 (MY_set_arch_mach): Likewise.
2082 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
2084 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
2085 of r_type before the shift.
2090 * elfnn-aarch64.c (group_sections): Copy implementation from
2096 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
2097 accessing root.u.def of symbols. Also check root.u.def.section
2098 is non-NULL. Reverse tests so as to make the logic positive.
2103 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
2104 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
2109 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
2110 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2111 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2112 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
2113 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
2114 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
2115 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
2116 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
2117 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
2118 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2123 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
2124 from shared libraries.
2128 * elf32-xtensa.c (relax_section): Don't negate diff_value for
2129 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
2130 equals 0. Report overflow when the result has negative sign but
2131 all significant bits are zero.
2135 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
2136 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2140 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
2141 Emit warning message.
2145 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
2146 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
2147 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
2148 to x86_64_pe_big_vec as it not a big-endian format.
2149 (vec i386_pe_big_vec): New.
2150 * configure.ac: Likewise.
2151 * targets.c: Likewise.
2152 * configure: Regenerate.
2153 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
2154 COFF_WITH_PE_BIGOBJ): New.
2155 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
2157 (x86_64_pe_be_vec): Moved.
2161 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
2162 * elf.c (elfcore_grok_arc_v2): New function.
2163 (elfcore_grok_note): Call the new function to handle the corresponding
2165 (elfcore_write_arc_v2): New function.
2166 (elfcore_write_register_note): Call the new function to handle the
2167 corresponding pseudo-sections.
2172 * bfd-in2.h: Regenerated.
2173 * elf32-xtensa.c (elf_howto_table): New entries for
2174 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
2175 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
2176 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
2177 R_XTENSA_NDIFF{8,16,32}.
2178 * libbfd.h (bfd_reloc_code_real_names): Add names for
2179 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
2180 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2181 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
2182 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2187 * compress.c (bfd_get_full_section_contents): Exclude sections with no
2193 * elf-bfd.h (elf_backend_data): Add
2194 elf_backend_strip_zero_sized_dynamic_sections.
2195 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
2196 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
2198 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
2200 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
2202 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
2206 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
2208 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
2210 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2214 * po/sr.po: Updated Serbian translation.
2218 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
2223 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
2224 causing globals from linker script to be treated as debug symbols.
2225 (translate_symbol_table): Don't sign-extend symbol values from 16
2226 to 64 bits in nm output.
2230 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
2234 * section.c (bfd_is_const_section): Correct test for special
2236 * bfd-in2.h: Regenerate.
2241 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
2247 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
2248 abort with a more helpful error message.
2253 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
2259 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
2260 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
2261 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2262 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
2263 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2264 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2265 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2266 * elf32-sh.c (sh_elf_relocate_section): Likewise.
2267 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2268 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2269 * elflink.c (elf_link_output_extsym): Likewise.
2270 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
2275 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
2276 pointer into strings that may be freed for section name, always
2277 allocate a new string.
2282 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
2283 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2284 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
2285 (_bfd_go32_mkobject): New functions.
2286 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
2287 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2288 (go32exe_mkobject): Call _bfd_go32_mkobject.
2289 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
2290 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
2292 (coff_write_relocs): Enable extended reloc counter code if
2293 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
2294 (coff_write_object_contents): Likewise. Pad section headers
2295 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
2296 instead of coff_swap_scnhdr_out.
2297 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
2298 enable extended reloc counter.
2299 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
2300 Declare with ATTRIBUTE_UNUSED.
2301 * libcoff-in.h: (struct coff_tdata): New field go32.
2303 * libcoff.h: Regenerate.
2308 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
2314 * pdp11.c: Add implementation of --imagic option.
2315 (adjust_o_magic): Fix objcopy --extract-symbol test.
2316 * libaout.h (enum aout_magic): Add i_magic.
2321 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
2323 <default>: Error rather than abort.
2328 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
2329 relocation section from section group.
2333 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
2334 bfd->origin to file offset.
2335 * bfdwin.c (bfd_get_file_window): Likewise.
2336 * bfd.c: Clarify the use of the bfd->origin field.
2337 * bfd-in2.h: Regenerate.
2338 * coff-i386.c: Don't include go32exe.h. Allow overriding
2339 coff_write_object_contents via COFF_WRITE_CONTENTS.
2340 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
2341 (go32exe_write_object_contents): New functions.
2342 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
2343 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
2344 (create_go32_stub): Remove check for 2k size limit. Read stub
2345 from go32exe_temp_stub if present.
2346 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
2347 copy variable-length stub.
2348 (go32_check_format): Read stub to go32exe_temp_stub, set
2349 origin, return go32exe_cleanup.
2350 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
2351 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
2352 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
2353 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
2354 Remove functions and their associated #defines.
2355 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
2356 * libcoff-in.h: (struct coff_tdata): New field stub_size.
2357 Rename field go32stub to stub.
2358 * libcoff.h: Regenerate.
2359 * coff-stgo32.c (go32_check_format): Rename to...
2360 (go32exe_check_format): ...this.
2361 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
2362 (go32exe_copy_private_bfd_data): ...this.
2363 (stub_bytes): Rename to...
2364 (go32exe_default_stub): ...this.
2365 (create_go32_stub): Rename to...
2366 (go32exe_create_stub): ...this.
2367 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
2374 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
2375 relocation to R_386_32 for relocation against non-preemptible
2377 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
2378 allocate dynamic relocation for non-preemptible absolute symbol.
2379 (elf_i386_relocate_section): Pass sec to
2380 GENERATE_DYNAMIC_RELOCATION_P.
2381 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
2382 (elf_x86_64_convert_load_reloc): Covert load relocation to
2383 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
2384 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
2385 for non-preemptible absolute symbol if they overflow.
2386 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
2387 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
2388 symbol. Don't allocate dynamic relocation for non-preemptible
2390 (elf_x86_64_relocate_section): Don't generate relative relocation
2391 for GOTPCREL relocations aganst local absolute symbol. Pass sec
2392 to GENERATE_DYNAMIC_RELOCATION_P.
2393 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
2394 against non-preemptible absolute symbol.
2395 (_bfd_elf_x86_valid_reloc_p): New function.
2396 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
2398 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
2399 argument. Don't generate dynamic relocation against
2400 non-preemptible absolute symbol.
2401 (ABS_SYMBOL_P): New.
2402 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
2403 against non-preemptible absolute symbol.
2405 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
2406 (_bfd_elf_x86_valid_reloc_p): New.
2411 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
2412 address in the GOT if in thumb only mode.
2416 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
2420 * mmo.c (mmo_scan): Create .text section only when needed, not
2425 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
2430 * vms-alpha.c (image_write): Check bounds for sections without
2431 contents too. Error on non-zero write to section without
2433 (_bfd_vms_slurp_etir): Check return of image_write* functions.
2437 * tekhex.c (pass_over): Check is_eof before reading buffer.
2442 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
2443 field to timestamp and make it an integer.
2444 * libcoff.h: Regenerate.
2445 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
2446 field in the pe_data structure rather than the insert_timestamp
2452 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
2457 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
2458 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
2460 * libbfd.h: Regenerate.
2464 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
2468 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
2470 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
2474 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
2476 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
2477 * libbfd.h: Regenerate.
2481 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
2482 correct field name in the output string.
2487 * elf.c (assign_file_positions_for_load_sections): Adjust offset
2488 for SHT_NOBITS section if first in segment.
2493 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
2494 (_bfd_elf_get_symbol_version_string): This.
2495 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
2496 (_bfd_elf_get_symbol_version_string): This.
2497 (bfd_elf_print_symbol): Pass TRUE to
2498 _bfd_elf_get_symbol_version_string.
2499 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
2500 bfd_boolean argument.
2501 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
2502 * targets.c (_bfd_get_symbol_version_string): Likewise.
2503 (bfd_get_symbol_version_string): Likewise.
2504 * bfd-in2.h: Regenerated.
2510 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
2516 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
2517 segment to use for PT_GNU_RELRO, ignore empty sections in a
2518 segment's current list.
2523 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2528 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
2529 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
2530 on the previous _bfd_elf_get_symbol_version_string.
2531 (_bfd_elf_get_symbol_version_string): Use it.
2535 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
2536 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
2541 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
2545 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
2546 symbol count. Allocate an extra byte to ensure name strings
2547 are terminated. Sanity check name offsets. Release memory on
2552 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
2553 field hasn't been read. Remove unnecessary casts.
2557 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
2558 enough to read number of symbols.
2562 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
2563 (EXECUTABLE_SUFFIX): Likewise.
2564 * config.in: Regenerated.
2565 * configure: Likewise.
2566 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
2567 _bfd_generic_close_and_cleanup.
2568 (plugin_list_entry): Remove resolution_file, resolution_option,
2569 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
2570 lto_wrapper, gcc_env and initialized,
2571 (need_lto_wrapper_p): Removed.
2572 (get_lto_wrapper): Likewise.
2573 (setup_lto_wrapper_env): Likewise.
2574 (register_all_symbols_read): Likewise.
2575 (egister_cleanup): Likewise.
2576 (get_symbols): Likewise.
2577 (add_input_file): Likewise.
2578 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
2579 (add_symbols): Updated.
2580 (try_claim): Likewise.
2581 (try_load_plugin): Likewise.
2582 (bfd_plugin_canonicalize_symtab): Likewise.
2583 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
2584 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
2589 * plugin.c (plugin_list_entry): Add has_symbol_type.
2590 (add_symbols_v2): New function.
2591 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
2592 provides symbol type.
2593 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
2594 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
2599 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
2600 enough to read number of symbols.
2604 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
2605 backend functions for NULL before calling.
2606 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
2607 (bfd_section_from_shdr, assign_section_numbers): Likewise.
2608 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
2609 * elfnn-ia64.c (ignore_errors): New function.
2610 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
2615 * dwarf2.c (struct varinfo): Add unit_offset field to record the
2616 location of the varinfo in the unit's debug info data. Change the
2617 type of the stack field to a boolean.
2618 (lookup_var_by_offset): New function. Returns the varinfo
2619 structure for the variable described at the given offset in the
2621 (scan_unit_for_symbols): Add support for variables which have the
2622 DW_AT_specification attribute.
2627 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
2632 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
2637 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
2638 memory access when processing a corrupt secondary reloc section.
2642 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
2643 instead of calling abort.
2644 * elf32-csky.c (csky_build_one_stub): Likewise.
2645 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2646 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2647 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2648 * elf32-metag.c (metag_build_one_stub): Likewise.
2649 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2650 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2651 (ppc_size_one_stub): Likewise.
2652 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2657 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
2658 with error messages.
2663 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
2664 free. Add free on another failure path.
2669 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
2670 we have a non-zero section count. Do lma comparison in octets.
2674 * vms-alpha.c (dst_restore_location): Validate index into
2675 dst_ptr_offsets array before accessing. Return status.
2676 (dst_retrieve_location): Similarly, making "loc" parameter a
2677 pointer to return value.
2678 (_bfd_vms_slurp_etir): Update calls to above functions.
2682 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
2684 * configure: Regenerated.
2688 * section.c (BFD_FAKE_SECTIONS): Formatting.
2689 * bfd-in2.h: Regenerate.
2693 * elf.c (elfcore_grok_netbsd_note): Add support for
2694 NT_NETBSDCORE_LWPSTATUS notes.
2698 * bfd-in2.h: Regenerate.
2699 * section.c (asection): Add already_assigned field.
2700 (BFD_FAKE_SECTION): Add default initializer for it.
2701 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
2702 * elf32-arm.c (arm_build_one_stub): Add support for
2703 non_contiguous_regions.
2704 * elf32-csky.c (csky_build_one_stub): Likewise.
2705 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2706 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2707 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2708 * elf32-metag.c (metag_build_one_stub): Likewise.
2709 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2710 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2711 (ppc_size_one_stub): Likewise.
2712 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2713 * elflink.c (elf_link_input_bfd): Likewise.
2718 * elf-linker-x86.h (elf_linker_x86_params): Add
2719 static_before_all_inputs and has_dynamic_linker.
2720 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2721 dynamic input objects if -static is passed at command-line
2722 before all input files without --dynamic-linker unless
2723 --no-dynamic-linker is used.
2727 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
2731 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
2732 "p_paddr" from "at".
2733 * elfcode.h (bfd_from_remote_memory): Add units to several
2734 parameters. New local "opb". Fix usage of p_align. Fix
2735 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
2736 call of target_read_memory.
2737 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
2738 calculation of "offset" and "output_offset".
2739 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
2740 from "offset" and fix calculation of "end" from "vma+size". Fix
2741 comparison between "sh_addr" and "vma"/"output_offset".
2742 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
2743 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
2745 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
2746 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
2747 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
2748 assignment of p_paddr from phdr_lma. Fix comparison between
2749 "lma+size" and "next->lma".
2750 (elf_sort_segments): Fix assignment from p_paddr to lma.
2751 (assign_file_positions_for_load_sections): Add unit (bytes) to
2752 local "align". Fix calculation of local "off_adjust". Fix
2753 calculation of local "filehdr_vaddr".
2754 (assign_file_positions_for_non_load_sections): New local "opb".
2755 Fix calculation of "end" from "p_size". Fix comparison between
2756 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
2757 from "end" and "p_vaddr".
2758 (rewrite_elf_program_header): Fix comparison between p_vaddr and
2759 vma. Fix assignment to p_paddr from lma. Fix comparison between
2760 p_paddr and lma. Fix assignment to p_paddr from lma.
2761 * merge.c (sec_merge_emit): New local "opb". Convert
2762 "alignment_power" to octets.
2763 (_bfd_add_merge_section): New locals "alignment_power" and
2764 "opb". Fix comparison between "alignment_power" and
2766 (_bfd_merge_sections): New local "opb". Divide size by opb
2767 before checking align mask.
2771 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
2772 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
2774 (_bfd_elf_make_section_from_phdr): Similarly.
2775 (elf_fake_sections): Fix calculation of
2776 Elf_Internal_shdr::sh_addr from section VMA.
2777 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
2779 (assign_file_positions_for_load_sections): Fix calculations of
2780 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
2781 comparison between program header address and section LMA.
2782 (assign_file_positions_for_non_load_sections): Likewise.
2783 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
2784 (IS_CONTAINED_BY_VMA): Add parameter opb.
2785 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
2786 INCLUDE_SECTION_IN_SEGMENT): Likewise.
2787 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
2788 Fix calculations of p_addr_valid and p_vaddr_offset.
2789 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
2790 with octets per byte when comparing against p_vaddr.
2794 * som.c (setup_sections): Sanity check subspace.name.
2798 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2803 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2808 * wasm-module.c (wasm_scan): Sanity check file name length
2809 before allocating memory. Move common section setup code. Do
2810 without bfd_tell to calculate section size.
2814 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2815 with error messages and failure return values.
2819 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2820 relocation sections for any removed reference to a dynamic symbol.
2824 * elf-bfd.h (struct elf_backend_data): Add new fields:
2825 init_secondary_reloc_section, slurp_secondary_reloc_section,
2826 write_secondary_reloc_section.
2827 (_bfd_elf_init_secondary_reloc_section): Prototype.
2828 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2829 (_bfd_elf_write_secondary_reloc_section): Prototype.
2830 * elf.c ( bfd_section_from_shdr): Invoke the new
2831 init_secondary_reloc_section backend function, if defined, when a
2832 second reloc section is encountered.
2833 (swap_out_syms): Invoke the new symbol_section_index function, if
2834 defined, when computing the section index of an OS/PROC specific
2836 (_bfd_elf_init_secondary_reloc_section): New function.
2837 (_bfd_elf_slurp_secondary_reloc_section): New function.
2838 (_bfd_elf_write_secondary_reloc_section): New function.
2839 (_bfd_elf_copy_special_section_fields): New function.
2840 * elfcode.h (elf_write_relocs): Invoke the new
2841 write_secondary_relocs function, if defined, in order to emit
2843 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2844 function, if defined, in order to read in secondary relocs.
2845 * elfxx-target.h (elf_backend_copy_special_section_fields):
2846 Provide a non-NULL default definition.
2847 (elf_backend_init_secondary_reloc_section): Likewise.
2848 (elf_backend_slurp_secondary_reloc_section): Likewise.
2849 (elf_backend_write_secondary_reloc_section): Likewise.
2850 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2852 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2853 * configure: Regenerate.
2857 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2858 against file size before allocating memory. Use bfd_alloc rather
2859 than bfd_zalloc for carsym/strings memory.
2863 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2864 sh_addr mod sh_addalign is zero.
2868 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2872 * format.c (struct bfd_preserve): Add cleanup field.
2873 (bfd_preserve_save): Add cleanup param and save.
2874 (bfd_preserve_restore): Return cleanup.
2875 (bfd_preserve_finish): Call the cleanup for the discarded match.
2876 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2877 and clear when preserving a match. Restore cleanup too when
2878 restoring that match.
2882 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2883 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2884 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2885 (core_sco5_vec): Correct initialisers.
2889 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2890 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2891 * cisco-core.c (cisco_core_file_validate): Likewise.
2892 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2893 * hpux-core.c (hpux_core_core_file_p): Likewise.
2894 * irix-core.c (irix_core_core_file_p): Likewise.
2895 * lynx-core.c (lynx_core_file_p): Likewise.
2896 * netbsd-core.c (netbsd_core_file_p): Likewise.
2897 * osf-core.c (osf_core_core_file_p): Likewise.
2898 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2899 * sco5-core.c (sco5_core_file_p): Likewise.
2903 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2907 * targets.c (bfd_cleanup): New typedef.
2908 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2909 * libbfd-in.h (_bfd_no_cleanup): Define.
2910 * format.c (bfd_reinit): Add cleanup parameter, call it.
2911 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2912 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2913 * aout-target.h (callback, object_p): Return bfd_cleanup.
2914 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2915 * archive.c (bfd_generic_archive_p): Likewise.
2916 * binary.c (binary_object_p): Likewise.
2917 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2918 * coff-ia64.c (ia64coff_object_p): Likewise.
2919 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2920 * coff-sh.c (coff_small_object_p): Likewise.
2921 * coff-stgo32.c (go32_check_format): Likewise.
2922 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2923 (xcoff64_core_p): Likewise.
2924 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2925 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2926 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2927 * elfcode.h (elf_object_p): Likewise.
2928 * elfcore.h (elf_core_file_p): Likewise.
2929 * i386msdos.c (msdos_object_p): Likewise.
2930 * ihex.c (ihex_object_p): Likewise.
2931 * libaout.h (some_aout_object_p): Likewise.
2932 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2933 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2934 * libbfd.c (_bfd_dummy_target): Likewise.
2935 * libcoff-in.h (coff_object_p): Likewise.
2936 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2937 (bfd_mach_o_arm64_core_p): Likewise.
2938 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2939 (bfd_mach_o_arm_core_p): Likewise.
2940 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2941 (bfd_mach_o_i386_core_p): Likewise.
2942 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2943 (bfd_mach_o_x86_64_core_p): Likewise.
2944 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2945 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2946 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2947 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2948 * mmo.c (mmo_object_p): Likewise.
2949 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2950 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2951 (pe_bfd_object_p): Likewise.
2952 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2953 * ppcboot.c (ppcboot_object_p): Likewise.
2954 * rs6000-core.c (rs6000coff_core_p): Likewise.
2955 * som.c (som_object_setup, som_object_p): Likewise.
2956 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2957 * tekhex.c (tekhex_object_p): Likewise.
2958 * vms-alpha.c (alpha_vms_object_p): Likewise.
2959 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2960 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2961 * wasm-module.c (wasm_object_p): Likewise.
2962 * xsym.c (bfd_sym_object_p): Likewise.
2963 * xsym.h (bfd_sym_object_p): Likewise.
2964 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2966 * pdp11.c (some_aout_object_p): Likewise.
2967 * plugin.c (register_ld_plugin_object_p): Update object_p
2969 * plugin.h (register_ld_plugin_object_p): Likewise.
2970 * bfd-in2.h: Regenerate.
2971 * libbfd.h: Regenerate.
2972 * libcoff.h: Regenerate.
2976 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2977 applicable section flags.
2978 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2979 (mips_ecoff_bele_vec): Likewise.
2980 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2982 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2983 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2987 * elf32-m32r.c (m32r_elf_section_flags): New function.
2988 (elf_backend_section_flags): Define.
2989 * elf32-nds32.c (nds32_elf_section_flags): New function.
2990 (elf_backend_section_flags): Define.
2991 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2992 .sbss and .sdata sections.
2993 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2994 for SHF_V850_GPREL sections.
2995 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2997 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2998 for SHF_PARISC_SHORT sections.
2999 * elf64-ppc.c (ppc64_elf_section_flags): New function.
3000 (elf_backend_section_flags): Define.
3001 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
3002 for SHF_MIPS_GPREL sections. Delete FIXME.
3006 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
3007 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
3008 calling elf_backend_section_flags with adjusted params. Use
3009 newsect->flags past that point.
3010 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
3012 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
3013 to have their type overridden, and all sh_flags but processor and
3015 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
3016 * elf32-mep.c (mep_elf_section_flags): Likewise.
3017 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
3018 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
3019 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
3020 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
3021 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
3022 stub BFD and non-aarch64 input files when scanning for stubs.
3026 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
3027 limit to decompressed element size.
3031 * vms-lib.c (vms_traverse_index): Add recur_count param and
3032 update calls. Fail on excessive recursion.
3036 * vms-alpha.c (vms_get_remaining_object_record): Use
3037 bfd_realloc_or_free rather than bfd_realloc.
3038 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
3039 (dst_define_location, parse_module): Likewise, and check realloc
3040 return status before using memory. Return status from function
3041 adjusting all callers.
3045 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
3049 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
3050 Remove duplicate undersize check.
3055 * mmo.c (mmo_scan): Set SEC_DATA for .data.
3060 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
3061 (coff_section_type): Adjust comment.
3062 (decode_section_type): Likewise. Call coff_section_type before
3063 decode_section_type.
3064 (bfd_decode_symclass): Use 'c' for common sections other than
3069 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
3074 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
3075 if file is an archive element.
3076 * bfd-in2.h: Regenerate.
3080 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
3081 bfd_set_error on failing test. Don't bother changing bfd_error on
3082 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
3083 Check sym name is within string buffer. Use size_t for some vars.
3084 (do_slurp_coff_armap): Use size_t for some variables, fix size of
3085 int_buf. Don't change bfd_error on file read error. Use
3086 _bfd_mul_overflow when calculating carsym buffer size. Reorder
3087 calculations to catch overflows before they occur. malloc and
3088 free raw armap rather than using bfd_alloc. Read raw armap before
3089 allocating carsym+strings buffer.
3090 (_bfd_slurp_extended_name_table): Localize variables. Check
3091 name size against file size.
3095 * vms-lib.c (vms_lib_read_index): Release correct buffer.
3099 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
3100 malloc. Check for NULL return from bfd_malloc.
3101 (rx_table_find, rx_table_map): Likewise.
3102 (rx_set_section_contents): Check bfd_alloc return.
3103 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
3107 * aoutx.h: Indent labels correctly. Format error strings.
3108 * archive.c: Likewise.
3109 * archive64.c: Likewise.
3110 * coff-arm.c: Likewise.
3111 * coff-rs6000.c: Likewise.
3112 * coff-stgo32.c: Likewise.
3113 * cpu-arm.c: Likewise.
3114 * dwarf2.c: Likewise.
3115 * elf-ifunc.c: Likewise.
3116 * elf-properties.c: Likewise.
3117 * elf-s390-common.c: Likewise.
3118 * elf-strtab.c: Likewise.
3120 * elf32-arm.c: Likewise.
3121 * elf32-bfin.c: Likewise.
3122 * elf32-cr16.c: Likewise.
3123 * elf32-csky.c: Likewise.
3124 * elf32-i386.c: Likewise.
3125 * elf32-m68k.c: Likewise.
3126 * elf32-msp430.c: Likewise.
3127 * elf32-nds32.c: Likewise.
3128 * elf32-nios2.c: Likewise.
3129 * elf32-pru.c: Likewise.
3130 * elf32-xtensa.c: Likewise.
3131 * elf64-ia64-vms.c: Likewise.
3132 * elf64-x86-64.c: Likewise.
3133 * elfcode.h: Likewise.
3134 * elfcore.h: Likewise.
3135 * elflink.c: Likewise.
3136 * elfnn-aarch64.c: Likewise.
3137 * elfnn-ia64.c: Likewise.
3138 * elfnn-riscv.c: Likewise.
3139 * elfxx-mips.c: Likewise.
3140 * elfxx-sparc.c: Likewise.
3141 * elfxx-x86.c: Likewise.
3142 * i386lynx.c: Likewise.
3143 * merge.c: Likewise.
3144 * pdp11.c: Likewise.
3145 * plugin.c: Likewise.
3146 * reloc.c: Likewise.
3151 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
3153 (bfd_elf_add_dt_needed_tag): Declare.
3154 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
3155 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
3156 from elf_add_dt_needed_tag. Remove soname and doit param.
3157 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
3158 to see whether as-needed lib is already loaded, use dyn_loaded
3159 list instead. When saving and restoring around as-needed lib
3160 handle possibility that dynstr has not been initialised. Don't
3161 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
3162 Mark libs loaded via DT_NEEDED entries of other libs with
3163 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
3165 (elf_link_check_versioned_symbol): Remove now unneccesary
3166 DYNAMIC check when traversing dyn_loaded list.
3170 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
3175 * plugin.c (need_lto_wrapper_p): New.
3176 (bfd_plugin_set_program_name): Add an int argument to set
3178 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
3180 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
3184 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
3188 * vms-lib.c (struct carsym_mem): Add limit.
3189 (vms_add_index): Heed limit.
3190 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
3191 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
3192 Always return actual number read.
3193 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
3194 assertion with error exit.
3199 * elf.c (assign_file_positions_for_load_sections): Continue linking
3200 on "PHDR segment not covered by LOAD segment" errors.
3204 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
3206 (bfd_mach_o_canonicalize_reloc): Likewise.
3207 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
3208 counts and offsets against file size.
3209 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
3210 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
3211 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
3212 against file size. Delete symbol table error message.
3213 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
3215 (bfd_mach_o_read_symtab): Likewise.
3216 (bfd_mach_o_read_command): Pass file size.
3217 (bfd_mach_o_scan): Sanity check command count against file size.
3222 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
3223 "text", "data" and "bss" section pointer vars. Don't update
3224 section size, just exec header sizes.
3225 (adjust_sizes_and_vmas): Don't update text section size. Set
3226 initial exec header a_text. Print exec headers sizes.
3227 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
3228 (adjust_sizes_and_vmas): Similarly. Formatting.
3229 (final_link): Correct final file extension.
3233 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
3235 * elfxx-target.h (elf_backend_symbol_section_index): Provide
3237 (elfNN_bed): Initialise the symbol_section_index field.
3238 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
3239 OS and PROC specific section indicies. Warn if converting other
3240 reserved incidies to SHN_ABS.
3245 * cpu-z80.c: Add machine type compatibility checking.
3250 * plugin.c (plugin_list_entry): Remove handle.
3251 (try_load_plugin): Call dlclose before return.
3255 * libbfd-in.h (_bfd_constant_p): Define.
3256 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
3257 file size before allocating memory.
3258 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
3259 * elf.c (bfd_elf_get_str_section): Likewise.
3260 (_bfd_elf_slurp_version_tables): Likewise.
3261 * libbfd.h: Regenerate.
3265 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
3266 * aoutx.h (aout_get_external_symbols): Replace calls to
3267 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
3268 (slurp_reloc_table): Likewise.
3269 * archive.c (do_slurp_bsd_armap): Likewise.
3270 (do_slurp_coff_armap): Likewise.
3271 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
3272 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
3273 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
3274 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
3275 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
3276 (_bfd_coff_get_external_symbols): Likewise.
3277 * ecoff.c (ecoff_slurp_symbolic_header),
3278 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
3279 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
3280 (ecoff_indirect_link_order): Likewise.
3281 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
3282 (_bfd_elf_slurp_version_tables): Likewise.
3283 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3284 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3285 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3286 * elf64-alpha.c (READ): Likewise.
3287 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
3288 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3289 * elfcode.h (elf_slurp_symbol_table),
3290 (elf_slurp_reloc_table_from_section): Likewise.
3291 * elflink.c (elf_link_add_object_symbols),
3292 (elf_link_check_versioned_symbol): Likewise.
3293 * elfxx-mips.c (READ): Likewise.
3294 * i386lynx.c (slurp_reloc_table): Likewise.
3295 * lynx-core.c (lynx_core_file_p): Likewise.
3296 * mach-o.c (bfd_mach_o_canonicalize_relocs),
3297 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
3298 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
3299 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
3300 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
3301 (bfd_pef_parse_symbols): Likewise.
3302 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
3303 * som.c (setup_sections, som_slurp_string_table),
3304 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3305 (som_bfd_fill_in_ar_symbols): Likewise.
3306 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
3307 (evax_bfd_print_image): Likewise.
3308 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
3309 * wasm-module.c (wasm_scan): Likewise.
3310 * xcofflink.c (xcoff_link_add_symbols): Likewise.
3311 * xsym.c (bfd_sym_read_name_table),
3312 (bfd_sym_print_type_information_table_entry): Likewise.
3313 * libbfd.h: Regenerate.
3317 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
3318 reading external relocs.
3319 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
3320 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
3322 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
3324 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
3325 (m32c_elf_relax_section): Likewise.
3326 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
3327 (rl78_elf_relax_section): Likewise.
3328 * elf32-rx.c (rx_offset_for_reloc): Likewise.
3329 (elf32_rx_relax_section): Likewise.
3330 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
3331 parameter types and use..
3332 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
3333 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
3334 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
3335 being read from file, just the extra.
3336 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
3337 after reading external syms. Free on failure.
3341 * coffcode.h (buy_and_read, coff_slurp_line_table),
3342 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
3343 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
3344 corresponding bfd_alloc call. Adjust variables to suit.
3345 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
3346 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
3347 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
3348 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
3349 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
3350 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3351 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3352 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3353 * elf64-alpha.c (READ): Likewise.
3354 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
3355 (elf_slurp_symbol_table, elf_slurp_reloc_table),
3356 (bfd_from_remote_memory): Likewise.
3357 * elfcore.h (core_find_build_id): Likewise.
3358 * elfxx-mips.c (READ): Likewise.
3359 * mach-o.c (bfd_mach_o_mangle_sections),
3360 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
3361 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
3362 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
3363 * som.c (setup_sections, som_prep_for_fixups)
3364 (som_build_and_write_symbol_table, som_slurp_symbol_table),
3365 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3366 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
3367 (som_bfd_ar_write_symbol_stuff): Likewise.
3368 * vms-alpha.c (vector_grow1): Likewise.
3369 * vms-lib.c (vms_add_index): Likewise.
3370 * wasm-module.c (wasm_scan_name_function_section): Likewise.
3371 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
3372 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
3373 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
3374 (bfd_alloc2, bfd_zalloc2): Delete.
3375 (_bfd_mul_overflow): Define.
3376 * libbfd.h: Regenerate.
3380 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
3382 (assign_section_numbers): Likewise.
3383 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
3384 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
3385 bfd_malloc2, size_t amt, and unsigned tls_count.
3386 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
3387 * elflink.c (elf_create_symbuf): Use bfd_malloc.
3388 (elf_output_implib): Use bfd_alloc.
3392 * bfd.c (struct bfd): Move format and direction to other
3393 bitfields. Add "size".
3394 * bfdio.c (bfd_get_size): Cache size when not writing file.
3395 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
3396 returning zero, ie. unknown.
3397 (bfd_get_alt_debug_link_info): Likewise.
3398 * bfd-in2.h: Regenerate.
3402 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
3403 bfd_get_file_size twice.
3404 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
3405 zero, ie. unknown, return.
3406 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
3407 * elfcode.h (elf_swap_shdr_in): Likewise.
3408 (elf_object_p): Don't call bfd_get_file_size twice and correct
3413 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
3414 FALSE if memory alloc fails. Adjust calls.
3415 * som.c (som_prep_for_fixups): Likewise.
3416 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
3417 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
3418 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
3419 * som.c (som_build_and_write_symbol_table): Return via error_return
3421 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
3422 (VEC_APPEND_EL): Delete.
3423 (vector_grow1): Return pointer to element. Catch overflow.
3424 Return NULL on memory allocation failure.
3425 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
3426 (alpha_vms_add_fixup_ca): Likewise.
3427 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
3429 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
3433 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
3434 * aout-target.h (object_p): Likewise.
3435 * aout-tic30.c (tic30_aout_object_p): Likewise.
3436 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
3437 (emit_stringtab, write_syms, link_hash_table_create),
3438 (aout_link_write_other_symbol): Likewise.
3439 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
3440 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
3441 (_bfd_compute_and_write_armap): Likewise.
3442 * archures.c (bfd_arch_list): Likewise.
3443 * bfd.c (bfd_record_phdr): Likewise.
3444 * binary.c (binary_canonicalize_symtab): Likewise.
3445 * cisco-core.c (cisco_core_file_validate): Likewise.
3446 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
3447 (find_arm_glue, record_arm_to_thumb_glue),
3448 (record_thumb_to_arm_glue): Likewise.
3449 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
3450 (ppc_allocate_toc_section): Likewise.
3451 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
3452 * coff-sh.c (sh_relax_section): Likewise.
3453 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
3454 * coffcode.h (handle_COMDAT, coff_new_section_hook),
3455 (coff_set_alignment_hook, coff_mkobject),
3456 (coff_compute_section_file_positions): Likewise.
3457 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
3458 (coff_find_nearest_line_with_names),
3459 ( bfd_coff_set_symbol_class): Likewise.
3460 * cofflink.c (_bfd_coff_link_hash_table_create),
3461 (_bfd_coff_link_input_bfd): Likewise.
3462 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
3463 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
3464 (build_line_info_table, sort_line_sequences),
3465 (line_info_add_include_dir, line_info_add_file_name),
3466 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
3467 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
3468 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
3469 (_bfd_ecoff_find_nearest_line),
3470 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
3471 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
3472 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
3473 * elf-m10300.c (mn10300_elf_relax_section),
3474 (elf32_mn10300_link_hash_table_create): Likewise.
3475 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
3476 * elf.c (make_mapping, copy_elf_program_header): Likewise.
3477 * elf32-arm.c (elf32_arm_link_hash_table_create),
3478 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
3479 (elf32_arm_new_section_hook): Likewise.
3480 * elf32-avr.c (elf_avr_new_section_hook),
3481 (elf32_avr_link_hash_table_create, get_local_syms),
3482 (elf32_avr_setup_section_lists): Likewise.
3483 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
3484 (bfin_link_hash_table_create): Likewise.
3485 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
3486 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
3487 * elf32-csky.c (csky_elf_link_hash_table_create),
3488 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
3489 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
3490 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
3491 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
3492 * elf32-i386.c (elf_i386_check_relocs): Likewise.
3493 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
3494 * elf32-m32r.c (m32r_elf_link_hash_table_create),
3495 (m32r_elf_check_relocs): Likewise.
3496 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
3497 (elf32_m68hc11_setup_section_lists),
3498 (elf32_m68hc11_size_stubs): Likewise.
3499 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
3500 * elf32-metag.c (elf_metag_link_hash_table_create),
3501 (elf_metag_setup_section_lists): Likewise.
3502 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
3503 (microblaze_elf_check_relocs): Likewise.
3504 * elf32-nds32.c (nds32_elf_link_hash_table_create),
3505 (nds32_elf_check_relocs): Likewise.
3506 * elf32-nios2.c (nios2_elf32_setup_section_lists),
3507 (get_local_syms, nios2_elf32_check_relocs),
3508 (nios2_elf32_link_hash_table_create): Likewise.
3509 * elf32-or1k.c (or1k_elf_link_hash_table_create),
3510 (or1k_elf_check_relocs): Likewise.
3511 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
3512 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
3513 * elf32-s390.c (elf_s390_link_hash_table_create),
3514 (elf_s390_check_relocs): Likewise.
3515 * elf32-score.c (score_elf_create_got_section),
3516 (s3_elf32_score_new_section_hook),
3517 (elf32_score_link_hash_table_create): Likewise.
3518 * elf32-score7.c (score_elf_create_got_section),
3519 (s7_elf32_score_new_section_hook): Likewise.
3520 * elf32-sh.c (sh_elf_link_hash_table_create),
3521 (sh_elf_check_relocs): Likewise.
3522 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
3523 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
3524 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
3525 (tilepro_elf_check_relocs): Likewise.
3526 * elf32-v850.c (remember_hi16s_reloc): Likewise.
3527 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
3528 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
3529 (elf_xtensa_new_section_hook): Likewise.
3530 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
3531 (get_got_entry, elf64_alpha_check_relocs): Likewise.
3532 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
3533 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
3534 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
3535 * elf64-ppc.c (ppc64_elf_new_section_hook),
3536 (ppc64_elf_link_hash_table_create, update_local_sym_info),
3537 (update_plt_info, ppc64_elf_check_relocs): Likewise.
3538 * elf64-s390.c (elf_s390_link_hash_table_create),
3539 (elf_s390_check_relocs): Likewise.
3540 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
3541 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
3542 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
3543 (elf_link_add_archive_symbols, compute_bucket_count),
3544 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
3545 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
3546 (bfd_elf_final_link): Likewise.
3547 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
3548 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
3549 (elfNN_aarch64_new_section_hook): Likewise.
3550 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
3551 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
3552 (riscv_elf_check_relocs): Likewise.
3553 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
3554 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
3555 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
3556 (_bfd_mips_elf_link_hash_table_create): Likewise.
3557 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
3558 (_bfd_sparc_elf_check_relocs),
3559 (_bfd_sparc_elf_new_section_hook): Likewise.
3560 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
3561 (tilegx_elf_check_relocs): Likewise.
3562 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
3563 * format.c (bfd_check_format_matches): Likewise.
3564 * hash.c (_bfd_stringtab_init): Likewise.
3565 * ihex.c (ihex_scan): Likewise.
3566 * irix-core.c (irix_core_core_file_p): Likewise.
3567 * linker.c (bfd_wrapped_link_hash_lookup),
3568 (_bfd_generic_link_hash_table_create),
3569 (_bfd_generic_reloc_link_order): Likewise.
3570 * lynx-core.c (lynx_core_file_p): Likewise.
3571 * netbsd-core.c (netbsd_core_file_p): Likewise.
3572 * osf-core.c (osf_core_core_file_p): Likewise.
3573 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
3574 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
3575 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
3576 * peicode.h (pe_mkobject): Likewise.
3577 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
3578 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3579 * sco5-core.c (read_uarea): Likewise.
3580 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
3581 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
3582 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
3583 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
3584 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
3585 * srec.c (srec_scan): Likewise.
3586 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
3587 * targets.c (bfd_target_list): Likewise.
3588 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
3589 * trad-core.c (trad_unix_core_file_p): Likewise.
3590 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
3591 (vms_new_section_hook): Likewise.
3592 * wasm-module.c (wasm_make_empty_symbol): Likewise.
3593 * xcofflink.c (xcoff_get_section_contents),
3594 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
3595 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
3596 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
3600 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
3604 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
3605 and use it if it isn't NULL. Remove has_plugin_p argument. Add
3606 a build_list_p argument. Don't search plugin_list. Short circuit
3607 when building the plugin list.
3608 (has_plugin): Renamed to has_plugin_list.
3609 (bfd_plugin_set_plugin): Don't set has_plugin.
3610 (bfd_plugin_specified_p): Check plugin_list instead.
3611 (build_plugin_list): New function.
3612 (load_plugin): Call build_plugin_list and use plugin_list.
3617 * plugin.c (try_claim): Always clean up for LTO wrapper.
3618 (try_load_plugin): Treat each object as independent. Create a
3619 copy for plugin name.
3623 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
3624 for addresses in print statements.
3625 (msp430_elf_relax_delete_bytes): Likewise.
3626 (msp430_elf_relax_add_words): Likewise.
3627 (msp430_elf_relax_section): Likewise.
3631 * plugin.c (add_symbols): Clear plugin_data memory.
3636 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
3637 (EXECUTABLE_SUFFIX): Likewise.
3638 * config.in: Regenerated.
3639 * configure: Likewise.
3640 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
3641 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
3642 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
3643 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
3644 (get_lto_wrapper): New.
3645 (setup_lto_wrapper_env): Likewise.
3646 (current_plugin): Likewise.
3647 (register_all_symbols_read): Likewise.
3648 (register_cleanup): Likewise.
3649 (get_symbols): Likewise.
3650 (add_input_file): Likewise.
3651 (bfd_plugin_close_and_cleanup): Likewise.
3652 (claim_file): Removed.
3653 (register_claim_file): Set current_plugin->claim_file.
3654 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
3655 lto_syms in current_plugin.
3656 (try_claim): Use current_plugin->claim_file. Call LTO plugin
3657 all_symbols_read handler. Copy real symbols to plugin_data.
3658 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
3659 (try_load_plugin): Don't reuse the previous plugin for LTO
3660 wrapper. Set up GCC LTO wrapper if possible. Don't set
3661 plugin_list_iter->claim_file.
3662 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
3664 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
3669 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
3670 check if previous instruction matches a conditional jump inserted
3671 earlier. Invert conditional jump and delete branch in this case.
3675 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
3676 msp430_elf_relax_add_words. Support insertion of either one or two
3678 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
3679 needs to be grown. Handle insertion of branch instruction to replace
3684 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
3685 debugging relocations.
3686 (msp430_elf_relax_delete_bytes): Likewise.
3687 (msp430_elf_relax_add_two_words): Likewise.
3688 (msp430_elf_relax_section): Likewise.
3692 * archures.c: Wrap overlong z80 comments.
3693 * bfd-in2.h: Regenerate.
3698 * archures.c: Add GBZ80 and Z80N machine values.
3699 * reloc.c: Add BFD_RELOC_Z80_16_BE.
3700 * coff-z80.c: Add support for new reloc.
3701 * coffcode.h: Add support for new machine values.
3702 * cpu-z80.c: Add support for new machine names.
3703 * elf32-z80.c: Add support for new reloc.
3704 * bfd-in2.h: Regenerate.
3705 * libbfd.h: Regenerate.
3710 * elf.c (rewrite_elf_program_header): Do not complain if no
3711 sections are mapped to a segment.
3716 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
3717 for garbage collection on __patchable_function_entries section
3718 without linked-to section.
3723 * bfd-in2.h: Regenerated.
3724 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
3725 on section if gc_mark of any of its linked-to sections is set
3726 and don't set gc_mark again.
3727 * section.c (asection): Add linked_to_symbol_name to map_head
3732 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
3733 reporting an unrecognized instruction with R_V850_LONGJUMP.
3737 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
3741 * elf32-ppc.c (ppc_elf_relocate_section): After applying
3742 R_PPC_VLE_ADDR20, goto copy_reloc.
3746 * bfd-in2.h: Regenerated.
3747 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
3752 * bfd-in2.h: Regenerated.
3753 * ecoff.c (bfd_debug_section): Add section_id.
3754 * section.c (bfd_section): Add section_id.
3755 (SEC_ASSEMBLER_SECTION_ID): New.
3756 (BFD_FAKE_SECTION): Add section_id.
3760 * config.bfd: Move the c30-aout and tic30-aout targets onto the
3765 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
3766 encodings are relative to the GOT on nios2, too.
3770 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
3771 file. Use $< and $@ in rules.
3772 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
3773 (elf32-ia64.c, elf64-ia64.c): Likewise.
3774 (elf32-riscv.c, elf64-riscv.c): Likewise.
3775 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3776 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
3777 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
3778 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
3779 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3780 * Makefile.in: Regenerate.
3785 * elf.c (setup_group): Don't clear entire section contents,
3786 just the padding after group flags. Release alloc'd memory
3787 after a seek or read failure.
3791 * peXXigen.c (pe_is_repro): New function.
3792 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
3793 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
3797 * peXXigen.c (debug_type_names): Add names for new debug data type
3802 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3803 inner loop. Fix a memory leak.
3807 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3808 or obj_coff_keep_strings here.
3809 (coff_get_normalized_symtab): Free external syms directly.
3810 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3815 * cpu-riscv.c (riscv_scan): New.
3816 (N): Change bfd_default_scan to riscv_scan.
3820 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3821 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3822 * Makefile.in: Regenerate.
3823 * cpu-plugin.c: Remove.
3824 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3825 (bfd_plugin_arch): Remove declaration.
3826 * bfd-in2.h: Regenerate.
3827 * po/SRC-POTFILES.in: Regenerate.
3833 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3837 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3838 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3839 avoid over long line.
3844 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3845 syms and keep strings flags as these may have been set in order to
3846 prevent a bogus call to free.
3850 * po/fr.po: Updated French translation.
3855 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3856 by zero when p_align is zero.
3860 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3861 (riscv_prefix_cmp): Likewise.
3862 (riscv_non_std_ext_p): Deleted.
3863 (riscv_std_sv_ext_p): Likewise.
3864 (riscv_non_std_sv_ext_p): Likewise.
3865 (riscv_merge_non_std_and_sv_ext): Rename to...
3866 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3867 (riscv_merge_arch_attr_info): Replace 3 calls to
3868 riscv_merge_non_std_and_sv_ext with single call to
3869 riscv_merge_multi_letter_ext.
3870 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3871 encounter a 'z' prefix.
3872 (riscv_get_prefix_class): New function, return prefix class based
3873 on first few characters of input string.
3874 (riscv_parse_config): New structure to factor out minor differences
3875 in extension class parsing behaviour.
3876 (riscv_parse_sv_or_non_std_ext): Rename to...
3877 (riscv_parse_prefixed_ext): and parameterise with
3879 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3880 (riscv_multi_letter_ext_valid_p): New.
3881 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3882 (riscv_parse_subset): Delegate all non-single-letter parsing work
3883 to riscv_parse_prefixed_ext.
3884 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3885 (riscv_get_prefix_class): Declare.
3889 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3890 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3891 __tls_get_addr_desc.
3892 (ppc64_elf_size_stubs): Add section for linker generated
3893 __tls_get_addr_desc wrapper function. Loop at least once if
3894 generating this function.
3895 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3896 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3900 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3901 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3903 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3904 (STDU_R1_0R1, ADDI_R1_R1): Define.
3905 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3906 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3907 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3908 no_tls_get_addr_regsave.
3909 (branch_reloc_hash_match): Add hash3 and hash4.
3910 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3911 (ppc64_elf_size_dynamic_sections): Likewise.
3912 (ppc64_elf_relocate_section): Likewise.
3913 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3914 __tls_get_addr stub.
3915 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3917 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3918 eh_frame for regsave __tls_get_addr.
3922 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3923 which __tls_get_addr calls will be eliminated.
3927 * po/pt.po: Updates Portuguese translation.
3928 * po/ru.po: Updated Russian translation.
3929 * po/uk.po: Updated Ukranian translation.
3934 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3935 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3937 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3938 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3939 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3940 "rex leal x@tlsdesc(%rip), %reg" to
3941 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3942 "call *(%eax)" to "nopl (%rax)".
3946 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3947 (MTLR_R11): Don't define.
3948 (LD_R0_0R3, CMPDI_R0_0): Define.
3949 (build_tls_get_addr_stub): Don't use r11 in stub.
3953 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3954 (defined_sym_val, is_tls_get_addr): Likewise.
3958 * version.m4 (BFD_VERSION): Set to 2.34.50.
3959 * configure: Regenerate.
3960 * po/bfd.pot: Regenerate.
3964 Binutils 2.34 branch created.
3968 * coff-arm.c: Fix spelling error (seperate).
3969 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3971 * sysdep.h (strnlen): Fix spelling error (seperate).
3976 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3981 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3982 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3983 of function symbols unless dot symbols are present. Do warn
3984 whenever one is created, regardles of whether a PLT entry is
3985 also emitted for the function symbol.
3989 * som.c (som_bfd_count_ar_symbols): Error when file position
3990 of symbols on chains is not strictly increasing.
3994 * vms.h (VMS_DEBUG): Define as 0.
3995 * vms-alpha.c (image_write): Move debug output after bounds check.
3997 (_bfd_vms_slurp_eihd): Warning fix.
3998 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
4002 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
4003 for "ignored" records.
4007 * wasm-module.c (wasm_scan_name_function_section): Formatting.
4008 Delete asect name check. Move asect NULL check to wasm_object_p.
4009 Correct bounds check of sizes against end. Replace uses of
4010 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
4011 just one bfd_release.
4012 (wasm_scan): Don't use malloc/strdup for section names,
4013 bfd_alloc instead. Simplify code prefixing section name.
4014 Formatting. Don't attempt to free memory here..
4015 (wasm_object_p): ..do so here.
4020 * elf32-arm.c (elf32_arm_final_link_relocate): Use
4021 UNDEFWEAK_NO_DYNAMIC_RELOC.
4022 (allocate_dynrelocs_for_symbol): Likewise.
4027 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
4031 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
4036 * bfd.c (bfd_convert_section_contents): Check for a compress
4037 header size that is larger than the actual section size.
4042 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
4043 after removing sections.
4048 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
4049 check for !bfd_link_pic (info).
4050 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
4051 <R_RISCV_JAL>: Add comment.
4052 (_bfd_riscv_relax_section): For plt.offset check, add check for
4053 bfd_link_pic (info). Add comment.
4057 * format.c (bfd_check_format_matches): Ignore bfd_error on target
4058 match failures. Don't init to bfd_error_wrong_format before
4059 calling _bfd_check_format.
4063 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
4064 status rather than exiting on stack overflow or underflow.
4065 (_bfd_vms_slurp_etir): Adjust to suit.
4069 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
4073 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
4074 command. Check name offset is within command.
4075 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
4076 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
4077 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
4078 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
4079 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
4080 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
4081 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
4082 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
4083 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
4084 (bfd_mach_o_read_segment): Similarly.
4085 (bfd_mach_o_read_thread): Properly bound check thread struct.
4086 Don't repeat checks on second loop.
4087 (bfd_mach_o_read_command): Fail on invalid command length.
4091 * format.c (bfd_check_format_matches): Add preserve_match.
4092 Save initial bfd state in "preserve", matched bfd state in
4093 "preserve_match". Save just the first match. Release
4094 bfd_alloc memory. Restore and finish preserved state as
4095 appropriate on all function exit paths.
4099 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
4103 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
4109 (bfd_pef_parse_function_stubs): Correct the test that ensures that
4110 there is enough data remaining in the code buffer before
4111 attempting to read a function stub.
4116 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
4117 return value from bfd_malloc.
4118 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
4119 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
4120 (elf32_arm_filter_cmse_symbols): Likewise.
4121 (elf32_arm_write_section): Likewise.
4122 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
4123 (bfd_mach_o_follow_dsym): Likewise.
4124 * pef.c (bfd_pef_print_loader_section): Likewise.
4125 (bfd_pef_scan_start_address): Likewise.
4126 (bfd_pef_parse_function_stubs): Likewise.
4127 (bfd_pef_parse_symbols): Likewise.
4131 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
4132 on binary inputs ld/PR25316.
4133 (is_ia64_elf): new helper to filter on ia64 objects.
4137 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
4139 (bfd_mach_o_scan): Insert underscore in two variable names.
4143 * Makefile.am: Add z80-elf target support.
4144 * configure.ac: Likewise.
4145 * targets.c: Likewise.
4146 * Makefile.in: Regenerate.
4147 * configure: Regenerate.
4148 * config.bfd: Add z80-elf target support and new arches: ez80 and
4150 * elf32-z80.c: New file.
4151 * archures.c: Add new z80 architectures: eZ80 and Z180.
4152 * coffcode.h: Likewise.
4153 * cpu-z80.c: Likewise.
4154 * coff-z80.c: Add new relocations for Z80 target and local label
4156 * reloc.c: Add new relocs.
4157 * bfd-in2.h: Regenerate.
4158 * libbfd.h: Regenerate.
4164 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
4168 Update year range in copyright notice of all files.
4170 For older changes see ChangeLog-2019
4172 Copyright (C) 2020 Free Software Foundation, Inc.
4174 Copying and distribution of this file, with or without modification,
4175 are permitted in any medium without royalty provided the copyright
4176 notice and this notice are preserved.
4182 version-control: never