1 2020-09-03 Kito Cheng <kito.cheng@sifive.com>
3 * elfnn-riscv.c (riscv_merge_std_ext): Fix to report the correct
4 error message when the versions of extension are mis-matched.
5 * elfxx-riscv.c (riscv_parse_subset): Don't issue the error when
8 2020-09-03 Alan Modra <amodra@gmail.com>
10 * xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info
11 on the output bfd objalloc memory.
13 2020-09-02 Alan Modra <amodra@gmail.com>
15 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
16 of constant shifted left.
18 2020-09-02 Alan Modra <amodra@gmail.com>
20 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned
21 type for "relocation".
23 2020-09-01 Alan Modra <amodra@gmail.com>
25 * reloc.c (N_ONES): Handle N=0.
26 * elf32-arm.c (elf32_arm_howto_table_1): Set complain_overflow_dont
27 for R_ARM_TLS_DESCSEQ and R_ARM_THM_TLS_DESCSEQ.
29 2020-09-01 Alan Modra <amodra@gmail.com>
32 * elf32-arm.c (elf32_arm_allocate_local_sym_info): Allocate arrays
33 in descending order of alignment.
35 2020-09-01 Alan Modra <amodra@gmail.com>
38 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
40 2020-08-31 Alan Modra <amodra@gmail.com>
43 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to
44 unsigned when using with RISCV_ITYPE.
45 (_bfd_riscv_relax_call): Use an unsigned foff.
47 2020-08-31 Alan Modra <amodra@gmail.com>
51 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO),
52 (CRINFO_RELVADDR): Make unsigned.
53 (mips_elf_nullify_got_load): Use unsigned constant when shifting
56 2020-08-31 Alan Modra <amodra@gmail.com>
59 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u"
60 variable and rewrite signed overflow check.
61 * elf32-mep.c: Regenerate.
62 (mep_final_link_relocate): Delete "s".
64 2020-08-31 Alan Modra <amodra@gmail.com>
67 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
68 that might shift values into sign bit.
70 2020-08-31 Alan Modra <amodra@gmail.com>
73 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma,
74 and similarly for variables dealing with overflow.
76 2020-08-31 Alan Modra <amodra@gmail.com>
79 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits
80 without undefined behaviour. Tidy excess casts.
82 2020-08-31 Alan Modra <amodra@gmail.com>
84 * elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
85 alignment from reloc addend after reloc type R_MN10300_ALIGN is
88 2020-08-30 Alan Modra <amodra@gmail.com>
92 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits
93 without undefined behaviour.
95 2020-08-29 Nick Clifton <nickc@redhat.com>
98 * dwarf2.c (scan_unit_for_symbols): Add member entries to the
101 2020-08-29 Alan Modra <amodra@gmail.com>
104 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last
105 element when count is zero. bfd_realloc when shrinking.
107 2020-08-28 Alan Modra <amodra@gmail.com>
110 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write
113 2020-08-28 Alan Modra <amodra@gmail.com>
116 * ecofflink.c (WRITE): Really don't write zero size chunks.
118 2020-08-28 Tuckker <tuckkern+sourceware@gmail.com>
121 * linker.c (bfd_generic_define_common_symbol): Force the alignment
122 to 1 if the section has now alignment requirement.
124 2020-08-28 Cooper Qu <cooper.qu@linux.alibaba.com>
126 * elf32-csky.c (csky_archs): Fix arch names.
127 (csky_find_arch_with_name): New.
128 (elf32_csky_merge_attributes): New.
129 (csky_elf_merge_private_bfd_data): Add process of merge
131 (elf32_csky_obj_attrs_arg_type): New.
132 (elf32_csky_obj_attrs_handle_unknown): New.
133 (elf_backend_obj_attrs_vendor): Define.
134 (elf_backend_obj_attrs_section): Define.
135 (elf_backend_obj_attrs_arg_type): Define.
136 (elf_backend_obj_attrs_section_type): Define.
138 2020-08-28 Nick Clifton <nickc@redhat.com>
141 * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value
142 for undefined symbols which will not generate extra warning
143 messages about truncated relocs.
145 2020-08-28 Nelson Chu <nelson.chu@sifive.com>
147 * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
148 and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
149 (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
150 unresolved reloc checks.
152 2020-08-27 John David Anglin <danglin@gcc.gnu.org>
155 * som.c (som_bfd_copy_private_section_data): Issue error when a
156 subspace is specified without its containing space.
158 2020-08-27 Alan Modra <amodra@gmail.com>
161 * elflink.c: Include limits.h.
162 (CHAR_BIT): Provide fallback define.
163 (set_symbol_value): Correct complex reloc comment.
164 (undefined_reference): Set bfd_error.
165 (BINARY_OP_HEAD, BINARY_OP_TAIL): Split out from..
167 (eval_symbol): Limit shifts. Force unsigned for left shift.
168 Catch divide by zero.
169 * configure.ac (AC_CHECK_HEADERS): Combine, sort and add limits.h.
170 * configure: Regenerate.
171 * config.in: Regenerate.
173 2020-08-27 Alan Modra <amodra@gmail.com>
176 * reloc.c (bfd_check_overflow): Return early if zero bitsize.
178 2020-08-27 Alan Modra <amodra@gmail.com>
180 * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
181 on sym_sec not being output.
183 2020-08-27 Alan Modra <amodra@gmail.com>
186 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Correct "dynamic".
188 2020-08-26 Nick Clifton <nickc@redhat.com>
191 * elf32-avr.c (avr_final_link_relocate): Fix undefined shift
193 (avr_elf32_load_records_from_section): Use bfd_get_16 and
194 bfd_get_32 to load values from potentially unaligned pointers.
197 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Test for and
198 ignore local symbols.
199 (elf64_alpha_relax_got_load): Do not check for local dynamic
201 (OP_LDA, OP_LDAH, OP_LDQ, OP_BR, OP_BSR): Use unsigned constant
203 (INSN_A) Cast the A parameter to unsigned.
204 (INSN_AB): Define in terms of INSN_A.
205 (INSN_ABC): Likewise.
206 (INSN_ABO): Likewise.
210 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
211 unsigned long constant when creating a mask to test for alignment
214 2020-08-26 Alan Modra <amodra@gmail.com>
217 * elf32-xtensa.c (find_removed_literal): Don't bsearch empty map.
219 2020-08-26 Alan Modra <amodra@gmail.com>
222 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early
223 when section is empty.
225 2020-08-26 Alan Modra <amodra@gmail.com>
228 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
231 2020-08-26 Alan Modra <amodra@gmail.com>
239 * elf64-ppc.c (is_tls_get_addr): Avoid UB &h->elf when h is NULL.
240 (ppc64_elf_tls_setup): Likewise.
241 (branch_reloc_hash_match): Likewise.
242 (build_plt_stub): Likewise.
243 (ppc64_elf_relocate_section): Likewise.
245 2020-08-26 Alan Modra <amodra@gmail.com>
248 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
250 2020-08-26 Alan Modra <amodra@gmail.com>
253 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
254 sstubs->contents != NULL.
256 2020-08-26 Alan Modra <amodra@gmail.com>
259 * som.c (som_prep_for_fixups): Return early when no symbols.
261 2020-08-26 Alan Modra <amodra@gmail.com>
264 * ecofflink.c (WRITE): Don't write size 0 chunks.
266 2020-08-26 Alan Modra <amodra@gmail.com>
268 * bfdio.c (bfd_get_file_size): Don't segv on NULL adata.
270 2020-08-26 Alan Modra <amodra@gmail.com>
273 * vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
275 2020-08-26 David Faust <david.faust@oracle.com>
277 * archures.c (bfd_mach_xbpf): Define.
278 * bfd-in2.h: Regenerate.
279 * cpu-bpf.c (bfd_xbpf_arch) New.
280 (bfd_bpf_arch) Update next in list field to point to xbpf arch.
282 2020-08-26 Alan Modra <amodra@gmail.com>
284 * archures.c (bfd_mach_ck860): Define.
286 2020-08-25 Mark Wielaard <mark@klomp.org>
288 * dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
289 and dwarf_rnglists_size fields.
290 (dwarf_debug_sections): Add debug_rnglists.
291 (dwarf_debug_section_enum): Likewise.
292 (read_debug_rnglists): New function.
293 (read_rangelist): New function to call either read_ranges or
294 read_rnglists. Rename original function to...
295 (read_ranges): ...this.
296 (read_rnglists): New function.
298 2020-08-25 Alan Modra <amodra@gmail.com>
301 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check
302 is_elf_hash_table before accessing elf fields.
304 2020-08-25 Alan Modra <amodra@gmail.com>
307 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
310 2020-08-25 Alan Modra <amodra@gmail.com>
313 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
314 before accessing elf fields.
316 2020-08-25 Alan Modra <amodra@gmail.com>
319 * som.c (som_compute_checksum): XOR 32-bit words in header,
320 not unsigned long sized words.
322 2020-08-25 Alan Modra <amodra@gmail.com>
325 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
326 amount copied for elf_segment_map defined with one element
329 2020-08-25 Alan Modra <amodra@gmail.com>
332 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
333 bfd_get_x size function to read addends out of fields. Apply
334 rightshift adjustment too. Don't apply the now unnecessary
335 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
336 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
337 Correct R_ARM_THM_JUMP6 addend.
339 2020-08-25 Alan Modra <amodra@gmail.com>
342 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
343 before start of section.
345 2020-08-25 Alan Modra <amodra@gmail.com>
347 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
348 before accessing elf_hash_table_id.
349 * elf32-arc.c (elf_arc_hash_table): Likewise.
350 * elf32-arm.c (elf32_arm_hash_table): Likewise.
351 * elf32-avr.c (avr_link_hash_table): Likewise.
352 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
353 * elf32-cris.c (elf_cris_hash_table): Likewise.
354 * elf32-csky.c (csky_elf_hash_table): Likewise.
355 * elf32-frv.c (frvfdpic_hash_table): Likewise.
356 * elf32-hppa.c (hppa_link_hash_table): Likewise.
357 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
358 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
359 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
360 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
361 * elf32-metag.c (metag_link_hash_table): Likewise.
362 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
363 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
364 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
365 * elf32-s390.c (elf_s390_hash_table): Likewise.
366 * elf32-sh.c (sh_elf_hash_table): Likewise.
367 * elf32-spu.c (spu_hash_table): Likewise.
368 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
369 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
370 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
371 * elf64-hppa.c (hppa_link_hash_table): Likewise.
372 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
373 * elf64-s390.c (elf_s390_hash_table): Likewise.
374 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
375 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
376 * elfxx-mips.c (mips_elf_hash_table): Likewise.
377 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
378 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
380 2020-08-21 Jon Turney <jon.turney@dronecode.org.uk>
382 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
383 int. Use '%u' format with _bfd_error_handler to render it.
385 2020-08-25 Alan Modra <amodra@gmail.com>
388 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
389 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
391 2020-08-25 Alan Modra <amodra@gmail.com>
394 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
395 accessing elf_hash_table_id.
397 2020-08-25 Alan Modra <amodra@gmail.com>
400 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
401 accessing elf_hash_table_id.
403 2020-08-24 Mark Wielaard <mark@klomp.org>
405 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
406 (read_formatted_entries): Likewise. And skip zero entry.
408 2020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
410 * bfd-in2.h (bfd_mach_ck860): New.
411 * cpu-csky.c (arch_info_struct): Add item for CK860.
413 2020-08-24 Alan Modra <amodra@gmail.com>
415 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
416 high part tprel16 relocs.
417 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
418 Clear do_tls_opt on odd instructions.
419 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
420 Don't sanity check them here.
421 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
422 high part tprel16 relocs.
423 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
424 Clear do_tls_opt on odd instructions.
425 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
427 2020-08-23 John David Anglin <danglin@gcc.gnu.org>
430 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
431 * configure: Regenerate.
433 2020-08-22 H.J. Lu <hongjiu.lu@intel.com>
436 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
437 versioned symbols, which are defined in shared objects, in
440 2020-08-21 Nick Clifton <nickc@redhat.com>
442 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
443 the data map if there are entries in it.
444 (_bfd_aarch64_erratum_843419_scan): Likewise.
446 2020-08-21 Jan Beulich <jbeulich@suse.com>
448 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
449 last byte of debug dir, not first.
451 2020-08-20 Nick Clifton <nickc@redhat.com>
454 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
455 field in the ELF header of the compressed sections.
457 2020-08-20 Nick Clifton <nickc@redhat.com>
460 * elf-bfd.h (struct bfd_elf_section_data): Add
461 has_secondary_relocs field.
462 * elf.c (_bfd_elf_copy_special_section_fields): Set the
463 has_secondary_relocs field for sections which have associated
465 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
466 on sections which have associated secondary relocs.
468 2020-08-15 Alan Modra <amodra@gmail.com>
470 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
471 small common section.
472 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
473 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
474 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
475 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
476 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
477 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
478 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
479 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
480 * elf32-v850.c (v850_elf_check_relocs): Likewise.
481 (v850_elf_add_symbol_hook): Likewise.
482 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
483 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
484 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
485 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
487 2020-08-15 Alan Modra <amodra@gmail.com>
490 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
492 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
493 on small common section.
494 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
495 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
496 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
497 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
498 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
499 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
501 2020-08-14 Alan Modra <amodra@gmail.com>
503 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
504 rather than another copy of primes. Increase maximum default
507 2020-08-13 Alan Modra <amodra@gmail.com>
509 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
511 2020-08-13 Alan Modra <amodra@gmail.com>
513 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
514 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
515 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
516 optimization when --no-pcrel-optimize.
518 2020-08-13 Alan Modra <amodra@gmail.com>
521 * bfd.c (struct bfd): Add read_only.
522 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
523 Set read_only on warning.
524 (elf_object_p): Sanity check program header alignment. Set
525 read_only on warning.
526 * bfd-in2.h: Regenerate.
528 2020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
530 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
531 win32pstatus note type to avoid signedness comparison warning.
533 2020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
535 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
536 win32pstatus notes, and return TRUE so we continue rather than
537 stopping as if it was an error.
539 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
541 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
543 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
545 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
546 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
547 appropriate size constraint for each win32pstatus note type.
549 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
551 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
552 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
555 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
557 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
558 (elfcore_grok_win32pstatus): Use.
560 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
562 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
563 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
564 offsets used to read NOTE_INFO_PROCESS.
566 2020-08-12 Nick Clifton <nickc@redhat.com>
568 * po/ru.po: Updated Russian translation.
569 * po/sr.po: Updated Serbian translation.
571 2020-08-07 David Faust <david.faust@oracle.com>
573 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
574 DISP16 and DISP32 relocations.
576 2020-08-05 David Faust <david.faust@oracle.com>
578 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
579 (bpf_elf_howto_table): Use it here.
580 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
581 instruction and data relocations.
583 2020-08-03 Alan Modra <amodra@gmail.com>
585 * vms-lib.c (vms_traverse_index): Sanity check size remaining
586 before accessing vms_idx or vms_elfidx.
588 2020-08-03 Alan Modra <amodra@gmail.com>
591 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
592 size against file size. Correct LONG_MAX limit check.
593 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
594 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
595 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
596 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
597 bfd_malloc_and_get_section.
599 2020-07-31 Alan Modra <amodra@gmail.com>
602 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
603 IR symbols to become dynamic.
604 (elf_link_add_object_symbols): Don't exclude IR symbols when
605 deciding whether an as-needed shared library is needed.
607 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
610 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
612 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
614 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
616 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
617 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
618 Don't define _STRUCTURED_PROC.
619 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
620 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
621 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
622 * configure, config.in: Regenerate.
623 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
624 * Makefile.in, doc/Makefile.in: Regenerate.
626 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
628 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
629 (elf_link_hash_table): Add sym_cache.
630 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
631 (elf32_arm_check_relocs): Updated.
632 (elf32_arm_size_dynamic_sections): Likewise.
633 * elf32-bfin.c (bfin_link_hash_table): Removed.
634 (bfin_link_hash_newfunc): Updated.
635 (bfin_hash_table): Removed.
636 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
637 (csky_elf_check_relocs): Updated.
638 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
639 (elf32_hppa_check_relocs): Updated.
640 * elf32-i386.c (elf_i386_tls_transition): Updated.
641 (elf_i386_convert_load_reloc): Likewise.
642 (elf_i386_check_relocs): Likewise.
643 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
644 (m32r_elf_hash_table): Updated.
645 (m32r_elf_link_hash_table_create): Likewise.
646 (m32r_elf_create_dynamic_sections): Likewise.
647 (m32r_elf_adjust_dynamic_symbol): Likewise.
648 (allocate_dynrelocs): Likewise.
649 (m32r_elf_size_dynamic_sections): Likewise.
650 (m32r_elf_relocate_section): Likewise.
651 (m32r_elf_finish_dynamic_symbol): Likewise.
652 (m32r_elf_check_relocs): Likewise.
653 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
655 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
656 (elf_m68k_check_relocs): Updated.
657 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
658 (elf_metag_check_relocs): Updated.
659 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
660 (microblaze_elf_check_relocs): Updated.
661 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
662 (nds32_elf_create_dynamic_sections): Likewise.
663 (nds32_elf_adjust_dynamic_symbol): Likewise.
664 (nds32_elf_check_relocs): Likewise.
665 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
666 srelbss and aym_cache.
667 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
668 (nios2_elf32_check_relocs): Updated.
669 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
670 (or1k_elf_check_relocs): Updated.
671 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
672 (ppc_elf_check_relocs): Updated.
673 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
674 (elf_s390_check_relocs): Updated.
675 (elf_s390_finish_dynamic_sections): Likewise.
676 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
678 (sh_elf_create_dynamic_sections): Updated.
679 (sh_elf_adjust_dynamic_symbol): Likewise.
680 (sh_elf_size_dynamic_sections): Likewise.
681 (sh_elf_check_relocs): Likewise.
682 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
683 (elf32_tic6x_check_relocs): Updated.
684 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
685 (tilepro_elf_hash_table): Updated.
686 (tilepro_elf_link_hash_table_create): Likewise.
687 (tilepro_elf_check_relocs): Likewise.
688 (tilepro_elf_adjust_dynamic_symbol): Likewise.
689 (allocate_dynrelocs): Likewise.
690 (tilepro_elf_size_dynamic_sections): Likewise.
691 (tilepro_elf_relocate_section): Likewise.
692 (tilepro_elf_finish_dynamic_symbol): Likewise.
693 (tilepro_finish_dyn): Likewise.
694 (tilepro_elf_finish_dynamic_sections): Likewise.
695 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
696 (ppc64_elf_before_check_relocs): Updated.
697 (ppc64_elf_check_relocs): Likewise.
698 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
699 (elf_s390_check_relocs): Updated.
700 (elf_s390_relocate_section): Likewise.
701 (elf_s390_finish_dynamic_sections): Likewise.
702 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
703 (elf_x86_64_check_relocs): Likewise.
704 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
706 (elfNN_aarch64_check_relocs): Updated.
707 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
708 (riscv_elf_check_relocs): Updated.
709 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
710 (mips_elf_resolve_got_page_ref): Updated.
711 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
712 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
714 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
715 (tilegx_elf_check_relocs): Updated.
716 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
718 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
720 * elflink.c (bfd_elf_final_link): Give local symbols a name if
722 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
723 return TRUE if making ET_REL output.
725 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
727 * elf-bfd.h (elf_backend_data): Add
728 `elf_backend_elfsym_local_is_section' member.
729 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
731 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
732 * elflink.c (bfd_elf_final_link): Use it to determine whether
733 set the `.symtab' section's `sh_info' value to the index of the
734 first non-local or non-section symbol.
735 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
737 (elf_backend_elfsym_local_is_section): New macro.
738 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
740 (elf_backend_elfsym_local_is_section): New macro.
742 2020-07-29 Alan Modra <amodra@gmail.com>
744 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
745 defined in excluded sections.
747 2020-07-28 Alan Modra <amodra@gmail.com>
749 * elf.c (assign_section_numbers): Comment. Don't segfault on
750 discarded sections when setting linked-to section for generic
752 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
754 2020-07-27 Alan Modra <amodra@gmail.com>
756 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
758 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
761 2020-07-24 Nick Clifton <nickc@redhat.com>
763 * config.bfd: Move xc16x target to the obsolete list.
765 2020-07-22 Kevin Buettner <kevinb@redhat.com>
767 * binary.c (binary_get_section_contents): Seek using offset
768 from section's file position.
770 2020-07-22 Kevin Buettner <kevinb@redhat.com>
772 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
774 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
777 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
778 type for the first function argument. Rename pointers to reflect
779 that they have distinct types.
781 2020-07-20 Alan Modra <amodra@gmail.com>
783 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
785 2020-07-19 Alan Modra <amodra@gmail.com>
787 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
788 (select_alt_stub): New function.
789 (ppc_get_stub_entry): Use it here.
790 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
792 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
793 merge notoc stubs with other varieties when power10_stubs is "auto".
794 Instead dup the stub hash table entry.
795 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
796 tests of power10_stubs.
798 2020-07-15 Alan Modra <amodra@gmail.com>
801 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
803 2020-07-15 Nick Clifton <nickc@redhat.com>
806 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
807 check for aux entries that overflow the buufer.
809 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
811 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
812 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
814 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
815 Alan Modra <amodra@gmail.com>
818 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
819 objects both before and after normal object files.
820 * elflink.c (_bfd_elf_section_already_linked): Likewise.
822 2020-07-10 Alan Modra <amodra@gmail.com>
824 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
825 * elf64-ppc.c (struct ppc_link_hash_table): Delete
827 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
828 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
829 uses of power10_stubs.
831 2020-07-09 Alan Modra <amodra@gmail.com>
833 * coff-ppc.c: Delete.
836 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
837 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
839 (coff_write_object_contents): Remove PPC_PE code.
840 * config.bfd: Move powerpcle-pe to removed targets.
841 * configure.ac: Remove powerpc PE entries.
842 * libcoff-in.h (ppc_allocate_toc_section): Delete.
843 (ppc_process_before_allocation): Delete.
844 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
845 * targets.c: Remove powerpc PE vectors.
846 * po/SRC-POTFILES.in: Regenerate.
847 * libcoff.h: Regenerate.
848 * Makefile.in: Regenerate.
849 * configure: Regenerate.
851 2020-07-09 Nick Clifton <nickc@redhat.com>
853 * po/fr.po: Updated French translation.
855 2020-07-07 Alan Modra <amodra@gmail.com>
857 * xcofflink.c (xcoff_mark): Don't mark const sections.
858 (bfd_xcoff_record_link_assignment): Add FIXME.
859 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
860 sections being discarded by linker script.
862 2020-07-07 Alan Modra <amodra@gmail.com>
864 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
865 time, uid, gid and mode for deterministic archive.
866 (xcoff_write_archive_contents_big): Likewise.
868 2020-07-07 Alan Modra <amodra@gmail.com>
870 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
873 2020-07-06 Nick Clifton <nickc@redhat.com>
875 * po/pt.po: Updated Portuguese translation.
876 * po/uk.po: Updated Ukranian translation.
878 2020-07-04 Nick Clifton <nickc@redhat.com>
880 * version.m4: Set version to 2.35.50.
881 * configure: Regenerate.
882 * po/bbfd.pot: Regenerate.
884 2020-07-04 Nick Clifton <nickc@redhat.com>
886 Binutils 2.35 branch created.
888 2020-07-01 Alan Modra <amodra@gmail.com>
891 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
892 raw syment index before dereferencing.
894 2020-07-01 Alan Modra <amodra@gmail.com>
896 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
898 2020-07-01 Alan Modra <amodra@gmail.com>
900 * config.bfd: Obsolete xc16x.
902 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
904 * archures.c (bfd_mach_i386_nacl): Removed.
905 (bfd_mach_i386_i386_nacl): Likewise.
906 (bfd_mach_x86_64_nacl): Likewise.
907 (bfd_mach_x64_32_nacl): Likewise.
908 * config.bfd: Remove *-*-nacl* targets.
909 * configure.ac: Remove x86 NaCl target vectors.
910 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
911 (bfd_x64_32_nacl_arch): Likewise.
912 (bfd_x86_64_nacl_arch): Likewise.
913 (bfd_i386_nacl_arch): Likewise.
914 (bfd_x64_32_arch_intel_syntax): Updated.
915 * elf32-i386.c: Don't include "elf-nacl.h".
916 (elf_i386_nacl_plt): Removed.
917 (elf_i386_nacl_plt0_entry): Likewise.
918 (elf_i386_nacl_plt_entry): Likewise.
919 (elf_i386_nacl_pic_plt0_entry): Likewise.
920 (elf_i386_nacl_pic_plt_entry): Likewise.
921 (elf_i386_nacl_eh_frame_plt): Likewise.
922 (elf_i386_nacl_plt): Likewise.
923 (elf32_i386_nacl_elf_object_p): Likewise.
924 (elf_i386_get_synthetic_symtab): Updated.
925 (elf_i386_link_setup_gnu_properties): Likewise.
926 * elf64-x86-64.c: Don't include "elf-nacl.h".
927 (elf_x86_64_nacl_plt): Removed.
928 (elf64_x86_64_nacl_elf_object_p): Likewise.
929 (elf_x86_64_nacl_plt0_entry): Likewise.
930 (elf_x86_64_nacl_plt_entry): Likewise.
931 (elf_x86_64_nacl_eh_frame_plt): Likewise.
932 (elf_x86_64_nacl_plt): Likewise.
933 (elf32_x86_64_nacl_elf_object_p): Likewise.
934 (elf_x86_64_get_synthetic_symtab): Updated.
935 (elf_x86_64_link_setup_gnu_properties): Likewise.
936 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
937 * targets.c: Remove x86 NaCl target vectors.
938 * bfd-in2.h: Regenerated.
939 * configure: Likewise.
941 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
943 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
944 _bfd_elf_add_dynamic_tags.
946 2020-06-29 Alan Modra <amodra@gmail.com>
948 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
949 return value of bfd_bread. Don't read more than requested length.
950 Sanity check length. Properly terminate file name.
952 2020-06-29 Alan Modra <amodra@gmail.com>
954 * arc-got.h: Use C style comments.
955 * coff-z80.c: Likewise.
956 * elf32-csky.c: Likewise.
957 * peXXigen.c: Likewise.
958 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
961 2020-06-26 Pat Bernardi <bernardi@adacore.com>
963 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
964 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
966 2020-06-26 Alan Modra <amodra@gmail.com>
968 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
969 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
970 (riscv_get_priv_spec_name): Move to..
971 * cpu-riscv.c: ..here.
972 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
973 Use %u to print unsigned numbers.
975 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
977 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
978 default architecture.
980 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
983 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
984 _bfd_elf_add_dynamic_tags.
986 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
989 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
990 _bfd_elf_add_dynamic_tags.
992 2020-06-24 Alan Modra <amodra@gmail.com>
994 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
995 shifts without undefined behaviour.
997 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
999 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
1001 (_bfd_elf_add_dynamic_tags): New.
1002 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
1003 _bfd_elf_add_dynamic_tags.
1004 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
1005 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
1006 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
1007 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
1008 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
1009 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
1010 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1011 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
1013 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
1014 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
1015 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
1016 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
1017 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
1018 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
1019 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1020 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
1021 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
1023 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
1024 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
1025 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
1026 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1027 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1028 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
1030 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1031 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1032 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
1033 dt_reloc_sz and dt_reloc_ent.
1034 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
1035 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
1037 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
1038 etab.dt_pltgot_required.
1039 (elf32_hppa_size_dynamic_sections): Call
1040 _bfd_elf_add_dynamic_tags.
1041 * elf32-metag.c (elf_metag_link_hash_table_create): Set
1042 etab.dt_pltgot_required.
1043 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
1044 * elf32-sh.c (sh_elf_link_hash_table_create): Set
1045 root.dt_pltgot_required for FDPIC output.
1046 (sh_elf_size_dynamic_sections): Call
1047 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1048 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
1049 elf.dt_pltgot_required.
1050 (elf_xtensa_size_dynamic_sections): Call
1051 _bfd_elf_add_dynamic_tags.
1052 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
1053 root.dt_pltgot_required.
1054 (elf64_hppa_size_dynamic_sections): Call
1055 _bfd_elf_add_dynamic_tags.
1056 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
1057 root.dt_pltgot_required.
1058 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
1059 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
1060 * elflink.c (_bfd_elf_add_dynamic_tags): New.
1062 2020-06-22 Saagar Jha <saagar@saagarjha.com>
1064 * mach-o.c: Support the new load commands by reading a linkedit
1065 data command for them.
1067 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1069 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
1070 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
1071 (riscv_get_priv_spec_class): Likewise.
1072 (riscv_get_priv_spec_name): Likewise.
1073 (riscv_get_priv_spec_class_from_numbers): New function, convert
1074 the version numbers into string, then call riscv_get_priv_spec_class
1075 to get the priv spec class.
1076 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
1077 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
1078 (riscv_get_priv_spec_name): Likewise.
1079 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
1080 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
1081 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
1082 of input and output objects form their priv spec attributes by
1083 riscv_get_priv_spec_class_from_numbers. Report warning rather than
1084 errors when linking objects with differnet priv spec versions. We do
1085 know v1.9.1 may have conflicts to other versions, so report the
1086 warning, too. After that, update the output priv spec version to the
1089 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1091 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
1092 priv attributes, we will check the conflicts for all of them (major,
1093 minor and revision), and then set the priv_attrs_merged to TRUE to
1094 indicate that we have handled all of the priv attributes. Remove
1095 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
1097 2020-06-21 Alan Modra <amodra@gmail.com>
1100 * configure.ac: Disable plugins by default for some targets.
1101 * plugin.c: Comment typo fix.
1102 * configure: Regenerate.
1104 2020-06-19 Nick Clifton <nickc@redhat.com>
1106 * plugin.c (try_load_plugin): Suppress the error message about
1107 being unable to open a plugin if creating a list of viable
1110 2020-06-16 Alan Modra <amodra@gmail.com>
1112 * aout-tic30.c: Delete file.
1113 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
1114 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
1115 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
1116 (xc16x-*-elf): Sort properly.
1117 * configure.ac: Remove tic30_aout_vec.
1118 * targets.c: Likewise.
1119 * Makefile.in: Regenerate.
1120 * configure: Regenerate.
1121 * po/SRC-POTFILES.in: Regenerate.
1123 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
1125 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
1126 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
1127 (elf32xtensa_abi): New global variable.
1128 (xtensa_abi_choice): New function.
1129 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
1130 XSHAL_ABI to select PLT code.
1132 2020-06-15 Roland McGrath <mcgrathr@google.com>
1134 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
1135 field of bfd_link_info.
1137 2020-06-15 Alan Modra <amodra@gmail.com>
1139 * config.bfd: Obsolete powerpcle-*-pe targets.
1141 2020-06-15 Alan Modra <amodra@gmail.com>
1144 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
1145 symbols that were defined in discarded sections.
1146 * cofflink.c (coff_link_check_archive_element): Likewise.
1147 (coff_link_add_symbols): Set indx to -3 for symbols defined in
1149 (_bfd_coff_write_global_sym): Don't emit such symbols.
1150 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
1151 libcoff.h: Regenerate.
1153 2020-06-11 Alan Modra <amodra@gmail.com>
1156 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
1158 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1160 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
1161 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
1162 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
1165 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1168 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
1169 Clear verinfo.verdef.
1171 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
1174 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
1175 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
1176 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
1178 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
1179 Set ifunc_resolvers if there are FUNC resolvers.
1180 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
1181 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
1182 with elf.ifunc_resolvers.
1183 (write_plt_relocs_for_local_syms): Likewise.
1184 (ppc64_elf_relocate_section): Likewise.
1185 (ppc64_elf_finish_dynamic_sections): Likewise.
1186 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
1188 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1189 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
1190 instead of readonly_dynrelocs_against_ifunc.
1191 * elfxx-x86.h (elf_x86_link_hash_table): Remove
1192 readonly_dynrelocs_against_ifunc.
1194 2020-06-09 Alan Modra <amodra@gmail.com>
1196 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1197 maybe_local_ifunc_resolver field.
1198 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
1199 cases where maybe_local_ifunc_resolver was set.
1200 (ppc64_elf_relocate_section): Likewise.
1201 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
1204 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
1206 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
1208 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
1210 (elf32_arm_size_dynamic_sections): Updated. Clear
1211 root.tlsdesc_plt for DF_BIND_NOW.
1212 (elf32_arm_finish_dynamic_sections): Updated.
1213 (elf32_arm_output_arch_local_syms): Likewise.
1214 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
1215 Clear root.tlsdesc_plt for DF_BIND_NOW.
1216 (nds32_elf_finish_dynamic_sections): Updated.
1217 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
1218 dt_tlsdesc_plt and dt_tlsdesc_got.
1219 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
1220 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1221 tlsdesc_plt and dt_tlsdesc_got.
1222 (elfNN_aarch64_allocate_dynrelocs): Updated.
1223 (elfNN_aarch64_finish_dynamic_sections): Likewise.
1224 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
1225 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
1227 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1228 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1229 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1230 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
1233 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1235 * elf32-tic6x.c (elf32_bed): Defined the default to
1238 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1240 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
1242 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
1243 root.splt/root.srelplt.
1244 (elf64_hppa_create_dynamic_sections): Likewise.
1245 (elf64_hppa_size_dynamic_sections): Likewise.
1246 (elf64_hppa_finish_dynamic_symbol): Likewise.
1247 (elf_hppa_final_link): Likewise.
1248 (elf_hppa_final_link_relocate): Likewise.
1250 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1252 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
1253 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1256 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1258 * elf-bfd.h (elf_target_os): New.
1259 (elf_link_hash_table): Add target_os.
1260 (elf_backend_data): Add target_os.
1261 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
1262 symbian_p and nacl_p.
1263 (create_got_section): Updated.
1264 (elf32_arm_create_dynamic_sections): Likewise.
1265 (arm_type_of_stub): Likewise.
1266 (elf32_arm_create_or_find_stub_sec): Likewise.
1267 (elf32_arm_allocate_plt_entry): Likewise.
1268 (elf32_arm_populate_plt_entry): Likewise.
1269 (elf32_arm_final_link_relocate): Likewise.
1270 (elf32_arm_check_relocs): Likewise.
1271 (allocate_dynrelocs_for_symbol): Likewise.
1272 (elf32_arm_finish_dynamic_symbol): Likewise.
1273 (elf32_arm_finish_dynamic_sections): Likewise.
1274 (elf32_arm_output_plt_map_1): Likewise.
1275 (elf32_arm_output_arch_local_syms): Likewise.
1276 (elf32_arm_add_symbol_hook): Likewise.
1277 (elf32_arm_nacl_link_hash_table_create): Likewise.
1278 (elf32_arm_vxworks_link_hash_table_create): Likewise.
1279 (elf32_arm_symbian_link_hash_table_create): Likewise.
1280 (ELF_TARGET_OS): New.
1281 * elf32-i386.c (elf_i386_arch_bed): Removed.
1282 (elf_backend_arch_data): Likewise.
1283 (elf_i386_solaris_arch_bed): Likewise.
1284 (elf_i386_nacl_arch_bed): Likewise.
1285 (elf_i386_vxworks_arch_bed): Likewise.
1286 (elf_i386_relocate_section): Updated.
1287 (elf_i386_finish_dynamic_sections): Likewise.
1288 (elf_i386_get_synthetic_symtab): Likewise.
1289 (elf_i386_link_setup_gnu_properties): Likewise.
1290 (ELF_TARGET_OS): New.
1291 * elf32-mips.c (ELF_TARGET_OS): New.
1292 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
1293 (ppc_elf_create_got): Updated.
1294 (ppc_elf_create_dynamic_sections): Likewise.
1295 (ppc_elf_check_relocs): Likewise.
1296 (ppc_elf_adjust_dynamic_symbol): Likewise.
1297 (ppc_elf_size_dynamic_sections): Likewise.
1298 (ppc_elf_relocate_section): Likewise.
1299 (ppc_elf_finish_dynamic_sections): Likewise.
1300 (ppc_elf_vxworks_link_hash_table_create): Likewise.
1301 (ELF_TARGET_OS): New.
1302 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
1303 (sh_elf_link_hash_table_create): Updated.
1304 (sh_elf_create_dynamic_sections): Likewise.
1305 (allocate_dynrelocs): Likewise.
1306 (sh_elf_size_dynamic_sections): Likewise.
1307 (sh_elf_relocate_section): Likewise.
1308 (sh_elf_finish_dynamic_symbol): Likewise.
1309 (sh_elf_finish_dynamic_sections): Likewise.
1310 (ELF_TARGET_OS): New.
1311 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
1313 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1314 (ELF_TARGET_OS): New.
1315 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
1316 (elf_x86_64_solaris_arch_bed): Likewise.
1317 (elf_x86_64_nacl_arch_bed): Likewise.
1318 (elf_x86_64_finish_dynamic_sections): Updated.
1319 (elf_x86_64_get_synthetic_symtab): Likewise.
1320 (elf_x86_64_link_setup_gnu_properties): Likewise.
1321 (ELF_TARGET_OS): New.
1322 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
1324 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
1325 (MIPS_ELF_REL_DYN_NAME): Updated.
1326 (ELF_MIPS_GP_OFFSET): Likewise.
1327 (mips_elf_create_local_got_entry): Likewise.
1328 (mips_elf_allocate_dynamic_relocations): Likewise.
1329 (mips_elf_count_got_symbols): Likewise.
1330 (is_gott_symbol): Likewise.
1331 (mips_elf_calculate_relocation): Likewise.
1332 (mips_elf_create_dynamic_relocation): Likewise.
1333 (_bfd_mips_elf_check_relocs): Likewise.
1334 (allocate_dynrelocs): Likewise.
1335 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
1336 (mips_elf_lay_out_got): Likewise.
1337 (mips_elf_set_plt_sym_value): Likewise.
1338 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1339 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1340 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1341 (_bfd_mips_elf_final_link): Likewise.
1342 (_bfd_mips_init_file_header): Likewise.
1343 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
1345 (allocate_dynrelocs): Likewise.
1346 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1347 (_bfd_sparc_elf_relocate_section): Likewise.
1348 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1349 (sparc_finish_dyn): Likewise.
1350 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1351 * elfxx-target.h (ELF_TARGET_OS): New.
1352 (elfNN_bed): Add ELF_TARGET_OS.
1353 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1354 (_bfd_x86_elf_link_hash_table_create): Likewise.
1355 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1356 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1357 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1358 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1359 * elfxx-x86.h (elf_x86_target_os): Removed.
1360 (elf_x86_backend_data): Likewise.
1361 (get_elf_x86_backend_data): Likewise.
1362 (elf_x86_link_hash_table): Remove target_os.
1364 2020-06-06 Alan Modra <amodra@gmail.com>
1367 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
1368 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
1369 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
1370 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
1371 * elf64-ppc.c: Update throughout for reloc renaming.
1372 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
1373 * libbfd.h: Regenerate.
1374 * bfd-in2.h: Regenerate.
1376 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
1379 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
1382 2020-06-05 Nick Clifton <nickc@redhat.com>
1384 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
1387 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
1389 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
1390 priv_may_conflict, in_priv_zero and out_priv_zero to decide
1391 whether the object can be linked according to it's priv
1392 attributes. The object without any priv spec attributes can
1393 be linked with others. If the first input object doesn't contain
1394 any priv attributes, then we need to copy the setting from the
1395 next input one. Also report more detailed error messages to user.
1397 2020-06-04 Stephen Casner <casner@acm.org>
1399 Extend pdp11-aout symbol table format to accommodate .stab
1400 symbols and implement correct handling of them.
1402 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
1403 (N_STAB, is_stab): Needed new function is_stab to disambiguate
1404 normal vs. .stab symbol table type values, replacing N_STAB mask.
1405 (translate_from_native_sym_flags): Determine correct section for
1406 different .stab types.
1407 (translate_to_native_sym_flags): Leave .stab types intact.
1408 (translate_symbol_table): Error if symbol indicates overlay;
1409 store desc field from .stab symbols.
1410 (write_syms): Output desc field with symbol.
1411 (aout_link_check_ar_symbols): Skip .stab symbols.
1412 (aout_link_add_symbols): Correctly distinguish .stab symbols.
1413 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
1414 (aout_link_write_symbols): Write 0 for desk and ovly fields;
1415 correctly distinguish .stab symbols and select calculate their
1416 section and value; and copy desc and ovly fields from input symbol
1419 2020-06-04 Stephen Casner <casner@acm.org>
1421 * aoutx.h (translate_symbol_table): Comment had external and
1423 * pdp11.c (translate_symbol_table): Likewise.
1425 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1427 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
1428 (is_x86_elf): Check elf.hash_table_id instead of target_id.
1429 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
1431 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1434 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
1435 in debug section against symbol defined in shared library to 0.
1436 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
1437 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
1438 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
1439 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
1440 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
1441 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1442 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
1443 * elf32-sh.c (sh_elf_check_relocs): Likewise.
1444 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1445 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1446 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1447 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1448 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1449 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
1451 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
1452 there is non-GOT reference.
1453 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
1454 non-alloced sections.
1456 2020-06-03 Stephen Casner <casner@acm.org>
1458 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
1460 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
1462 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
1463 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
1464 other size that doesn't qcover the header word.
1465 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
1466 string table, and zero it.
1467 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
1468 message and set bfd_error on finding an invalid name string offset.
1469 (add_to_stringtab): INLINE -> inline
1470 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
1472 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
1473 any relocs that could not be recognised.
1474 92744f05809 PR 20929 - Check for relocs without an associated symbol.
1475 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
1476 name exists and is long enough, before attempting to see if it is
1478 c3864421222 - Correct case for N_SO being the last symbol.
1479 50455f1ab29 PR 20891 - Handle the case where the main file name
1480 and the directory name are both empty.
1481 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
1482 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
1483 range string table offsets.
1484 531336e3a0b PR 20909 - Fix off-by-one error in check for an
1485 illegal string offset.
1486 (aout_link_includes_newfunc): Add comment.
1487 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
1488 on unexpected relocation type rather than ASSERT.
1490 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1493 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
1494 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
1496 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1499 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
1500 non-alloced sections.
1502 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1504 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
1505 dynamic relocations for non SEC_ALLOC sections.
1507 2020-06-03 Gunther Nikl <gnikl@justmail.de>
1509 * aout64.c (BMAGIC, QMAGIC): Do not define.
1510 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
1511 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
1512 to check the file format.
1513 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
1514 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
1515 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
1517 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1519 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
1520 relocations for non SEC_ALLOC sections.
1522 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1524 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
1525 * elf32-arm.c (maybe_set_textrel): Removed.
1526 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
1527 with _bfd_elf_maybe_set_textrel.
1528 * elf32-csky.c (maybe_set_textrel): Removed.
1529 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
1530 with _bfd_elf_maybe_set_textrel.
1531 * elf32-hppa.c (maybe_set_textrel): Removed.
1532 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
1533 with _bfd_elf_maybe_set_textrel.
1534 * elf32-lm32.c (maybe_set_textrel): Removed.
1535 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
1536 with _bfd_elf_maybe_set_textrel.
1537 * elf32-m32r.c (maybe_set_textrel): Removed.
1538 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
1539 with _bfd_elf_maybe_set_textrel.
1540 * elf32-metag.c (maybe_set_textrel): Removed.
1541 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
1542 with _bfd_elf_maybe_set_textrel.
1543 * elf32-nds32.c (maybe_set_textrel): Removed.
1544 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
1545 with _bfd_elf_maybe_set_textrel.
1546 * elf32-or1k.c (maybe_set_textrel): Removed.
1547 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
1548 with _bfd_elf_maybe_set_textrel.
1549 * elf32-ppc.c (maybe_set_textrel): Removed.
1550 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
1551 with _bfd_elf_maybe_set_textrel.
1552 * elf32-s390.c (maybe_set_textrel): Removed.
1553 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1554 with _bfd_elf_maybe_set_textrel.
1555 * elf32-sh.c (maybe_set_textrel): Removed.
1556 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
1557 with _bfd_elf_maybe_set_textrel.
1558 * elf32-tic6x.c (maybe_set_textrel): Removed.
1559 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
1560 with _bfd_elf_maybe_set_textrel.
1561 * elf32-tilepro.c (maybe_set_textrel): Removed.
1562 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
1563 with _bfd_elf_maybe_set_textrel.
1564 * elf64-ppc.c (maybe_set_textrel): Removed.
1565 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
1566 with _bfd_elf_maybe_set_textrel.
1567 * elf64-s390.c (maybe_set_textrel): Removed.
1568 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1569 with _bfd_elf_maybe_set_textrel.
1570 * elfnn-aarch64.c (maybe_set_textrel): Removed.
1571 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
1572 with _bfd_elf_maybe_set_textrel.
1573 * elfnn-riscv.c (maybe_set_textrel): Removed.
1574 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
1575 with _bfd_elf_maybe_set_textrel.
1576 * elfxx-sparc.c (maybe_set_textrel): Removed.
1577 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
1578 with _bfd_elf_maybe_set_textrel.
1579 * elfxx-tilegx.c (maybe_set_textrel): Removed.
1580 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
1581 with _bfd_elf_maybe_set_textrel.
1582 * elfxx-x86.c (maybe_set_textrel): Removed.
1583 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
1584 with _bfd_elf_maybe_set_textrel.
1585 * elflink.c (_bfd_elf_maybe_set_textrel): New.
1587 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1590 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
1592 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
1593 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
1594 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
1595 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
1597 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
1598 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
1599 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
1600 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1601 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
1602 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
1603 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1604 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
1605 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
1606 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1607 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
1608 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1609 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
1610 (elf_backend_copy_indirect_symbol): Likewise.
1611 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
1612 (elf_backend_copy_indirect_symbol): Likewise.
1613 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
1615 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1618 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
1619 * elf32-arm.c (readonly_dynrelocs): Removed.
1620 (maybe_set_textrel): Replace readonly_dynrelocs with
1621 _bfd_elf_readonly_dynrelocs.
1622 * elf32-csky.c (readonly_dynrelocs): Removed.
1623 (maybe_set_textrel): Replace readonly_dynrelocs with
1624 _bfd_elf_readonly_dynrelocs.
1625 * elf32-hppa.c(readonly_dynrelocs): Removed.
1626 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1627 _bfd_elf_readonly_dynrelocs.
1628 (maybe_set_textrel): Likewise.
1629 * elf32-lm32.c (readonly_dynrelocs): Removed.
1630 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1631 with _bfd_elf_readonly_dynrelocs.
1632 (maybe_set_textrel): Likewise.
1633 * elf32-m32r.c (readonly_dynrelocs): Removed.
1634 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1635 with _bfd_elf_readonly_dynrelocs.
1636 (maybe_set_textrel): Likewise.
1637 * elf32-metag.c (readonly_dynrelocs): Removed.
1638 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
1639 with _bfd_elf_readonly_dynrelocs.
1640 (maybe_set_textrel): Likewise.
1641 * elf32-microblaze.c (readonly_dynrelocs): Removed.
1642 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1643 with _bfd_elf_readonly_dynrelocs.
1644 * elf32-nds32.c (readonly_dynrelocs): Removed.
1645 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1646 with _bfd_elf_readonly_dynrelocs.
1647 (maybe_set_textrel): Likewise.
1648 * elf32-or1k.c (readonly_dynrelocs): Removed.
1649 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1650 with _bfd_elf_readonly_dynrelocs.
1651 * elf32-ppc.c (readonly_dynrelocs): Removed.
1652 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1653 _bfd_elf_readonly_dynrelocs.
1654 (ppc_elf_adjust_dynamic_symbol): Likewise.
1655 (maybe_set_textrel): Likewise.
1656 * elf32-s390.c (readonly_dynrelocs): Removed.
1657 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1658 with _bfd_elf_readonly_dynrelocs.
1659 (maybe_set_textrel): Likewise.
1660 * elf32-sh.c (readonly_dynrelocs): Removed.
1661 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
1662 _bfd_elf_readonly_dynrelocs.
1663 (maybe_set_textrel): Likewise.
1664 * elf32-tic6x.c (readonly_dynrelocs): Removed.
1665 (maybe_set_textrel): Replace readonly_dynrelocs with
1666 _bfd_elf_readonly_dynrelocs.
1667 * elf32-tilepro.c (readonly_dynrelocs): Removed.
1668 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1669 with _bfd_elf_readonly_dynrelocs.
1670 (maybe_set_textrel): Likewise.
1671 * elf64-ppc.c (readonly_dynrelocs): Removed.
1672 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1673 _bfd_elf_readonly_dynrelocs.
1674 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1675 (maybe_set_textrel): Likewise.
1676 * elf64-s390.c (readonly_dynrelocs): Removed.
1677 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1678 with _bfd_elf_readonly_dynrelocs.
1679 (maybe_set_textrel): Likewise.
1680 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
1681 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
1682 (maybe_set_textrel): Replace readonly_dynrelocs with
1683 _bfd_elf_readonly_dynrelocs.
1684 * elfnn-riscv.c (readonly_dynrelocs): Removed.
1685 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1686 with _bfd_elf_readonly_dynrelocs.
1687 (maybe_set_textrel): Likewise.
1688 * elfxx-sparc.c (readonly_dynrelocs): Removed.
1689 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
1690 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
1691 (maybe_set_textrel): Likewise.
1692 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
1693 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1694 with _bfd_elf_readonly_dynrelocs.
1695 (maybe_set_textrel): Likewise.
1696 * elfxx-x86.c (readonly_dynrelocs): Removed.
1697 (maybe_set_textrel): Replace readonly_dynrelocs with
1698 _bfd_elf_readonly_dynrelocs.
1699 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1701 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1703 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
1704 -fsanitize=undefined.
1706 2020-06-03 Alan Modra <amodra@gmail.com>
1710 * peicode.h (pe_ILF_make_a_section): Align data for compilers
1712 (pe_ILF_build_a_bfd): Likewise.
1714 2020-06-03 Alan Modra <amodra@gmail.com>
1717 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
1718 core files as well as objects.
1720 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
1723 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
1724 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
1726 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
1727 (elf_arc_link_hash_newfunc): Updated.
1728 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
1729 (elf32_arm_link_hash_newfunc): Updated.
1730 (elf32_arm_copy_indirect_symbol): Likewise.
1731 (elf32_arm_check_relocs): Likewise.
1732 (readonly_dynrelocs): Likewise.
1733 (allocate_dynrelocs_for_symbol): Likewise.
1734 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
1735 (csky_elf_link_hash_newfunc): Updated.
1736 (csky_allocate_dynrelocs): Likewise.
1737 (readonly_dynrelocs): Likewise.
1738 (csky_elf_copy_indirect_symbol): Likewise.
1739 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
1740 (hppa_link_hash_newfunc): Updated.
1741 (elf32_hppa_copy_indirect_symbol): Likewise.
1742 (elf32_hppa_hide_symbol): Likewise.
1743 (elf32_hppa_adjust_dynamic_symbol): Likewise.
1744 (allocate_dynrelocs): Likewise.
1745 (elf32_hppa_relocate_section): Likewise.
1746 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1747 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
1748 (lm32_elf_link_hash_newfunc): Likewise.
1749 (lm32_elf_link_hash_table_create): Updated.
1750 (readonly_dynrelocs): Likewise.
1751 (allocate_dynrelocs): Likewise.
1752 (lm32_elf_copy_indirect_symbol): Likewise.
1753 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
1754 (m32r_elf_link_hash_newfunc): Likewise.
1755 (m32r_elf_link_hash_table_create): Updated.
1756 (m32r_elf_copy_indirect_symbol): Likewise.
1757 (allocate_dynrelocs): Likewise.
1758 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
1759 (metag_link_hash_newfunc): Updated.
1760 (elf_metag_copy_indirect_symbol): Likewise.
1761 (readonly_dynrelocs): Likewise.
1762 (allocate_dynrelocs): Likewise.
1763 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
1765 (link_hash_newfunc): Updated.
1766 (microblaze_elf_check_relocs): Likewise.
1767 (microblaze_elf_copy_indirect_symbol): Likewise.
1768 (readonly_dynrelocs): Likewise.
1769 (allocate_dynrelocs): Likewise.
1770 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
1771 (nds32_elf_link_hash_newfunc): Updated.
1772 (nds32_elf_copy_indirect_symbol): Likewise.
1773 (readonly_dynrelocs): Likewise.
1774 (allocate_dynrelocs): Likewise.
1775 (nds32_elf_check_relocs): Likewise.
1776 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
1777 (link_hash_newfunc): Updated.
1778 (nios2_elf32_copy_indirect_symbol): Likewise.
1779 (nios2_elf32_check_relocs): Likewise.
1780 (allocate_dynrelocs): Likewise.
1781 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
1782 (or1k_elf_link_hash_newfunc): Updated.
1783 (readonly_dynrelocs): Likewise.
1784 (allocate_dynrelocs): Likewise.
1785 (or1k_elf_copy_indirect_symbol): Likewise.
1786 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
1787 (ppc_elf_link_hash_newfunc): Updated.
1788 (ppc_elf_copy_indirect_symbol): Likewise.
1789 (ppc_elf_check_relocs): Likewise.
1790 (readonly_dynrelocs): Likewise.
1791 (ppc_elf_adjust_dynamic_symbol): Likewise.
1792 (allocate_dynrelocs): Likewise.
1793 (ppc_elf_relocate_section): Likewise.
1794 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1795 (link_hash_newfunc): Updated.
1796 (elf_s390_copy_indirect_symbol): Likewise.
1797 (readonly_dynrelocs): Likewise.
1798 (elf_s390_adjust_dynamic_symbol): Likewise.
1799 (allocate_dynrelocs): Likewise.
1800 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
1801 (sh_elf_link_hash_newfunc): Updated.
1802 (readonly_dynrelocs): Likewise.
1803 (allocate_dynrelocs): Likewise.
1804 (sh_elf_copy_indirect_symbol): Likewise.
1805 (sh_elf_check_relocs): Likewise.
1806 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
1807 (elf32_tic6x_link_hash_newfunc): Likewise.
1808 (elf32_tic6x_link_hash_table_create): Updated.
1809 (readonly_dynrelocs): Likewise.
1810 (elf32_tic6x_check_relocs): Likewise.
1811 (elf32_tic6x_allocate_dynrelocs): Likewise.
1812 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
1814 (link_hash_newfunc): Updated.
1815 (tilepro_elf_copy_indirect_symbol): Likewise.
1816 (tilepro_elf_check_relocs): Likewise.
1817 (allocate_dynrelocs): Likewise.
1818 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
1819 (ppc64_elf_copy_indirect_symbol): Updated.
1820 (ppc64_elf_check_relocs): Likewise.
1821 (readonly_dynrelocs): Likewise.
1822 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1823 (dec_dynrel_count): Likewise.
1824 (allocate_dynrelocs): Likewise.
1825 (ppc64_elf_relocate_section): Likewise.
1826 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1827 (link_hash_newfunc): Updated.
1828 (elf_s390_copy_indirect_symbol): Likewise.
1829 (readonly_dynrelocs): Likewise.
1830 (allocate_dynrelocs): Likewise.
1831 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1832 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1834 (elfNN_aarch64_link_hash_newfunc): Updated.
1835 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1836 (readonly_dynrelocs): Likewise.
1837 (need_copy_relocation_p): Likewise.
1838 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1839 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1840 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1841 (link_hash_newfunc): Updated.
1842 (riscv_elf_copy_indirect_symbol): Likewise.
1843 (riscv_elf_check_relocs): Likewise.
1844 (readonly_dynrelocs): Likewise.
1845 (allocate_dynrelocs): Likewise.
1846 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1848 (link_hash_newfunc): Updated.
1849 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1850 (_bfd_sparc_elf_check_relocs): Likewise.
1851 (readonly_dynrelocs): Likewise.
1852 (allocate_dynrelocs): Likewise.
1853 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1854 (link_hash_newfunc): Updated.
1855 (tilegx_elf_copy_indirect_symbol): Likewise.
1856 (tilegx_elf_check_relocs): Likewise.
1857 (readonly_dynrelocs): Likewise.
1858 (allocate_dynrelocs): Likewise.
1859 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1860 (readonly_dynrelocs): Likewise.
1861 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1862 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1864 2020-06-01 Alan Modra <amodra@gmail.com>
1866 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1867 command against cmd_length, not the end of record. For
1868 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1869 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1872 2020-05-28 David Faust <david.faust@oracle.com>
1874 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1875 R_BPF_INSN_{32,64} relocations.
1877 2020-05-28 Stephen Casner <casner@acm.org>
1879 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1880 addreses in .long (used in testsuites) and .stab values.
1882 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1885 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1886 Check bfd_link_dll when issue a DT_TEXTREL warning.
1887 * elfxx-x86.c (maybe_set_textrel): Likewise.
1888 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1890 2020-05-26 Nick Clifton <nickc@redhat.com>
1892 * plugin.c (try_load_plugin): Extend error message when a plugin
1895 2020-05-23 Alan Modra <amodra@gmail.com>
1897 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1899 2020-05-22 Alan Modra <amodra@gmail.com>
1902 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1903 attributes from shared libraries, and do not return an error if
1906 2020-05-21 Alan Modra <amodra@gmail.com>
1909 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1911 (_bfd_delete_bfd): Free the copy.
1912 (_bfd_new_bfd): Free nbfd->memory on error.
1914 2020-05-21 Alan Modra <amodra@gmail.com>
1916 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1917 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1918 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1919 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1920 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1921 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1922 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1923 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1924 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1925 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1926 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1927 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1928 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1929 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1930 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1931 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1932 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1933 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1934 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1935 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1937 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1939 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1940 get_default_version. It is used to find the default version for
1941 the specific extension.
1942 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1943 default_major_version and default_minor_version. Add new bfd_boolean
1944 parameter *use_default_version. Set it to TRUE if we need to call
1945 the callback rps->get_default_version to find the default version.
1946 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1947 the default version in riscv_parsing_subset_version, and then call
1948 riscv_add_subset to add the subset into subset list.
1949 (riscv_parse_prefixed_ext): Likewise.
1950 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1951 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1952 strings rather than characters.
1953 riscv_merge_arch_attr_info): The callback function get_default_version
1954 is only needed for assembler, so set it to NULL int the linker.
1955 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1956 * elfxx-riscv.h: Updated.
1958 2020-05-20 Alan Modra <amodra@gmail.com>
1961 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1962 use bfd_set_filename.
1963 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1964 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1965 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1966 (bfd_create): Likewise.
1967 (_bfd_delete_bfd): Don't free filename.
1968 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1969 return pointer to the copy or NULL on alloc fail.
1970 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1971 result of bfd_set_filename.
1972 * bfd-in2.h: Regenerate.
1974 2020-05-20 Alan Modra <amodra@gmail.com>
1977 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1978 section size against file size.
1979 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1981 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1984 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1985 and memset when allocating memory for the sections_being_created
1988 2020-05-19 Stafford Horne <shorne@gmail.com>
1990 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1992 (or1k_elf_relocate_section): Access srelgot via
1993 htab->root.srelgot. Add assertions for srelgot->contents.
1994 Introduce local variable for srelgot to not reuse global
1996 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1997 (or1k_set_got_and_rela_sizes): New function.
1998 (or1k_initial_exec_offset): New function.
1999 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
2000 (or1k_elf_relocate_section): Allow for TLS to handle multiple
2002 (or1k_elf_check_relocs): Use OR to set TLS access.
2003 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
2005 (or1k_elf_size_dynamic_sections): Use
2006 or1k_set_got_and_rela_sizes to set sizes.
2007 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
2008 (TCB_SIZE): New macro.
2009 (tpoff): Use TCB_SIZE and alignment to calculate offset.
2010 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
2011 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
2012 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
2013 (tpoff): Add dynamic boolean argument.
2014 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
2016 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
2018 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
2019 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
2020 cases with BFD_RELOC_AARCH64_JUMP26.
2021 (elfNN_aarch64_check_relocs): Likewise.
2023 2020-05-19 Alan Modra <amodra@gmail.com>
2025 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
2026 bfd_get_filename rather than accessing bfd->filename directly.
2027 * aout-target.h (MY (object_p)): Likewise.
2028 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2029 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
2030 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
2031 (_bfd_archive_bsd44_construct_extended_name_table),
2032 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
2033 (_bfd_bsd_write_armap): Likewise.
2034 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
2035 * cache.c (bfd_open_file): Likewise.
2036 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
2037 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
2038 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2039 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2040 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
2041 * elf32-nds32.c (nds32_elf_output_symbol_hook),
2042 (patch_tls_desc_to_ie): Likewise.
2043 * elf32-spu.c (sort_bfds, print_one_overlay_section),
2044 (spu_elf_auto_overlay): Likewise.
2045 * elf64-hppa.c (elf_hppa_final_link): Likewise.
2046 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
2047 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
2048 * elflink.c (bfd_elf_size_dynamic_sections),
2049 (elf_link_input_bfd): Likewise.
2050 * linker.c (_bfd_generic_link_output_symbols): Likewise.
2051 * mach-o.c (bfd_mach_o_follow_dsym),
2052 (bfd_mach_o_close_and_cleanup): Likewise.
2053 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
2054 (find_separate_debug_file, get_build_id_name): Likewise.
2055 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2056 * plugin.c (bfd_plugin_open_input): Likewise.
2057 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
2058 * som.c (som_write_armap): Likewise.
2059 * srec.c (srec_write_record, srec_write_symbols): Likewise.
2060 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
2061 (_bfd_vms_lib_write_archive_contents): Likewise.
2062 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2064 2020-05-19 Alan Modra <amodra@gmail.com>
2067 * bfdio.c (_bfd_real_fopen): Typo fix.
2069 2020-05-18 Nick Clifton <nickc@redhat.com>
2072 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
2073 for the sections_being_created array.
2075 2020-05-18 Alan Modra <amodra@gmail.com>
2077 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
2078 they can be freed without also freeing internal_relocs.
2080 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2083 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
2084 separators into DOS style when creating a WIN32 fullpath.
2086 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
2088 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
2089 to initialize RISC-V tdata.
2091 2020-05-12 Gunther Nikl <gnikl@justmail.de>
2093 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
2096 2020-05-11 Alan Modra <amodra@gmail.com>
2098 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
2100 2020-05-11 Alan Modra <amodra@gmail.com>
2102 * elf64-ppc.c: Rename powerxx to power10 throughout.
2104 2020-05-11 Alan Modra <amodra@gmail.com>
2107 * coffgen.c (coff_get_normalized_symtab): Check that buffer
2108 contains required number of auxents before processing any auxent.
2109 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
2110 file name from auxents for PE.
2112 2020-05-04 Gunther Nikl <gnikl@justmail.de>
2114 * aout-cris.c (DEFAULT_ARCH): Delete define.
2115 (MY_set_arch_mach): Likewise.
2116 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
2118 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
2119 of r_type before the shift.
2121 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
2124 * elfnn-aarch64.c (group_sections): Copy implementation from
2127 2020-05-01 Alan Modra <amodra@gmail.com>
2130 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
2131 accessing root.u.def of symbols. Also check root.u.def.section
2132 is non-NULL. Reverse tests so as to make the logic positive.
2134 2020-05-01 Alan Modra <amodra@gmail.com>
2137 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
2138 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
2140 2020-05-01 Alan Modra <amodra@gmail.com>
2143 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
2144 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2145 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2146 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
2147 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
2148 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
2149 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
2150 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
2151 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
2152 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2154 2020-05-01 Alan Modra <amodra@gmail.com>
2157 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
2158 from shared libraries.
2160 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
2162 * elf32-xtensa.c (relax_section): Don't negate diff_value for
2163 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
2164 equals 0. Report overflow when the result has negative sign but
2165 all significant bits are zero.
2167 2020-04-29 Gunther Nikl <gnikl@justmail.de>
2169 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
2170 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2172 2020-04-28 Alan Modra <amodra@gmail.com>
2174 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
2175 Emit warning message.
2177 2020-04-27 Tamar Christina <tamar.christina@arm.com>
2179 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
2180 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
2181 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
2182 to x86_64_pe_big_vec as it not a big-endian format.
2183 (vec i386_pe_big_vec): New.
2184 * configure.ac: Likewise.
2185 * targets.c: Likewise.
2186 * configure: Regenerate.
2187 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
2188 COFF_WITH_PE_BIGOBJ): New.
2189 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
2191 (x86_64_pe_be_vec): Moved.
2193 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
2195 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
2196 * elf.c (elfcore_grok_arc_v2): New function.
2197 (elfcore_grok_note): Call the new function to handle the corresponding
2199 (elfcore_write_arc_v2): New function.
2200 (elfcore_write_register_note): Call the new function to handle the
2201 corresponding pseudo-sections.
2203 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
2206 * bfd-in2.h: Regenerated.
2207 * elf32-xtensa.c (elf_howto_table): New entries for
2208 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
2209 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
2210 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
2211 R_XTENSA_NDIFF{8,16,32}.
2212 * libbfd.h (bfd_reloc_code_real_names): Add names for
2213 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
2214 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2215 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
2216 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2218 2020-04-21 Tamar Christina <tamar.christina@arm.com>
2221 * compress.c (bfd_get_full_section_contents): Exclude sections with no
2224 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2227 * elf-bfd.h (elf_backend_data): Add
2228 elf_backend_strip_zero_sized_dynamic_sections.
2229 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
2230 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
2232 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
2234 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
2236 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
2238 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2240 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
2242 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
2244 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2246 2020-04-21 Nick Clifton <nickc@redhat.com>
2248 * po/sr.po: Updated Serbian translation.
2250 2020-04-21 Alan Modra <amodra@gmail.com>
2252 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
2255 2020-04-20 Stephen Casner <casner@acm.org>
2257 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
2258 causing globals from linker script to be treated as debug symbols.
2259 (translate_symbol_table): Don't sign-extend symbol values from 16
2260 to 64 bits in nm output.
2262 2020-04-20 Alan Modra <amodra@gmail.com>
2264 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
2266 2020-04-18 Alan Modra <amodra@gmail.com>
2268 * section.c (bfd_is_const_section): Correct test for special
2270 * bfd-in2.h: Regenerate.
2272 2020-04-17 Alan Modra <amodra@gmail.com>
2275 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
2278 2020-04-16 Nick Clifton <nickc@redhat.com>
2281 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
2282 abort with a more helpful error message.
2284 2020-04-16 Alan Modra <amodra@gmail.com>
2287 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
2290 2020-04-15 Fangrui Song <maskray@google.com>
2293 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
2294 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
2295 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2296 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
2297 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2298 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2299 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2300 * elf32-sh.c (sh_elf_relocate_section): Likewise.
2301 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2302 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2303 * elflink.c (elf_link_output_extsym): Likewise.
2304 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
2306 2020-04-15 Alan Modra <amodra@gmail.com>
2309 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
2310 pointer into strings that may be freed for section name, always
2311 allocate a new string.
2313 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2314 Jan W. Jagersma <jwjagersma@gmail.com>
2316 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
2317 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2318 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
2319 (_bfd_go32_mkobject): New functions.
2320 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
2321 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2322 (go32exe_mkobject): Call _bfd_go32_mkobject.
2323 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
2324 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
2326 (coff_write_relocs): Enable extended reloc counter code if
2327 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
2328 (coff_write_object_contents): Likewise. Pad section headers
2329 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
2330 instead of coff_swap_scnhdr_out.
2331 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
2332 enable extended reloc counter.
2333 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
2334 Declare with ATTRIBUTE_UNUSED.
2335 * libcoff-in.h: (struct coff_tdata): New field go32.
2337 * libcoff.h: Regenerate.
2339 2020-04-14 Fangrui Song <maskray@google.com>
2342 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
2345 2020-04-14 Stephen Casner <casner@acm.org>
2348 * pdp11.c: Add implementation of --imagic option.
2349 (adjust_o_magic): Fix objcopy --extract-symbol test.
2350 * libaout.h (enum aout_magic): Add i_magic.
2352 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2353 Nick Clifton <nickc@redhat.com>
2355 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
2357 <default>: Error rather than abort.
2359 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
2362 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
2363 relocation section from section group.
2365 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
2367 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
2368 bfd->origin to file offset.
2369 * bfdwin.c (bfd_get_file_window): Likewise.
2370 * bfd.c: Clarify the use of the bfd->origin field.
2371 * bfd-in2.h: Regenerate.
2372 * coff-i386.c: Don't include go32exe.h. Allow overriding
2373 coff_write_object_contents via COFF_WRITE_CONTENTS.
2374 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
2375 (go32exe_write_object_contents): New functions.
2376 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
2377 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
2378 (create_go32_stub): Remove check for 2k size limit. Read stub
2379 from go32exe_temp_stub if present.
2380 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
2381 copy variable-length stub.
2382 (go32_check_format): Read stub to go32exe_temp_stub, set
2383 origin, return go32exe_cleanup.
2384 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
2385 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
2386 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
2387 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
2388 Remove functions and their associated #defines.
2389 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
2390 * libcoff-in.h: (struct coff_tdata): New field stub_size.
2391 Rename field go32stub to stub.
2392 * libcoff.h: Regenerate.
2393 * coff-stgo32.c (go32_check_format): Rename to...
2394 (go32exe_check_format): ...this.
2395 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
2396 (go32exe_copy_private_bfd_data): ...this.
2397 (stub_bytes): Rename to...
2398 (go32exe_default_stub): ...this.
2399 (create_go32_stub): Rename to...
2400 (go32exe_create_stub): ...this.
2401 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
2404 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
2408 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
2409 relocation to R_386_32 for relocation against non-preemptible
2411 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
2412 allocate dynamic relocation for non-preemptible absolute symbol.
2413 (elf_i386_relocate_section): Pass sec to
2414 GENERATE_DYNAMIC_RELOCATION_P.
2415 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
2416 (elf_x86_64_convert_load_reloc): Covert load relocation to
2417 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
2418 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
2419 for non-preemptible absolute symbol if they overflow.
2420 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
2421 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
2422 symbol. Don't allocate dynamic relocation for non-preemptible
2424 (elf_x86_64_relocate_section): Don't generate relative relocation
2425 for GOTPCREL relocations aganst local absolute symbol. Pass sec
2426 to GENERATE_DYNAMIC_RELOCATION_P.
2427 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
2428 against non-preemptible absolute symbol.
2429 (_bfd_elf_x86_valid_reloc_p): New function.
2430 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
2432 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
2433 argument. Don't generate dynamic relocation against
2434 non-preemptible absolute symbol.
2435 (ABS_SYMBOL_P): New.
2436 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
2437 against non-preemptible absolute symbol.
2439 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
2440 (_bfd_elf_x86_valid_reloc_p): New.
2442 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2445 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
2446 address in the GOT if in thumb only mode.
2448 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2450 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
2452 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
2454 * mmo.c (mmo_scan): Create .text section only when needed, not
2457 2020-03-31 Alan Modra <amodra@gmail.com>
2459 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
2462 2020-03-31 Alan Modra <amodra@gmail.com>
2464 * vms-alpha.c (image_write): Check bounds for sections without
2465 contents too. Error on non-zero write to section without
2467 (_bfd_vms_slurp_etir): Check return of image_write* functions.
2469 2020-03-31 Alan Modra <amodra@gmail.com>
2471 * tekhex.c (pass_over): Check is_eof before reading buffer.
2473 2020-03-30 Nick Clifton <nickc@redhat.com>
2476 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
2477 field to timestamp and make it an integer.
2478 * libcoff.h: Regenerate.
2479 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
2480 field in the pe_data structure rather than the insert_timestamp
2483 2020-03-30 Alan Modra <amodra@gmail.com>
2486 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
2489 2020-03-26 Nick Clifton <nickc@redhat.com>
2491 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
2492 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
2494 * libbfd.h: Regenerate.
2496 2020-03-26 Alan Modra <amodra@gmail.com>
2498 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
2500 2020-03-26 Alan Modra <amodra@gmail.com>
2502 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
2504 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
2506 2020-03-25 Nick Clifton <nickc@redhat.com>
2508 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
2510 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
2511 * libbfd.h: Regenerate.
2513 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
2515 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
2516 correct field name in the output string.
2518 2020-03-25 Alan Modra <amodra@gmail.com>
2521 * elf.c (assign_file_positions_for_load_sections): Adjust offset
2522 for SHT_NOBITS section if first in segment.
2524 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2527 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
2528 (_bfd_elf_get_symbol_version_string): This.
2529 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
2530 (_bfd_elf_get_symbol_version_string): This.
2531 (bfd_elf_print_symbol): Pass TRUE to
2532 _bfd_elf_get_symbol_version_string.
2533 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
2534 bfd_boolean argument.
2535 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
2536 * targets.c (_bfd_get_symbol_version_string): Likewise.
2537 (bfd_get_symbol_version_string): Likewise.
2538 * bfd-in2.h: Regenerated.
2540 2020-03-24 Nick Clifton <nickc@redhat.com>
2541 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2544 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
2547 2020-03-24 Nick Clifton <nickc@redhat.com>
2550 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
2551 segment to use for PT_GNU_RELRO, ignore empty sections in a
2552 segment's current list.
2554 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2557 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2559 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2562 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
2563 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
2564 on the previous _bfd_elf_get_symbol_version_string.
2565 (_bfd_elf_get_symbol_version_string): Use it.
2567 2020-03-24 Alan Modra <amodra@gmail.com>
2569 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
2570 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
2573 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
2575 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
2577 2020-03-23 Alan Modra <amodra@gmail.com>
2579 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
2580 symbol count. Allocate an extra byte to ensure name strings
2581 are terminated. Sanity check name offsets. Release memory on
2584 2020-03-23 Alan Modra <amodra@gmail.com>
2586 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
2587 field hasn't been read. Remove unnecessary casts.
2589 2020-03-22 Alan Modra <amodra@gmail.com>
2591 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
2592 enough to read number of symbols.
2594 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
2596 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
2597 (EXECUTABLE_SUFFIX): Likewise.
2598 * config.in: Regenerated.
2599 * configure: Likewise.
2600 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
2601 _bfd_generic_close_and_cleanup.
2602 (plugin_list_entry): Remove resolution_file, resolution_option,
2603 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
2604 lto_wrapper, gcc_env and initialized,
2605 (need_lto_wrapper_p): Removed.
2606 (get_lto_wrapper): Likewise.
2607 (setup_lto_wrapper_env): Likewise.
2608 (register_all_symbols_read): Likewise.
2609 (egister_cleanup): Likewise.
2610 (get_symbols): Likewise.
2611 (add_input_file): Likewise.
2612 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
2613 (add_symbols): Updated.
2614 (try_claim): Likewise.
2615 (try_load_plugin): Likewise.
2616 (bfd_plugin_canonicalize_symtab): Likewise.
2617 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
2618 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
2620 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
2623 * plugin.c (plugin_list_entry): Add has_symbol_type.
2624 (add_symbols_v2): New function.
2625 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
2626 provides symbol type.
2627 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
2628 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
2631 2020-03-20 Alan Modra <amodra@gmail.com>
2633 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
2634 enough to read number of symbols.
2636 2020-03-20 Alan Modra <amodra@gmail.com>
2638 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
2639 backend functions for NULL before calling.
2640 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
2641 (bfd_section_from_shdr, assign_section_numbers): Likewise.
2642 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
2643 * elfnn-ia64.c (ignore_errors): New function.
2644 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
2646 2020-03-19 Nick Clifton <nickc@redhat.com>
2649 * dwarf2.c (struct varinfo): Add unit_offset field to record the
2650 location of the varinfo in the unit's debug info data. Change the
2651 type of the stack field to a boolean.
2652 (lookup_var_by_offset): New function. Returns the varinfo
2653 structure for the variable described at the given offset in the
2655 (scan_unit_for_symbols): Add support for variables which have the
2656 DW_AT_specification attribute.
2658 2020-03-19 Nick Clifton <nickc@redhat.com>
2661 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
2664 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
2666 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
2668 2020-03-18 Nick Clifton <nickc@redhat.com>
2671 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
2672 memory access when processing a corrupt secondary reloc section.
2674 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
2676 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
2677 instead of calling abort.
2678 * elf32-csky.c (csky_build_one_stub): Likewise.
2679 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2680 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2681 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2682 * elf32-metag.c (metag_build_one_stub): Likewise.
2683 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2684 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2685 (ppc_size_one_stub): Likewise.
2686 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2688 2020-03-17 Nick Clifton <nickc@redhat.com>
2691 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
2692 with error messages.
2694 2020-03-17 Nick Clifton <nickc@redhat.com>
2697 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
2698 free. Add free on another failure path.
2700 2020-03-16 Alan Modra <amodra@gmail.com>
2703 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
2704 we have a non-zero section count. Do lma comparison in octets.
2706 2020-03-16 Alan Modra <amodra@gmail.com>
2708 * vms-alpha.c (dst_restore_location): Validate index into
2709 dst_ptr_offsets array before accessing. Return status.
2710 (dst_retrieve_location): Similarly, making "loc" parameter a
2711 pointer to return value.
2712 (_bfd_vms_slurp_etir): Update calls to above functions.
2714 2020-03-14 Kamil Rytarowski <n54@gmx.com>
2716 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
2718 * configure: Regenerated.
2720 2020-03-14 Alan Modra <amodra@gmail.com>
2722 * section.c (BFD_FAKE_SECTIONS): Formatting.
2723 * bfd-in2.h: Regenerate.
2725 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2727 * elf.c (elfcore_grok_netbsd_note): Add support for
2728 NT_NETBSDCORE_LWPSTATUS notes.
2730 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
2732 * bfd-in2.h: Regenerate.
2733 * section.c (asection): Add already_assigned field.
2734 (BFD_FAKE_SECTION): Add default initializer for it.
2735 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
2736 * elf32-arm.c (arm_build_one_stub): Add support for
2737 non_contiguous_regions.
2738 * elf32-csky.c (csky_build_one_stub): Likewise.
2739 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2740 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2741 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2742 * elf32-metag.c (metag_build_one_stub): Likewise.
2743 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2744 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2745 (ppc_size_one_stub): Likewise.
2746 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2747 * elflink.c (elf_link_input_bfd): Likewise.
2749 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
2752 * elf-linker-x86.h (elf_linker_x86_params): Add
2753 static_before_all_inputs and has_dynamic_linker.
2754 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2755 dynamic input objects if -static is passed at command-line
2756 before all input files without --dynamic-linker unless
2757 --no-dynamic-linker is used.
2759 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2761 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
2763 2020-03-13 Christian Eggers <ceggers@gmx.de>
2765 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
2766 "p_paddr" from "at".
2767 * elfcode.h (bfd_from_remote_memory): Add units to several
2768 parameters. New local "opb". Fix usage of p_align. Fix
2769 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
2770 call of target_read_memory.
2771 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
2772 calculation of "offset" and "output_offset".
2773 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
2774 from "offset" and fix calculation of "end" from "vma+size". Fix
2775 comparison between "sh_addr" and "vma"/"output_offset".
2776 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
2777 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
2779 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
2780 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
2781 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
2782 assignment of p_paddr from phdr_lma. Fix comparison between
2783 "lma+size" and "next->lma".
2784 (elf_sort_segments): Fix assignment from p_paddr to lma.
2785 (assign_file_positions_for_load_sections): Add unit (bytes) to
2786 local "align". Fix calculation of local "off_adjust". Fix
2787 calculation of local "filehdr_vaddr".
2788 (assign_file_positions_for_non_load_sections): New local "opb".
2789 Fix calculation of "end" from "p_size". Fix comparison between
2790 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
2791 from "end" and "p_vaddr".
2792 (rewrite_elf_program_header): Fix comparison between p_vaddr and
2793 vma. Fix assignment to p_paddr from lma. Fix comparison between
2794 p_paddr and lma. Fix assignment to p_paddr from lma.
2795 * merge.c (sec_merge_emit): New local "opb". Convert
2796 "alignment_power" to octets.
2797 (_bfd_add_merge_section): New locals "alignment_power" and
2798 "opb". Fix comparison between "alignment_power" and
2800 (_bfd_merge_sections): New local "opb". Divide size by opb
2801 before checking align mask.
2803 2020-03-13 Christian Eggers <ceggers@gmx.de>
2805 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
2806 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
2808 (_bfd_elf_make_section_from_phdr): Similarly.
2809 (elf_fake_sections): Fix calculation of
2810 Elf_Internal_shdr::sh_addr from section VMA.
2811 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
2813 (assign_file_positions_for_load_sections): Fix calculations of
2814 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
2815 comparison between program header address and section LMA.
2816 (assign_file_positions_for_non_load_sections): Likewise.
2817 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
2818 (IS_CONTAINED_BY_VMA): Add parameter opb.
2819 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
2820 INCLUDE_SECTION_IN_SEGMENT): Likewise.
2821 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
2822 Fix calculations of p_addr_valid and p_vaddr_offset.
2823 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
2824 with octets per byte when comparing against p_vaddr.
2826 2020-03-11 Alan Modra <amodra@gmail.com>
2828 * som.c (setup_sections): Sanity check subspace.name.
2830 2020-03-11 Alan Modra <amodra@gmail.com>
2832 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2834 2020-03-10 Alan Modra <amodra@gmail.com>
2837 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2840 2020-03-09 Alan Modra <amodra@gmail.com>
2842 * wasm-module.c (wasm_scan): Sanity check file name length
2843 before allocating memory. Move common section setup code. Do
2844 without bfd_tell to calculate section size.
2846 2020-03-06 Nick Clifton <nickc@redhat.com>
2848 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2849 with error messages and failure return values.
2851 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
2853 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2854 relocation sections for any removed reference to a dynamic symbol.
2856 2020-03-05 Nick Clifton <nickc@redhat.com>
2858 * elf-bfd.h (struct elf_backend_data): Add new fields:
2859 init_secondary_reloc_section, slurp_secondary_reloc_section,
2860 write_secondary_reloc_section.
2861 (_bfd_elf_init_secondary_reloc_section): Prototype.
2862 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2863 (_bfd_elf_write_secondary_reloc_section): Prototype.
2864 * elf.c ( bfd_section_from_shdr): Invoke the new
2865 init_secondary_reloc_section backend function, if defined, when a
2866 second reloc section is encountered.
2867 (swap_out_syms): Invoke the new symbol_section_index function, if
2868 defined, when computing the section index of an OS/PROC specific
2870 (_bfd_elf_init_secondary_reloc_section): New function.
2871 (_bfd_elf_slurp_secondary_reloc_section): New function.
2872 (_bfd_elf_write_secondary_reloc_section): New function.
2873 (_bfd_elf_copy_special_section_fields): New function.
2874 * elfcode.h (elf_write_relocs): Invoke the new
2875 write_secondary_relocs function, if defined, in order to emit
2877 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2878 function, if defined, in order to read in secondary relocs.
2879 * elfxx-target.h (elf_backend_copy_special_section_fields):
2880 Provide a non-NULL default definition.
2881 (elf_backend_init_secondary_reloc_section): Likewise.
2882 (elf_backend_slurp_secondary_reloc_section): Likewise.
2883 (elf_backend_write_secondary_reloc_section): Likewise.
2884 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2886 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2887 * configure: Regenerate.
2889 2020-03-05 Alan Modra <amodra@gmail.com>
2891 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2892 against file size before allocating memory. Use bfd_alloc rather
2893 than bfd_zalloc for carsym/strings memory.
2895 2020-03-04 Alan Modra <amodra@gmail.com>
2897 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2898 sh_addr mod sh_addalign is zero.
2900 2020-03-04 Alan Modra <amodra@gmail.com>
2902 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2904 2020-03-03 Alan Modra <amodra@gmail.com>
2906 * format.c (struct bfd_preserve): Add cleanup field.
2907 (bfd_preserve_save): Add cleanup param and save.
2908 (bfd_preserve_restore): Return cleanup.
2909 (bfd_preserve_finish): Call the cleanup for the discarded match.
2910 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2911 and clear when preserving a match. Restore cleanup too when
2912 restoring that match.
2914 2020-03-02 Alan Modra <amodra@gmail.com>
2916 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2917 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2918 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2919 (core_sco5_vec): Correct initialisers.
2921 2020-03-02 Alan Modra <amodra@gmail.com>
2923 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2924 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2925 * cisco-core.c (cisco_core_file_validate): Likewise.
2926 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2927 * hpux-core.c (hpux_core_core_file_p): Likewise.
2928 * irix-core.c (irix_core_core_file_p): Likewise.
2929 * lynx-core.c (lynx_core_file_p): Likewise.
2930 * netbsd-core.c (netbsd_core_file_p): Likewise.
2931 * osf-core.c (osf_core_core_file_p): Likewise.
2932 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2933 * sco5-core.c (sco5_core_file_p): Likewise.
2935 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2937 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2939 2020-03-02 Alan Modra <amodra@gmail.com>
2941 * targets.c (bfd_cleanup): New typedef.
2942 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2943 * libbfd-in.h (_bfd_no_cleanup): Define.
2944 * format.c (bfd_reinit): Add cleanup parameter, call it.
2945 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2946 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2947 * aout-target.h (callback, object_p): Return bfd_cleanup.
2948 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2949 * archive.c (bfd_generic_archive_p): Likewise.
2950 * binary.c (binary_object_p): Likewise.
2951 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2952 * coff-ia64.c (ia64coff_object_p): Likewise.
2953 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2954 * coff-sh.c (coff_small_object_p): Likewise.
2955 * coff-stgo32.c (go32_check_format): Likewise.
2956 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2957 (xcoff64_core_p): Likewise.
2958 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2959 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2960 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2961 * elfcode.h (elf_object_p): Likewise.
2962 * elfcore.h (elf_core_file_p): Likewise.
2963 * i386msdos.c (msdos_object_p): Likewise.
2964 * ihex.c (ihex_object_p): Likewise.
2965 * libaout.h (some_aout_object_p): Likewise.
2966 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2967 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2968 * libbfd.c (_bfd_dummy_target): Likewise.
2969 * libcoff-in.h (coff_object_p): Likewise.
2970 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2971 (bfd_mach_o_arm64_core_p): Likewise.
2972 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2973 (bfd_mach_o_arm_core_p): Likewise.
2974 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2975 (bfd_mach_o_i386_core_p): Likewise.
2976 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2977 (bfd_mach_o_x86_64_core_p): Likewise.
2978 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2979 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2980 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2981 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2982 * mmo.c (mmo_object_p): Likewise.
2983 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2984 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2985 (pe_bfd_object_p): Likewise.
2986 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2987 * ppcboot.c (ppcboot_object_p): Likewise.
2988 * rs6000-core.c (rs6000coff_core_p): Likewise.
2989 * som.c (som_object_setup, som_object_p): Likewise.
2990 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2991 * tekhex.c (tekhex_object_p): Likewise.
2992 * vms-alpha.c (alpha_vms_object_p): Likewise.
2993 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2994 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2995 * wasm-module.c (wasm_object_p): Likewise.
2996 * xsym.c (bfd_sym_object_p): Likewise.
2997 * xsym.h (bfd_sym_object_p): Likewise.
2998 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
3000 * pdp11.c (some_aout_object_p): Likewise.
3001 * plugin.c (register_ld_plugin_object_p): Update object_p
3003 * plugin.h (register_ld_plugin_object_p): Likewise.
3004 * bfd-in2.h: Regenerate.
3005 * libbfd.h: Regenerate.
3006 * libcoff.h: Regenerate.
3008 2020-03-02 Alan Modra <amodra@gmail.com>
3010 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
3011 applicable section flags.
3012 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
3013 (mips_ecoff_bele_vec): Likewise.
3014 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
3016 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
3017 (_bfd_ecoff_styp_to_sec_flags): Likewise.
3019 2020-03-02 Alan Modra <amodra@gmail.com>
3021 * elf32-m32r.c (m32r_elf_section_flags): New function.
3022 (elf_backend_section_flags): Define.
3023 * elf32-nds32.c (nds32_elf_section_flags): New function.
3024 (elf_backend_section_flags): Define.
3025 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
3026 .sbss and .sdata sections.
3027 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
3028 for SHF_V850_GPREL sections.
3029 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
3031 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
3032 for SHF_PARISC_SHORT sections.
3033 * elf64-ppc.c (ppc64_elf_section_flags): New function.
3034 (elf_backend_section_flags): Define.
3035 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
3036 for SHF_MIPS_GPREL sections. Delete FIXME.
3038 2020-03-02 Alan Modra <amodra@gmail.com>
3040 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
3041 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
3042 calling elf_backend_section_flags with adjusted params. Use
3043 newsect->flags past that point.
3044 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
3046 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
3047 to have their type overridden, and all sh_flags but processor and
3049 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
3050 * elf32-mep.c (mep_elf_section_flags): Likewise.
3051 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
3052 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
3053 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
3054 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
3055 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
3056 stub BFD and non-aarch64 input files when scanning for stubs.
3058 2020-03-02 Alan Modra <amodra@gmail.com>
3060 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
3061 limit to decompressed element size.
3063 2020-03-02 Alan Modra <amodra@gmail.com>
3065 * vms-lib.c (vms_traverse_index): Add recur_count param and
3066 update calls. Fail on excessive recursion.
3068 2020-03-02 Alan Modra <amodra@gmail.com>
3070 * vms-alpha.c (vms_get_remaining_object_record): Use
3071 bfd_realloc_or_free rather than bfd_realloc.
3072 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
3073 (dst_define_location, parse_module): Likewise, and check realloc
3074 return status before using memory. Return status from function
3075 adjusting all callers.
3077 2020-02-28 Alan Modra <amodra@gmail.com>
3079 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
3081 2020-02-28 Alan Modra <amodra@gmail.com>
3083 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
3084 Remove duplicate undersize check.
3086 2020-02-27 Alan Modra <amodra@gmail.com>
3089 * mmo.c (mmo_scan): Set SEC_DATA for .data.
3091 2020-02-27 Alan Modra <amodra@gmail.com>
3094 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
3095 (coff_section_type): Adjust comment.
3096 (decode_section_type): Likewise. Call coff_section_type before
3097 decode_section_type.
3098 (bfd_decode_symclass): Use 'c' for common sections other than
3101 2020-02-27 Alan Modra <amodra@gmail.com>
3103 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
3106 2020-02-27 Alan Modra <amodra@gmail.com>
3108 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
3109 if file is an archive element.
3110 * bfd-in2.h: Regenerate.
3112 2020-02-26 Alan Modra <amodra@gmail.com>
3114 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
3115 bfd_set_error on failing test. Don't bother changing bfd_error on
3116 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
3117 Check sym name is within string buffer. Use size_t for some vars.
3118 (do_slurp_coff_armap): Use size_t for some variables, fix size of
3119 int_buf. Don't change bfd_error on file read error. Use
3120 _bfd_mul_overflow when calculating carsym buffer size. Reorder
3121 calculations to catch overflows before they occur. malloc and
3122 free raw armap rather than using bfd_alloc. Read raw armap before
3123 allocating carsym+strings buffer.
3124 (_bfd_slurp_extended_name_table): Localize variables. Check
3125 name size against file size.
3127 2020-02-26 Alan Modra <amodra@gmail.com>
3129 * vms-lib.c (vms_lib_read_index): Release correct buffer.
3131 2020-02-26 Alan Modra <amodra@gmail.com>
3133 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
3134 malloc. Check for NULL return from bfd_malloc.
3135 (rx_table_find, rx_table_map): Likewise.
3136 (rx_set_section_contents): Check bfd_alloc return.
3137 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
3139 2020-02-26 Alan Modra <amodra@gmail.com>
3141 * aoutx.h: Indent labels correctly. Format error strings.
3142 * archive.c: Likewise.
3143 * archive64.c: Likewise.
3144 * coff-arm.c: Likewise.
3145 * coff-rs6000.c: Likewise.
3146 * coff-stgo32.c: Likewise.
3147 * cpu-arm.c: Likewise.
3148 * dwarf2.c: Likewise.
3149 * elf-ifunc.c: Likewise.
3150 * elf-properties.c: Likewise.
3151 * elf-s390-common.c: Likewise.
3152 * elf-strtab.c: Likewise.
3154 * elf32-arm.c: Likewise.
3155 * elf32-bfin.c: Likewise.
3156 * elf32-cr16.c: Likewise.
3157 * elf32-csky.c: Likewise.
3158 * elf32-i386.c: Likewise.
3159 * elf32-m68k.c: Likewise.
3160 * elf32-msp430.c: Likewise.
3161 * elf32-nds32.c: Likewise.
3162 * elf32-nios2.c: Likewise.
3163 * elf32-pru.c: Likewise.
3164 * elf32-xtensa.c: Likewise.
3165 * elf64-ia64-vms.c: Likewise.
3166 * elf64-x86-64.c: Likewise.
3167 * elfcode.h: Likewise.
3168 * elfcore.h: Likewise.
3169 * elflink.c: Likewise.
3170 * elfnn-aarch64.c: Likewise.
3171 * elfnn-ia64.c: Likewise.
3172 * elfnn-riscv.c: Likewise.
3173 * elfxx-mips.c: Likewise.
3174 * elfxx-sparc.c: Likewise.
3175 * elfxx-x86.c: Likewise.
3176 * i386lynx.c: Likewise.
3177 * merge.c: Likewise.
3178 * pdp11.c: Likewise.
3179 * plugin.c: Likewise.
3180 * reloc.c: Likewise.
3182 2020-02-26 Alan Modra <amodra@gmail.com>
3185 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
3187 (bfd_elf_add_dt_needed_tag): Declare.
3188 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
3189 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
3190 from elf_add_dt_needed_tag. Remove soname and doit param.
3191 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
3192 to see whether as-needed lib is already loaded, use dyn_loaded
3193 list instead. When saving and restoring around as-needed lib
3194 handle possibility that dynstr has not been initialised. Don't
3195 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
3196 Mark libs loaded via DT_NEEDED entries of other libs with
3197 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
3199 (elf_link_check_versioned_symbol): Remove now unneccesary
3200 DYNAMIC check when traversing dyn_loaded list.
3202 2020-02-26 Alan Modra <amodra@gmail.com>
3204 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
3206 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
3209 * plugin.c (need_lto_wrapper_p): New.
3210 (bfd_plugin_set_program_name): Add an int argument to set
3212 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
3214 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
3216 2020-02-24 Alan Modra <amodra@gmail.com>
3218 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
3220 2020-02-24 Alan Modra <amodra@gmail.com>
3222 * vms-lib.c (struct carsym_mem): Add limit.
3223 (vms_add_index): Heed limit.
3224 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
3225 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
3226 Always return actual number read.
3227 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
3228 assertion with error exit.
3230 2020-02-22 Alan Modra <amodra@gmail.com>
3233 * elf.c (assign_file_positions_for_load_sections): Continue linking
3234 on "PHDR segment not covered by LOAD segment" errors.
3236 2020-02-21 Alan Modra <amodra@gmail.com>
3238 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
3240 (bfd_mach_o_canonicalize_reloc): Likewise.
3241 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
3242 counts and offsets against file size.
3243 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
3244 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
3245 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
3246 against file size. Delete symbol table error message.
3247 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
3249 (bfd_mach_o_read_symtab): Likewise.
3250 (bfd_mach_o_read_command): Pass file size.
3251 (bfd_mach_o_scan): Sanity check command count against file size.
3253 2020-02-21 Alan Modra <amodra@gmail.com>
3256 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
3257 "text", "data" and "bss" section pointer vars. Don't update
3258 section size, just exec header sizes.
3259 (adjust_sizes_and_vmas): Don't update text section size. Set
3260 initial exec header a_text. Print exec headers sizes.
3261 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
3262 (adjust_sizes_and_vmas): Similarly. Formatting.
3263 (final_link): Correct final file extension.
3265 2020-02-20 Nick Clifton <nickc@redhat.com>
3267 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
3269 * elfxx-target.h (elf_backend_symbol_section_index): Provide
3271 (elfNN_bed): Initialise the symbol_section_index field.
3272 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
3273 OS and PROC specific section indicies. Warn if converting other
3274 reserved incidies to SHN_ABS.
3276 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
3279 * cpu-z80.c: Add machine type compatibility checking.
3281 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
3284 * plugin.c (plugin_list_entry): Remove handle.
3285 (try_load_plugin): Call dlclose before return.
3287 2020-02-19 Alan Modra <amodra@gmail.com>
3289 * libbfd-in.h (_bfd_constant_p): Define.
3290 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
3291 file size before allocating memory.
3292 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
3293 * elf.c (bfd_elf_get_str_section): Likewise.
3294 (_bfd_elf_slurp_version_tables): Likewise.
3295 * libbfd.h: Regenerate.
3297 2020-02-19 Alan Modra <amodra@gmail.com>
3299 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
3300 * aoutx.h (aout_get_external_symbols): Replace calls to
3301 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
3302 (slurp_reloc_table): Likewise.
3303 * archive.c (do_slurp_bsd_armap): Likewise.
3304 (do_slurp_coff_armap): Likewise.
3305 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
3306 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
3307 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
3308 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
3309 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
3310 (_bfd_coff_get_external_symbols): Likewise.
3311 * ecoff.c (ecoff_slurp_symbolic_header),
3312 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
3313 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
3314 (ecoff_indirect_link_order): Likewise.
3315 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
3316 (_bfd_elf_slurp_version_tables): Likewise.
3317 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3318 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3319 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3320 * elf64-alpha.c (READ): Likewise.
3321 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
3322 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3323 * elfcode.h (elf_slurp_symbol_table),
3324 (elf_slurp_reloc_table_from_section): Likewise.
3325 * elflink.c (elf_link_add_object_symbols),
3326 (elf_link_check_versioned_symbol): Likewise.
3327 * elfxx-mips.c (READ): Likewise.
3328 * i386lynx.c (slurp_reloc_table): Likewise.
3329 * lynx-core.c (lynx_core_file_p): Likewise.
3330 * mach-o.c (bfd_mach_o_canonicalize_relocs),
3331 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
3332 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
3333 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
3334 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
3335 (bfd_pef_parse_symbols): Likewise.
3336 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
3337 * som.c (setup_sections, som_slurp_string_table),
3338 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3339 (som_bfd_fill_in_ar_symbols): Likewise.
3340 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
3341 (evax_bfd_print_image): Likewise.
3342 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
3343 * wasm-module.c (wasm_scan): Likewise.
3344 * xcofflink.c (xcoff_link_add_symbols): Likewise.
3345 * xsym.c (bfd_sym_read_name_table),
3346 (bfd_sym_print_type_information_table_entry): Likewise.
3347 * libbfd.h: Regenerate.
3349 2020-02-19 Alan Modra <amodra@gmail.com>
3351 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
3352 reading external relocs.
3353 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
3354 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
3356 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
3358 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
3359 (m32c_elf_relax_section): Likewise.
3360 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
3361 (rl78_elf_relax_section): Likewise.
3362 * elf32-rx.c (rx_offset_for_reloc): Likewise.
3363 (elf32_rx_relax_section): Likewise.
3364 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
3365 parameter types and use..
3366 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
3367 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
3368 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
3369 being read from file, just the extra.
3370 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
3371 after reading external syms. Free on failure.
3373 2020-02-19 Alan Modra <amodra@gmail.com>
3375 * coffcode.h (buy_and_read, coff_slurp_line_table),
3376 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
3377 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
3378 corresponding bfd_alloc call. Adjust variables to suit.
3379 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
3380 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
3381 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
3382 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
3383 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
3384 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3385 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3386 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3387 * elf64-alpha.c (READ): Likewise.
3388 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
3389 (elf_slurp_symbol_table, elf_slurp_reloc_table),
3390 (bfd_from_remote_memory): Likewise.
3391 * elfcore.h (core_find_build_id): Likewise.
3392 * elfxx-mips.c (READ): Likewise.
3393 * mach-o.c (bfd_mach_o_mangle_sections),
3394 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
3395 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
3396 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
3397 * som.c (setup_sections, som_prep_for_fixups)
3398 (som_build_and_write_symbol_table, som_slurp_symbol_table),
3399 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3400 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
3401 (som_bfd_ar_write_symbol_stuff): Likewise.
3402 * vms-alpha.c (vector_grow1): Likewise.
3403 * vms-lib.c (vms_add_index): Likewise.
3404 * wasm-module.c (wasm_scan_name_function_section): Likewise.
3405 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
3406 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
3407 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
3408 (bfd_alloc2, bfd_zalloc2): Delete.
3409 (_bfd_mul_overflow): Define.
3410 * libbfd.h: Regenerate.
3412 2020-02-19 Alan Modra <amodra@gmail.com>
3414 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
3416 (assign_section_numbers): Likewise.
3417 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
3418 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
3419 bfd_malloc2, size_t amt, and unsigned tls_count.
3420 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
3421 * elflink.c (elf_create_symbuf): Use bfd_malloc.
3422 (elf_output_implib): Use bfd_alloc.
3424 2020-02-19 Alan Modra <amodra@gmail.com>
3426 * bfd.c (struct bfd): Move format and direction to other
3427 bitfields. Add "size".
3428 * bfdio.c (bfd_get_size): Cache size when not writing file.
3429 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
3430 returning zero, ie. unknown.
3431 (bfd_get_alt_debug_link_info): Likewise.
3432 * bfd-in2.h: Regenerate.
3434 2020-02-19 Alan Modra <amodra@gmail.com>
3436 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
3437 bfd_get_file_size twice.
3438 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
3439 zero, ie. unknown, return.
3440 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
3441 * elfcode.h (elf_swap_shdr_in): Likewise.
3442 (elf_object_p): Don't call bfd_get_file_size twice and correct
3445 2020-02-19 Alan Modra <amodra@gmail.com>
3447 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
3448 FALSE if memory alloc fails. Adjust calls.
3449 * som.c (som_prep_for_fixups): Likewise.
3450 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
3451 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
3452 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
3453 * som.c (som_build_and_write_symbol_table): Return via error_return
3455 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
3456 (VEC_APPEND_EL): Delete.
3457 (vector_grow1): Return pointer to element. Catch overflow.
3458 Return NULL on memory allocation failure.
3459 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
3460 (alpha_vms_add_fixup_ca): Likewise.
3461 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
3463 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
3465 2020-02-19 Alan Modra <amodra@gmail.com>
3467 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
3468 * aout-target.h (object_p): Likewise.
3469 * aout-tic30.c (tic30_aout_object_p): Likewise.
3470 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
3471 (emit_stringtab, write_syms, link_hash_table_create),
3472 (aout_link_write_other_symbol): Likewise.
3473 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
3474 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
3475 (_bfd_compute_and_write_armap): Likewise.
3476 * archures.c (bfd_arch_list): Likewise.
3477 * bfd.c (bfd_record_phdr): Likewise.
3478 * binary.c (binary_canonicalize_symtab): Likewise.
3479 * cisco-core.c (cisco_core_file_validate): Likewise.
3480 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
3481 (find_arm_glue, record_arm_to_thumb_glue),
3482 (record_thumb_to_arm_glue): Likewise.
3483 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
3484 (ppc_allocate_toc_section): Likewise.
3485 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
3486 * coff-sh.c (sh_relax_section): Likewise.
3487 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
3488 * coffcode.h (handle_COMDAT, coff_new_section_hook),
3489 (coff_set_alignment_hook, coff_mkobject),
3490 (coff_compute_section_file_positions): Likewise.
3491 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
3492 (coff_find_nearest_line_with_names),
3493 ( bfd_coff_set_symbol_class): Likewise.
3494 * cofflink.c (_bfd_coff_link_hash_table_create),
3495 (_bfd_coff_link_input_bfd): Likewise.
3496 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
3497 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
3498 (build_line_info_table, sort_line_sequences),
3499 (line_info_add_include_dir, line_info_add_file_name),
3500 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
3501 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
3502 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
3503 (_bfd_ecoff_find_nearest_line),
3504 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
3505 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
3506 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
3507 * elf-m10300.c (mn10300_elf_relax_section),
3508 (elf32_mn10300_link_hash_table_create): Likewise.
3509 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
3510 * elf.c (make_mapping, copy_elf_program_header): Likewise.
3511 * elf32-arm.c (elf32_arm_link_hash_table_create),
3512 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
3513 (elf32_arm_new_section_hook): Likewise.
3514 * elf32-avr.c (elf_avr_new_section_hook),
3515 (elf32_avr_link_hash_table_create, get_local_syms),
3516 (elf32_avr_setup_section_lists): Likewise.
3517 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
3518 (bfin_link_hash_table_create): Likewise.
3519 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
3520 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
3521 * elf32-csky.c (csky_elf_link_hash_table_create),
3522 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
3523 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
3524 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
3525 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
3526 * elf32-i386.c (elf_i386_check_relocs): Likewise.
3527 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
3528 * elf32-m32r.c (m32r_elf_link_hash_table_create),
3529 (m32r_elf_check_relocs): Likewise.
3530 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
3531 (elf32_m68hc11_setup_section_lists),
3532 (elf32_m68hc11_size_stubs): Likewise.
3533 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
3534 * elf32-metag.c (elf_metag_link_hash_table_create),
3535 (elf_metag_setup_section_lists): Likewise.
3536 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
3537 (microblaze_elf_check_relocs): Likewise.
3538 * elf32-nds32.c (nds32_elf_link_hash_table_create),
3539 (nds32_elf_check_relocs): Likewise.
3540 * elf32-nios2.c (nios2_elf32_setup_section_lists),
3541 (get_local_syms, nios2_elf32_check_relocs),
3542 (nios2_elf32_link_hash_table_create): Likewise.
3543 * elf32-or1k.c (or1k_elf_link_hash_table_create),
3544 (or1k_elf_check_relocs): Likewise.
3545 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
3546 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
3547 * elf32-s390.c (elf_s390_link_hash_table_create),
3548 (elf_s390_check_relocs): Likewise.
3549 * elf32-score.c (score_elf_create_got_section),
3550 (s3_elf32_score_new_section_hook),
3551 (elf32_score_link_hash_table_create): Likewise.
3552 * elf32-score7.c (score_elf_create_got_section),
3553 (s7_elf32_score_new_section_hook): Likewise.
3554 * elf32-sh.c (sh_elf_link_hash_table_create),
3555 (sh_elf_check_relocs): Likewise.
3556 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
3557 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
3558 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
3559 (tilepro_elf_check_relocs): Likewise.
3560 * elf32-v850.c (remember_hi16s_reloc): Likewise.
3561 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
3562 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
3563 (elf_xtensa_new_section_hook): Likewise.
3564 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
3565 (get_got_entry, elf64_alpha_check_relocs): Likewise.
3566 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
3567 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
3568 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
3569 * elf64-ppc.c (ppc64_elf_new_section_hook),
3570 (ppc64_elf_link_hash_table_create, update_local_sym_info),
3571 (update_plt_info, ppc64_elf_check_relocs): Likewise.
3572 * elf64-s390.c (elf_s390_link_hash_table_create),
3573 (elf_s390_check_relocs): Likewise.
3574 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
3575 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
3576 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
3577 (elf_link_add_archive_symbols, compute_bucket_count),
3578 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
3579 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
3580 (bfd_elf_final_link): Likewise.
3581 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
3582 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
3583 (elfNN_aarch64_new_section_hook): Likewise.
3584 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
3585 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
3586 (riscv_elf_check_relocs): Likewise.
3587 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
3588 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
3589 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
3590 (_bfd_mips_elf_link_hash_table_create): Likewise.
3591 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
3592 (_bfd_sparc_elf_check_relocs),
3593 (_bfd_sparc_elf_new_section_hook): Likewise.
3594 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
3595 (tilegx_elf_check_relocs): Likewise.
3596 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
3597 * format.c (bfd_check_format_matches): Likewise.
3598 * hash.c (_bfd_stringtab_init): Likewise.
3599 * ihex.c (ihex_scan): Likewise.
3600 * irix-core.c (irix_core_core_file_p): Likewise.
3601 * linker.c (bfd_wrapped_link_hash_lookup),
3602 (_bfd_generic_link_hash_table_create),
3603 (_bfd_generic_reloc_link_order): Likewise.
3604 * lynx-core.c (lynx_core_file_p): Likewise.
3605 * netbsd-core.c (netbsd_core_file_p): Likewise.
3606 * osf-core.c (osf_core_core_file_p): Likewise.
3607 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
3608 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
3609 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
3610 * peicode.h (pe_mkobject): Likewise.
3611 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
3612 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3613 * sco5-core.c (read_uarea): Likewise.
3614 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
3615 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
3616 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
3617 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
3618 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
3619 * srec.c (srec_scan): Likewise.
3620 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
3621 * targets.c (bfd_target_list): Likewise.
3622 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
3623 * trad-core.c (trad_unix_core_file_p): Likewise.
3624 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
3625 (vms_new_section_hook): Likewise.
3626 * wasm-module.c (wasm_make_empty_symbol): Likewise.
3627 * xcofflink.c (xcoff_get_section_contents),
3628 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
3629 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
3630 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
3632 2020-02-19 Alan Modra <amodra@gmail.com>
3634 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
3636 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
3638 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
3639 and use it if it isn't NULL. Remove has_plugin_p argument. Add
3640 a build_list_p argument. Don't search plugin_list. Short circuit
3641 when building the plugin list.
3642 (has_plugin): Renamed to has_plugin_list.
3643 (bfd_plugin_set_plugin): Don't set has_plugin.
3644 (bfd_plugin_specified_p): Check plugin_list instead.
3645 (build_plugin_list): New function.
3646 (load_plugin): Call build_plugin_list and use plugin_list.
3648 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3651 * plugin.c (try_claim): Always clean up for LTO wrapper.
3652 (try_load_plugin): Treat each object as independent. Create a
3653 copy for plugin name.
3655 2020-02-11 Nick Clifton <nickc@redhat.com>
3657 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
3658 for addresses in print statements.
3659 (msp430_elf_relax_delete_bytes): Likewise.
3660 (msp430_elf_relax_add_words): Likewise.
3661 (msp430_elf_relax_section): Likewise.
3663 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3665 * plugin.c (add_symbols): Clear plugin_data memory.
3667 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
3670 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
3671 (EXECUTABLE_SUFFIX): Likewise.
3672 * config.in: Regenerated.
3673 * configure: Likewise.
3674 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
3675 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
3676 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
3677 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
3678 (get_lto_wrapper): New.
3679 (setup_lto_wrapper_env): Likewise.
3680 (current_plugin): Likewise.
3681 (register_all_symbols_read): Likewise.
3682 (register_cleanup): Likewise.
3683 (get_symbols): Likewise.
3684 (add_input_file): Likewise.
3685 (bfd_plugin_close_and_cleanup): Likewise.
3686 (claim_file): Removed.
3687 (register_claim_file): Set current_plugin->claim_file.
3688 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
3689 lto_syms in current_plugin.
3690 (try_claim): Use current_plugin->claim_file. Call LTO plugin
3691 all_symbols_read handler. Copy real symbols to plugin_data.
3692 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
3693 (try_load_plugin): Don't reuse the previous plugin for LTO
3694 wrapper. Set up GCC LTO wrapper if possible. Don't set
3695 plugin_list_iter->claim_file.
3696 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
3698 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
3701 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3703 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
3704 check if previous instruction matches a conditional jump inserted
3705 earlier. Invert conditional jump and delete branch in this case.
3707 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3709 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
3710 msp430_elf_relax_add_words. Support insertion of either one or two
3712 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
3713 needs to be grown. Handle insertion of branch instruction to replace
3716 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3718 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
3719 debugging relocations.
3720 (msp430_elf_relax_delete_bytes): Likewise.
3721 (msp430_elf_relax_add_two_words): Likewise.
3722 (msp430_elf_relax_section): Likewise.
3724 2020-02-10 Alan Modra <amodra@gmail.com>
3726 * archures.c: Wrap overlong z80 comments.
3727 * bfd-in2.h: Regenerate.
3729 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
3732 * archures.c: Add GBZ80 and Z80N machine values.
3733 * reloc.c: Add BFD_RELOC_Z80_16_BE.
3734 * coff-z80.c: Add support for new reloc.
3735 * coffcode.h: Add support for new machine values.
3736 * cpu-z80.c: Add support for new machine names.
3737 * elf32-z80.c: Add support for new reloc.
3738 * bfd-in2.h: Regenerate.
3739 * libbfd.h: Regenerate.
3741 2020-02-07 Nick Clifton <nickc@redhat.com>
3744 * elf.c (rewrite_elf_program_header): Do not complain if no
3745 sections are mapped to a segment.
3747 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3750 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
3751 for garbage collection on __patchable_function_entries section
3752 without linked-to section.
3754 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3757 * bfd-in2.h: Regenerated.
3758 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
3759 on section if gc_mark of any of its linked-to sections is set
3760 and don't set gc_mark again.
3761 * section.c (asection): Add linked_to_symbol_name to map_head
3764 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
3766 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
3767 reporting an unrecognized instruction with R_V850_LONGJUMP.
3769 2020-02-05 Alan Modra <amodra@gmail.com>
3771 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
3773 2020-02-04 Alan Modra <amodra@gmail.com>
3775 * elf32-ppc.c (ppc_elf_relocate_section): After applying
3776 R_PPC_VLE_ADDR20, goto copy_reloc.
3778 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3780 * bfd-in2.h: Regenerated.
3781 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
3783 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3786 * bfd-in2.h: Regenerated.
3787 * ecoff.c (bfd_debug_section): Add section_id.
3788 * section.c (bfd_section): Add section_id.
3789 (SEC_ASSEMBLER_SECTION_ID): New.
3790 (BFD_FAKE_SECTION): Add section_id.
3792 2020-02-01 Nick Clifton <nickc@redhat.com>
3794 * config.bfd: Move the c30-aout and tic30-aout targets onto the
3797 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
3799 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
3800 encodings are relative to the GOT on nios2, too.
3802 2020-01-31 Alan Modra <amodra@gmail.com>
3804 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
3805 file. Use $< and $@ in rules.
3806 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
3807 (elf32-ia64.c, elf64-ia64.c): Likewise.
3808 (elf32-riscv.c, elf64-riscv.c): Likewise.
3809 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3810 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
3811 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
3812 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
3813 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3814 * Makefile.in: Regenerate.
3816 2020-01-31 Alan Modra <amodra@gmail.com>
3819 * elf.c (setup_group): Don't clear entire section contents,
3820 just the padding after group flags. Release alloc'd memory
3821 after a seek or read failure.
3823 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3825 * peXXigen.c (pe_is_repro): New function.
3826 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
3827 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
3829 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3831 * peXXigen.c (debug_type_names): Add names for new debug data type
3834 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3836 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3837 inner loop. Fix a memory leak.
3839 2020-01-30 Alan Modra <amodra@gmail.com>
3841 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3842 or obj_coff_keep_strings here.
3843 (coff_get_normalized_symtab): Free external syms directly.
3844 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3847 2020-01-27 Jim Wilson <jimw@sifive.com>
3849 * cpu-riscv.c (riscv_scan): New.
3850 (N): Change bfd_default_scan to riscv_scan.
3852 2020-01-27 Andreas Schwab <schwab@suse.de>
3854 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3855 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3856 * Makefile.in: Regenerate.
3857 * cpu-plugin.c: Remove.
3858 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3859 (bfd_plugin_arch): Remove declaration.
3860 * bfd-in2.h: Regenerate.
3861 * po/SRC-POTFILES.in: Regenerate.
3863 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
3864 Alan Modra <amodra@gmail.com>
3867 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3869 2020-01-24 Jim Wilson <jimw@sifive.com>
3871 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3872 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3873 avoid over long line.
3875 2020-01-24 Nick Clifton <nickc@redhat.com>
3878 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3879 syms and keep strings flags as these may have been set in order to
3880 prevent a bogus call to free.
3882 2020-01-23 Nick Clifton <nickc@redhat.com>
3884 * po/fr.po: Updated French translation.
3886 2020-01-23 Alan Modra <amodra@gmail.com>
3889 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3890 by zero when p_align is zero.
3892 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3894 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3895 (riscv_prefix_cmp): Likewise.
3896 (riscv_non_std_ext_p): Deleted.
3897 (riscv_std_sv_ext_p): Likewise.
3898 (riscv_non_std_sv_ext_p): Likewise.
3899 (riscv_merge_non_std_and_sv_ext): Rename to...
3900 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3901 (riscv_merge_arch_attr_info): Replace 3 calls to
3902 riscv_merge_non_std_and_sv_ext with single call to
3903 riscv_merge_multi_letter_ext.
3904 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3905 encounter a 'z' prefix.
3906 (riscv_get_prefix_class): New function, return prefix class based
3907 on first few characters of input string.
3908 (riscv_parse_config): New structure to factor out minor differences
3909 in extension class parsing behaviour.
3910 (riscv_parse_sv_or_non_std_ext): Rename to...
3911 (riscv_parse_prefixed_ext): and parameterise with
3913 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3914 (riscv_multi_letter_ext_valid_p): New.
3915 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3916 (riscv_parse_subset): Delegate all non-single-letter parsing work
3917 to riscv_parse_prefixed_ext.
3918 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3919 (riscv_get_prefix_class): Declare.
3921 2020-01-22 Alan Modra <amodra@gmail.com>
3923 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3924 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3925 __tls_get_addr_desc.
3926 (ppc64_elf_size_stubs): Add section for linker generated
3927 __tls_get_addr_desc wrapper function. Loop at least once if
3928 generating this function.
3929 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3930 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3932 2020-01-22 Alan Modra <amodra@gmail.com>
3934 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3935 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3937 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3938 (STDU_R1_0R1, ADDI_R1_R1): Define.
3939 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3940 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3941 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3942 no_tls_get_addr_regsave.
3943 (branch_reloc_hash_match): Add hash3 and hash4.
3944 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3945 (ppc64_elf_size_dynamic_sections): Likewise.
3946 (ppc64_elf_relocate_section): Likewise.
3947 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3948 __tls_get_addr stub.
3949 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3951 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3952 eh_frame for regsave __tls_get_addr.
3954 2020-01-22 Alan Modra <amodra@gmail.com>
3956 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3957 which __tls_get_addr calls will be eliminated.
3959 2020-01-20 Nick Clifton <nickc@redhat.com>
3961 * po/pt.po: Updates Portuguese translation.
3962 * po/ru.po: Updated Russian translation.
3963 * po/uk.po: Updated Ukranian translation.
3965 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3968 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3969 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3971 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3972 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3973 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3974 "rex leal x@tlsdesc(%rip), %reg" to
3975 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3976 "call *(%eax)" to "nopl (%rax)".
3978 2020-01-20 Alan Modra <amodra@gmail.com>
3980 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3981 (MTLR_R11): Don't define.
3982 (LD_R0_0R3, CMPDI_R0_0): Define.
3983 (build_tls_get_addr_stub): Don't use r11 in stub.
3985 2020-01-20 Alan Modra <amodra@gmail.com>
3987 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3988 (defined_sym_val, is_tls_get_addr): Likewise.
3990 2020-01-18 Nick Clifton <nickc@redhat.com>
3992 * version.m4 (BFD_VERSION): Set to 2.34.50.
3993 * configure: Regenerate.
3994 * po/bfd.pot: Regenerate.
3996 2020-01-18 Nick Clifton <nickc@redhat.com>
3998 Binutils 2.34 branch created.
4000 2020-01-17 Christian Biesinger <cbiesinger@google.com>
4002 * coff-arm.c: Fix spelling error (seperate).
4003 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
4005 * sysdep.h (strnlen): Fix spelling error (seperate).
4007 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
4010 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
4012 2020-01-15 Alan Modra <amodra@gmail.com>
4015 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
4016 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
4017 of function symbols unless dot symbols are present. Do warn
4018 whenever one is created, regardles of whether a PLT entry is
4019 also emitted for the function symbol.
4021 2020-01-14 Alan Modra <amodra@gmail.com>
4023 * som.c (som_bfd_count_ar_symbols): Error when file position
4024 of symbols on chains is not strictly increasing.
4026 2020-01-14 Alan Modra <amodra@gmail.com>
4028 * vms.h (VMS_DEBUG): Define as 0.
4029 * vms-alpha.c (image_write): Move debug output after bounds check.
4031 (_bfd_vms_slurp_eihd): Warning fix.
4032 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
4034 2020-01-13 Alan Modra <amodra@gmail.com>
4036 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
4037 for "ignored" records.
4039 2020-01-13 Alan Modra <amodra@gmail.com>
4041 * wasm-module.c (wasm_scan_name_function_section): Formatting.
4042 Delete asect name check. Move asect NULL check to wasm_object_p.
4043 Correct bounds check of sizes against end. Replace uses of
4044 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
4045 just one bfd_release.
4046 (wasm_scan): Don't use malloc/strdup for section names,
4047 bfd_alloc instead. Simplify code prefixing section name.
4048 Formatting. Don't attempt to free memory here..
4049 (wasm_object_p): ..do so here.
4051 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
4054 * elf32-arm.c (elf32_arm_final_link_relocate): Use
4055 UNDEFWEAK_NO_DYNAMIC_RELOC.
4056 (allocate_dynrelocs_for_symbol): Likewise.
4058 2020-01-10 Tamar Christina <tamar.christina@arm.com>
4061 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
4063 2020-01-10 Alan Modra <amodra@gmail.com>
4065 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
4067 2020-01-09 Nick Clifton <nickc@redhat.com>
4070 * bfd.c (bfd_convert_section_contents): Check for a compress
4071 header size that is larger than the actual section size.
4073 2020-01-08 Alan Modra <amodra@gmail.com>
4076 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
4077 after removing sections.
4079 2020-01-06 Jim Wilson <jimw@sifive.com>
4082 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
4083 check for !bfd_link_pic (info).
4084 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
4085 <R_RISCV_JAL>: Add comment.
4086 (_bfd_riscv_relax_section): For plt.offset check, add check for
4087 bfd_link_pic (info). Add comment.
4089 2020-01-06 Alan Modra <amodra@gmail.com>
4091 * format.c (bfd_check_format_matches): Ignore bfd_error on target
4092 match failures. Don't init to bfd_error_wrong_format before
4093 calling _bfd_check_format.
4095 2020-01-06 Alan Modra <amodra@gmail.com>
4097 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
4098 status rather than exiting on stack overflow or underflow.
4099 (_bfd_vms_slurp_etir): Adjust to suit.
4101 2020-01-06 Alan Modra <amodra@gmail.com>
4103 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
4105 2020-01-06 Alan Modra <amodra@gmail.com>
4107 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
4108 command. Check name offset is within command.
4109 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
4110 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
4111 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
4112 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
4113 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
4114 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
4115 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
4116 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
4117 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
4118 (bfd_mach_o_read_segment): Similarly.
4119 (bfd_mach_o_read_thread): Properly bound check thread struct.
4120 Don't repeat checks on second loop.
4121 (bfd_mach_o_read_command): Fail on invalid command length.
4123 2020-01-04 Alan Modra <amodra@gmail.com>
4125 * format.c (bfd_check_format_matches): Add preserve_match.
4126 Save initial bfd state in "preserve", matched bfd state in
4127 "preserve_match". Save just the first match. Release
4128 bfd_alloc memory. Restore and finish preserved state as
4129 appropriate on all function exit paths.
4131 2020-01-04 Alan Modra <amodra@gmail.com>
4133 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
4135 2020-01-04 Alan Modra <amodra@gmail.com>
4137 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
4140 2020-01-03 Nick Clifton <nickc@redhat.com>
4143 (bfd_pef_parse_function_stubs): Correct the test that ensures that
4144 there is enough data remaining in the code buffer before
4145 attempting to read a function stub.
4147 2020-01-03 Nick Clifton <nickc@redhat.com>
4150 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
4151 return value from bfd_malloc.
4152 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
4153 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
4154 (elf32_arm_filter_cmse_symbols): Likewise.
4155 (elf32_arm_write_section): Likewise.
4156 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
4157 (bfd_mach_o_follow_dsym): Likewise.
4158 * pef.c (bfd_pef_print_loader_section): Likewise.
4159 (bfd_pef_scan_start_address): Likewise.
4160 (bfd_pef_parse_function_stubs): Likewise.
4161 (bfd_pef_parse_symbols): Likewise.
4163 2020-01-03 Sergei Trofimovich <siarheit@google.com>
4165 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
4166 on binary inputs ld/PR25316.
4167 (is_ia64_elf): new helper to filter on ia64 objects.
4169 2020-01-03 Jan Beulich <jbeulich@suse.com>
4171 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
4173 (bfd_mach_o_scan): Insert underscore in two variable names.
4175 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
4177 * Makefile.am: Add z80-elf target support.
4178 * configure.ac: Likewise.
4179 * targets.c: Likewise.
4180 * Makefile.in: Regenerate.
4181 * configure: Regenerate.
4182 * config.bfd: Add z80-elf target support and new arches: ez80 and
4184 * elf32-z80.c: New file.
4185 * archures.c: Add new z80 architectures: eZ80 and Z180.
4186 * coffcode.h: Likewise.
4187 * cpu-z80.c: Likewise.
4188 * coff-z80.c: Add new relocations for Z80 target and local label
4190 * reloc.c: Add new relocs.
4191 * bfd-in2.h: Regenerate.
4192 * libbfd.h: Regenerate.
4194 2020-01-02 Tamar Christina <tamar.christina@arm.com>
4198 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
4200 2020-01-01 Alan Modra <amodra@gmail.com>
4202 Update year range in copyright notice of all files.
4204 For older changes see ChangeLog-2019
4206 Copyright (C) 2020 Free Software Foundation, Inc.
4208 Copying and distribution of this file, with or without modification,
4209 are permitted in any medium without royalty provided the copyright
4210 notice and this notice are preserved.
4216 version-control: never