1 2020-11-19 Nick Clifton <nickc@redhat.com>
4 * elf64-s390.c (elf_s390_finish_dynamic_sections): Check for the
5 existance of an sgot output section before setting the
8 2020-11-18 Jozef Lawrynowicz <jozef.l@mittosystems.com>
9 H.J. Lu <hongjiu.lu@intel.com>
11 * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_retain.
12 (struct elf_obj_tdata): Increase has_gnu_osabi to 4 bits.
13 * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_retain
15 (_bfd_elf_final_write_processing): Report if SHF_GNU_RETAIN is
16 not supported by the OSABI.
17 Adjust error messages.
18 * elflink.c (elf_link_input_bfd): Copy enabled has_gnu_osabi bits from
19 input BFD to output BFD.
20 (bfd_elf_gc_sections): gc_mark the section if SHF_GNU_RETAIN is set.
22 2020-11-16 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
24 * cpu-arm.c (processors): Add Cortex-A78C.
26 2020-11-11 Tom Tromey <tromey@adacore.com>
28 * archive.c (getuid, getgid): Move...
29 * sysdep.h (getuid, getgid): ...here.
31 2020-11-09 Alan Modra <amodra@gmail.com>
33 * vms-alpha.c (alpha_vms_write_exec): Write 16 bits to eihd.alias.
35 2020-11-09 Alan Modra <amodra@gmail.com>
37 * archive.c (bfd_ar_hdr_from_filesystem): Use bfd_set_input_error
38 when stat of archive member fails.
39 * coff-rs6000.c (xcoff_write_archive_contents_old),
40 (xcoff_write_archive_contents_big): Likewise, and handle in-memory
43 2020-11-03 Alan Modra <amodra@gmail.com>
45 * elf.c (bfd_section_from_shdr): Free sections_being_created.
48 2020-11-02 Alan Modra <amodra@gmail.com>
54 * elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
55 for plugin syms. Do allow plugin syms to mark as-needed libs.
57 2020-10-30 H.J. Lu <hongjiu.lu@intel.com>
60 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Generate
61 GNU_PROPERTY_X86_ISA_1_BASELINE for -z x86-64-baseline.
63 2020-10-29 Nick Clifton <nickc@redhat.com>
66 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Use the correct
67 sized reloc reading function.
68 (_bfd_elf_write_secondary_reloc_section): Use the correct sized
69 reloc writing function.
71 2020-10-28 Nick Clifton <nickc@redhat.com>
74 * srec.c (srec_write_symbols): Do not emit symbols in sections
75 that have been removed from the output.
77 2020-10-27 Nick Clifton <nickc@redhat.com>
79 * elf64-hppa.c (elf_hppa_final_link_relocate): Check that the
80 symbol's section is being output before adding its offset to the
81 addend when processing R_PARISC_SECREL32.
83 2020-10-25 Alan Modra <amodra@gmail.com>
85 * vms-misc.c (_bfd_vms_save_counted_string): Count length byte
88 2020-10-20 Dr. David Alan Gilbert <dgilbert@redhat.com>
90 * po/es.po: Fix printf format.
92 2020-10-16 Nelson Chu <nelson.chu@sifive.com>
94 * elfnn-riscv.c (riscv_elf_link_hash_table): Add last_iplt_index.
95 (riscv_elf_size_dynamic_sections): Initialize the last_iplt_index.
96 (riscv_elf_relocate_section): Use riscv_elf_append_rela.
97 (riscv_elf_finish_dynamic_symbol): If the use_elf_append_rela is
98 false, then we should add the dynamic relocs from the last of
99 the .rela.iplt, and don't use the riscv_elf_append_rela to add.
101 2020-10-16 Nelson Chu <nelson.chu@sifive.com>
103 * elfnn-riscv.c: Include "objalloc.h" since we need objalloc_alloc.
104 (riscv_elf_link_hash_table): Add loc_hash_table and loc_hash_memory
105 for local STT_GNU_IFUNC symbols.
106 (riscv_elf_got_plt_val): Removed.
107 (riscv_elf_local_htab_hash, riscv_elf_local_htab_eq): New functions.
108 Use to compare local hash entries.
109 (riscv_elf_get_local_sym_hash): New function. Find a hash entry for
110 local symbol, and create a new one if needed.
111 (riscv_elf_link_hash_table_free): New function. Destroy an riscv
112 elf linker hash table.
113 (riscv_elf_link_hash_table_create): Create hash table for local ifunc.
114 (riscv_elf_check_relocs): Create a fake global symbol to track the
115 local ifunc symbol. Add support to check and handle the relocations
116 reference to ifunc symbols.
117 (allocate_dynrelocs): Let allocate_ifunc_dynrelocs and
118 allocate_local_ifunc_dynrelocs to handle the ifunc symbols if they
119 are defined and referenced in a non-shared object.
120 (allocate_ifunc_dynrelocs): New function. Allocate space in .plt,
121 .got and associated reloc sections for ifunc dynamic relocs.
122 (allocate_local_ifunc_dynrelocs): Likewise, but for local ifunc
124 (riscv_elf_relocate_section): Add support to handle the relocation
125 referenced to ifunc symbols.
126 (riscv_elf_size_dynamic_sections): Updated.
127 (riscv_elf_adjust_dynamic_symbol): Updated.
128 (riscv_elf_finish_dynamic_symbol): Finish up the ifunc handling,
129 including fill the PLT and GOT entries for ifunc symbols.
130 (riscv_elf_finish_local_dynamic_symbol): New function. Called by
131 riscv_elf_finish_dynamic_symbol to handle the local ifunc symbols.
132 (_bfd_riscv_relax_section): Don't do the relaxation for ifunc.
133 * elfxx-riscv.c: Add R_RISCV_IRELATIVE.
134 * configure.ac: Link elf-ifunc.lo to use the generic ifunc support.
135 * configure: Regenerated.
137 2020-10-16 Alan Modra <amodra@gmail.com>
139 * elf32-arc.c (replace_func): Correct return type.
140 (get_replace_function): Use a replace_func function pointer rather
141 than void*. Update associated ARC_RELOC_HOWTO define.
143 2020-10-16 Alan Modra <amodra@gmail.com>
145 * elf32-cr16.c: Formatting.
146 (cr16_elf_final_link_relocate): Sign extend rather than clumsy
147 "add or subtract" of offset value. Simplify range checks. Move
148 common code out of "if" branches. Don't refetch insn fields
151 2020-10-16 Alan Modra <amodra@gmail.com>
153 * elf64-ppc.c (ppc64_elf_relocate_section): Tighten sanity check
154 on R_PPC64_GOT_LO_DS and R_PPC64_GOT_HA instructions.
156 2020-10-09 Alan Modra <amodra@gmail.com>
158 * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't do local
159 entry offset optimisation.
161 2020-10-09 H.J. Lu <hongjiu.lu@intel.com>
164 * elf-linker-x86.h (elf_linker_x86_params): Add isa_level.
165 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge
166 GNU_PROPERTY_X86_ISA_1_V[234].
167 (_bfd_x86_elf_link_setup_gnu_properties): Generate
168 GNU_PROPERTY_X86_ISA_1_V[234] for -z x86-64-v[234].
170 2020-10-06 H.J. Lu <hongjiu.lu@intel.com>
173 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge -z ibt
174 and -z shstk only with GNU_PROPERTY_X86_FEATURE_1_AND.
176 2020-10-06 Brandon Bergren <bdragon@FreeBSD.org>
178 * config.bfd: Add powerpc64le-*-freebsd*.
179 * configure.ac: Add powerpc_elf64_fbsd_le_vec.
180 * elf64-ppc.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define for
182 * targets.c (powerpc_elf64_fbsd_le_vec): Declare.
183 (_bfd_target_vector): Add it.
184 * configure: Regenerate.
186 2020-10-05 Kamil Rytarowski <n54@gmx.com>
188 * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.
190 2020-10-05 Nick Clifton <nickc@redhat.com>
193 * elf.c (_bfd_elf_setup_sections): Do not complain about an
194 sh_link value of zero when the SLF_LINK_ORDER flag is set.
195 (assign_section_numbers): Likewise.
197 2020-10-02 H.J. Lu <hongjiu.lu@intel.com>
200 * elflink.c (bfd_elf_gc_sections): Do not arbitrarily keep note
201 sections which are linked to another section.
203 2020-09-30 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
205 * cpu-arm.c: Add cortex-a78 and cortex-a78ae.
207 2020-09-28 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
209 * cpu-arm.c: (processors) Add Cortex-X1.
211 2020-09-28 Alan Modra <amodra@gmail.com>
214 * elf64-ppc.c (ppc_build_one_stub, ppc_size_one_stub): Check for
215 NULL stub_entry->h before calling is_tls_get_addr.
217 2020-09-26 Alan Modra <amodra@gmail.com>
219 * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Depend on has_plt_localentry0.
220 (LD_R0_0R11, ADD_R11_R0_R11): Define.
221 (ppc64_elf_tls_setup): Disable params->plt_localentry0 when power10
223 (ppc64_elf_size_stubs): Update __glink_PLTresolve eh_frame.
224 (ppc64_elf_build_stubs): Move r2 save to start of __glink_PLTresolve,
225 and only emit for has_plt_localentry0. Don't use r2 in the stub.
227 2020-09-24 Alan Modra <amodra@gmail.com>
230 * elf64-ppc.c (plt_stub_size): Add "odd" param. Use it with
231 size_power10_offset rather than calculating from start of stub.
232 Add size for notoc tls_get_addr_opt stub.
233 (plt_stub_pad): Add "odd" param, pass to plt_stub_size.
234 (build_tls_get_addr_head, build_tls_get_addr_tail): New functions.
235 (build_tls_get_addr_stub): Delete.
236 (ppc_build_one_stub): Use a temp for htab->params->stub_bfd.
237 Emit notoc tls_get_addr_opt stub. Move eh_frame code to
238 suit. Adjust code to use bfd_tls_get_addr_head/tail in place
239 of build_tls_get_addr_stub.
240 (ppc_size_one_stub): Size notoc tls_get_addr_opt stub.
241 Adjust plt_stub_size and plt_stub_pad calls. Correct "odd"
242 when padding stub. Size eh_frame for notoc stub too.
243 Correct lr_restore value.
244 (ppc64_elf_relocate_section): Don't skip over first insn of
245 notoc tls_get_addr_opt stub.
247 2020-09-24 Alan Modra <amodra@gmail.com>
250 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Rename to..
251 (ppc64_elf_edit): Call params->edit.
252 (ppc64_elf_tls_setup): Don't call _bfd_elf_tls_setup. Return a
254 * elf64-ppc.h (struct ppc64_elf_params): Add "edit".
255 (ppc64_elf_tls_setup): Update declaration.
257 2020-09-21 Alan Modra <amodra@gmail.com>
260 * elfxx-riscv.c (howto_table): Correct size and bitsize of
261 R_RISCV_RVC_BRANCH, R_RISCV_RVC_JUMP, and R_RISCV_RVC_LUI.
262 Correct size for R_RISCV_TLS_DTPMOD32, R_RISCV_TLS_DTPREL32,
263 R_RISCV_CALL, and R_RISCV_CALL_PLT. Make R_RISCV_TPREL_ADD and
264 R_RISCV_ALIGN like R_RISCV_NONE. Correct dst_mask many relocs.
266 2020-09-17 Mikael Pettersson <mikpelinux@gmail.com>
269 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC
270 relocations in debug sections, change abort to _bfd_error_handler.
272 2020-09-16 H.J. Lu <hongjiu.lu@intel.com>
275 * config.bfd (targ64_selvecs, targ_selvecs): Add x86_64_pe_vec
277 * reloc.c: Include "coff/internal.h".
278 (bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs.
280 2020-09-16 Alan Modra <amodra@gmail.com>
282 * elf-bfd.h (elf_symbol_from): Remove unused ABFD parameter.
283 * elf.c (ignore_section_sym, _bfd_elf_copy_private_symbol_data),
284 (swap_out_syms): Adjust elf_symbol_from invocation.
286 2020-09-16 Alan Modra <amodra@gmail.com>
289 * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.
291 2020-09-15 H.J. Lu <hongjiu.lu@intel.com>
293 * coff-x86_64.c (howto_table): Display PE relocation names.
295 2020-09-15 Hans-Peter Nilsson <hp@axis.com>
298 * elf32-cris.c (cris_elf_check_relocs): Add missing NULL check
299 on argument before calling UNDEFWEAK_NO_DYNAMIC_RELOC.
301 2020-09-12 H.J. Lu <hongjiu.lu@intel.com>
304 * elflink.c (elf_final_link_info): Add local_hash_table.
305 (local_hash_entry): New.
306 (local_hash_newfunc): Likewise.
307 (elf_link_output_symstrtab): Append ".COUNT" to duplicated local
309 (bfd_elf_final_link): Initialize and free local_hash_table for
312 2020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
314 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Revert
315 changes in 7e05773767820b441b23a16628b55c98cb1aef46. Set
316 error for undefined symbol in BFD_RELOC_AARCH64_BRANCH19 and
317 BFD_RELOC_AARCH64_TSTBR14 relocations.
319 2020-09-09 Nick Clifton <nickc@redhat.com>
321 * cofflink.c (coff_link_check_archive_element): Move the check for
322 coff type input to the start of the function.
324 2020-09-09 Alan Modra <amodra@gmail.com>
326 * libbfd-in.h (_bfd_write_unsigned_leb128): Declare.
327 * libbfd.h: Regenerate.
329 2020-09-08 Jozef Lawrynowicz <jozef.l@mittosystems.com>
330 Kuan-Lin Chen <kuanlinchentw@gmail.com>
332 * bfd-in2.h (bfd_reloc_code_real): Add
333 BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
334 * elf32-msp430.c (msp430_elf_ignore_reloc): New.
335 (elf_msp430_howto_table): Add R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
336 (msp430_reloc_map): Add R_MSP430_GNU_{SET,SUB}_ULEB128.
337 (msp430x_reloc_map): Add R_MSP430X_GNU_{SET,SUB}_ULEB128.
338 (write_uleb128): New.
339 (msp430_final_link_relocate): Handle R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
340 * libbfd.c (_bfd_write_unsigned_leb128): New.
341 * libbfd.h (_bfd_write_unsigned_leb128): New prototype.
342 Add BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
343 * reloc.c: Document BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
345 2020-09-08 Alex Coplan <alex.coplan@arm.com>
347 * archures.c (bfd_mach_aarch64_8R): New.
348 * bfd-in2.h: Regenerate.
349 * cpu-aarch64.c (bfd_aarch64_arch_v8_r): New.
350 (bfd_aarch64_arch_ilp32): Update tail pointer.
352 2020-09-08 Alan Modra <amodra@gmail.com>
356 * elflink.c (_bfd_elf_merge_symbol): Make "override" a bfd**.
357 Return oldbfd in override when old common should override new
359 (_bfd_elf_add_default_symbol): Adjust to suit.
360 (elf_link_add_object_symbols): Likewise. Pass "override" to
361 _bfd_generic_link_add_one_symbol. Save and restore common u.c.p
362 field for --as-needed shared libraries. Revert pr13250 changes.
364 2020-09-08 Nick Clifton <nickc@redhat.com>
366 * plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an
367 unrecognized symbol type in a weak definition.
369 2020-09-04 Alan Modra <amodra@gmail.com>
372 * elfcode.h (elf_object_p): Sanity check section header offset.
373 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
376 2020-09-04 Alan Modra <amodra@gmail.com>
381 * elflink.c (elf_link_add_object_symbols): Do set def_regular
382 and ref_regular for IR symbols. Don't clear dynsym, allowing
383 IR symbols to load --as-needed shared libraries, but prevent
384 IR symbols from becoming dynamic.
386 2020-09-03 Nick Clifton <nickc@redhat.com>
389 * elf.c (_bfd_elf_write_secondary_reloc_section): Check for
390 secondary reloc sections with a zero sh_entsize field.
392 2020-09-03 Nelson Chu <nelson.chu@sifive.com>
394 * elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors.
395 (riscv_merge_std_ext): Likewise.
396 (riscv_merge_arch_attr_info): Likewise.
397 (riscv_merge_attributes): Likewise and fix comment typos.
399 2020-09-03 Nelson Chu <nelson.chu@sifive.com>
401 * elfnn-riscv.c (riscv_version_mismatch): Change the return type
402 from void to bfd_boolean. Report warnings rather than errors
403 when the ISA versions are mis-matched. Afterwards, remember to
404 update the output ISA versions to the newest ones.
405 (riscv_merge_std_ext): Allow to link objects with different
406 standard ISA versions. Try to add output ISA versions to
407 merged_subsets first.
408 (riscv_merge_multi_letter_ext): Likewise. But for standard additional
409 ISA and non-standard ISA versions.
411 2020-09-03 Kito Cheng <kito.cheng@sifive.com>
413 * elfnn-riscv.c (riscv_merge_std_ext): Fix to report the correct
414 error message when the versions of extension are mis-matched.
415 * elfxx-riscv.c (riscv_parse_subset): Don't issue the error when
418 2020-09-03 Alan Modra <amodra@gmail.com>
420 * xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info
421 on the output bfd objalloc memory.
423 2020-09-02 Alan Modra <amodra@gmail.com>
425 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
426 of constant shifted left.
428 2020-09-02 Alan Modra <amodra@gmail.com>
430 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned
431 type for "relocation".
433 2020-09-01 Alan Modra <amodra@gmail.com>
435 * reloc.c (N_ONES): Handle N=0.
436 * elf32-arm.c (elf32_arm_howto_table_1): Set complain_overflow_dont
437 for R_ARM_TLS_DESCSEQ and R_ARM_THM_TLS_DESCSEQ.
439 2020-09-01 Alan Modra <amodra@gmail.com>
442 * elf32-arm.c (elf32_arm_allocate_local_sym_info): Allocate arrays
443 in descending order of alignment.
445 2020-09-01 Alan Modra <amodra@gmail.com>
448 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
450 2020-08-31 Alan Modra <amodra@gmail.com>
453 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to
454 unsigned when using with RISCV_ITYPE.
455 (_bfd_riscv_relax_call): Use an unsigned foff.
457 2020-08-31 Alan Modra <amodra@gmail.com>
461 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO),
462 (CRINFO_RELVADDR): Make unsigned.
463 (mips_elf_nullify_got_load): Use unsigned constant when shifting
466 2020-08-31 Alan Modra <amodra@gmail.com>
469 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u"
470 variable and rewrite signed overflow check.
471 * elf32-mep.c: Regenerate.
472 (mep_final_link_relocate): Delete "s".
474 2020-08-31 Alan Modra <amodra@gmail.com>
477 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
478 that might shift values into sign bit.
480 2020-08-31 Alan Modra <amodra@gmail.com>
483 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma,
484 and similarly for variables dealing with overflow.
486 2020-08-31 Alan Modra <amodra@gmail.com>
489 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits
490 without undefined behaviour. Tidy excess casts.
492 2020-08-31 Alan Modra <amodra@gmail.com>
494 * elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
495 alignment from reloc addend after reloc type R_MN10300_ALIGN is
498 2020-08-30 Alan Modra <amodra@gmail.com>
502 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits
503 without undefined behaviour.
505 2020-08-29 Nick Clifton <nickc@redhat.com>
508 * dwarf2.c (scan_unit_for_symbols): Add member entries to the
511 2020-08-29 Alan Modra <amodra@gmail.com>
514 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last
515 element when count is zero. bfd_realloc when shrinking.
517 2020-08-28 Alan Modra <amodra@gmail.com>
520 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write
523 2020-08-28 Alan Modra <amodra@gmail.com>
526 * ecofflink.c (WRITE): Really don't write zero size chunks.
528 2020-08-28 Tuckker <tuckkern+sourceware@gmail.com>
531 * linker.c (bfd_generic_define_common_symbol): Force the alignment
532 to 1 if the section has now alignment requirement.
534 2020-08-28 Cooper Qu <cooper.qu@linux.alibaba.com>
536 * elf32-csky.c (csky_archs): Fix arch names.
537 (csky_find_arch_with_name): New.
538 (elf32_csky_merge_attributes): New.
539 (csky_elf_merge_private_bfd_data): Add process of merge
541 (elf32_csky_obj_attrs_arg_type): New.
542 (elf32_csky_obj_attrs_handle_unknown): New.
543 (elf_backend_obj_attrs_vendor): Define.
544 (elf_backend_obj_attrs_section): Define.
545 (elf_backend_obj_attrs_arg_type): Define.
546 (elf_backend_obj_attrs_section_type): Define.
548 2020-08-28 Nick Clifton <nickc@redhat.com>
551 * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value
552 for undefined symbols which will not generate extra warning
553 messages about truncated relocs.
555 2020-08-28 Nelson Chu <nelson.chu@sifive.com>
557 * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
558 and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
559 (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
560 unresolved reloc checks.
562 2020-08-27 John David Anglin <danglin@gcc.gnu.org>
565 * som.c (som_bfd_copy_private_section_data): Issue error when a
566 subspace is specified without its containing space.
568 2020-08-27 Alan Modra <amodra@gmail.com>
571 * elflink.c: Include limits.h.
572 (CHAR_BIT): Provide fallback define.
573 (set_symbol_value): Correct complex reloc comment.
574 (undefined_reference): Set bfd_error.
575 (BINARY_OP_HEAD, BINARY_OP_TAIL): Split out from..
577 (eval_symbol): Limit shifts. Force unsigned for left shift.
578 Catch divide by zero.
579 * configure.ac (AC_CHECK_HEADERS): Combine, sort and add limits.h.
580 * configure: Regenerate.
581 * config.in: Regenerate.
583 2020-08-27 Alan Modra <amodra@gmail.com>
586 * reloc.c (bfd_check_overflow): Return early if zero bitsize.
588 2020-08-27 Alan Modra <amodra@gmail.com>
590 * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
591 on sym_sec not being output.
593 2020-08-27 Alan Modra <amodra@gmail.com>
596 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Correct "dynamic".
598 2020-08-26 Nick Clifton <nickc@redhat.com>
601 * elf32-avr.c (avr_final_link_relocate): Fix undefined shift
603 (avr_elf32_load_records_from_section): Use bfd_get_16 and
604 bfd_get_32 to load values from potentially unaligned pointers.
607 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Test for and
608 ignore local symbols.
609 (elf64_alpha_relax_got_load): Do not check for local dynamic
611 (OP_LDA, OP_LDAH, OP_LDQ, OP_BR, OP_BSR): Use unsigned constant
613 (INSN_A) Cast the A parameter to unsigned.
614 (INSN_AB): Define in terms of INSN_A.
615 (INSN_ABC): Likewise.
616 (INSN_ABO): Likewise.
620 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
621 unsigned long constant when creating a mask to test for alignment
624 2020-08-26 Alan Modra <amodra@gmail.com>
627 * elf32-xtensa.c (find_removed_literal): Don't bsearch empty map.
629 2020-08-26 Alan Modra <amodra@gmail.com>
632 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early
633 when section is empty.
635 2020-08-26 Alan Modra <amodra@gmail.com>
638 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
641 2020-08-26 Alan Modra <amodra@gmail.com>
649 * elf64-ppc.c (is_tls_get_addr): Avoid UB &h->elf when h is NULL.
650 (ppc64_elf_tls_setup): Likewise.
651 (branch_reloc_hash_match): Likewise.
652 (build_plt_stub): Likewise.
653 (ppc64_elf_relocate_section): Likewise.
655 2020-08-26 Alan Modra <amodra@gmail.com>
658 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
660 2020-08-26 Alan Modra <amodra@gmail.com>
663 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
664 sstubs->contents != NULL.
666 2020-08-26 Alan Modra <amodra@gmail.com>
669 * som.c (som_prep_for_fixups): Return early when no symbols.
671 2020-08-26 Alan Modra <amodra@gmail.com>
674 * ecofflink.c (WRITE): Don't write size 0 chunks.
676 2020-08-26 Alan Modra <amodra@gmail.com>
678 * bfdio.c (bfd_get_file_size): Don't segv on NULL adata.
680 2020-08-26 Alan Modra <amodra@gmail.com>
683 * vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
685 2020-08-26 David Faust <david.faust@oracle.com>
687 * archures.c (bfd_mach_xbpf): Define.
688 * bfd-in2.h: Regenerate.
689 * cpu-bpf.c (bfd_xbpf_arch) New.
690 (bfd_bpf_arch) Update next in list field to point to xbpf arch.
692 2020-08-26 Alan Modra <amodra@gmail.com>
694 * archures.c (bfd_mach_ck860): Define.
696 2020-08-25 Mark Wielaard <mark@klomp.org>
698 * dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
699 and dwarf_rnglists_size fields.
700 (dwarf_debug_sections): Add debug_rnglists.
701 (dwarf_debug_section_enum): Likewise.
702 (read_debug_rnglists): New function.
703 (read_rangelist): New function to call either read_ranges or
704 read_rnglists. Rename original function to...
705 (read_ranges): ...this.
706 (read_rnglists): New function.
708 2020-08-25 Alan Modra <amodra@gmail.com>
711 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check
712 is_elf_hash_table before accessing elf fields.
714 2020-08-25 Alan Modra <amodra@gmail.com>
717 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
720 2020-08-25 Alan Modra <amodra@gmail.com>
723 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
724 before accessing elf fields.
726 2020-08-25 Alan Modra <amodra@gmail.com>
729 * som.c (som_compute_checksum): XOR 32-bit words in header,
730 not unsigned long sized words.
732 2020-08-25 Alan Modra <amodra@gmail.com>
735 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
736 amount copied for elf_segment_map defined with one element
739 2020-08-25 Alan Modra <amodra@gmail.com>
742 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
743 bfd_get_x size function to read addends out of fields. Apply
744 rightshift adjustment too. Don't apply the now unnecessary
745 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
746 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
747 Correct R_ARM_THM_JUMP6 addend.
749 2020-08-25 Alan Modra <amodra@gmail.com>
752 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
753 before start of section.
755 2020-08-25 Alan Modra <amodra@gmail.com>
757 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
758 before accessing elf_hash_table_id.
759 * elf32-arc.c (elf_arc_hash_table): Likewise.
760 * elf32-arm.c (elf32_arm_hash_table): Likewise.
761 * elf32-avr.c (avr_link_hash_table): Likewise.
762 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
763 * elf32-cris.c (elf_cris_hash_table): Likewise.
764 * elf32-csky.c (csky_elf_hash_table): Likewise.
765 * elf32-frv.c (frvfdpic_hash_table): Likewise.
766 * elf32-hppa.c (hppa_link_hash_table): Likewise.
767 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
768 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
769 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
770 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
771 * elf32-metag.c (metag_link_hash_table): Likewise.
772 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
773 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
774 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
775 * elf32-s390.c (elf_s390_hash_table): Likewise.
776 * elf32-sh.c (sh_elf_hash_table): Likewise.
777 * elf32-spu.c (spu_hash_table): Likewise.
778 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
779 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
780 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
781 * elf64-hppa.c (hppa_link_hash_table): Likewise.
782 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
783 * elf64-s390.c (elf_s390_hash_table): Likewise.
784 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
785 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
786 * elfxx-mips.c (mips_elf_hash_table): Likewise.
787 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
788 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
790 2020-08-21 Jon Turney <jon.turney@dronecode.org.uk>
792 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
793 int. Use '%u' format with _bfd_error_handler to render it.
795 2020-08-25 Alan Modra <amodra@gmail.com>
798 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
799 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
801 2020-08-25 Alan Modra <amodra@gmail.com>
804 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
805 accessing elf_hash_table_id.
807 2020-08-25 Alan Modra <amodra@gmail.com>
810 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
811 accessing elf_hash_table_id.
813 2020-08-24 Mark Wielaard <mark@klomp.org>
815 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
816 (read_formatted_entries): Likewise. And skip zero entry.
818 2020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
820 * bfd-in2.h (bfd_mach_ck860): New.
821 * cpu-csky.c (arch_info_struct): Add item for CK860.
823 2020-08-24 Alan Modra <amodra@gmail.com>
825 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
826 high part tprel16 relocs.
827 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
828 Clear do_tls_opt on odd instructions.
829 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
830 Don't sanity check them here.
831 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
832 high part tprel16 relocs.
833 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
834 Clear do_tls_opt on odd instructions.
835 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
837 2020-08-23 John David Anglin <danglin@gcc.gnu.org>
840 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
841 * configure: Regenerate.
843 2020-08-22 H.J. Lu <hongjiu.lu@intel.com>
846 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
847 versioned symbols, which are defined in shared objects, in
850 2020-08-21 Nick Clifton <nickc@redhat.com>
852 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
853 the data map if there are entries in it.
854 (_bfd_aarch64_erratum_843419_scan): Likewise.
856 2020-08-21 Jan Beulich <jbeulich@suse.com>
858 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
859 last byte of debug dir, not first.
861 2020-08-20 Nick Clifton <nickc@redhat.com>
864 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
865 field in the ELF header of the compressed sections.
867 2020-08-20 Nick Clifton <nickc@redhat.com>
870 * elf-bfd.h (struct bfd_elf_section_data): Add
871 has_secondary_relocs field.
872 * elf.c (_bfd_elf_copy_special_section_fields): Set the
873 has_secondary_relocs field for sections which have associated
875 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
876 on sections which have associated secondary relocs.
878 2020-08-15 Alan Modra <amodra@gmail.com>
880 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
881 small common section.
882 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
883 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
884 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
885 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
886 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
887 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
888 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
889 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
890 * elf32-v850.c (v850_elf_check_relocs): Likewise.
891 (v850_elf_add_symbol_hook): Likewise.
892 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
893 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
894 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
895 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
897 2020-08-15 Alan Modra <amodra@gmail.com>
900 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
902 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
903 on small common section.
904 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
905 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
906 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
907 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
908 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
909 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
911 2020-08-14 Alan Modra <amodra@gmail.com>
913 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
914 rather than another copy of primes. Increase maximum default
917 2020-08-13 Alan Modra <amodra@gmail.com>
919 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
921 2020-08-13 Alan Modra <amodra@gmail.com>
923 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
924 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
925 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
926 optimization when --no-pcrel-optimize.
928 2020-08-13 Alan Modra <amodra@gmail.com>
931 * bfd.c (struct bfd): Add read_only.
932 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
933 Set read_only on warning.
934 (elf_object_p): Sanity check program header alignment. Set
935 read_only on warning.
936 * bfd-in2.h: Regenerate.
938 2020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
940 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
941 win32pstatus note type to avoid signedness comparison warning.
943 2020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
945 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
946 win32pstatus notes, and return TRUE so we continue rather than
947 stopping as if it was an error.
949 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
951 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
953 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
955 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
956 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
957 appropriate size constraint for each win32pstatus note type.
959 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
961 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
962 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
965 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
967 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
968 (elfcore_grok_win32pstatus): Use.
970 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
972 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
973 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
974 offsets used to read NOTE_INFO_PROCESS.
976 2020-08-12 Nick Clifton <nickc@redhat.com>
978 * po/ru.po: Updated Russian translation.
979 * po/sr.po: Updated Serbian translation.
981 2020-08-07 David Faust <david.faust@oracle.com>
983 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
984 DISP16 and DISP32 relocations.
986 2020-08-05 David Faust <david.faust@oracle.com>
988 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
989 (bpf_elf_howto_table): Use it here.
990 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
991 instruction and data relocations.
993 2020-08-03 Alan Modra <amodra@gmail.com>
995 * vms-lib.c (vms_traverse_index): Sanity check size remaining
996 before accessing vms_idx or vms_elfidx.
998 2020-08-03 Alan Modra <amodra@gmail.com>
1001 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
1002 size against file size. Correct LONG_MAX limit check.
1003 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
1004 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
1005 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1006 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
1007 bfd_malloc_and_get_section.
1009 2020-07-31 Alan Modra <amodra@gmail.com>
1012 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
1013 IR symbols to become dynamic.
1014 (elf_link_add_object_symbols): Don't exclude IR symbols when
1015 deciding whether an as-needed shared library is needed.
1017 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1020 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
1022 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
1024 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1026 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
1027 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
1028 Don't define _STRUCTURED_PROC.
1029 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
1030 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
1031 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
1032 * configure, config.in: Regenerate.
1033 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
1034 * Makefile.in, doc/Makefile.in: Regenerate.
1036 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
1038 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
1039 (elf_link_hash_table): Add sym_cache.
1040 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
1041 (elf32_arm_check_relocs): Updated.
1042 (elf32_arm_size_dynamic_sections): Likewise.
1043 * elf32-bfin.c (bfin_link_hash_table): Removed.
1044 (bfin_link_hash_newfunc): Updated.
1045 (bfin_hash_table): Removed.
1046 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
1047 (csky_elf_check_relocs): Updated.
1048 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
1049 (elf32_hppa_check_relocs): Updated.
1050 * elf32-i386.c (elf_i386_tls_transition): Updated.
1051 (elf_i386_convert_load_reloc): Likewise.
1052 (elf_i386_check_relocs): Likewise.
1053 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
1054 (m32r_elf_hash_table): Updated.
1055 (m32r_elf_link_hash_table_create): Likewise.
1056 (m32r_elf_create_dynamic_sections): Likewise.
1057 (m32r_elf_adjust_dynamic_symbol): Likewise.
1058 (allocate_dynrelocs): Likewise.
1059 (m32r_elf_size_dynamic_sections): Likewise.
1060 (m32r_elf_relocate_section): Likewise.
1061 (m32r_elf_finish_dynamic_symbol): Likewise.
1062 (m32r_elf_check_relocs): Likewise.
1063 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
1065 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
1066 (elf_m68k_check_relocs): Updated.
1067 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
1068 (elf_metag_check_relocs): Updated.
1069 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
1070 (microblaze_elf_check_relocs): Updated.
1071 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
1072 (nds32_elf_create_dynamic_sections): Likewise.
1073 (nds32_elf_adjust_dynamic_symbol): Likewise.
1074 (nds32_elf_check_relocs): Likewise.
1075 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
1076 srelbss and aym_cache.
1077 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
1078 (nios2_elf32_check_relocs): Updated.
1079 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
1080 (or1k_elf_check_relocs): Updated.
1081 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
1082 (ppc_elf_check_relocs): Updated.
1083 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1084 (elf_s390_check_relocs): Updated.
1085 (elf_s390_finish_dynamic_sections): Likewise.
1086 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
1088 (sh_elf_create_dynamic_sections): Updated.
1089 (sh_elf_adjust_dynamic_symbol): Likewise.
1090 (sh_elf_size_dynamic_sections): Likewise.
1091 (sh_elf_check_relocs): Likewise.
1092 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
1093 (elf32_tic6x_check_relocs): Updated.
1094 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
1095 (tilepro_elf_hash_table): Updated.
1096 (tilepro_elf_link_hash_table_create): Likewise.
1097 (tilepro_elf_check_relocs): Likewise.
1098 (tilepro_elf_adjust_dynamic_symbol): Likewise.
1099 (allocate_dynrelocs): Likewise.
1100 (tilepro_elf_size_dynamic_sections): Likewise.
1101 (tilepro_elf_relocate_section): Likewise.
1102 (tilepro_elf_finish_dynamic_symbol): Likewise.
1103 (tilepro_finish_dyn): Likewise.
1104 (tilepro_elf_finish_dynamic_sections): Likewise.
1105 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
1106 (ppc64_elf_before_check_relocs): Updated.
1107 (ppc64_elf_check_relocs): Likewise.
1108 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1109 (elf_s390_check_relocs): Updated.
1110 (elf_s390_relocate_section): Likewise.
1111 (elf_s390_finish_dynamic_sections): Likewise.
1112 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1113 (elf_x86_64_check_relocs): Likewise.
1114 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1116 (elfNN_aarch64_check_relocs): Updated.
1117 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
1118 (riscv_elf_check_relocs): Updated.
1119 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
1120 (mips_elf_resolve_got_page_ref): Updated.
1121 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1122 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1124 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
1125 (tilegx_elf_check_relocs): Updated.
1126 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
1128 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1130 * elflink.c (bfd_elf_final_link): Give local symbols a name if
1132 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
1133 return TRUE if making ET_REL output.
1135 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1137 * elf-bfd.h (elf_backend_data): Add
1138 `elf_backend_elfsym_local_is_section' member.
1139 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
1141 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
1142 * elflink.c (bfd_elf_final_link): Use it to determine whether
1143 set the `.symtab' section's `sh_info' value to the index of the
1144 first non-local or non-section symbol.
1145 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
1147 (elf_backend_elfsym_local_is_section): New macro.
1148 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
1150 (elf_backend_elfsym_local_is_section): New macro.
1152 2020-07-29 Alan Modra <amodra@gmail.com>
1154 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
1155 defined in excluded sections.
1157 2020-07-28 Alan Modra <amodra@gmail.com>
1159 * elf.c (assign_section_numbers): Comment. Don't segfault on
1160 discarded sections when setting linked-to section for generic
1162 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
1164 2020-07-27 Alan Modra <amodra@gmail.com>
1166 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
1167 similar as absolute.
1168 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
1171 2020-07-24 Nick Clifton <nickc@redhat.com>
1173 * config.bfd: Move xc16x target to the obsolete list.
1175 2020-07-22 Kevin Buettner <kevinb@redhat.com>
1177 * binary.c (binary_get_section_contents): Seek using offset
1178 from section's file position.
1180 2020-07-22 Kevin Buettner <kevinb@redhat.com>
1182 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
1184 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
1187 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
1188 type for the first function argument. Rename pointers to reflect
1189 that they have distinct types.
1191 2020-07-20 Alan Modra <amodra@gmail.com>
1193 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
1195 2020-07-19 Alan Modra <amodra@gmail.com>
1197 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
1198 (select_alt_stub): New function.
1199 (ppc_get_stub_entry): Use it here.
1200 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
1202 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
1203 merge notoc stubs with other varieties when power10_stubs is "auto".
1204 Instead dup the stub hash table entry.
1205 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1206 tests of power10_stubs.
1208 2020-07-15 Alan Modra <amodra@gmail.com>
1211 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
1213 2020-07-15 Nick Clifton <nickc@redhat.com>
1216 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
1217 check for aux entries that overflow the buufer.
1219 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
1221 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
1222 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
1224 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
1225 Alan Modra <amodra@gmail.com>
1228 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
1229 objects both before and after normal object files.
1230 * elflink.c (_bfd_elf_section_already_linked): Likewise.
1232 2020-07-10 Alan Modra <amodra@gmail.com>
1234 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
1235 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1237 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
1238 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1239 uses of power10_stubs.
1241 2020-07-09 Alan Modra <amodra@gmail.com>
1243 * coff-ppc.c: Delete.
1245 * pei-ppc.c: Delete.
1246 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
1247 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
1249 (coff_write_object_contents): Remove PPC_PE code.
1250 * config.bfd: Move powerpcle-pe to removed targets.
1251 * configure.ac: Remove powerpc PE entries.
1252 * libcoff-in.h (ppc_allocate_toc_section): Delete.
1253 (ppc_process_before_allocation): Delete.
1254 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
1255 * targets.c: Remove powerpc PE vectors.
1256 * po/SRC-POTFILES.in: Regenerate.
1257 * libcoff.h: Regenerate.
1258 * Makefile.in: Regenerate.
1259 * configure: Regenerate.
1261 2020-07-09 Nick Clifton <nickc@redhat.com>
1263 * po/fr.po: Updated French translation.
1265 2020-07-07 Alan Modra <amodra@gmail.com>
1267 * xcofflink.c (xcoff_mark): Don't mark const sections.
1268 (bfd_xcoff_record_link_assignment): Add FIXME.
1269 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
1270 sections being discarded by linker script.
1272 2020-07-07 Alan Modra <amodra@gmail.com>
1274 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
1275 time, uid, gid and mode for deterministic archive.
1276 (xcoff_write_archive_contents_big): Likewise.
1278 2020-07-07 Alan Modra <amodra@gmail.com>
1280 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
1283 2020-07-06 Nick Clifton <nickc@redhat.com>
1285 * po/pt.po: Updated Portuguese translation.
1286 * po/uk.po: Updated Ukranian translation.
1288 2020-07-04 Nick Clifton <nickc@redhat.com>
1290 * version.m4: Set version to 2.35.50.
1291 * configure: Regenerate.
1292 * po/bbfd.pot: Regenerate.
1294 2020-07-04 Nick Clifton <nickc@redhat.com>
1296 Binutils 2.35 branch created.
1298 2020-07-01 Alan Modra <amodra@gmail.com>
1301 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
1302 raw syment index before dereferencing.
1304 2020-07-01 Alan Modra <amodra@gmail.com>
1306 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
1308 2020-07-01 Alan Modra <amodra@gmail.com>
1310 * config.bfd: Obsolete xc16x.
1312 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
1314 * archures.c (bfd_mach_i386_nacl): Removed.
1315 (bfd_mach_i386_i386_nacl): Likewise.
1316 (bfd_mach_x86_64_nacl): Likewise.
1317 (bfd_mach_x64_32_nacl): Likewise.
1318 * config.bfd: Remove *-*-nacl* targets.
1319 * configure.ac: Remove x86 NaCl target vectors.
1320 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
1321 (bfd_x64_32_nacl_arch): Likewise.
1322 (bfd_x86_64_nacl_arch): Likewise.
1323 (bfd_i386_nacl_arch): Likewise.
1324 (bfd_x64_32_arch_intel_syntax): Updated.
1325 * elf32-i386.c: Don't include "elf-nacl.h".
1326 (elf_i386_nacl_plt): Removed.
1327 (elf_i386_nacl_plt0_entry): Likewise.
1328 (elf_i386_nacl_plt_entry): Likewise.
1329 (elf_i386_nacl_pic_plt0_entry): Likewise.
1330 (elf_i386_nacl_pic_plt_entry): Likewise.
1331 (elf_i386_nacl_eh_frame_plt): Likewise.
1332 (elf_i386_nacl_plt): Likewise.
1333 (elf32_i386_nacl_elf_object_p): Likewise.
1334 (elf_i386_get_synthetic_symtab): Updated.
1335 (elf_i386_link_setup_gnu_properties): Likewise.
1336 * elf64-x86-64.c: Don't include "elf-nacl.h".
1337 (elf_x86_64_nacl_plt): Removed.
1338 (elf64_x86_64_nacl_elf_object_p): Likewise.
1339 (elf_x86_64_nacl_plt0_entry): Likewise.
1340 (elf_x86_64_nacl_plt_entry): Likewise.
1341 (elf_x86_64_nacl_eh_frame_plt): Likewise.
1342 (elf_x86_64_nacl_plt): Likewise.
1343 (elf32_x86_64_nacl_elf_object_p): Likewise.
1344 (elf_x86_64_get_synthetic_symtab): Updated.
1345 (elf_x86_64_link_setup_gnu_properties): Likewise.
1346 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1347 * targets.c: Remove x86 NaCl target vectors.
1348 * bfd-in2.h: Regenerated.
1349 * configure: Likewise.
1351 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
1353 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
1354 _bfd_elf_add_dynamic_tags.
1356 2020-06-29 Alan Modra <amodra@gmail.com>
1358 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
1359 return value of bfd_bread. Don't read more than requested length.
1360 Sanity check length. Properly terminate file name.
1362 2020-06-29 Alan Modra <amodra@gmail.com>
1364 * arc-got.h: Use C style comments.
1365 * coff-z80.c: Likewise.
1366 * elf32-csky.c: Likewise.
1367 * peXXigen.c: Likewise.
1368 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
1371 2020-06-26 Pat Bernardi <bernardi@adacore.com>
1373 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
1374 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
1376 2020-06-26 Alan Modra <amodra@gmail.com>
1378 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
1379 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
1380 (riscv_get_priv_spec_name): Move to..
1381 * cpu-riscv.c: ..here.
1382 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
1383 Use %u to print unsigned numbers.
1385 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
1387 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
1388 default architecture.
1390 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1393 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
1394 _bfd_elf_add_dynamic_tags.
1396 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1399 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
1400 _bfd_elf_add_dynamic_tags.
1402 2020-06-24 Alan Modra <amodra@gmail.com>
1404 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
1405 shifts without undefined behaviour.
1407 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
1409 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
1411 (_bfd_elf_add_dynamic_tags): New.
1412 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
1413 _bfd_elf_add_dynamic_tags.
1414 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
1415 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
1416 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
1417 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
1418 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
1419 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
1420 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1421 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
1423 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
1424 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
1425 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
1426 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
1427 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
1428 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
1429 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1430 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
1431 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
1433 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
1434 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
1435 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
1436 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1437 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1438 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
1440 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1441 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1442 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
1443 dt_reloc_sz and dt_reloc_ent.
1444 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
1445 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
1447 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
1448 etab.dt_pltgot_required.
1449 (elf32_hppa_size_dynamic_sections): Call
1450 _bfd_elf_add_dynamic_tags.
1451 * elf32-metag.c (elf_metag_link_hash_table_create): Set
1452 etab.dt_pltgot_required.
1453 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
1454 * elf32-sh.c (sh_elf_link_hash_table_create): Set
1455 root.dt_pltgot_required for FDPIC output.
1456 (sh_elf_size_dynamic_sections): Call
1457 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1458 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
1459 elf.dt_pltgot_required.
1460 (elf_xtensa_size_dynamic_sections): Call
1461 _bfd_elf_add_dynamic_tags.
1462 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
1463 root.dt_pltgot_required.
1464 (elf64_hppa_size_dynamic_sections): Call
1465 _bfd_elf_add_dynamic_tags.
1466 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
1467 root.dt_pltgot_required.
1468 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
1469 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
1470 * elflink.c (_bfd_elf_add_dynamic_tags): New.
1472 2020-06-22 Saagar Jha <saagar@saagarjha.com>
1474 * mach-o.c: Support the new load commands by reading a linkedit
1475 data command for them.
1477 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1479 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
1480 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
1481 (riscv_get_priv_spec_class): Likewise.
1482 (riscv_get_priv_spec_name): Likewise.
1483 (riscv_get_priv_spec_class_from_numbers): New function, convert
1484 the version numbers into string, then call riscv_get_priv_spec_class
1485 to get the priv spec class.
1486 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
1487 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
1488 (riscv_get_priv_spec_name): Likewise.
1489 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
1490 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
1491 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
1492 of input and output objects form their priv spec attributes by
1493 riscv_get_priv_spec_class_from_numbers. Report warning rather than
1494 errors when linking objects with differnet priv spec versions. We do
1495 know v1.9.1 may have conflicts to other versions, so report the
1496 warning, too. After that, update the output priv spec version to the
1499 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1501 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
1502 priv attributes, we will check the conflicts for all of them (major,
1503 minor and revision), and then set the priv_attrs_merged to TRUE to
1504 indicate that we have handled all of the priv attributes. Remove
1505 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
1507 2020-06-21 Alan Modra <amodra@gmail.com>
1510 * configure.ac: Disable plugins by default for some targets.
1511 * plugin.c: Comment typo fix.
1512 * configure: Regenerate.
1514 2020-06-19 Nick Clifton <nickc@redhat.com>
1516 * plugin.c (try_load_plugin): Suppress the error message about
1517 being unable to open a plugin if creating a list of viable
1520 2020-06-16 Alan Modra <amodra@gmail.com>
1522 * aout-tic30.c: Delete file.
1523 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
1524 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
1525 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
1526 (xc16x-*-elf): Sort properly.
1527 * configure.ac: Remove tic30_aout_vec.
1528 * targets.c: Likewise.
1529 * Makefile.in: Regenerate.
1530 * configure: Regenerate.
1531 * po/SRC-POTFILES.in: Regenerate.
1533 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
1535 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
1536 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
1537 (elf32xtensa_abi): New global variable.
1538 (xtensa_abi_choice): New function.
1539 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
1540 XSHAL_ABI to select PLT code.
1542 2020-06-15 Roland McGrath <mcgrathr@google.com>
1544 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
1545 field of bfd_link_info.
1547 2020-06-15 Alan Modra <amodra@gmail.com>
1549 * config.bfd: Obsolete powerpcle-*-pe targets.
1551 2020-06-15 Alan Modra <amodra@gmail.com>
1554 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
1555 symbols that were defined in discarded sections.
1556 * cofflink.c (coff_link_check_archive_element): Likewise.
1557 (coff_link_add_symbols): Set indx to -3 for symbols defined in
1559 (_bfd_coff_write_global_sym): Don't emit such symbols.
1560 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
1561 libcoff.h: Regenerate.
1563 2020-06-11 Alan Modra <amodra@gmail.com>
1566 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
1568 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1570 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
1571 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
1572 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
1575 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1578 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
1579 Clear verinfo.verdef.
1581 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
1584 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
1585 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
1586 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
1588 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
1589 Set ifunc_resolvers if there are FUNC resolvers.
1590 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
1591 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
1592 with elf.ifunc_resolvers.
1593 (write_plt_relocs_for_local_syms): Likewise.
1594 (ppc64_elf_relocate_section): Likewise.
1595 (ppc64_elf_finish_dynamic_sections): Likewise.
1596 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
1598 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1599 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
1600 instead of readonly_dynrelocs_against_ifunc.
1601 * elfxx-x86.h (elf_x86_link_hash_table): Remove
1602 readonly_dynrelocs_against_ifunc.
1604 2020-06-09 Alan Modra <amodra@gmail.com>
1606 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1607 maybe_local_ifunc_resolver field.
1608 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
1609 cases where maybe_local_ifunc_resolver was set.
1610 (ppc64_elf_relocate_section): Likewise.
1611 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
1614 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
1616 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
1618 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
1620 (elf32_arm_size_dynamic_sections): Updated. Clear
1621 root.tlsdesc_plt for DF_BIND_NOW.
1622 (elf32_arm_finish_dynamic_sections): Updated.
1623 (elf32_arm_output_arch_local_syms): Likewise.
1624 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
1625 Clear root.tlsdesc_plt for DF_BIND_NOW.
1626 (nds32_elf_finish_dynamic_sections): Updated.
1627 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
1628 dt_tlsdesc_plt and dt_tlsdesc_got.
1629 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
1630 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1631 tlsdesc_plt and dt_tlsdesc_got.
1632 (elfNN_aarch64_allocate_dynrelocs): Updated.
1633 (elfNN_aarch64_finish_dynamic_sections): Likewise.
1634 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
1635 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
1637 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1638 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1639 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1640 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
1643 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1645 * elf32-tic6x.c (elf32_bed): Defined the default to
1648 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1650 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
1652 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
1653 root.splt/root.srelplt.
1654 (elf64_hppa_create_dynamic_sections): Likewise.
1655 (elf64_hppa_size_dynamic_sections): Likewise.
1656 (elf64_hppa_finish_dynamic_symbol): Likewise.
1657 (elf_hppa_final_link): Likewise.
1658 (elf_hppa_final_link_relocate): Likewise.
1660 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1662 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
1663 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1666 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1668 * elf-bfd.h (elf_target_os): New.
1669 (elf_link_hash_table): Add target_os.
1670 (elf_backend_data): Add target_os.
1671 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
1672 symbian_p and nacl_p.
1673 (create_got_section): Updated.
1674 (elf32_arm_create_dynamic_sections): Likewise.
1675 (arm_type_of_stub): Likewise.
1676 (elf32_arm_create_or_find_stub_sec): Likewise.
1677 (elf32_arm_allocate_plt_entry): Likewise.
1678 (elf32_arm_populate_plt_entry): Likewise.
1679 (elf32_arm_final_link_relocate): Likewise.
1680 (elf32_arm_check_relocs): Likewise.
1681 (allocate_dynrelocs_for_symbol): Likewise.
1682 (elf32_arm_finish_dynamic_symbol): Likewise.
1683 (elf32_arm_finish_dynamic_sections): Likewise.
1684 (elf32_arm_output_plt_map_1): Likewise.
1685 (elf32_arm_output_arch_local_syms): Likewise.
1686 (elf32_arm_add_symbol_hook): Likewise.
1687 (elf32_arm_nacl_link_hash_table_create): Likewise.
1688 (elf32_arm_vxworks_link_hash_table_create): Likewise.
1689 (elf32_arm_symbian_link_hash_table_create): Likewise.
1690 (ELF_TARGET_OS): New.
1691 * elf32-i386.c (elf_i386_arch_bed): Removed.
1692 (elf_backend_arch_data): Likewise.
1693 (elf_i386_solaris_arch_bed): Likewise.
1694 (elf_i386_nacl_arch_bed): Likewise.
1695 (elf_i386_vxworks_arch_bed): Likewise.
1696 (elf_i386_relocate_section): Updated.
1697 (elf_i386_finish_dynamic_sections): Likewise.
1698 (elf_i386_get_synthetic_symtab): Likewise.
1699 (elf_i386_link_setup_gnu_properties): Likewise.
1700 (ELF_TARGET_OS): New.
1701 * elf32-mips.c (ELF_TARGET_OS): New.
1702 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
1703 (ppc_elf_create_got): Updated.
1704 (ppc_elf_create_dynamic_sections): Likewise.
1705 (ppc_elf_check_relocs): Likewise.
1706 (ppc_elf_adjust_dynamic_symbol): Likewise.
1707 (ppc_elf_size_dynamic_sections): Likewise.
1708 (ppc_elf_relocate_section): Likewise.
1709 (ppc_elf_finish_dynamic_sections): Likewise.
1710 (ppc_elf_vxworks_link_hash_table_create): Likewise.
1711 (ELF_TARGET_OS): New.
1712 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
1713 (sh_elf_link_hash_table_create): Updated.
1714 (sh_elf_create_dynamic_sections): Likewise.
1715 (allocate_dynrelocs): Likewise.
1716 (sh_elf_size_dynamic_sections): Likewise.
1717 (sh_elf_relocate_section): Likewise.
1718 (sh_elf_finish_dynamic_symbol): Likewise.
1719 (sh_elf_finish_dynamic_sections): Likewise.
1720 (ELF_TARGET_OS): New.
1721 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
1723 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1724 (ELF_TARGET_OS): New.
1725 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
1726 (elf_x86_64_solaris_arch_bed): Likewise.
1727 (elf_x86_64_nacl_arch_bed): Likewise.
1728 (elf_x86_64_finish_dynamic_sections): Updated.
1729 (elf_x86_64_get_synthetic_symtab): Likewise.
1730 (elf_x86_64_link_setup_gnu_properties): Likewise.
1731 (ELF_TARGET_OS): New.
1732 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
1734 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
1735 (MIPS_ELF_REL_DYN_NAME): Updated.
1736 (ELF_MIPS_GP_OFFSET): Likewise.
1737 (mips_elf_create_local_got_entry): Likewise.
1738 (mips_elf_allocate_dynamic_relocations): Likewise.
1739 (mips_elf_count_got_symbols): Likewise.
1740 (is_gott_symbol): Likewise.
1741 (mips_elf_calculate_relocation): Likewise.
1742 (mips_elf_create_dynamic_relocation): Likewise.
1743 (_bfd_mips_elf_check_relocs): Likewise.
1744 (allocate_dynrelocs): Likewise.
1745 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
1746 (mips_elf_lay_out_got): Likewise.
1747 (mips_elf_set_plt_sym_value): Likewise.
1748 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1749 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1750 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1751 (_bfd_mips_elf_final_link): Likewise.
1752 (_bfd_mips_init_file_header): Likewise.
1753 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
1755 (allocate_dynrelocs): Likewise.
1756 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1757 (_bfd_sparc_elf_relocate_section): Likewise.
1758 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1759 (sparc_finish_dyn): Likewise.
1760 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1761 * elfxx-target.h (ELF_TARGET_OS): New.
1762 (elfNN_bed): Add ELF_TARGET_OS.
1763 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1764 (_bfd_x86_elf_link_hash_table_create): Likewise.
1765 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1766 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1767 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1768 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1769 * elfxx-x86.h (elf_x86_target_os): Removed.
1770 (elf_x86_backend_data): Likewise.
1771 (get_elf_x86_backend_data): Likewise.
1772 (elf_x86_link_hash_table): Remove target_os.
1774 2020-06-06 Alan Modra <amodra@gmail.com>
1777 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
1778 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
1779 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
1780 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
1781 * elf64-ppc.c: Update throughout for reloc renaming.
1782 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
1783 * libbfd.h: Regenerate.
1784 * bfd-in2.h: Regenerate.
1786 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
1789 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
1792 2020-06-05 Nick Clifton <nickc@redhat.com>
1794 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
1797 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
1799 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
1800 priv_may_conflict, in_priv_zero and out_priv_zero to decide
1801 whether the object can be linked according to it's priv
1802 attributes. The object without any priv spec attributes can
1803 be linked with others. If the first input object doesn't contain
1804 any priv attributes, then we need to copy the setting from the
1805 next input one. Also report more detailed error messages to user.
1807 2020-06-04 Stephen Casner <casner@acm.org>
1809 Extend pdp11-aout symbol table format to accommodate .stab
1810 symbols and implement correct handling of them.
1812 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
1813 (N_STAB, is_stab): Needed new function is_stab to disambiguate
1814 normal vs. .stab symbol table type values, replacing N_STAB mask.
1815 (translate_from_native_sym_flags): Determine correct section for
1816 different .stab types.
1817 (translate_to_native_sym_flags): Leave .stab types intact.
1818 (translate_symbol_table): Error if symbol indicates overlay;
1819 store desc field from .stab symbols.
1820 (write_syms): Output desc field with symbol.
1821 (aout_link_check_ar_symbols): Skip .stab symbols.
1822 (aout_link_add_symbols): Correctly distinguish .stab symbols.
1823 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
1824 (aout_link_write_symbols): Write 0 for desk and ovly fields;
1825 correctly distinguish .stab symbols and select calculate their
1826 section and value; and copy desc and ovly fields from input symbol
1829 2020-06-04 Stephen Casner <casner@acm.org>
1831 * aoutx.h (translate_symbol_table): Comment had external and
1833 * pdp11.c (translate_symbol_table): Likewise.
1835 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1837 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
1838 (is_x86_elf): Check elf.hash_table_id instead of target_id.
1839 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
1841 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1844 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
1845 in debug section against symbol defined in shared library to 0.
1846 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
1847 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
1848 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
1849 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
1850 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
1851 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1852 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
1853 * elf32-sh.c (sh_elf_check_relocs): Likewise.
1854 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1855 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1856 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1857 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1858 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1859 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
1861 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
1862 there is non-GOT reference.
1863 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
1864 non-alloced sections.
1866 2020-06-03 Stephen Casner <casner@acm.org>
1868 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
1870 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
1872 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
1873 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
1874 other size that doesn't qcover the header word.
1875 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
1876 string table, and zero it.
1877 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
1878 message and set bfd_error on finding an invalid name string offset.
1879 (add_to_stringtab): INLINE -> inline
1880 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
1882 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
1883 any relocs that could not be recognised.
1884 92744f05809 PR 20929 - Check for relocs without an associated symbol.
1885 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
1886 name exists and is long enough, before attempting to see if it is
1888 c3864421222 - Correct case for N_SO being the last symbol.
1889 50455f1ab29 PR 20891 - Handle the case where the main file name
1890 and the directory name are both empty.
1891 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
1892 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
1893 range string table offsets.
1894 531336e3a0b PR 20909 - Fix off-by-one error in check for an
1895 illegal string offset.
1896 (aout_link_includes_newfunc): Add comment.
1897 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
1898 on unexpected relocation type rather than ASSERT.
1900 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1903 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
1904 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
1906 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1909 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
1910 non-alloced sections.
1912 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1914 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
1915 dynamic relocations for non SEC_ALLOC sections.
1917 2020-06-03 Gunther Nikl <gnikl@justmail.de>
1919 * aout64.c (BMAGIC, QMAGIC): Do not define.
1920 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
1921 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
1922 to check the file format.
1923 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
1924 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
1925 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
1927 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1929 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
1930 relocations for non SEC_ALLOC sections.
1932 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1934 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
1935 * elf32-arm.c (maybe_set_textrel): Removed.
1936 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
1937 with _bfd_elf_maybe_set_textrel.
1938 * elf32-csky.c (maybe_set_textrel): Removed.
1939 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
1940 with _bfd_elf_maybe_set_textrel.
1941 * elf32-hppa.c (maybe_set_textrel): Removed.
1942 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
1943 with _bfd_elf_maybe_set_textrel.
1944 * elf32-lm32.c (maybe_set_textrel): Removed.
1945 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
1946 with _bfd_elf_maybe_set_textrel.
1947 * elf32-m32r.c (maybe_set_textrel): Removed.
1948 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
1949 with _bfd_elf_maybe_set_textrel.
1950 * elf32-metag.c (maybe_set_textrel): Removed.
1951 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
1952 with _bfd_elf_maybe_set_textrel.
1953 * elf32-nds32.c (maybe_set_textrel): Removed.
1954 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
1955 with _bfd_elf_maybe_set_textrel.
1956 * elf32-or1k.c (maybe_set_textrel): Removed.
1957 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
1958 with _bfd_elf_maybe_set_textrel.
1959 * elf32-ppc.c (maybe_set_textrel): Removed.
1960 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
1961 with _bfd_elf_maybe_set_textrel.
1962 * elf32-s390.c (maybe_set_textrel): Removed.
1963 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1964 with _bfd_elf_maybe_set_textrel.
1965 * elf32-sh.c (maybe_set_textrel): Removed.
1966 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
1967 with _bfd_elf_maybe_set_textrel.
1968 * elf32-tic6x.c (maybe_set_textrel): Removed.
1969 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
1970 with _bfd_elf_maybe_set_textrel.
1971 * elf32-tilepro.c (maybe_set_textrel): Removed.
1972 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
1973 with _bfd_elf_maybe_set_textrel.
1974 * elf64-ppc.c (maybe_set_textrel): Removed.
1975 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
1976 with _bfd_elf_maybe_set_textrel.
1977 * elf64-s390.c (maybe_set_textrel): Removed.
1978 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1979 with _bfd_elf_maybe_set_textrel.
1980 * elfnn-aarch64.c (maybe_set_textrel): Removed.
1981 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
1982 with _bfd_elf_maybe_set_textrel.
1983 * elfnn-riscv.c (maybe_set_textrel): Removed.
1984 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
1985 with _bfd_elf_maybe_set_textrel.
1986 * elfxx-sparc.c (maybe_set_textrel): Removed.
1987 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
1988 with _bfd_elf_maybe_set_textrel.
1989 * elfxx-tilegx.c (maybe_set_textrel): Removed.
1990 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
1991 with _bfd_elf_maybe_set_textrel.
1992 * elfxx-x86.c (maybe_set_textrel): Removed.
1993 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
1994 with _bfd_elf_maybe_set_textrel.
1995 * elflink.c (_bfd_elf_maybe_set_textrel): New.
1997 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2000 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
2002 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
2003 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
2004 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
2005 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
2007 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
2008 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
2009 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
2010 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2011 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
2012 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
2013 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2014 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
2015 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
2016 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2017 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
2018 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2019 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
2020 (elf_backend_copy_indirect_symbol): Likewise.
2021 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
2022 (elf_backend_copy_indirect_symbol): Likewise.
2023 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
2025 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2028 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
2029 * elf32-arm.c (readonly_dynrelocs): Removed.
2030 (maybe_set_textrel): Replace readonly_dynrelocs with
2031 _bfd_elf_readonly_dynrelocs.
2032 * elf32-csky.c (readonly_dynrelocs): Removed.
2033 (maybe_set_textrel): Replace readonly_dynrelocs with
2034 _bfd_elf_readonly_dynrelocs.
2035 * elf32-hppa.c(readonly_dynrelocs): Removed.
2036 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2037 _bfd_elf_readonly_dynrelocs.
2038 (maybe_set_textrel): Likewise.
2039 * elf32-lm32.c (readonly_dynrelocs): Removed.
2040 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2041 with _bfd_elf_readonly_dynrelocs.
2042 (maybe_set_textrel): Likewise.
2043 * elf32-m32r.c (readonly_dynrelocs): Removed.
2044 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2045 with _bfd_elf_readonly_dynrelocs.
2046 (maybe_set_textrel): Likewise.
2047 * elf32-metag.c (readonly_dynrelocs): Removed.
2048 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
2049 with _bfd_elf_readonly_dynrelocs.
2050 (maybe_set_textrel): Likewise.
2051 * elf32-microblaze.c (readonly_dynrelocs): Removed.
2052 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2053 with _bfd_elf_readonly_dynrelocs.
2054 * elf32-nds32.c (readonly_dynrelocs): Removed.
2055 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2056 with _bfd_elf_readonly_dynrelocs.
2057 (maybe_set_textrel): Likewise.
2058 * elf32-or1k.c (readonly_dynrelocs): Removed.
2059 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2060 with _bfd_elf_readonly_dynrelocs.
2061 * elf32-ppc.c (readonly_dynrelocs): Removed.
2062 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2063 _bfd_elf_readonly_dynrelocs.
2064 (ppc_elf_adjust_dynamic_symbol): Likewise.
2065 (maybe_set_textrel): Likewise.
2066 * elf32-s390.c (readonly_dynrelocs): Removed.
2067 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2068 with _bfd_elf_readonly_dynrelocs.
2069 (maybe_set_textrel): Likewise.
2070 * elf32-sh.c (readonly_dynrelocs): Removed.
2071 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
2072 _bfd_elf_readonly_dynrelocs.
2073 (maybe_set_textrel): Likewise.
2074 * elf32-tic6x.c (readonly_dynrelocs): Removed.
2075 (maybe_set_textrel): Replace readonly_dynrelocs with
2076 _bfd_elf_readonly_dynrelocs.
2077 * elf32-tilepro.c (readonly_dynrelocs): Removed.
2078 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2079 with _bfd_elf_readonly_dynrelocs.
2080 (maybe_set_textrel): Likewise.
2081 * elf64-ppc.c (readonly_dynrelocs): Removed.
2082 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2083 _bfd_elf_readonly_dynrelocs.
2084 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2085 (maybe_set_textrel): Likewise.
2086 * elf64-s390.c (readonly_dynrelocs): Removed.
2087 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2088 with _bfd_elf_readonly_dynrelocs.
2089 (maybe_set_textrel): Likewise.
2090 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
2091 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
2092 (maybe_set_textrel): Replace readonly_dynrelocs with
2093 _bfd_elf_readonly_dynrelocs.
2094 * elfnn-riscv.c (readonly_dynrelocs): Removed.
2095 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2096 with _bfd_elf_readonly_dynrelocs.
2097 (maybe_set_textrel): Likewise.
2098 * elfxx-sparc.c (readonly_dynrelocs): Removed.
2099 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
2100 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
2101 (maybe_set_textrel): Likewise.
2102 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
2103 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2104 with _bfd_elf_readonly_dynrelocs.
2105 (maybe_set_textrel): Likewise.
2106 * elfxx-x86.c (readonly_dynrelocs): Removed.
2107 (maybe_set_textrel): Replace readonly_dynrelocs with
2108 _bfd_elf_readonly_dynrelocs.
2109 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
2111 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2113 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
2114 -fsanitize=undefined.
2116 2020-06-03 Alan Modra <amodra@gmail.com>
2120 * peicode.h (pe_ILF_make_a_section): Align data for compilers
2122 (pe_ILF_build_a_bfd): Likewise.
2124 2020-06-03 Alan Modra <amodra@gmail.com>
2127 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
2128 core files as well as objects.
2130 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
2133 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
2134 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
2136 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
2137 (elf_arc_link_hash_newfunc): Updated.
2138 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
2139 (elf32_arm_link_hash_newfunc): Updated.
2140 (elf32_arm_copy_indirect_symbol): Likewise.
2141 (elf32_arm_check_relocs): Likewise.
2142 (readonly_dynrelocs): Likewise.
2143 (allocate_dynrelocs_for_symbol): Likewise.
2144 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
2145 (csky_elf_link_hash_newfunc): Updated.
2146 (csky_allocate_dynrelocs): Likewise.
2147 (readonly_dynrelocs): Likewise.
2148 (csky_elf_copy_indirect_symbol): Likewise.
2149 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
2150 (hppa_link_hash_newfunc): Updated.
2151 (elf32_hppa_copy_indirect_symbol): Likewise.
2152 (elf32_hppa_hide_symbol): Likewise.
2153 (elf32_hppa_adjust_dynamic_symbol): Likewise.
2154 (allocate_dynrelocs): Likewise.
2155 (elf32_hppa_relocate_section): Likewise.
2156 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2157 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
2158 (lm32_elf_link_hash_newfunc): Likewise.
2159 (lm32_elf_link_hash_table_create): Updated.
2160 (readonly_dynrelocs): Likewise.
2161 (allocate_dynrelocs): Likewise.
2162 (lm32_elf_copy_indirect_symbol): Likewise.
2163 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
2164 (m32r_elf_link_hash_newfunc): Likewise.
2165 (m32r_elf_link_hash_table_create): Updated.
2166 (m32r_elf_copy_indirect_symbol): Likewise.
2167 (allocate_dynrelocs): Likewise.
2168 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
2169 (metag_link_hash_newfunc): Updated.
2170 (elf_metag_copy_indirect_symbol): Likewise.
2171 (readonly_dynrelocs): Likewise.
2172 (allocate_dynrelocs): Likewise.
2173 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
2175 (link_hash_newfunc): Updated.
2176 (microblaze_elf_check_relocs): Likewise.
2177 (microblaze_elf_copy_indirect_symbol): Likewise.
2178 (readonly_dynrelocs): Likewise.
2179 (allocate_dynrelocs): Likewise.
2180 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
2181 (nds32_elf_link_hash_newfunc): Updated.
2182 (nds32_elf_copy_indirect_symbol): Likewise.
2183 (readonly_dynrelocs): Likewise.
2184 (allocate_dynrelocs): Likewise.
2185 (nds32_elf_check_relocs): Likewise.
2186 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
2187 (link_hash_newfunc): Updated.
2188 (nios2_elf32_copy_indirect_symbol): Likewise.
2189 (nios2_elf32_check_relocs): Likewise.
2190 (allocate_dynrelocs): Likewise.
2191 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
2192 (or1k_elf_link_hash_newfunc): Updated.
2193 (readonly_dynrelocs): Likewise.
2194 (allocate_dynrelocs): Likewise.
2195 (or1k_elf_copy_indirect_symbol): Likewise.
2196 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
2197 (ppc_elf_link_hash_newfunc): Updated.
2198 (ppc_elf_copy_indirect_symbol): Likewise.
2199 (ppc_elf_check_relocs): Likewise.
2200 (readonly_dynrelocs): Likewise.
2201 (ppc_elf_adjust_dynamic_symbol): Likewise.
2202 (allocate_dynrelocs): Likewise.
2203 (ppc_elf_relocate_section): Likewise.
2204 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2205 (link_hash_newfunc): Updated.
2206 (elf_s390_copy_indirect_symbol): Likewise.
2207 (readonly_dynrelocs): Likewise.
2208 (elf_s390_adjust_dynamic_symbol): Likewise.
2209 (allocate_dynrelocs): Likewise.
2210 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
2211 (sh_elf_link_hash_newfunc): Updated.
2212 (readonly_dynrelocs): Likewise.
2213 (allocate_dynrelocs): Likewise.
2214 (sh_elf_copy_indirect_symbol): Likewise.
2215 (sh_elf_check_relocs): Likewise.
2216 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
2217 (elf32_tic6x_link_hash_newfunc): Likewise.
2218 (elf32_tic6x_link_hash_table_create): Updated.
2219 (readonly_dynrelocs): Likewise.
2220 (elf32_tic6x_check_relocs): Likewise.
2221 (elf32_tic6x_allocate_dynrelocs): Likewise.
2222 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
2224 (link_hash_newfunc): Updated.
2225 (tilepro_elf_copy_indirect_symbol): Likewise.
2226 (tilepro_elf_check_relocs): Likewise.
2227 (allocate_dynrelocs): Likewise.
2228 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
2229 (ppc64_elf_copy_indirect_symbol): Updated.
2230 (ppc64_elf_check_relocs): Likewise.
2231 (readonly_dynrelocs): Likewise.
2232 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2233 (dec_dynrel_count): Likewise.
2234 (allocate_dynrelocs): Likewise.
2235 (ppc64_elf_relocate_section): Likewise.
2236 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2237 (link_hash_newfunc): Updated.
2238 (elf_s390_copy_indirect_symbol): Likewise.
2239 (readonly_dynrelocs): Likewise.
2240 (allocate_dynrelocs): Likewise.
2241 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2242 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
2244 (elfNN_aarch64_link_hash_newfunc): Updated.
2245 (elfNN_aarch64_copy_indirect_symbol): Likewise.
2246 (readonly_dynrelocs): Likewise.
2247 (need_copy_relocation_p): Likewise.
2248 (elfNN_aarch64_allocate_dynrelocs): Likewise.
2249 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
2250 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
2251 (link_hash_newfunc): Updated.
2252 (riscv_elf_copy_indirect_symbol): Likewise.
2253 (riscv_elf_check_relocs): Likewise.
2254 (readonly_dynrelocs): Likewise.
2255 (allocate_dynrelocs): Likewise.
2256 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
2258 (link_hash_newfunc): Updated.
2259 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2260 (_bfd_sparc_elf_check_relocs): Likewise.
2261 (readonly_dynrelocs): Likewise.
2262 (allocate_dynrelocs): Likewise.
2263 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
2264 (link_hash_newfunc): Updated.
2265 (tilegx_elf_copy_indirect_symbol): Likewise.
2266 (tilegx_elf_check_relocs): Likewise.
2267 (readonly_dynrelocs): Likewise.
2268 (allocate_dynrelocs): Likewise.
2269 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
2270 (readonly_dynrelocs): Likewise.
2271 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2272 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
2274 2020-06-01 Alan Modra <amodra@gmail.com>
2276 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
2277 command against cmd_length, not the end of record. For
2278 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
2279 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
2282 2020-05-28 David Faust <david.faust@oracle.com>
2284 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
2285 R_BPF_INSN_{32,64} relocations.
2287 2020-05-28 Stephen Casner <casner@acm.org>
2289 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
2290 addreses in .long (used in testsuites) and .stab values.
2292 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
2295 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
2296 Check bfd_link_dll when issue a DT_TEXTREL warning.
2297 * elfxx-x86.c (maybe_set_textrel): Likewise.
2298 (_bfd_x86_elf_size_dynamic_sections): Likewise.
2300 2020-05-26 Nick Clifton <nickc@redhat.com>
2302 * plugin.c (try_load_plugin): Extend error message when a plugin
2305 2020-05-23 Alan Modra <amodra@gmail.com>
2307 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
2309 2020-05-22 Alan Modra <amodra@gmail.com>
2312 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
2313 attributes from shared libraries, and do not return an error if
2316 2020-05-21 Alan Modra <amodra@gmail.com>
2319 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
2321 (_bfd_delete_bfd): Free the copy.
2322 (_bfd_new_bfd): Free nbfd->memory on error.
2324 2020-05-21 Alan Modra <amodra@gmail.com>
2326 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
2327 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
2328 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
2329 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
2330 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
2331 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
2332 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
2333 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
2334 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
2335 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
2336 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
2337 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
2338 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
2339 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
2340 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
2341 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
2342 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
2343 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
2344 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
2345 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
2347 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
2349 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
2350 get_default_version. It is used to find the default version for
2351 the specific extension.
2352 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
2353 default_major_version and default_minor_version. Add new bfd_boolean
2354 parameter *use_default_version. Set it to TRUE if we need to call
2355 the callback rps->get_default_version to find the default version.
2356 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
2357 the default version in riscv_parsing_subset_version, and then call
2358 riscv_add_subset to add the subset into subset list.
2359 (riscv_parse_prefixed_ext): Likewise.
2360 (riscv_std_z_ext_strtab): Support Zicsr extensions.
2361 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
2362 strings rather than characters.
2363 riscv_merge_arch_attr_info): The callback function get_default_version
2364 is only needed for assembler, so set it to NULL int the linker.
2365 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
2366 * elfxx-riscv.h: Updated.
2368 2020-05-20 Alan Modra <amodra@gmail.com>
2371 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
2372 use bfd_set_filename.
2373 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
2374 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
2375 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
2376 (bfd_create): Likewise.
2377 (_bfd_delete_bfd): Don't free filename.
2378 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
2379 return pointer to the copy or NULL on alloc fail.
2380 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
2381 result of bfd_set_filename.
2382 * bfd-in2.h: Regenerate.
2384 2020-05-20 Alan Modra <amodra@gmail.com>
2387 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
2388 section size against file size.
2389 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
2391 2020-05-19 Gunther Nikl <gnikl@justmail.de>
2394 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
2395 and memset when allocating memory for the sections_being_created
2398 2020-05-19 Stafford Horne <shorne@gmail.com>
2400 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
2402 (or1k_elf_relocate_section): Access srelgot via
2403 htab->root.srelgot. Add assertions for srelgot->contents.
2404 Introduce local variable for srelgot to not reuse global
2406 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
2407 (or1k_set_got_and_rela_sizes): New function.
2408 (or1k_initial_exec_offset): New function.
2409 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
2410 (or1k_elf_relocate_section): Allow for TLS to handle multiple
2412 (or1k_elf_check_relocs): Use OR to set TLS access.
2413 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
2415 (or1k_elf_size_dynamic_sections): Use
2416 or1k_set_got_and_rela_sizes to set sizes.
2417 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
2418 (TCB_SIZE): New macro.
2419 (tpoff): Use TCB_SIZE and alignment to calculate offset.
2420 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
2421 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
2422 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
2423 (tpoff): Add dynamic boolean argument.
2424 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
2426 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
2428 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
2429 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
2430 cases with BFD_RELOC_AARCH64_JUMP26.
2431 (elfNN_aarch64_check_relocs): Likewise.
2433 2020-05-19 Alan Modra <amodra@gmail.com>
2435 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
2436 bfd_get_filename rather than accessing bfd->filename directly.
2437 * aout-target.h (MY (object_p)): Likewise.
2438 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2439 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
2440 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
2441 (_bfd_archive_bsd44_construct_extended_name_table),
2442 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
2443 (_bfd_bsd_write_armap): Likewise.
2444 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
2445 * cache.c (bfd_open_file): Likewise.
2446 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
2447 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
2448 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2449 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2450 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
2451 * elf32-nds32.c (nds32_elf_output_symbol_hook),
2452 (patch_tls_desc_to_ie): Likewise.
2453 * elf32-spu.c (sort_bfds, print_one_overlay_section),
2454 (spu_elf_auto_overlay): Likewise.
2455 * elf64-hppa.c (elf_hppa_final_link): Likewise.
2456 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
2457 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
2458 * elflink.c (bfd_elf_size_dynamic_sections),
2459 (elf_link_input_bfd): Likewise.
2460 * linker.c (_bfd_generic_link_output_symbols): Likewise.
2461 * mach-o.c (bfd_mach_o_follow_dsym),
2462 (bfd_mach_o_close_and_cleanup): Likewise.
2463 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
2464 (find_separate_debug_file, get_build_id_name): Likewise.
2465 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2466 * plugin.c (bfd_plugin_open_input): Likewise.
2467 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
2468 * som.c (som_write_armap): Likewise.
2469 * srec.c (srec_write_record, srec_write_symbols): Likewise.
2470 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
2471 (_bfd_vms_lib_write_archive_contents): Likewise.
2472 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2474 2020-05-19 Alan Modra <amodra@gmail.com>
2477 * bfdio.c (_bfd_real_fopen): Typo fix.
2479 2020-05-18 Nick Clifton <nickc@redhat.com>
2482 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
2483 for the sections_being_created array.
2485 2020-05-18 Alan Modra <amodra@gmail.com>
2487 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
2488 they can be freed without also freeing internal_relocs.
2490 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2493 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
2494 separators into DOS style when creating a WIN32 fullpath.
2496 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
2498 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
2499 to initialize RISC-V tdata.
2501 2020-05-12 Gunther Nikl <gnikl@justmail.de>
2503 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
2506 2020-05-11 Alan Modra <amodra@gmail.com>
2508 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
2510 2020-05-11 Alan Modra <amodra@gmail.com>
2512 * elf64-ppc.c: Rename powerxx to power10 throughout.
2514 2020-05-11 Alan Modra <amodra@gmail.com>
2517 * coffgen.c (coff_get_normalized_symtab): Check that buffer
2518 contains required number of auxents before processing any auxent.
2519 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
2520 file name from auxents for PE.
2522 2020-05-04 Gunther Nikl <gnikl@justmail.de>
2524 * aout-cris.c (DEFAULT_ARCH): Delete define.
2525 (MY_set_arch_mach): Likewise.
2526 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
2528 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
2529 of r_type before the shift.
2531 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
2534 * elfnn-aarch64.c (group_sections): Copy implementation from
2537 2020-05-01 Alan Modra <amodra@gmail.com>
2540 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
2541 accessing root.u.def of symbols. Also check root.u.def.section
2542 is non-NULL. Reverse tests so as to make the logic positive.
2544 2020-05-01 Alan Modra <amodra@gmail.com>
2547 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
2548 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
2550 2020-05-01 Alan Modra <amodra@gmail.com>
2553 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
2554 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2555 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2556 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
2557 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
2558 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
2559 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
2560 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
2561 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
2562 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2564 2020-05-01 Alan Modra <amodra@gmail.com>
2567 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
2568 from shared libraries.
2570 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
2572 * elf32-xtensa.c (relax_section): Don't negate diff_value for
2573 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
2574 equals 0. Report overflow when the result has negative sign but
2575 all significant bits are zero.
2577 2020-04-29 Gunther Nikl <gnikl@justmail.de>
2579 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
2580 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2582 2020-04-28 Alan Modra <amodra@gmail.com>
2584 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
2585 Emit warning message.
2587 2020-04-27 Tamar Christina <tamar.christina@arm.com>
2589 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
2590 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
2591 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
2592 to x86_64_pe_big_vec as it not a big-endian format.
2593 (vec i386_pe_big_vec): New.
2594 * configure.ac: Likewise.
2595 * targets.c: Likewise.
2596 * configure: Regenerate.
2597 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
2598 COFF_WITH_PE_BIGOBJ): New.
2599 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
2601 (x86_64_pe_be_vec): Moved.
2603 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
2605 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
2606 * elf.c (elfcore_grok_arc_v2): New function.
2607 (elfcore_grok_note): Call the new function to handle the corresponding
2609 (elfcore_write_arc_v2): New function.
2610 (elfcore_write_register_note): Call the new function to handle the
2611 corresponding pseudo-sections.
2613 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
2616 * bfd-in2.h: Regenerated.
2617 * elf32-xtensa.c (elf_howto_table): New entries for
2618 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
2619 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
2620 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
2621 R_XTENSA_NDIFF{8,16,32}.
2622 * libbfd.h (bfd_reloc_code_real_names): Add names for
2623 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
2624 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2625 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
2626 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2628 2020-04-21 Tamar Christina <tamar.christina@arm.com>
2631 * compress.c (bfd_get_full_section_contents): Exclude sections with no
2634 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2637 * elf-bfd.h (elf_backend_data): Add
2638 elf_backend_strip_zero_sized_dynamic_sections.
2639 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
2640 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
2642 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
2644 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
2646 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
2648 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2650 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
2652 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
2654 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2656 2020-04-21 Nick Clifton <nickc@redhat.com>
2658 * po/sr.po: Updated Serbian translation.
2660 2020-04-21 Alan Modra <amodra@gmail.com>
2662 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
2665 2020-04-20 Stephen Casner <casner@acm.org>
2667 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
2668 causing globals from linker script to be treated as debug symbols.
2669 (translate_symbol_table): Don't sign-extend symbol values from 16
2670 to 64 bits in nm output.
2672 2020-04-20 Alan Modra <amodra@gmail.com>
2674 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
2676 2020-04-18 Alan Modra <amodra@gmail.com>
2678 * section.c (bfd_is_const_section): Correct test for special
2680 * bfd-in2.h: Regenerate.
2682 2020-04-17 Alan Modra <amodra@gmail.com>
2685 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
2688 2020-04-16 Nick Clifton <nickc@redhat.com>
2691 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
2692 abort with a more helpful error message.
2694 2020-04-16 Alan Modra <amodra@gmail.com>
2697 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
2700 2020-04-15 Fangrui Song <maskray@google.com>
2703 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
2704 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
2705 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2706 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
2707 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2708 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2709 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2710 * elf32-sh.c (sh_elf_relocate_section): Likewise.
2711 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2712 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2713 * elflink.c (elf_link_output_extsym): Likewise.
2714 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
2716 2020-04-15 Alan Modra <amodra@gmail.com>
2719 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
2720 pointer into strings that may be freed for section name, always
2721 allocate a new string.
2723 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2724 Jan W. Jagersma <jwjagersma@gmail.com>
2726 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
2727 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2728 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
2729 (_bfd_go32_mkobject): New functions.
2730 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
2731 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2732 (go32exe_mkobject): Call _bfd_go32_mkobject.
2733 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
2734 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
2736 (coff_write_relocs): Enable extended reloc counter code if
2737 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
2738 (coff_write_object_contents): Likewise. Pad section headers
2739 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
2740 instead of coff_swap_scnhdr_out.
2741 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
2742 enable extended reloc counter.
2743 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
2744 Declare with ATTRIBUTE_UNUSED.
2745 * libcoff-in.h: (struct coff_tdata): New field go32.
2747 * libcoff.h: Regenerate.
2749 2020-04-14 Fangrui Song <maskray@google.com>
2752 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
2755 2020-04-14 Stephen Casner <casner@acm.org>
2758 * pdp11.c: Add implementation of --imagic option.
2759 (adjust_o_magic): Fix objcopy --extract-symbol test.
2760 * libaout.h (enum aout_magic): Add i_magic.
2762 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2763 Nick Clifton <nickc@redhat.com>
2765 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
2767 <default>: Error rather than abort.
2769 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
2772 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
2773 relocation section from section group.
2775 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
2777 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
2778 bfd->origin to file offset.
2779 * bfdwin.c (bfd_get_file_window): Likewise.
2780 * bfd.c: Clarify the use of the bfd->origin field.
2781 * bfd-in2.h: Regenerate.
2782 * coff-i386.c: Don't include go32exe.h. Allow overriding
2783 coff_write_object_contents via COFF_WRITE_CONTENTS.
2784 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
2785 (go32exe_write_object_contents): New functions.
2786 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
2787 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
2788 (create_go32_stub): Remove check for 2k size limit. Read stub
2789 from go32exe_temp_stub if present.
2790 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
2791 copy variable-length stub.
2792 (go32_check_format): Read stub to go32exe_temp_stub, set
2793 origin, return go32exe_cleanup.
2794 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
2795 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
2796 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
2797 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
2798 Remove functions and their associated #defines.
2799 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
2800 * libcoff-in.h: (struct coff_tdata): New field stub_size.
2801 Rename field go32stub to stub.
2802 * libcoff.h: Regenerate.
2803 * coff-stgo32.c (go32_check_format): Rename to...
2804 (go32exe_check_format): ...this.
2805 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
2806 (go32exe_copy_private_bfd_data): ...this.
2807 (stub_bytes): Rename to...
2808 (go32exe_default_stub): ...this.
2809 (create_go32_stub): Rename to...
2810 (go32exe_create_stub): ...this.
2811 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
2814 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
2818 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
2819 relocation to R_386_32 for relocation against non-preemptible
2821 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
2822 allocate dynamic relocation for non-preemptible absolute symbol.
2823 (elf_i386_relocate_section): Pass sec to
2824 GENERATE_DYNAMIC_RELOCATION_P.
2825 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
2826 (elf_x86_64_convert_load_reloc): Covert load relocation to
2827 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
2828 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
2829 for non-preemptible absolute symbol if they overflow.
2830 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
2831 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
2832 symbol. Don't allocate dynamic relocation for non-preemptible
2834 (elf_x86_64_relocate_section): Don't generate relative relocation
2835 for GOTPCREL relocations aganst local absolute symbol. Pass sec
2836 to GENERATE_DYNAMIC_RELOCATION_P.
2837 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
2838 against non-preemptible absolute symbol.
2839 (_bfd_elf_x86_valid_reloc_p): New function.
2840 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
2842 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
2843 argument. Don't generate dynamic relocation against
2844 non-preemptible absolute symbol.
2845 (ABS_SYMBOL_P): New.
2846 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
2847 against non-preemptible absolute symbol.
2849 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
2850 (_bfd_elf_x86_valid_reloc_p): New.
2852 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2855 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
2856 address in the GOT if in thumb only mode.
2858 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2860 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
2862 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
2864 * mmo.c (mmo_scan): Create .text section only when needed, not
2867 2020-03-31 Alan Modra <amodra@gmail.com>
2869 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
2872 2020-03-31 Alan Modra <amodra@gmail.com>
2874 * vms-alpha.c (image_write): Check bounds for sections without
2875 contents too. Error on non-zero write to section without
2877 (_bfd_vms_slurp_etir): Check return of image_write* functions.
2879 2020-03-31 Alan Modra <amodra@gmail.com>
2881 * tekhex.c (pass_over): Check is_eof before reading buffer.
2883 2020-03-30 Nick Clifton <nickc@redhat.com>
2886 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
2887 field to timestamp and make it an integer.
2888 * libcoff.h: Regenerate.
2889 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
2890 field in the pe_data structure rather than the insert_timestamp
2893 2020-03-30 Alan Modra <amodra@gmail.com>
2896 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
2899 2020-03-26 Nick Clifton <nickc@redhat.com>
2901 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
2902 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
2904 * libbfd.h: Regenerate.
2906 2020-03-26 Alan Modra <amodra@gmail.com>
2908 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
2910 2020-03-26 Alan Modra <amodra@gmail.com>
2912 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
2914 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
2916 2020-03-25 Nick Clifton <nickc@redhat.com>
2918 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
2920 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
2921 * libbfd.h: Regenerate.
2923 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
2925 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
2926 correct field name in the output string.
2928 2020-03-25 Alan Modra <amodra@gmail.com>
2931 * elf.c (assign_file_positions_for_load_sections): Adjust offset
2932 for SHT_NOBITS section if first in segment.
2934 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2937 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
2938 (_bfd_elf_get_symbol_version_string): This.
2939 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
2940 (_bfd_elf_get_symbol_version_string): This.
2941 (bfd_elf_print_symbol): Pass TRUE to
2942 _bfd_elf_get_symbol_version_string.
2943 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
2944 bfd_boolean argument.
2945 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
2946 * targets.c (_bfd_get_symbol_version_string): Likewise.
2947 (bfd_get_symbol_version_string): Likewise.
2948 * bfd-in2.h: Regenerated.
2950 2020-03-24 Nick Clifton <nickc@redhat.com>
2951 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2954 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
2957 2020-03-24 Nick Clifton <nickc@redhat.com>
2960 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
2961 segment to use for PT_GNU_RELRO, ignore empty sections in a
2962 segment's current list.
2964 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2967 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2969 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2972 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
2973 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
2974 on the previous _bfd_elf_get_symbol_version_string.
2975 (_bfd_elf_get_symbol_version_string): Use it.
2977 2020-03-24 Alan Modra <amodra@gmail.com>
2979 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
2980 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
2983 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
2985 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
2987 2020-03-23 Alan Modra <amodra@gmail.com>
2989 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
2990 symbol count. Allocate an extra byte to ensure name strings
2991 are terminated. Sanity check name offsets. Release memory on
2994 2020-03-23 Alan Modra <amodra@gmail.com>
2996 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
2997 field hasn't been read. Remove unnecessary casts.
2999 2020-03-22 Alan Modra <amodra@gmail.com>
3001 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
3002 enough to read number of symbols.
3004 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
3006 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
3007 (EXECUTABLE_SUFFIX): Likewise.
3008 * config.in: Regenerated.
3009 * configure: Likewise.
3010 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
3011 _bfd_generic_close_and_cleanup.
3012 (plugin_list_entry): Remove resolution_file, resolution_option,
3013 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
3014 lto_wrapper, gcc_env and initialized,
3015 (need_lto_wrapper_p): Removed.
3016 (get_lto_wrapper): Likewise.
3017 (setup_lto_wrapper_env): Likewise.
3018 (register_all_symbols_read): Likewise.
3019 (egister_cleanup): Likewise.
3020 (get_symbols): Likewise.
3021 (add_input_file): Likewise.
3022 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
3023 (add_symbols): Updated.
3024 (try_claim): Likewise.
3025 (try_load_plugin): Likewise.
3026 (bfd_plugin_canonicalize_symtab): Likewise.
3027 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
3028 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
3030 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
3033 * plugin.c (plugin_list_entry): Add has_symbol_type.
3034 (add_symbols_v2): New function.
3035 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
3036 provides symbol type.
3037 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
3038 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
3041 2020-03-20 Alan Modra <amodra@gmail.com>
3043 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
3044 enough to read number of symbols.
3046 2020-03-20 Alan Modra <amodra@gmail.com>
3048 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
3049 backend functions for NULL before calling.
3050 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
3051 (bfd_section_from_shdr, assign_section_numbers): Likewise.
3052 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
3053 * elfnn-ia64.c (ignore_errors): New function.
3054 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
3056 2020-03-19 Nick Clifton <nickc@redhat.com>
3059 * dwarf2.c (struct varinfo): Add unit_offset field to record the
3060 location of the varinfo in the unit's debug info data. Change the
3061 type of the stack field to a boolean.
3062 (lookup_var_by_offset): New function. Returns the varinfo
3063 structure for the variable described at the given offset in the
3065 (scan_unit_for_symbols): Add support for variables which have the
3066 DW_AT_specification attribute.
3068 2020-03-19 Nick Clifton <nickc@redhat.com>
3071 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
3074 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
3076 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
3078 2020-03-18 Nick Clifton <nickc@redhat.com>
3081 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
3082 memory access when processing a corrupt secondary reloc section.
3084 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
3086 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
3087 instead of calling abort.
3088 * elf32-csky.c (csky_build_one_stub): Likewise.
3089 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3090 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3091 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3092 * elf32-metag.c (metag_build_one_stub): Likewise.
3093 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3094 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3095 (ppc_size_one_stub): Likewise.
3096 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3098 2020-03-17 Nick Clifton <nickc@redhat.com>
3101 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
3102 with error messages.
3104 2020-03-17 Nick Clifton <nickc@redhat.com>
3107 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
3108 free. Add free on another failure path.
3110 2020-03-16 Alan Modra <amodra@gmail.com>
3113 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
3114 we have a non-zero section count. Do lma comparison in octets.
3116 2020-03-16 Alan Modra <amodra@gmail.com>
3118 * vms-alpha.c (dst_restore_location): Validate index into
3119 dst_ptr_offsets array before accessing. Return status.
3120 (dst_retrieve_location): Similarly, making "loc" parameter a
3121 pointer to return value.
3122 (_bfd_vms_slurp_etir): Update calls to above functions.
3124 2020-03-14 Kamil Rytarowski <n54@gmx.com>
3126 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
3128 * configure: Regenerated.
3130 2020-03-14 Alan Modra <amodra@gmail.com>
3132 * section.c (BFD_FAKE_SECTIONS): Formatting.
3133 * bfd-in2.h: Regenerate.
3135 2020-03-13 Kamil Rytarowski <n54@gmx.com>
3137 * elf.c (elfcore_grok_netbsd_note): Add support for
3138 NT_NETBSDCORE_LWPSTATUS notes.
3140 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
3142 * bfd-in2.h: Regenerate.
3143 * section.c (asection): Add already_assigned field.
3144 (BFD_FAKE_SECTION): Add default initializer for it.
3145 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
3146 * elf32-arm.c (arm_build_one_stub): Add support for
3147 non_contiguous_regions.
3148 * elf32-csky.c (csky_build_one_stub): Likewise.
3149 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3150 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3151 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3152 * elf32-metag.c (metag_build_one_stub): Likewise.
3153 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3154 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3155 (ppc_size_one_stub): Likewise.
3156 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3157 * elflink.c (elf_link_input_bfd): Likewise.
3159 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
3162 * elf-linker-x86.h (elf_linker_x86_params): Add
3163 static_before_all_inputs and has_dynamic_linker.
3164 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
3165 dynamic input objects if -static is passed at command-line
3166 before all input files without --dynamic-linker unless
3167 --no-dynamic-linker is used.
3169 2020-03-13 Kamil Rytarowski <n54@gmx.com>
3171 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
3173 2020-03-13 Christian Eggers <ceggers@gmx.de>
3175 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
3176 "p_paddr" from "at".
3177 * elfcode.h (bfd_from_remote_memory): Add units to several
3178 parameters. New local "opb". Fix usage of p_align. Fix
3179 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
3180 call of target_read_memory.
3181 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
3182 calculation of "offset" and "output_offset".
3183 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
3184 from "offset" and fix calculation of "end" from "vma+size". Fix
3185 comparison between "sh_addr" and "vma"/"output_offset".
3186 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
3187 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
3189 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
3190 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
3191 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
3192 assignment of p_paddr from phdr_lma. Fix comparison between
3193 "lma+size" and "next->lma".
3194 (elf_sort_segments): Fix assignment from p_paddr to lma.
3195 (assign_file_positions_for_load_sections): Add unit (bytes) to
3196 local "align". Fix calculation of local "off_adjust". Fix
3197 calculation of local "filehdr_vaddr".
3198 (assign_file_positions_for_non_load_sections): New local "opb".
3199 Fix calculation of "end" from "p_size". Fix comparison between
3200 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
3201 from "end" and "p_vaddr".
3202 (rewrite_elf_program_header): Fix comparison between p_vaddr and
3203 vma. Fix assignment to p_paddr from lma. Fix comparison between
3204 p_paddr and lma. Fix assignment to p_paddr from lma.
3205 * merge.c (sec_merge_emit): New local "opb". Convert
3206 "alignment_power" to octets.
3207 (_bfd_add_merge_section): New locals "alignment_power" and
3208 "opb". Fix comparison between "alignment_power" and
3210 (_bfd_merge_sections): New local "opb". Divide size by opb
3211 before checking align mask.
3213 2020-03-13 Christian Eggers <ceggers@gmx.de>
3215 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
3216 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
3218 (_bfd_elf_make_section_from_phdr): Similarly.
3219 (elf_fake_sections): Fix calculation of
3220 Elf_Internal_shdr::sh_addr from section VMA.
3221 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
3223 (assign_file_positions_for_load_sections): Fix calculations of
3224 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
3225 comparison between program header address and section LMA.
3226 (assign_file_positions_for_non_load_sections): Likewise.
3227 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
3228 (IS_CONTAINED_BY_VMA): Add parameter opb.
3229 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
3230 INCLUDE_SECTION_IN_SEGMENT): Likewise.
3231 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
3232 Fix calculations of p_addr_valid and p_vaddr_offset.
3233 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
3234 with octets per byte when comparing against p_vaddr.
3236 2020-03-11 Alan Modra <amodra@gmail.com>
3238 * som.c (setup_sections): Sanity check subspace.name.
3240 2020-03-11 Alan Modra <amodra@gmail.com>
3242 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
3244 2020-03-10 Alan Modra <amodra@gmail.com>
3247 * ihex.c (ihex_write_object_contents): Don't assume ordering of
3250 2020-03-09 Alan Modra <amodra@gmail.com>
3252 * wasm-module.c (wasm_scan): Sanity check file name length
3253 before allocating memory. Move common section setup code. Do
3254 without bfd_tell to calculate section size.
3256 2020-03-06 Nick Clifton <nickc@redhat.com>
3258 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
3259 with error messages and failure return values.
3261 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
3263 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
3264 relocation sections for any removed reference to a dynamic symbol.
3266 2020-03-05 Nick Clifton <nickc@redhat.com>
3268 * elf-bfd.h (struct elf_backend_data): Add new fields:
3269 init_secondary_reloc_section, slurp_secondary_reloc_section,
3270 write_secondary_reloc_section.
3271 (_bfd_elf_init_secondary_reloc_section): Prototype.
3272 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
3273 (_bfd_elf_write_secondary_reloc_section): Prototype.
3274 * elf.c ( bfd_section_from_shdr): Invoke the new
3275 init_secondary_reloc_section backend function, if defined, when a
3276 second reloc section is encountered.
3277 (swap_out_syms): Invoke the new symbol_section_index function, if
3278 defined, when computing the section index of an OS/PROC specific
3280 (_bfd_elf_init_secondary_reloc_section): New function.
3281 (_bfd_elf_slurp_secondary_reloc_section): New function.
3282 (_bfd_elf_write_secondary_reloc_section): New function.
3283 (_bfd_elf_copy_special_section_fields): New function.
3284 * elfcode.h (elf_write_relocs): Invoke the new
3285 write_secondary_relocs function, if defined, in order to emit
3287 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
3288 function, if defined, in order to read in secondary relocs.
3289 * elfxx-target.h (elf_backend_copy_special_section_fields):
3290 Provide a non-NULL default definition.
3291 (elf_backend_init_secondary_reloc_section): Likewise.
3292 (elf_backend_slurp_secondary_reloc_section): Likewise.
3293 (elf_backend_write_secondary_reloc_section): Likewise.
3294 (struct elf_backend_data elfNN_bed): Add initialisers for the new
3296 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
3297 * configure: Regenerate.
3299 2020-03-05 Alan Modra <amodra@gmail.com>
3301 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
3302 against file size before allocating memory. Use bfd_alloc rather
3303 than bfd_zalloc for carsym/strings memory.
3305 2020-03-04 Alan Modra <amodra@gmail.com>
3307 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
3308 sh_addr mod sh_addalign is zero.
3310 2020-03-04 Alan Modra <amodra@gmail.com>
3312 * format.c (bfd_check_format_matches): Call cleanup on error exit.
3314 2020-03-03 Alan Modra <amodra@gmail.com>
3316 * format.c (struct bfd_preserve): Add cleanup field.
3317 (bfd_preserve_save): Add cleanup param and save.
3318 (bfd_preserve_restore): Return cleanup.
3319 (bfd_preserve_finish): Call the cleanup for the discarded match.
3320 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
3321 and clear when preserving a match. Restore cleanup too when
3322 restoring that match.
3324 2020-03-02 Alan Modra <amodra@gmail.com>
3326 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
3327 * hpux-core.c (hpux_core_core_file_p): Update prototype.
3328 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
3329 (core_sco5_vec): Correct initialisers.
3331 2020-03-02 Alan Modra <amodra@gmail.com>
3333 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
3334 * aix5ppc-core.c (xcoff64_core_p): Likewise.
3335 * cisco-core.c (cisco_core_file_validate): Likewise.
3336 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
3337 * hpux-core.c (hpux_core_core_file_p): Likewise.
3338 * irix-core.c (irix_core_core_file_p): Likewise.
3339 * lynx-core.c (lynx_core_file_p): Likewise.
3340 * netbsd-core.c (netbsd_core_file_p): Likewise.
3341 * osf-core.c (osf_core_core_file_p): Likewise.
3342 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3343 * sco5-core.c (sco5_core_file_p): Likewise.
3345 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
3347 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
3349 2020-03-02 Alan Modra <amodra@gmail.com>
3351 * targets.c (bfd_cleanup): New typedef.
3352 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
3353 * libbfd-in.h (_bfd_no_cleanup): Define.
3354 * format.c (bfd_reinit): Add cleanup parameter, call it.
3355 (bfd_check_format_matches): Set cleanup from _bfd_check_format
3356 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
3357 * aout-target.h (callback, object_p): Return bfd_cleanup.
3358 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
3359 * archive.c (bfd_generic_archive_p): Likewise.
3360 * binary.c (binary_object_p): Likewise.
3361 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
3362 * coff-ia64.c (ia64coff_object_p): Likewise.
3363 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
3364 * coff-sh.c (coff_small_object_p): Likewise.
3365 * coff-stgo32.c (go32_check_format): Likewise.
3366 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
3367 (xcoff64_core_p): Likewise.
3368 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
3369 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
3370 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
3371 * elfcode.h (elf_object_p): Likewise.
3372 * elfcore.h (elf_core_file_p): Likewise.
3373 * i386msdos.c (msdos_object_p): Likewise.
3374 * ihex.c (ihex_object_p): Likewise.
3375 * libaout.h (some_aout_object_p): Likewise.
3376 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
3377 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
3378 * libbfd.c (_bfd_dummy_target): Likewise.
3379 * libcoff-in.h (coff_object_p): Likewise.
3380 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
3381 (bfd_mach_o_arm64_core_p): Likewise.
3382 * mach-o-arm.c (bfd_mach_o_arm_object_p),
3383 (bfd_mach_o_arm_core_p): Likewise.
3384 * mach-o-i386.c (bfd_mach_o_i386_object_p),
3385 (bfd_mach_o_i386_core_p): Likewise.
3386 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
3387 (bfd_mach_o_x86_64_core_p): Likewise.
3388 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
3389 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
3390 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
3391 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
3392 * mmo.c (mmo_object_p): Likewise.
3393 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
3394 * peicode.h (coff_real_object_p, pe_ILF_object_p),
3395 (pe_bfd_object_p): Likewise.
3396 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
3397 * ppcboot.c (ppcboot_object_p): Likewise.
3398 * rs6000-core.c (rs6000coff_core_p): Likewise.
3399 * som.c (som_object_setup, som_object_p): Likewise.
3400 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
3401 * tekhex.c (tekhex_object_p): Likewise.
3402 * vms-alpha.c (alpha_vms_object_p): Likewise.
3403 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
3404 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
3405 * wasm-module.c (wasm_object_p): Likewise.
3406 * xsym.c (bfd_sym_object_p): Likewise.
3407 * xsym.h (bfd_sym_object_p): Likewise.
3408 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
3410 * pdp11.c (some_aout_object_p): Likewise.
3411 * plugin.c (register_ld_plugin_object_p): Update object_p
3413 * plugin.h (register_ld_plugin_object_p): Likewise.
3414 * bfd-in2.h: Regenerate.
3415 * libbfd.h: Regenerate.
3416 * libcoff.h: Regenerate.
3418 2020-03-02 Alan Modra <amodra@gmail.com>
3420 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
3421 applicable section flags.
3422 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
3423 (mips_ecoff_bele_vec): Likewise.
3424 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
3426 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
3427 (_bfd_ecoff_styp_to_sec_flags): Likewise.
3429 2020-03-02 Alan Modra <amodra@gmail.com>
3431 * elf32-m32r.c (m32r_elf_section_flags): New function.
3432 (elf_backend_section_flags): Define.
3433 * elf32-nds32.c (nds32_elf_section_flags): New function.
3434 (elf_backend_section_flags): Define.
3435 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
3436 .sbss and .sdata sections.
3437 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
3438 for SHF_V850_GPREL sections.
3439 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
3441 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
3442 for SHF_PARISC_SHORT sections.
3443 * elf64-ppc.c (ppc64_elf_section_flags): New function.
3444 (elf_backend_section_flags): Define.
3445 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
3446 for SHF_MIPS_GPREL sections. Delete FIXME.
3448 2020-03-02 Alan Modra <amodra@gmail.com>
3450 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
3451 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
3452 calling elf_backend_section_flags with adjusted params. Use
3453 newsect->flags past that point.
3454 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
3456 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
3457 to have their type overridden, and all sh_flags but processor and
3459 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
3460 * elf32-mep.c (mep_elf_section_flags): Likewise.
3461 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
3462 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
3463 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
3464 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
3465 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
3466 stub BFD and non-aarch64 input files when scanning for stubs.
3468 2020-03-02 Alan Modra <amodra@gmail.com>
3470 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
3471 limit to decompressed element size.
3473 2020-03-02 Alan Modra <amodra@gmail.com>
3475 * vms-lib.c (vms_traverse_index): Add recur_count param and
3476 update calls. Fail on excessive recursion.
3478 2020-03-02 Alan Modra <amodra@gmail.com>
3480 * vms-alpha.c (vms_get_remaining_object_record): Use
3481 bfd_realloc_or_free rather than bfd_realloc.
3482 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
3483 (dst_define_location, parse_module): Likewise, and check realloc
3484 return status before using memory. Return status from function
3485 adjusting all callers.
3487 2020-02-28 Alan Modra <amodra@gmail.com>
3489 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
3491 2020-02-28 Alan Modra <amodra@gmail.com>
3493 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
3494 Remove duplicate undersize check.
3496 2020-02-27 Alan Modra <amodra@gmail.com>
3499 * mmo.c (mmo_scan): Set SEC_DATA for .data.
3501 2020-02-27 Alan Modra <amodra@gmail.com>
3504 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
3505 (coff_section_type): Adjust comment.
3506 (decode_section_type): Likewise. Call coff_section_type before
3507 decode_section_type.
3508 (bfd_decode_symclass): Use 'c' for common sections other than
3511 2020-02-27 Alan Modra <amodra@gmail.com>
3513 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
3516 2020-02-27 Alan Modra <amodra@gmail.com>
3518 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
3519 if file is an archive element.
3520 * bfd-in2.h: Regenerate.
3522 2020-02-26 Alan Modra <amodra@gmail.com>
3524 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
3525 bfd_set_error on failing test. Don't bother changing bfd_error on
3526 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
3527 Check sym name is within string buffer. Use size_t for some vars.
3528 (do_slurp_coff_armap): Use size_t for some variables, fix size of
3529 int_buf. Don't change bfd_error on file read error. Use
3530 _bfd_mul_overflow when calculating carsym buffer size. Reorder
3531 calculations to catch overflows before they occur. malloc and
3532 free raw armap rather than using bfd_alloc. Read raw armap before
3533 allocating carsym+strings buffer.
3534 (_bfd_slurp_extended_name_table): Localize variables. Check
3535 name size against file size.
3537 2020-02-26 Alan Modra <amodra@gmail.com>
3539 * vms-lib.c (vms_lib_read_index): Release correct buffer.
3541 2020-02-26 Alan Modra <amodra@gmail.com>
3543 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
3544 malloc. Check for NULL return from bfd_malloc.
3545 (rx_table_find, rx_table_map): Likewise.
3546 (rx_set_section_contents): Check bfd_alloc return.
3547 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
3549 2020-02-26 Alan Modra <amodra@gmail.com>
3551 * aoutx.h: Indent labels correctly. Format error strings.
3552 * archive.c: Likewise.
3553 * archive64.c: Likewise.
3554 * coff-arm.c: Likewise.
3555 * coff-rs6000.c: Likewise.
3556 * coff-stgo32.c: Likewise.
3557 * cpu-arm.c: Likewise.
3558 * dwarf2.c: Likewise.
3559 * elf-ifunc.c: Likewise.
3560 * elf-properties.c: Likewise.
3561 * elf-s390-common.c: Likewise.
3562 * elf-strtab.c: Likewise.
3564 * elf32-arm.c: Likewise.
3565 * elf32-bfin.c: Likewise.
3566 * elf32-cr16.c: Likewise.
3567 * elf32-csky.c: Likewise.
3568 * elf32-i386.c: Likewise.
3569 * elf32-m68k.c: Likewise.
3570 * elf32-msp430.c: Likewise.
3571 * elf32-nds32.c: Likewise.
3572 * elf32-nios2.c: Likewise.
3573 * elf32-pru.c: Likewise.
3574 * elf32-xtensa.c: Likewise.
3575 * elf64-ia64-vms.c: Likewise.
3576 * elf64-x86-64.c: Likewise.
3577 * elfcode.h: Likewise.
3578 * elfcore.h: Likewise.
3579 * elflink.c: Likewise.
3580 * elfnn-aarch64.c: Likewise.
3581 * elfnn-ia64.c: Likewise.
3582 * elfnn-riscv.c: Likewise.
3583 * elfxx-mips.c: Likewise.
3584 * elfxx-sparc.c: Likewise.
3585 * elfxx-x86.c: Likewise.
3586 * i386lynx.c: Likewise.
3587 * merge.c: Likewise.
3588 * pdp11.c: Likewise.
3589 * plugin.c: Likewise.
3590 * reloc.c: Likewise.
3592 2020-02-26 Alan Modra <amodra@gmail.com>
3595 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
3597 (bfd_elf_add_dt_needed_tag): Declare.
3598 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
3599 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
3600 from elf_add_dt_needed_tag. Remove soname and doit param.
3601 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
3602 to see whether as-needed lib is already loaded, use dyn_loaded
3603 list instead. When saving and restoring around as-needed lib
3604 handle possibility that dynstr has not been initialised. Don't
3605 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
3606 Mark libs loaded via DT_NEEDED entries of other libs with
3607 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
3609 (elf_link_check_versioned_symbol): Remove now unneccesary
3610 DYNAMIC check when traversing dyn_loaded list.
3612 2020-02-26 Alan Modra <amodra@gmail.com>
3614 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
3616 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
3619 * plugin.c (need_lto_wrapper_p): New.
3620 (bfd_plugin_set_program_name): Add an int argument to set
3622 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
3624 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
3626 2020-02-24 Alan Modra <amodra@gmail.com>
3628 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
3630 2020-02-24 Alan Modra <amodra@gmail.com>
3632 * vms-lib.c (struct carsym_mem): Add limit.
3633 (vms_add_index): Heed limit.
3634 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
3635 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
3636 Always return actual number read.
3637 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
3638 assertion with error exit.
3640 2020-02-22 Alan Modra <amodra@gmail.com>
3643 * elf.c (assign_file_positions_for_load_sections): Continue linking
3644 on "PHDR segment not covered by LOAD segment" errors.
3646 2020-02-21 Alan Modra <amodra@gmail.com>
3648 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
3650 (bfd_mach_o_canonicalize_reloc): Likewise.
3651 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
3652 counts and offsets against file size.
3653 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
3654 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
3655 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
3656 against file size. Delete symbol table error message.
3657 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
3659 (bfd_mach_o_read_symtab): Likewise.
3660 (bfd_mach_o_read_command): Pass file size.
3661 (bfd_mach_o_scan): Sanity check command count against file size.
3663 2020-02-21 Alan Modra <amodra@gmail.com>
3666 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
3667 "text", "data" and "bss" section pointer vars. Don't update
3668 section size, just exec header sizes.
3669 (adjust_sizes_and_vmas): Don't update text section size. Set
3670 initial exec header a_text. Print exec headers sizes.
3671 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
3672 (adjust_sizes_and_vmas): Similarly. Formatting.
3673 (final_link): Correct final file extension.
3675 2020-02-20 Nick Clifton <nickc@redhat.com>
3677 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
3679 * elfxx-target.h (elf_backend_symbol_section_index): Provide
3681 (elfNN_bed): Initialise the symbol_section_index field.
3682 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
3683 OS and PROC specific section indicies. Warn if converting other
3684 reserved incidies to SHN_ABS.
3686 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
3689 * cpu-z80.c: Add machine type compatibility checking.
3691 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
3694 * plugin.c (plugin_list_entry): Remove handle.
3695 (try_load_plugin): Call dlclose before return.
3697 2020-02-19 Alan Modra <amodra@gmail.com>
3699 * libbfd-in.h (_bfd_constant_p): Define.
3700 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
3701 file size before allocating memory.
3702 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
3703 * elf.c (bfd_elf_get_str_section): Likewise.
3704 (_bfd_elf_slurp_version_tables): Likewise.
3705 * libbfd.h: Regenerate.
3707 2020-02-19 Alan Modra <amodra@gmail.com>
3709 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
3710 * aoutx.h (aout_get_external_symbols): Replace calls to
3711 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
3712 (slurp_reloc_table): Likewise.
3713 * archive.c (do_slurp_bsd_armap): Likewise.
3714 (do_slurp_coff_armap): Likewise.
3715 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
3716 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
3717 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
3718 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
3719 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
3720 (_bfd_coff_get_external_symbols): Likewise.
3721 * ecoff.c (ecoff_slurp_symbolic_header),
3722 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
3723 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
3724 (ecoff_indirect_link_order): Likewise.
3725 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
3726 (_bfd_elf_slurp_version_tables): Likewise.
3727 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3728 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3729 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3730 * elf64-alpha.c (READ): Likewise.
3731 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
3732 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3733 * elfcode.h (elf_slurp_symbol_table),
3734 (elf_slurp_reloc_table_from_section): Likewise.
3735 * elflink.c (elf_link_add_object_symbols),
3736 (elf_link_check_versioned_symbol): Likewise.
3737 * elfxx-mips.c (READ): Likewise.
3738 * i386lynx.c (slurp_reloc_table): Likewise.
3739 * lynx-core.c (lynx_core_file_p): Likewise.
3740 * mach-o.c (bfd_mach_o_canonicalize_relocs),
3741 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
3742 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
3743 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
3744 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
3745 (bfd_pef_parse_symbols): Likewise.
3746 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
3747 * som.c (setup_sections, som_slurp_string_table),
3748 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3749 (som_bfd_fill_in_ar_symbols): Likewise.
3750 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
3751 (evax_bfd_print_image): Likewise.
3752 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
3753 * wasm-module.c (wasm_scan): Likewise.
3754 * xcofflink.c (xcoff_link_add_symbols): Likewise.
3755 * xsym.c (bfd_sym_read_name_table),
3756 (bfd_sym_print_type_information_table_entry): Likewise.
3757 * libbfd.h: Regenerate.
3759 2020-02-19 Alan Modra <amodra@gmail.com>
3761 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
3762 reading external relocs.
3763 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
3764 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
3766 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
3768 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
3769 (m32c_elf_relax_section): Likewise.
3770 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
3771 (rl78_elf_relax_section): Likewise.
3772 * elf32-rx.c (rx_offset_for_reloc): Likewise.
3773 (elf32_rx_relax_section): Likewise.
3774 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
3775 parameter types and use..
3776 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
3777 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
3778 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
3779 being read from file, just the extra.
3780 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
3781 after reading external syms. Free on failure.
3783 2020-02-19 Alan Modra <amodra@gmail.com>
3785 * coffcode.h (buy_and_read, coff_slurp_line_table),
3786 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
3787 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
3788 corresponding bfd_alloc call. Adjust variables to suit.
3789 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
3790 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
3791 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
3792 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
3793 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
3794 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3795 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3796 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3797 * elf64-alpha.c (READ): Likewise.
3798 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
3799 (elf_slurp_symbol_table, elf_slurp_reloc_table),
3800 (bfd_from_remote_memory): Likewise.
3801 * elfcore.h (core_find_build_id): Likewise.
3802 * elfxx-mips.c (READ): Likewise.
3803 * mach-o.c (bfd_mach_o_mangle_sections),
3804 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
3805 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
3806 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
3807 * som.c (setup_sections, som_prep_for_fixups)
3808 (som_build_and_write_symbol_table, som_slurp_symbol_table),
3809 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3810 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
3811 (som_bfd_ar_write_symbol_stuff): Likewise.
3812 * vms-alpha.c (vector_grow1): Likewise.
3813 * vms-lib.c (vms_add_index): Likewise.
3814 * wasm-module.c (wasm_scan_name_function_section): Likewise.
3815 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
3816 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
3817 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
3818 (bfd_alloc2, bfd_zalloc2): Delete.
3819 (_bfd_mul_overflow): Define.
3820 * libbfd.h: Regenerate.
3822 2020-02-19 Alan Modra <amodra@gmail.com>
3824 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
3826 (assign_section_numbers): Likewise.
3827 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
3828 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
3829 bfd_malloc2, size_t amt, and unsigned tls_count.
3830 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
3831 * elflink.c (elf_create_symbuf): Use bfd_malloc.
3832 (elf_output_implib): Use bfd_alloc.
3834 2020-02-19 Alan Modra <amodra@gmail.com>
3836 * bfd.c (struct bfd): Move format and direction to other
3837 bitfields. Add "size".
3838 * bfdio.c (bfd_get_size): Cache size when not writing file.
3839 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
3840 returning zero, ie. unknown.
3841 (bfd_get_alt_debug_link_info): Likewise.
3842 * bfd-in2.h: Regenerate.
3844 2020-02-19 Alan Modra <amodra@gmail.com>
3846 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
3847 bfd_get_file_size twice.
3848 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
3849 zero, ie. unknown, return.
3850 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
3851 * elfcode.h (elf_swap_shdr_in): Likewise.
3852 (elf_object_p): Don't call bfd_get_file_size twice and correct
3855 2020-02-19 Alan Modra <amodra@gmail.com>
3857 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
3858 FALSE if memory alloc fails. Adjust calls.
3859 * som.c (som_prep_for_fixups): Likewise.
3860 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
3861 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
3862 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
3863 * som.c (som_build_and_write_symbol_table): Return via error_return
3865 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
3866 (VEC_APPEND_EL): Delete.
3867 (vector_grow1): Return pointer to element. Catch overflow.
3868 Return NULL on memory allocation failure.
3869 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
3870 (alpha_vms_add_fixup_ca): Likewise.
3871 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
3873 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
3875 2020-02-19 Alan Modra <amodra@gmail.com>
3877 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
3878 * aout-target.h (object_p): Likewise.
3879 * aout-tic30.c (tic30_aout_object_p): Likewise.
3880 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
3881 (emit_stringtab, write_syms, link_hash_table_create),
3882 (aout_link_write_other_symbol): Likewise.
3883 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
3884 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
3885 (_bfd_compute_and_write_armap): Likewise.
3886 * archures.c (bfd_arch_list): Likewise.
3887 * bfd.c (bfd_record_phdr): Likewise.
3888 * binary.c (binary_canonicalize_symtab): Likewise.
3889 * cisco-core.c (cisco_core_file_validate): Likewise.
3890 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
3891 (find_arm_glue, record_arm_to_thumb_glue),
3892 (record_thumb_to_arm_glue): Likewise.
3893 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
3894 (ppc_allocate_toc_section): Likewise.
3895 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
3896 * coff-sh.c (sh_relax_section): Likewise.
3897 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
3898 * coffcode.h (handle_COMDAT, coff_new_section_hook),
3899 (coff_set_alignment_hook, coff_mkobject),
3900 (coff_compute_section_file_positions): Likewise.
3901 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
3902 (coff_find_nearest_line_with_names),
3903 ( bfd_coff_set_symbol_class): Likewise.
3904 * cofflink.c (_bfd_coff_link_hash_table_create),
3905 (_bfd_coff_link_input_bfd): Likewise.
3906 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
3907 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
3908 (build_line_info_table, sort_line_sequences),
3909 (line_info_add_include_dir, line_info_add_file_name),
3910 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
3911 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
3912 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
3913 (_bfd_ecoff_find_nearest_line),
3914 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
3915 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
3916 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
3917 * elf-m10300.c (mn10300_elf_relax_section),
3918 (elf32_mn10300_link_hash_table_create): Likewise.
3919 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
3920 * elf.c (make_mapping, copy_elf_program_header): Likewise.
3921 * elf32-arm.c (elf32_arm_link_hash_table_create),
3922 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
3923 (elf32_arm_new_section_hook): Likewise.
3924 * elf32-avr.c (elf_avr_new_section_hook),
3925 (elf32_avr_link_hash_table_create, get_local_syms),
3926 (elf32_avr_setup_section_lists): Likewise.
3927 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
3928 (bfin_link_hash_table_create): Likewise.
3929 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
3930 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
3931 * elf32-csky.c (csky_elf_link_hash_table_create),
3932 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
3933 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
3934 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
3935 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
3936 * elf32-i386.c (elf_i386_check_relocs): Likewise.
3937 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
3938 * elf32-m32r.c (m32r_elf_link_hash_table_create),
3939 (m32r_elf_check_relocs): Likewise.
3940 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
3941 (elf32_m68hc11_setup_section_lists),
3942 (elf32_m68hc11_size_stubs): Likewise.
3943 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
3944 * elf32-metag.c (elf_metag_link_hash_table_create),
3945 (elf_metag_setup_section_lists): Likewise.
3946 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
3947 (microblaze_elf_check_relocs): Likewise.
3948 * elf32-nds32.c (nds32_elf_link_hash_table_create),
3949 (nds32_elf_check_relocs): Likewise.
3950 * elf32-nios2.c (nios2_elf32_setup_section_lists),
3951 (get_local_syms, nios2_elf32_check_relocs),
3952 (nios2_elf32_link_hash_table_create): Likewise.
3953 * elf32-or1k.c (or1k_elf_link_hash_table_create),
3954 (or1k_elf_check_relocs): Likewise.
3955 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
3956 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
3957 * elf32-s390.c (elf_s390_link_hash_table_create),
3958 (elf_s390_check_relocs): Likewise.
3959 * elf32-score.c (score_elf_create_got_section),
3960 (s3_elf32_score_new_section_hook),
3961 (elf32_score_link_hash_table_create): Likewise.
3962 * elf32-score7.c (score_elf_create_got_section),
3963 (s7_elf32_score_new_section_hook): Likewise.
3964 * elf32-sh.c (sh_elf_link_hash_table_create),
3965 (sh_elf_check_relocs): Likewise.
3966 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
3967 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
3968 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
3969 (tilepro_elf_check_relocs): Likewise.
3970 * elf32-v850.c (remember_hi16s_reloc): Likewise.
3971 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
3972 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
3973 (elf_xtensa_new_section_hook): Likewise.
3974 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
3975 (get_got_entry, elf64_alpha_check_relocs): Likewise.
3976 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
3977 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
3978 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
3979 * elf64-ppc.c (ppc64_elf_new_section_hook),
3980 (ppc64_elf_link_hash_table_create, update_local_sym_info),
3981 (update_plt_info, ppc64_elf_check_relocs): Likewise.
3982 * elf64-s390.c (elf_s390_link_hash_table_create),
3983 (elf_s390_check_relocs): Likewise.
3984 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
3985 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
3986 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
3987 (elf_link_add_archive_symbols, compute_bucket_count),
3988 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
3989 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
3990 (bfd_elf_final_link): Likewise.
3991 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
3992 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
3993 (elfNN_aarch64_new_section_hook): Likewise.
3994 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
3995 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
3996 (riscv_elf_check_relocs): Likewise.
3997 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
3998 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
3999 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
4000 (_bfd_mips_elf_link_hash_table_create): Likewise.
4001 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
4002 (_bfd_sparc_elf_check_relocs),
4003 (_bfd_sparc_elf_new_section_hook): Likewise.
4004 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
4005 (tilegx_elf_check_relocs): Likewise.
4006 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
4007 * format.c (bfd_check_format_matches): Likewise.
4008 * hash.c (_bfd_stringtab_init): Likewise.
4009 * ihex.c (ihex_scan): Likewise.
4010 * irix-core.c (irix_core_core_file_p): Likewise.
4011 * linker.c (bfd_wrapped_link_hash_lookup),
4012 (_bfd_generic_link_hash_table_create),
4013 (_bfd_generic_reloc_link_order): Likewise.
4014 * lynx-core.c (lynx_core_file_p): Likewise.
4015 * netbsd-core.c (netbsd_core_file_p): Likewise.
4016 * osf-core.c (osf_core_core_file_p): Likewise.
4017 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
4018 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
4019 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
4020 * peicode.h (pe_mkobject): Likewise.
4021 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
4022 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
4023 * sco5-core.c (read_uarea): Likewise.
4024 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
4025 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
4026 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
4027 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
4028 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
4029 * srec.c (srec_scan): Likewise.
4030 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
4031 * targets.c (bfd_target_list): Likewise.
4032 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
4033 * trad-core.c (trad_unix_core_file_p): Likewise.
4034 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
4035 (vms_new_section_hook): Likewise.
4036 * wasm-module.c (wasm_make_empty_symbol): Likewise.
4037 * xcofflink.c (xcoff_get_section_contents),
4038 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
4039 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
4040 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
4042 2020-02-19 Alan Modra <amodra@gmail.com>
4044 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
4046 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
4048 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
4049 and use it if it isn't NULL. Remove has_plugin_p argument. Add
4050 a build_list_p argument. Don't search plugin_list. Short circuit
4051 when building the plugin list.
4052 (has_plugin): Renamed to has_plugin_list.
4053 (bfd_plugin_set_plugin): Don't set has_plugin.
4054 (bfd_plugin_specified_p): Check plugin_list instead.
4055 (build_plugin_list): New function.
4056 (load_plugin): Call build_plugin_list and use plugin_list.
4058 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4061 * plugin.c (try_claim): Always clean up for LTO wrapper.
4062 (try_load_plugin): Treat each object as independent. Create a
4063 copy for plugin name.
4065 2020-02-11 Nick Clifton <nickc@redhat.com>
4067 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
4068 for addresses in print statements.
4069 (msp430_elf_relax_delete_bytes): Likewise.
4070 (msp430_elf_relax_add_words): Likewise.
4071 (msp430_elf_relax_section): Likewise.
4073 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4075 * plugin.c (add_symbols): Clear plugin_data memory.
4077 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
4080 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
4081 (EXECUTABLE_SUFFIX): Likewise.
4082 * config.in: Regenerated.
4083 * configure: Likewise.
4084 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
4085 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
4086 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
4087 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
4088 (get_lto_wrapper): New.
4089 (setup_lto_wrapper_env): Likewise.
4090 (current_plugin): Likewise.
4091 (register_all_symbols_read): Likewise.
4092 (register_cleanup): Likewise.
4093 (get_symbols): Likewise.
4094 (add_input_file): Likewise.
4095 (bfd_plugin_close_and_cleanup): Likewise.
4096 (claim_file): Removed.
4097 (register_claim_file): Set current_plugin->claim_file.
4098 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
4099 lto_syms in current_plugin.
4100 (try_claim): Use current_plugin->claim_file. Call LTO plugin
4101 all_symbols_read handler. Copy real symbols to plugin_data.
4102 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
4103 (try_load_plugin): Don't reuse the previous plugin for LTO
4104 wrapper. Set up GCC LTO wrapper if possible. Don't set
4105 plugin_list_iter->claim_file.
4106 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
4108 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
4111 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4113 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
4114 check if previous instruction matches a conditional jump inserted
4115 earlier. Invert conditional jump and delete branch in this case.
4117 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4119 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
4120 msp430_elf_relax_add_words. Support insertion of either one or two
4122 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
4123 needs to be grown. Handle insertion of branch instruction to replace
4126 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4128 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
4129 debugging relocations.
4130 (msp430_elf_relax_delete_bytes): Likewise.
4131 (msp430_elf_relax_add_two_words): Likewise.
4132 (msp430_elf_relax_section): Likewise.
4134 2020-02-10 Alan Modra <amodra@gmail.com>
4136 * archures.c: Wrap overlong z80 comments.
4137 * bfd-in2.h: Regenerate.
4139 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
4142 * archures.c: Add GBZ80 and Z80N machine values.
4143 * reloc.c: Add BFD_RELOC_Z80_16_BE.
4144 * coff-z80.c: Add support for new reloc.
4145 * coffcode.h: Add support for new machine values.
4146 * cpu-z80.c: Add support for new machine names.
4147 * elf32-z80.c: Add support for new reloc.
4148 * bfd-in2.h: Regenerate.
4149 * libbfd.h: Regenerate.
4151 2020-02-07 Nick Clifton <nickc@redhat.com>
4154 * elf.c (rewrite_elf_program_header): Do not complain if no
4155 sections are mapped to a segment.
4157 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4160 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
4161 for garbage collection on __patchable_function_entries section
4162 without linked-to section.
4164 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4167 * bfd-in2.h: Regenerated.
4168 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
4169 on section if gc_mark of any of its linked-to sections is set
4170 and don't set gc_mark again.
4171 * section.c (asection): Add linked_to_symbol_name to map_head
4174 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
4176 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
4177 reporting an unrecognized instruction with R_V850_LONGJUMP.
4179 2020-02-05 Alan Modra <amodra@gmail.com>
4181 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
4183 2020-02-04 Alan Modra <amodra@gmail.com>
4185 * elf32-ppc.c (ppc_elf_relocate_section): After applying
4186 R_PPC_VLE_ADDR20, goto copy_reloc.
4188 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4190 * bfd-in2.h: Regenerated.
4191 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
4193 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4196 * bfd-in2.h: Regenerated.
4197 * ecoff.c (bfd_debug_section): Add section_id.
4198 * section.c (bfd_section): Add section_id.
4199 (SEC_ASSEMBLER_SECTION_ID): New.
4200 (BFD_FAKE_SECTION): Add section_id.
4202 2020-02-01 Nick Clifton <nickc@redhat.com>
4204 * config.bfd: Move the c30-aout and tic30-aout targets onto the
4207 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
4209 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
4210 encodings are relative to the GOT on nios2, too.
4212 2020-01-31 Alan Modra <amodra@gmail.com>
4214 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
4215 file. Use $< and $@ in rules.
4216 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
4217 (elf32-ia64.c, elf64-ia64.c): Likewise.
4218 (elf32-riscv.c, elf64-riscv.c): Likewise.
4219 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4220 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
4221 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
4222 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
4223 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4224 * Makefile.in: Regenerate.
4226 2020-01-31 Alan Modra <amodra@gmail.com>
4229 * elf.c (setup_group): Don't clear entire section contents,
4230 just the padding after group flags. Release alloc'd memory
4231 after a seek or read failure.
4233 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4235 * peXXigen.c (pe_is_repro): New function.
4236 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
4237 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
4239 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4241 * peXXigen.c (debug_type_names): Add names for new debug data type
4244 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4246 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
4247 inner loop. Fix a memory leak.
4249 2020-01-30 Alan Modra <amodra@gmail.com>
4251 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
4252 or obj_coff_keep_strings here.
4253 (coff_get_normalized_symtab): Free external syms directly.
4254 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
4257 2020-01-27 Jim Wilson <jimw@sifive.com>
4259 * cpu-riscv.c (riscv_scan): New.
4260 (N): Change bfd_default_scan to riscv_scan.
4262 2020-01-27 Andreas Schwab <schwab@suse.de>
4264 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
4265 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
4266 * Makefile.in: Regenerate.
4267 * cpu-plugin.c: Remove.
4268 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
4269 (bfd_plugin_arch): Remove declaration.
4270 * bfd-in2.h: Regenerate.
4271 * po/SRC-POTFILES.in: Regenerate.
4273 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
4274 Alan Modra <amodra@gmail.com>
4277 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
4279 2020-01-24 Jim Wilson <jimw@sifive.com>
4281 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
4282 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
4283 avoid over long line.
4285 2020-01-24 Nick Clifton <nickc@redhat.com>
4288 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
4289 syms and keep strings flags as these may have been set in order to
4290 prevent a bogus call to free.
4292 2020-01-23 Nick Clifton <nickc@redhat.com>
4294 * po/fr.po: Updated French translation.
4296 2020-01-23 Alan Modra <amodra@gmail.com>
4299 * elf.c (assign_file_positions_for_load_sections): Avoid divide
4300 by zero when p_align is zero.
4302 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
4304 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
4305 (riscv_prefix_cmp): Likewise.
4306 (riscv_non_std_ext_p): Deleted.
4307 (riscv_std_sv_ext_p): Likewise.
4308 (riscv_non_std_sv_ext_p): Likewise.
4309 (riscv_merge_non_std_and_sv_ext): Rename to...
4310 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
4311 (riscv_merge_arch_attr_info): Replace 3 calls to
4312 riscv_merge_non_std_and_sv_ext with single call to
4313 riscv_merge_multi_letter_ext.
4314 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
4315 encounter a 'z' prefix.
4316 (riscv_get_prefix_class): New function, return prefix class based
4317 on first few characters of input string.
4318 (riscv_parse_config): New structure to factor out minor differences
4319 in extension class parsing behaviour.
4320 (riscv_parse_sv_or_non_std_ext): Rename to...
4321 (riscv_parse_prefixed_ext): and parameterise with
4323 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
4324 (riscv_multi_letter_ext_valid_p): New.
4325 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
4326 (riscv_parse_subset): Delegate all non-single-letter parsing work
4327 to riscv_parse_prefixed_ext.
4328 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
4329 (riscv_get_prefix_class): Declare.
4331 2020-01-22 Alan Modra <amodra@gmail.com>
4333 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
4334 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
4335 __tls_get_addr_desc.
4336 (ppc64_elf_size_stubs): Add section for linker generated
4337 __tls_get_addr_desc wrapper function. Loop at least once if
4338 generating this function.
4339 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
4340 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
4342 2020-01-22 Alan Modra <amodra@gmail.com>
4344 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
4345 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
4347 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
4348 (STDU_R1_0R1, ADDI_R1_R1): Define.
4349 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
4350 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
4351 tga_desc_fd to opt_fd, and tga_desc to opt. Set
4352 no_tls_get_addr_regsave.
4353 (branch_reloc_hash_match): Add hash3 and hash4.
4354 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
4355 (ppc64_elf_size_dynamic_sections): Likewise.
4356 (ppc64_elf_relocate_section): Likewise.
4357 (plt_stub_size, build_plt_stub): Likewise. Size regsave
4358 __tls_get_addr stub.
4359 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
4361 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
4362 eh_frame for regsave __tls_get_addr.
4364 2020-01-22 Alan Modra <amodra@gmail.com>
4366 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
4367 which __tls_get_addr calls will be eliminated.
4369 2020-01-20 Nick Clifton <nickc@redhat.com>
4371 * po/pt.po: Updates Portuguese translation.
4372 * po/ru.po: Updated Russian translation.
4373 * po/uk.po: Updated Ukranian translation.
4375 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
4378 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
4379 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
4381 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
4382 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
4383 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
4384 "rex leal x@tlsdesc(%rip), %reg" to
4385 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
4386 "call *(%eax)" to "nopl (%rax)".
4388 2020-01-20 Alan Modra <amodra@gmail.com>
4390 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
4391 (MTLR_R11): Don't define.
4392 (LD_R0_0R3, CMPDI_R0_0): Define.
4393 (build_tls_get_addr_stub): Don't use r11 in stub.
4395 2020-01-20 Alan Modra <amodra@gmail.com>
4397 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
4398 (defined_sym_val, is_tls_get_addr): Likewise.
4400 2020-01-18 Nick Clifton <nickc@redhat.com>
4402 * version.m4 (BFD_VERSION): Set to 2.34.50.
4403 * configure: Regenerate.
4404 * po/bfd.pot: Regenerate.
4406 2020-01-18 Nick Clifton <nickc@redhat.com>
4408 Binutils 2.34 branch created.
4410 2020-01-17 Christian Biesinger <cbiesinger@google.com>
4412 * coff-arm.c: Fix spelling error (seperate).
4413 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
4415 * sysdep.h (strnlen): Fix spelling error (seperate).
4417 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
4420 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
4422 2020-01-15 Alan Modra <amodra@gmail.com>
4425 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
4426 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
4427 of function symbols unless dot symbols are present. Do warn
4428 whenever one is created, regardles of whether a PLT entry is
4429 also emitted for the function symbol.
4431 2020-01-14 Alan Modra <amodra@gmail.com>
4433 * som.c (som_bfd_count_ar_symbols): Error when file position
4434 of symbols on chains is not strictly increasing.
4436 2020-01-14 Alan Modra <amodra@gmail.com>
4438 * vms.h (VMS_DEBUG): Define as 0.
4439 * vms-alpha.c (image_write): Move debug output after bounds check.
4441 (_bfd_vms_slurp_eihd): Warning fix.
4442 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
4444 2020-01-13 Alan Modra <amodra@gmail.com>
4446 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
4447 for "ignored" records.
4449 2020-01-13 Alan Modra <amodra@gmail.com>
4451 * wasm-module.c (wasm_scan_name_function_section): Formatting.
4452 Delete asect name check. Move asect NULL check to wasm_object_p.
4453 Correct bounds check of sizes against end. Replace uses of
4454 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
4455 just one bfd_release.
4456 (wasm_scan): Don't use malloc/strdup for section names,
4457 bfd_alloc instead. Simplify code prefixing section name.
4458 Formatting. Don't attempt to free memory here..
4459 (wasm_object_p): ..do so here.
4461 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
4464 * elf32-arm.c (elf32_arm_final_link_relocate): Use
4465 UNDEFWEAK_NO_DYNAMIC_RELOC.
4466 (allocate_dynrelocs_for_symbol): Likewise.
4468 2020-01-10 Tamar Christina <tamar.christina@arm.com>
4471 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
4473 2020-01-10 Alan Modra <amodra@gmail.com>
4475 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
4477 2020-01-09 Nick Clifton <nickc@redhat.com>
4480 * bfd.c (bfd_convert_section_contents): Check for a compress
4481 header size that is larger than the actual section size.
4483 2020-01-08 Alan Modra <amodra@gmail.com>
4486 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
4487 after removing sections.
4489 2020-01-06 Jim Wilson <jimw@sifive.com>
4492 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
4493 check for !bfd_link_pic (info).
4494 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
4495 <R_RISCV_JAL>: Add comment.
4496 (_bfd_riscv_relax_section): For plt.offset check, add check for
4497 bfd_link_pic (info). Add comment.
4499 2020-01-06 Alan Modra <amodra@gmail.com>
4501 * format.c (bfd_check_format_matches): Ignore bfd_error on target
4502 match failures. Don't init to bfd_error_wrong_format before
4503 calling _bfd_check_format.
4505 2020-01-06 Alan Modra <amodra@gmail.com>
4507 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
4508 status rather than exiting on stack overflow or underflow.
4509 (_bfd_vms_slurp_etir): Adjust to suit.
4511 2020-01-06 Alan Modra <amodra@gmail.com>
4513 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
4515 2020-01-06 Alan Modra <amodra@gmail.com>
4517 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
4518 command. Check name offset is within command.
4519 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
4520 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
4521 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
4522 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
4523 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
4524 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
4525 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
4526 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
4527 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
4528 (bfd_mach_o_read_segment): Similarly.
4529 (bfd_mach_o_read_thread): Properly bound check thread struct.
4530 Don't repeat checks on second loop.
4531 (bfd_mach_o_read_command): Fail on invalid command length.
4533 2020-01-04 Alan Modra <amodra@gmail.com>
4535 * format.c (bfd_check_format_matches): Add preserve_match.
4536 Save initial bfd state in "preserve", matched bfd state in
4537 "preserve_match". Save just the first match. Release
4538 bfd_alloc memory. Restore and finish preserved state as
4539 appropriate on all function exit paths.
4541 2020-01-04 Alan Modra <amodra@gmail.com>
4543 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
4545 2020-01-04 Alan Modra <amodra@gmail.com>
4547 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
4550 2020-01-03 Nick Clifton <nickc@redhat.com>
4553 (bfd_pef_parse_function_stubs): Correct the test that ensures that
4554 there is enough data remaining in the code buffer before
4555 attempting to read a function stub.
4557 2020-01-03 Nick Clifton <nickc@redhat.com>
4560 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
4561 return value from bfd_malloc.
4562 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
4563 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
4564 (elf32_arm_filter_cmse_symbols): Likewise.
4565 (elf32_arm_write_section): Likewise.
4566 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
4567 (bfd_mach_o_follow_dsym): Likewise.
4568 * pef.c (bfd_pef_print_loader_section): Likewise.
4569 (bfd_pef_scan_start_address): Likewise.
4570 (bfd_pef_parse_function_stubs): Likewise.
4571 (bfd_pef_parse_symbols): Likewise.
4573 2020-01-03 Sergei Trofimovich <siarheit@google.com>
4575 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
4576 on binary inputs ld/PR25316.
4577 (is_ia64_elf): new helper to filter on ia64 objects.
4579 2020-01-03 Jan Beulich <jbeulich@suse.com>
4581 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
4583 (bfd_mach_o_scan): Insert underscore in two variable names.
4585 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
4587 * Makefile.am: Add z80-elf target support.
4588 * configure.ac: Likewise.
4589 * targets.c: Likewise.
4590 * Makefile.in: Regenerate.
4591 * configure: Regenerate.
4592 * config.bfd: Add z80-elf target support and new arches: ez80 and
4594 * elf32-z80.c: New file.
4595 * archures.c: Add new z80 architectures: eZ80 and Z180.
4596 * coffcode.h: Likewise.
4597 * cpu-z80.c: Likewise.
4598 * coff-z80.c: Add new relocations for Z80 target and local label
4600 * reloc.c: Add new relocs.
4601 * bfd-in2.h: Regenerate.
4602 * libbfd.h: Regenerate.
4604 2020-01-02 Tamar Christina <tamar.christina@arm.com>
4608 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
4610 2020-01-01 Alan Modra <amodra@gmail.com>
4612 Update year range in copyright notice of all files.
4614 For older changes see ChangeLog-2019
4616 Copyright (C) 2020 Free Software Foundation, Inc.
4618 Copying and distribution of this file, with or without modification,
4619 are permitted in any medium without royalty provided the copyright
4620 notice and this notice are preserved.
4626 version-control: never