1 2020-12-01 Alan Modra <amodra@gmail.com>
4 * elf-bfd.h (elf_backend_merge_symbol_attribute): Update prototype.
5 * elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Likewise.
6 * elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Likewise.
7 * elfxx-x86.h (_bfd_x86_elf_merge_symbol_attribute): Likewise.
8 * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): Replace
9 isym parameter with st_other. Adjust code.
10 * elf64-alpha.c (elf64_alpha_merge_symbol_attribute): Likewise.
11 * elf64-ppc.c (ppc64_elf_merge_symbol_attribute): Likewise.
12 * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): Likewise.
13 * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): Likewise.
14 * elfxx-x86.c (_bfd_x86_elf_merge_symbol_attribute): Likewise.
15 * elflink.c (elf_merge_st_other): Likewise.
16 (_bfd_elf_merge_symbol, elf_link_add_object_symbols): Adjust to suit.
17 (_bfd_elf_copy_link_hash_symbol_type): Likewise.
18 (_bfd_elf_add_default_symbol): Merge st_other from undecorated
19 symbol and @VER symbol to @@VER symbol.
21 2020-11-28 Alan Modra <amodra@gmail.com>
24 * elf.c (elf_sort_sections): Don't sort zero size !load sections
27 2020-11-27 Jozef Lawrynowicz <jozef.l@mittosystems.com>
29 * elf.c (special_sections_g): Add .gnu.linkonce.n and .gnu.linkonce.p.
30 (special_sections_n): Add .noinit.
31 (special_sections_p): Add .persistent.
33 2020-11-26 Nick Clifton <nickc@redhat.com>
36 * dwarf2.c (read_section): Check for debug sections with excessive
39 2020-11-25 H.J. Lu <hongjiu.lu@intel.com>
42 * elflink.c (_bfd_elf_check_kept_section): Get the real kept
45 2020-11-23 Nick Clifton <nickc@redhat.com>
48 * elf-bfd.h (struct elf_backend_data): Add bfd_boolean field to
49 slurp_secondary_relocs field.
50 (_bfd_elf_slurp_secondary_reloc_section): Update prototype.
51 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Add new
52 parameter. Compute number of symbols based upon the new
54 * elfcode.h (elf_slurp_reloc_table): Pass dynamic as new
57 2020-11-23 H.J. Lu <hongjiu.lu@intel.com>
60 * elf64-s390.c (elf_s390_finish_dynamic_sections): Set .got
61 sh_entsize only if .got size > 0.
63 2020-11-21 Nelson Chu <nelson.chu@sifive.com>
65 * elfnn-riscv.c (_bfd_riscv_relax_section): Add a new relax pass
66 to do the pcgp relaxation later, after the lui and call relaxations,
67 but before the delete and alignment relaxations.
69 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
71 * elflink.c (elf_finalize_dynstr): Call examine_strtab after
73 (elf_link_swap_symbols_out): Don't call it here. Call
74 ctf_new_symbol before swap_symbol_out.
75 (elf_link_output_extsym): Call ctf_new_dynsym before
77 (bfd_elf_final_link): Likewise.
78 * elf.c (swap_out_syms): Pass in bfd_link_info. Call
79 ctf_new_symbol before swap_symbol_out.
80 (_bfd_elf_compute_section_file_positions): Adjust.
82 2020-11-19 Nick Clifton <nickc@redhat.com>
85 * elf64-s390.c (elf_s390_finish_dynamic_sections): Check for the
86 existance of an sgot output section before setting the
89 2020-11-18 Jozef Lawrynowicz <jozef.l@mittosystems.com>
90 H.J. Lu <hongjiu.lu@intel.com>
92 * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_retain.
93 (struct elf_obj_tdata): Increase has_gnu_osabi to 4 bits.
94 * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_retain
96 (_bfd_elf_final_write_processing): Report if SHF_GNU_RETAIN is
97 not supported by the OSABI.
98 Adjust error messages.
99 * elflink.c (elf_link_input_bfd): Copy enabled has_gnu_osabi bits from
100 input BFD to output BFD.
101 (bfd_elf_gc_sections): gc_mark the section if SHF_GNU_RETAIN is set.
103 2020-11-16 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
105 * cpu-arm.c (processors): Add Cortex-A78C.
107 2020-11-11 Tom Tromey <tromey@adacore.com>
109 * archive.c (getuid, getgid): Move...
110 * sysdep.h (getuid, getgid): ...here.
112 2020-11-09 Alan Modra <amodra@gmail.com>
114 * vms-alpha.c (alpha_vms_write_exec): Write 16 bits to eihd.alias.
116 2020-11-09 Alan Modra <amodra@gmail.com>
118 * archive.c (bfd_ar_hdr_from_filesystem): Use bfd_set_input_error
119 when stat of archive member fails.
120 * coff-rs6000.c (xcoff_write_archive_contents_old),
121 (xcoff_write_archive_contents_big): Likewise, and handle in-memory
124 2020-11-03 Alan Modra <amodra@gmail.com>
126 * elf.c (bfd_section_from_shdr): Free sections_being_created.
129 2020-11-02 Alan Modra <amodra@gmail.com>
135 * elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
136 for plugin syms. Do allow plugin syms to mark as-needed libs.
138 2020-10-30 H.J. Lu <hongjiu.lu@intel.com>
141 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Generate
142 GNU_PROPERTY_X86_ISA_1_BASELINE for -z x86-64-baseline.
144 2020-10-29 Nick Clifton <nickc@redhat.com>
147 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Use the correct
148 sized reloc reading function.
149 (_bfd_elf_write_secondary_reloc_section): Use the correct sized
150 reloc writing function.
152 2020-10-28 Nick Clifton <nickc@redhat.com>
155 * srec.c (srec_write_symbols): Do not emit symbols in sections
156 that have been removed from the output.
158 2020-10-27 Nick Clifton <nickc@redhat.com>
160 * elf64-hppa.c (elf_hppa_final_link_relocate): Check that the
161 symbol's section is being output before adding its offset to the
162 addend when processing R_PARISC_SECREL32.
164 2020-10-25 Alan Modra <amodra@gmail.com>
166 * vms-misc.c (_bfd_vms_save_counted_string): Count length byte
169 2020-10-20 Dr. David Alan Gilbert <dgilbert@redhat.com>
171 * po/es.po: Fix printf format.
173 2020-10-16 Nelson Chu <nelson.chu@sifive.com>
175 * elfnn-riscv.c (riscv_elf_link_hash_table): Add last_iplt_index.
176 (riscv_elf_size_dynamic_sections): Initialize the last_iplt_index.
177 (riscv_elf_relocate_section): Use riscv_elf_append_rela.
178 (riscv_elf_finish_dynamic_symbol): If the use_elf_append_rela is
179 false, then we should add the dynamic relocs from the last of
180 the .rela.iplt, and don't use the riscv_elf_append_rela to add.
182 2020-10-16 Nelson Chu <nelson.chu@sifive.com>
184 * elfnn-riscv.c: Include "objalloc.h" since we need objalloc_alloc.
185 (riscv_elf_link_hash_table): Add loc_hash_table and loc_hash_memory
186 for local STT_GNU_IFUNC symbols.
187 (riscv_elf_got_plt_val): Removed.
188 (riscv_elf_local_htab_hash, riscv_elf_local_htab_eq): New functions.
189 Use to compare local hash entries.
190 (riscv_elf_get_local_sym_hash): New function. Find a hash entry for
191 local symbol, and create a new one if needed.
192 (riscv_elf_link_hash_table_free): New function. Destroy an riscv
193 elf linker hash table.
194 (riscv_elf_link_hash_table_create): Create hash table for local ifunc.
195 (riscv_elf_check_relocs): Create a fake global symbol to track the
196 local ifunc symbol. Add support to check and handle the relocations
197 reference to ifunc symbols.
198 (allocate_dynrelocs): Let allocate_ifunc_dynrelocs and
199 allocate_local_ifunc_dynrelocs to handle the ifunc symbols if they
200 are defined and referenced in a non-shared object.
201 (allocate_ifunc_dynrelocs): New function. Allocate space in .plt,
202 .got and associated reloc sections for ifunc dynamic relocs.
203 (allocate_local_ifunc_dynrelocs): Likewise, but for local ifunc
205 (riscv_elf_relocate_section): Add support to handle the relocation
206 referenced to ifunc symbols.
207 (riscv_elf_size_dynamic_sections): Updated.
208 (riscv_elf_adjust_dynamic_symbol): Updated.
209 (riscv_elf_finish_dynamic_symbol): Finish up the ifunc handling,
210 including fill the PLT and GOT entries for ifunc symbols.
211 (riscv_elf_finish_local_dynamic_symbol): New function. Called by
212 riscv_elf_finish_dynamic_symbol to handle the local ifunc symbols.
213 (_bfd_riscv_relax_section): Don't do the relaxation for ifunc.
214 * elfxx-riscv.c: Add R_RISCV_IRELATIVE.
215 * configure.ac: Link elf-ifunc.lo to use the generic ifunc support.
216 * configure: Regenerated.
218 2020-10-16 Alan Modra <amodra@gmail.com>
220 * elf32-arc.c (replace_func): Correct return type.
221 (get_replace_function): Use a replace_func function pointer rather
222 than void*. Update associated ARC_RELOC_HOWTO define.
224 2020-10-16 Alan Modra <amodra@gmail.com>
226 * elf32-cr16.c: Formatting.
227 (cr16_elf_final_link_relocate): Sign extend rather than clumsy
228 "add or subtract" of offset value. Simplify range checks. Move
229 common code out of "if" branches. Don't refetch insn fields
232 2020-10-16 Alan Modra <amodra@gmail.com>
234 * elf64-ppc.c (ppc64_elf_relocate_section): Tighten sanity check
235 on R_PPC64_GOT_LO_DS and R_PPC64_GOT_HA instructions.
237 2020-10-09 Alan Modra <amodra@gmail.com>
239 * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't do local
240 entry offset optimisation.
242 2020-10-09 H.J. Lu <hongjiu.lu@intel.com>
245 * elf-linker-x86.h (elf_linker_x86_params): Add isa_level.
246 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge
247 GNU_PROPERTY_X86_ISA_1_V[234].
248 (_bfd_x86_elf_link_setup_gnu_properties): Generate
249 GNU_PROPERTY_X86_ISA_1_V[234] for -z x86-64-v[234].
251 2020-10-06 H.J. Lu <hongjiu.lu@intel.com>
254 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge -z ibt
255 and -z shstk only with GNU_PROPERTY_X86_FEATURE_1_AND.
257 2020-10-06 Brandon Bergren <bdragon@FreeBSD.org>
259 * config.bfd: Add powerpc64le-*-freebsd*.
260 * configure.ac: Add powerpc_elf64_fbsd_le_vec.
261 * elf64-ppc.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define for
263 * targets.c (powerpc_elf64_fbsd_le_vec): Declare.
264 (_bfd_target_vector): Add it.
265 * configure: Regenerate.
267 2020-10-05 Kamil Rytarowski <n54@gmx.com>
269 * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.
271 2020-10-05 Nick Clifton <nickc@redhat.com>
274 * elf.c (_bfd_elf_setup_sections): Do not complain about an
275 sh_link value of zero when the SLF_LINK_ORDER flag is set.
276 (assign_section_numbers): Likewise.
278 2020-10-02 H.J. Lu <hongjiu.lu@intel.com>
281 * elflink.c (bfd_elf_gc_sections): Do not arbitrarily keep note
282 sections which are linked to another section.
284 2020-09-30 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
286 * cpu-arm.c: Add cortex-a78 and cortex-a78ae.
288 2020-09-28 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
290 * cpu-arm.c: (processors) Add Cortex-X1.
292 2020-09-28 Alan Modra <amodra@gmail.com>
295 * elf64-ppc.c (ppc_build_one_stub, ppc_size_one_stub): Check for
296 NULL stub_entry->h before calling is_tls_get_addr.
298 2020-09-26 Alan Modra <amodra@gmail.com>
300 * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Depend on has_plt_localentry0.
301 (LD_R0_0R11, ADD_R11_R0_R11): Define.
302 (ppc64_elf_tls_setup): Disable params->plt_localentry0 when power10
304 (ppc64_elf_size_stubs): Update __glink_PLTresolve eh_frame.
305 (ppc64_elf_build_stubs): Move r2 save to start of __glink_PLTresolve,
306 and only emit for has_plt_localentry0. Don't use r2 in the stub.
308 2020-09-24 Alan Modra <amodra@gmail.com>
311 * elf64-ppc.c (plt_stub_size): Add "odd" param. Use it with
312 size_power10_offset rather than calculating from start of stub.
313 Add size for notoc tls_get_addr_opt stub.
314 (plt_stub_pad): Add "odd" param, pass to plt_stub_size.
315 (build_tls_get_addr_head, build_tls_get_addr_tail): New functions.
316 (build_tls_get_addr_stub): Delete.
317 (ppc_build_one_stub): Use a temp for htab->params->stub_bfd.
318 Emit notoc tls_get_addr_opt stub. Move eh_frame code to
319 suit. Adjust code to use bfd_tls_get_addr_head/tail in place
320 of build_tls_get_addr_stub.
321 (ppc_size_one_stub): Size notoc tls_get_addr_opt stub.
322 Adjust plt_stub_size and plt_stub_pad calls. Correct "odd"
323 when padding stub. Size eh_frame for notoc stub too.
324 Correct lr_restore value.
325 (ppc64_elf_relocate_section): Don't skip over first insn of
326 notoc tls_get_addr_opt stub.
328 2020-09-24 Alan Modra <amodra@gmail.com>
331 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Rename to..
332 (ppc64_elf_edit): Call params->edit.
333 (ppc64_elf_tls_setup): Don't call _bfd_elf_tls_setup. Return a
335 * elf64-ppc.h (struct ppc64_elf_params): Add "edit".
336 (ppc64_elf_tls_setup): Update declaration.
338 2020-09-21 Alan Modra <amodra@gmail.com>
341 * elfxx-riscv.c (howto_table): Correct size and bitsize of
342 R_RISCV_RVC_BRANCH, R_RISCV_RVC_JUMP, and R_RISCV_RVC_LUI.
343 Correct size for R_RISCV_TLS_DTPMOD32, R_RISCV_TLS_DTPREL32,
344 R_RISCV_CALL, and R_RISCV_CALL_PLT. Make R_RISCV_TPREL_ADD and
345 R_RISCV_ALIGN like R_RISCV_NONE. Correct dst_mask many relocs.
347 2020-09-17 Mikael Pettersson <mikpelinux@gmail.com>
350 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC
351 relocations in debug sections, change abort to _bfd_error_handler.
353 2020-09-16 H.J. Lu <hongjiu.lu@intel.com>
356 * config.bfd (targ64_selvecs, targ_selvecs): Add x86_64_pe_vec
358 * reloc.c: Include "coff/internal.h".
359 (bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs.
361 2020-09-16 Alan Modra <amodra@gmail.com>
363 * elf-bfd.h (elf_symbol_from): Remove unused ABFD parameter.
364 * elf.c (ignore_section_sym, _bfd_elf_copy_private_symbol_data),
365 (swap_out_syms): Adjust elf_symbol_from invocation.
367 2020-09-16 Alan Modra <amodra@gmail.com>
370 * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.
372 2020-09-15 H.J. Lu <hongjiu.lu@intel.com>
374 * coff-x86_64.c (howto_table): Display PE relocation names.
376 2020-09-15 Hans-Peter Nilsson <hp@axis.com>
379 * elf32-cris.c (cris_elf_check_relocs): Add missing NULL check
380 on argument before calling UNDEFWEAK_NO_DYNAMIC_RELOC.
382 2020-09-12 H.J. Lu <hongjiu.lu@intel.com>
385 * elflink.c (elf_final_link_info): Add local_hash_table.
386 (local_hash_entry): New.
387 (local_hash_newfunc): Likewise.
388 (elf_link_output_symstrtab): Append ".COUNT" to duplicated local
390 (bfd_elf_final_link): Initialize and free local_hash_table for
393 2020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
395 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Revert
396 changes in 7e05773767820b441b23a16628b55c98cb1aef46. Set
397 error for undefined symbol in BFD_RELOC_AARCH64_BRANCH19 and
398 BFD_RELOC_AARCH64_TSTBR14 relocations.
400 2020-09-09 Nick Clifton <nickc@redhat.com>
402 * cofflink.c (coff_link_check_archive_element): Move the check for
403 coff type input to the start of the function.
405 2020-09-09 Alan Modra <amodra@gmail.com>
407 * libbfd-in.h (_bfd_write_unsigned_leb128): Declare.
408 * libbfd.h: Regenerate.
410 2020-09-08 Jozef Lawrynowicz <jozef.l@mittosystems.com>
411 Kuan-Lin Chen <kuanlinchentw@gmail.com>
413 * bfd-in2.h (bfd_reloc_code_real): Add
414 BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
415 * elf32-msp430.c (msp430_elf_ignore_reloc): New.
416 (elf_msp430_howto_table): Add R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
417 (msp430_reloc_map): Add R_MSP430_GNU_{SET,SUB}_ULEB128.
418 (msp430x_reloc_map): Add R_MSP430X_GNU_{SET,SUB}_ULEB128.
419 (write_uleb128): New.
420 (msp430_final_link_relocate): Handle R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
421 * libbfd.c (_bfd_write_unsigned_leb128): New.
422 * libbfd.h (_bfd_write_unsigned_leb128): New prototype.
423 Add BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
424 * reloc.c: Document BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
426 2020-09-08 Alex Coplan <alex.coplan@arm.com>
428 * archures.c (bfd_mach_aarch64_8R): New.
429 * bfd-in2.h: Regenerate.
430 * cpu-aarch64.c (bfd_aarch64_arch_v8_r): New.
431 (bfd_aarch64_arch_ilp32): Update tail pointer.
433 2020-09-08 Alan Modra <amodra@gmail.com>
437 * elflink.c (_bfd_elf_merge_symbol): Make "override" a bfd**.
438 Return oldbfd in override when old common should override new
440 (_bfd_elf_add_default_symbol): Adjust to suit.
441 (elf_link_add_object_symbols): Likewise. Pass "override" to
442 _bfd_generic_link_add_one_symbol. Save and restore common u.c.p
443 field for --as-needed shared libraries. Revert pr13250 changes.
445 2020-09-08 Nick Clifton <nickc@redhat.com>
447 * plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an
448 unrecognized symbol type in a weak definition.
450 2020-09-04 Alan Modra <amodra@gmail.com>
453 * elfcode.h (elf_object_p): Sanity check section header offset.
454 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
457 2020-09-04 Alan Modra <amodra@gmail.com>
462 * elflink.c (elf_link_add_object_symbols): Do set def_regular
463 and ref_regular for IR symbols. Don't clear dynsym, allowing
464 IR symbols to load --as-needed shared libraries, but prevent
465 IR symbols from becoming dynamic.
467 2020-09-03 Nick Clifton <nickc@redhat.com>
470 * elf.c (_bfd_elf_write_secondary_reloc_section): Check for
471 secondary reloc sections with a zero sh_entsize field.
473 2020-09-03 Nelson Chu <nelson.chu@sifive.com>
475 * elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors.
476 (riscv_merge_std_ext): Likewise.
477 (riscv_merge_arch_attr_info): Likewise.
478 (riscv_merge_attributes): Likewise and fix comment typos.
480 2020-09-03 Nelson Chu <nelson.chu@sifive.com>
482 * elfnn-riscv.c (riscv_version_mismatch): Change the return type
483 from void to bfd_boolean. Report warnings rather than errors
484 when the ISA versions are mis-matched. Afterwards, remember to
485 update the output ISA versions to the newest ones.
486 (riscv_merge_std_ext): Allow to link objects with different
487 standard ISA versions. Try to add output ISA versions to
488 merged_subsets first.
489 (riscv_merge_multi_letter_ext): Likewise. But for standard additional
490 ISA and non-standard ISA versions.
492 2020-09-03 Kito Cheng <kito.cheng@sifive.com>
494 * elfnn-riscv.c (riscv_merge_std_ext): Fix to report the correct
495 error message when the versions of extension are mis-matched.
496 * elfxx-riscv.c (riscv_parse_subset): Don't issue the error when
499 2020-09-03 Alan Modra <amodra@gmail.com>
501 * xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info
502 on the output bfd objalloc memory.
504 2020-09-02 Alan Modra <amodra@gmail.com>
506 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
507 of constant shifted left.
509 2020-09-02 Alan Modra <amodra@gmail.com>
511 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned
512 type for "relocation".
514 2020-09-01 Alan Modra <amodra@gmail.com>
516 * reloc.c (N_ONES): Handle N=0.
517 * elf32-arm.c (elf32_arm_howto_table_1): Set complain_overflow_dont
518 for R_ARM_TLS_DESCSEQ and R_ARM_THM_TLS_DESCSEQ.
520 2020-09-01 Alan Modra <amodra@gmail.com>
523 * elf32-arm.c (elf32_arm_allocate_local_sym_info): Allocate arrays
524 in descending order of alignment.
526 2020-09-01 Alan Modra <amodra@gmail.com>
529 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
531 2020-08-31 Alan Modra <amodra@gmail.com>
534 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to
535 unsigned when using with RISCV_ITYPE.
536 (_bfd_riscv_relax_call): Use an unsigned foff.
538 2020-08-31 Alan Modra <amodra@gmail.com>
542 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO),
543 (CRINFO_RELVADDR): Make unsigned.
544 (mips_elf_nullify_got_load): Use unsigned constant when shifting
547 2020-08-31 Alan Modra <amodra@gmail.com>
550 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u"
551 variable and rewrite signed overflow check.
552 * elf32-mep.c: Regenerate.
553 (mep_final_link_relocate): Delete "s".
555 2020-08-31 Alan Modra <amodra@gmail.com>
558 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
559 that might shift values into sign bit.
561 2020-08-31 Alan Modra <amodra@gmail.com>
564 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma,
565 and similarly for variables dealing with overflow.
567 2020-08-31 Alan Modra <amodra@gmail.com>
570 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits
571 without undefined behaviour. Tidy excess casts.
573 2020-08-31 Alan Modra <amodra@gmail.com>
575 * elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
576 alignment from reloc addend after reloc type R_MN10300_ALIGN is
579 2020-08-30 Alan Modra <amodra@gmail.com>
583 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits
584 without undefined behaviour.
586 2020-08-29 Nick Clifton <nickc@redhat.com>
589 * dwarf2.c (scan_unit_for_symbols): Add member entries to the
592 2020-08-29 Alan Modra <amodra@gmail.com>
595 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last
596 element when count is zero. bfd_realloc when shrinking.
598 2020-08-28 Alan Modra <amodra@gmail.com>
601 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write
604 2020-08-28 Alan Modra <amodra@gmail.com>
607 * ecofflink.c (WRITE): Really don't write zero size chunks.
609 2020-08-28 Tuckker <tuckkern+sourceware@gmail.com>
612 * linker.c (bfd_generic_define_common_symbol): Force the alignment
613 to 1 if the section has now alignment requirement.
615 2020-08-28 Cooper Qu <cooper.qu@linux.alibaba.com>
617 * elf32-csky.c (csky_archs): Fix arch names.
618 (csky_find_arch_with_name): New.
619 (elf32_csky_merge_attributes): New.
620 (csky_elf_merge_private_bfd_data): Add process of merge
622 (elf32_csky_obj_attrs_arg_type): New.
623 (elf32_csky_obj_attrs_handle_unknown): New.
624 (elf_backend_obj_attrs_vendor): Define.
625 (elf_backend_obj_attrs_section): Define.
626 (elf_backend_obj_attrs_arg_type): Define.
627 (elf_backend_obj_attrs_section_type): Define.
629 2020-08-28 Nick Clifton <nickc@redhat.com>
632 * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value
633 for undefined symbols which will not generate extra warning
634 messages about truncated relocs.
636 2020-08-28 Nelson Chu <nelson.chu@sifive.com>
638 * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
639 and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
640 (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
641 unresolved reloc checks.
643 2020-08-27 John David Anglin <danglin@gcc.gnu.org>
646 * som.c (som_bfd_copy_private_section_data): Issue error when a
647 subspace is specified without its containing space.
649 2020-08-27 Alan Modra <amodra@gmail.com>
652 * elflink.c: Include limits.h.
653 (CHAR_BIT): Provide fallback define.
654 (set_symbol_value): Correct complex reloc comment.
655 (undefined_reference): Set bfd_error.
656 (BINARY_OP_HEAD, BINARY_OP_TAIL): Split out from..
658 (eval_symbol): Limit shifts. Force unsigned for left shift.
659 Catch divide by zero.
660 * configure.ac (AC_CHECK_HEADERS): Combine, sort and add limits.h.
661 * configure: Regenerate.
662 * config.in: Regenerate.
664 2020-08-27 Alan Modra <amodra@gmail.com>
667 * reloc.c (bfd_check_overflow): Return early if zero bitsize.
669 2020-08-27 Alan Modra <amodra@gmail.com>
671 * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
672 on sym_sec not being output.
674 2020-08-27 Alan Modra <amodra@gmail.com>
677 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Correct "dynamic".
679 2020-08-26 Nick Clifton <nickc@redhat.com>
682 * elf32-avr.c (avr_final_link_relocate): Fix undefined shift
684 (avr_elf32_load_records_from_section): Use bfd_get_16 and
685 bfd_get_32 to load values from potentially unaligned pointers.
688 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Test for and
689 ignore local symbols.
690 (elf64_alpha_relax_got_load): Do not check for local dynamic
692 (OP_LDA, OP_LDAH, OP_LDQ, OP_BR, OP_BSR): Use unsigned constant
694 (INSN_A) Cast the A parameter to unsigned.
695 (INSN_AB): Define in terms of INSN_A.
696 (INSN_ABC): Likewise.
697 (INSN_ABO): Likewise.
701 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
702 unsigned long constant when creating a mask to test for alignment
705 2020-08-26 Alan Modra <amodra@gmail.com>
708 * elf32-xtensa.c (find_removed_literal): Don't bsearch empty map.
710 2020-08-26 Alan Modra <amodra@gmail.com>
713 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early
714 when section is empty.
716 2020-08-26 Alan Modra <amodra@gmail.com>
719 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
722 2020-08-26 Alan Modra <amodra@gmail.com>
730 * elf64-ppc.c (is_tls_get_addr): Avoid UB &h->elf when h is NULL.
731 (ppc64_elf_tls_setup): Likewise.
732 (branch_reloc_hash_match): Likewise.
733 (build_plt_stub): Likewise.
734 (ppc64_elf_relocate_section): Likewise.
736 2020-08-26 Alan Modra <amodra@gmail.com>
739 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
741 2020-08-26 Alan Modra <amodra@gmail.com>
744 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
745 sstubs->contents != NULL.
747 2020-08-26 Alan Modra <amodra@gmail.com>
750 * som.c (som_prep_for_fixups): Return early when no symbols.
752 2020-08-26 Alan Modra <amodra@gmail.com>
755 * ecofflink.c (WRITE): Don't write size 0 chunks.
757 2020-08-26 Alan Modra <amodra@gmail.com>
759 * bfdio.c (bfd_get_file_size): Don't segv on NULL adata.
761 2020-08-26 Alan Modra <amodra@gmail.com>
764 * vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
766 2020-08-26 David Faust <david.faust@oracle.com>
768 * archures.c (bfd_mach_xbpf): Define.
769 * bfd-in2.h: Regenerate.
770 * cpu-bpf.c (bfd_xbpf_arch) New.
771 (bfd_bpf_arch) Update next in list field to point to xbpf arch.
773 2020-08-26 Alan Modra <amodra@gmail.com>
775 * archures.c (bfd_mach_ck860): Define.
777 2020-08-25 Mark Wielaard <mark@klomp.org>
779 * dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
780 and dwarf_rnglists_size fields.
781 (dwarf_debug_sections): Add debug_rnglists.
782 (dwarf_debug_section_enum): Likewise.
783 (read_debug_rnglists): New function.
784 (read_rangelist): New function to call either read_ranges or
785 read_rnglists. Rename original function to...
786 (read_ranges): ...this.
787 (read_rnglists): New function.
789 2020-08-25 Alan Modra <amodra@gmail.com>
792 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check
793 is_elf_hash_table before accessing elf fields.
795 2020-08-25 Alan Modra <amodra@gmail.com>
798 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
801 2020-08-25 Alan Modra <amodra@gmail.com>
804 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
805 before accessing elf fields.
807 2020-08-25 Alan Modra <amodra@gmail.com>
810 * som.c (som_compute_checksum): XOR 32-bit words in header,
811 not unsigned long sized words.
813 2020-08-25 Alan Modra <amodra@gmail.com>
816 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
817 amount copied for elf_segment_map defined with one element
820 2020-08-25 Alan Modra <amodra@gmail.com>
823 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
824 bfd_get_x size function to read addends out of fields. Apply
825 rightshift adjustment too. Don't apply the now unnecessary
826 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
827 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
828 Correct R_ARM_THM_JUMP6 addend.
830 2020-08-25 Alan Modra <amodra@gmail.com>
833 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
834 before start of section.
836 2020-08-25 Alan Modra <amodra@gmail.com>
838 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
839 before accessing elf_hash_table_id.
840 * elf32-arc.c (elf_arc_hash_table): Likewise.
841 * elf32-arm.c (elf32_arm_hash_table): Likewise.
842 * elf32-avr.c (avr_link_hash_table): Likewise.
843 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
844 * elf32-cris.c (elf_cris_hash_table): Likewise.
845 * elf32-csky.c (csky_elf_hash_table): Likewise.
846 * elf32-frv.c (frvfdpic_hash_table): Likewise.
847 * elf32-hppa.c (hppa_link_hash_table): Likewise.
848 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
849 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
850 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
851 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
852 * elf32-metag.c (metag_link_hash_table): Likewise.
853 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
854 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
855 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
856 * elf32-s390.c (elf_s390_hash_table): Likewise.
857 * elf32-sh.c (sh_elf_hash_table): Likewise.
858 * elf32-spu.c (spu_hash_table): Likewise.
859 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
860 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
861 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
862 * elf64-hppa.c (hppa_link_hash_table): Likewise.
863 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
864 * elf64-s390.c (elf_s390_hash_table): Likewise.
865 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
866 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
867 * elfxx-mips.c (mips_elf_hash_table): Likewise.
868 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
869 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
871 2020-08-21 Jon Turney <jon.turney@dronecode.org.uk>
873 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
874 int. Use '%u' format with _bfd_error_handler to render it.
876 2020-08-25 Alan Modra <amodra@gmail.com>
879 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
880 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
882 2020-08-25 Alan Modra <amodra@gmail.com>
885 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
886 accessing elf_hash_table_id.
888 2020-08-25 Alan Modra <amodra@gmail.com>
891 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
892 accessing elf_hash_table_id.
894 2020-08-24 Mark Wielaard <mark@klomp.org>
896 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
897 (read_formatted_entries): Likewise. And skip zero entry.
899 2020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
901 * bfd-in2.h (bfd_mach_ck860): New.
902 * cpu-csky.c (arch_info_struct): Add item for CK860.
904 2020-08-24 Alan Modra <amodra@gmail.com>
906 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
907 high part tprel16 relocs.
908 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
909 Clear do_tls_opt on odd instructions.
910 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
911 Don't sanity check them here.
912 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
913 high part tprel16 relocs.
914 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
915 Clear do_tls_opt on odd instructions.
916 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
918 2020-08-23 John David Anglin <danglin@gcc.gnu.org>
921 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
922 * configure: Regenerate.
924 2020-08-22 H.J. Lu <hongjiu.lu@intel.com>
927 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
928 versioned symbols, which are defined in shared objects, in
931 2020-08-21 Nick Clifton <nickc@redhat.com>
933 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
934 the data map if there are entries in it.
935 (_bfd_aarch64_erratum_843419_scan): Likewise.
937 2020-08-21 Jan Beulich <jbeulich@suse.com>
939 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
940 last byte of debug dir, not first.
942 2020-08-20 Nick Clifton <nickc@redhat.com>
945 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
946 field in the ELF header of the compressed sections.
948 2020-08-20 Nick Clifton <nickc@redhat.com>
951 * elf-bfd.h (struct bfd_elf_section_data): Add
952 has_secondary_relocs field.
953 * elf.c (_bfd_elf_copy_special_section_fields): Set the
954 has_secondary_relocs field for sections which have associated
956 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
957 on sections which have associated secondary relocs.
959 2020-08-15 Alan Modra <amodra@gmail.com>
961 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
962 small common section.
963 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
964 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
965 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
966 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
967 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
968 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
969 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
970 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
971 * elf32-v850.c (v850_elf_check_relocs): Likewise.
972 (v850_elf_add_symbol_hook): Likewise.
973 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
974 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
975 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
976 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
978 2020-08-15 Alan Modra <amodra@gmail.com>
981 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
983 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
984 on small common section.
985 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
986 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
987 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
988 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
989 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
990 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
992 2020-08-14 Alan Modra <amodra@gmail.com>
994 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
995 rather than another copy of primes. Increase maximum default
998 2020-08-13 Alan Modra <amodra@gmail.com>
1000 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
1002 2020-08-13 Alan Modra <amodra@gmail.com>
1004 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
1005 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
1006 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
1007 optimization when --no-pcrel-optimize.
1009 2020-08-13 Alan Modra <amodra@gmail.com>
1012 * bfd.c (struct bfd): Add read_only.
1013 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
1014 Set read_only on warning.
1015 (elf_object_p): Sanity check program header alignment. Set
1016 read_only on warning.
1017 * bfd-in2.h: Regenerate.
1019 2020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
1021 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
1022 win32pstatus note type to avoid signedness comparison warning.
1024 2020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
1026 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
1027 win32pstatus notes, and return TRUE so we continue rather than
1028 stopping as if it was an error.
1030 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1032 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
1034 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
1036 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
1037 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
1038 appropriate size constraint for each win32pstatus note type.
1040 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1042 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
1043 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
1046 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
1048 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
1049 (elfcore_grok_win32pstatus): Use.
1051 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1053 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
1054 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
1055 offsets used to read NOTE_INFO_PROCESS.
1057 2020-08-12 Nick Clifton <nickc@redhat.com>
1059 * po/ru.po: Updated Russian translation.
1060 * po/sr.po: Updated Serbian translation.
1062 2020-08-07 David Faust <david.faust@oracle.com>
1064 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
1065 DISP16 and DISP32 relocations.
1067 2020-08-05 David Faust <david.faust@oracle.com>
1069 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
1070 (bpf_elf_howto_table): Use it here.
1071 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
1072 instruction and data relocations.
1074 2020-08-03 Alan Modra <amodra@gmail.com>
1076 * vms-lib.c (vms_traverse_index): Sanity check size remaining
1077 before accessing vms_idx or vms_elfidx.
1079 2020-08-03 Alan Modra <amodra@gmail.com>
1082 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
1083 size against file size. Correct LONG_MAX limit check.
1084 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
1085 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
1086 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1087 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
1088 bfd_malloc_and_get_section.
1090 2020-07-31 Alan Modra <amodra@gmail.com>
1093 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
1094 IR symbols to become dynamic.
1095 (elf_link_add_object_symbols): Don't exclude IR symbols when
1096 deciding whether an as-needed shared library is needed.
1098 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1101 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
1103 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
1105 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1107 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
1108 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
1109 Don't define _STRUCTURED_PROC.
1110 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
1111 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
1112 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
1113 * configure, config.in: Regenerate.
1114 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
1115 * Makefile.in, doc/Makefile.in: Regenerate.
1117 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
1119 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
1120 (elf_link_hash_table): Add sym_cache.
1121 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
1122 (elf32_arm_check_relocs): Updated.
1123 (elf32_arm_size_dynamic_sections): Likewise.
1124 * elf32-bfin.c (bfin_link_hash_table): Removed.
1125 (bfin_link_hash_newfunc): Updated.
1126 (bfin_hash_table): Removed.
1127 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
1128 (csky_elf_check_relocs): Updated.
1129 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
1130 (elf32_hppa_check_relocs): Updated.
1131 * elf32-i386.c (elf_i386_tls_transition): Updated.
1132 (elf_i386_convert_load_reloc): Likewise.
1133 (elf_i386_check_relocs): Likewise.
1134 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
1135 (m32r_elf_hash_table): Updated.
1136 (m32r_elf_link_hash_table_create): Likewise.
1137 (m32r_elf_create_dynamic_sections): Likewise.
1138 (m32r_elf_adjust_dynamic_symbol): Likewise.
1139 (allocate_dynrelocs): Likewise.
1140 (m32r_elf_size_dynamic_sections): Likewise.
1141 (m32r_elf_relocate_section): Likewise.
1142 (m32r_elf_finish_dynamic_symbol): Likewise.
1143 (m32r_elf_check_relocs): Likewise.
1144 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
1146 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
1147 (elf_m68k_check_relocs): Updated.
1148 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
1149 (elf_metag_check_relocs): Updated.
1150 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
1151 (microblaze_elf_check_relocs): Updated.
1152 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
1153 (nds32_elf_create_dynamic_sections): Likewise.
1154 (nds32_elf_adjust_dynamic_symbol): Likewise.
1155 (nds32_elf_check_relocs): Likewise.
1156 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
1157 srelbss and aym_cache.
1158 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
1159 (nios2_elf32_check_relocs): Updated.
1160 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
1161 (or1k_elf_check_relocs): Updated.
1162 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
1163 (ppc_elf_check_relocs): Updated.
1164 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1165 (elf_s390_check_relocs): Updated.
1166 (elf_s390_finish_dynamic_sections): Likewise.
1167 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
1169 (sh_elf_create_dynamic_sections): Updated.
1170 (sh_elf_adjust_dynamic_symbol): Likewise.
1171 (sh_elf_size_dynamic_sections): Likewise.
1172 (sh_elf_check_relocs): Likewise.
1173 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
1174 (elf32_tic6x_check_relocs): Updated.
1175 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
1176 (tilepro_elf_hash_table): Updated.
1177 (tilepro_elf_link_hash_table_create): Likewise.
1178 (tilepro_elf_check_relocs): Likewise.
1179 (tilepro_elf_adjust_dynamic_symbol): Likewise.
1180 (allocate_dynrelocs): Likewise.
1181 (tilepro_elf_size_dynamic_sections): Likewise.
1182 (tilepro_elf_relocate_section): Likewise.
1183 (tilepro_elf_finish_dynamic_symbol): Likewise.
1184 (tilepro_finish_dyn): Likewise.
1185 (tilepro_elf_finish_dynamic_sections): Likewise.
1186 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
1187 (ppc64_elf_before_check_relocs): Updated.
1188 (ppc64_elf_check_relocs): Likewise.
1189 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1190 (elf_s390_check_relocs): Updated.
1191 (elf_s390_relocate_section): Likewise.
1192 (elf_s390_finish_dynamic_sections): Likewise.
1193 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1194 (elf_x86_64_check_relocs): Likewise.
1195 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1197 (elfNN_aarch64_check_relocs): Updated.
1198 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
1199 (riscv_elf_check_relocs): Updated.
1200 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
1201 (mips_elf_resolve_got_page_ref): Updated.
1202 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1203 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1205 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
1206 (tilegx_elf_check_relocs): Updated.
1207 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
1209 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1211 * elflink.c (bfd_elf_final_link): Give local symbols a name if
1213 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
1214 return TRUE if making ET_REL output.
1216 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1218 * elf-bfd.h (elf_backend_data): Add
1219 `elf_backend_elfsym_local_is_section' member.
1220 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
1222 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
1223 * elflink.c (bfd_elf_final_link): Use it to determine whether
1224 set the `.symtab' section's `sh_info' value to the index of the
1225 first non-local or non-section symbol.
1226 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
1228 (elf_backend_elfsym_local_is_section): New macro.
1229 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
1231 (elf_backend_elfsym_local_is_section): New macro.
1233 2020-07-29 Alan Modra <amodra@gmail.com>
1235 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
1236 defined in excluded sections.
1238 2020-07-28 Alan Modra <amodra@gmail.com>
1240 * elf.c (assign_section_numbers): Comment. Don't segfault on
1241 discarded sections when setting linked-to section for generic
1243 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
1245 2020-07-27 Alan Modra <amodra@gmail.com>
1247 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
1248 similar as absolute.
1249 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
1252 2020-07-24 Nick Clifton <nickc@redhat.com>
1254 * config.bfd: Move xc16x target to the obsolete list.
1256 2020-07-22 Kevin Buettner <kevinb@redhat.com>
1258 * binary.c (binary_get_section_contents): Seek using offset
1259 from section's file position.
1261 2020-07-22 Kevin Buettner <kevinb@redhat.com>
1263 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
1265 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
1268 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
1269 type for the first function argument. Rename pointers to reflect
1270 that they have distinct types.
1272 2020-07-20 Alan Modra <amodra@gmail.com>
1274 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
1276 2020-07-19 Alan Modra <amodra@gmail.com>
1278 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
1279 (select_alt_stub): New function.
1280 (ppc_get_stub_entry): Use it here.
1281 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
1283 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
1284 merge notoc stubs with other varieties when power10_stubs is "auto".
1285 Instead dup the stub hash table entry.
1286 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1287 tests of power10_stubs.
1289 2020-07-15 Alan Modra <amodra@gmail.com>
1292 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
1294 2020-07-15 Nick Clifton <nickc@redhat.com>
1297 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
1298 check for aux entries that overflow the buufer.
1300 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
1302 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
1303 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
1305 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
1306 Alan Modra <amodra@gmail.com>
1309 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
1310 objects both before and after normal object files.
1311 * elflink.c (_bfd_elf_section_already_linked): Likewise.
1313 2020-07-10 Alan Modra <amodra@gmail.com>
1315 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
1316 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1318 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
1319 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1320 uses of power10_stubs.
1322 2020-07-09 Alan Modra <amodra@gmail.com>
1324 * coff-ppc.c: Delete.
1326 * pei-ppc.c: Delete.
1327 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
1328 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
1330 (coff_write_object_contents): Remove PPC_PE code.
1331 * config.bfd: Move powerpcle-pe to removed targets.
1332 * configure.ac: Remove powerpc PE entries.
1333 * libcoff-in.h (ppc_allocate_toc_section): Delete.
1334 (ppc_process_before_allocation): Delete.
1335 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
1336 * targets.c: Remove powerpc PE vectors.
1337 * po/SRC-POTFILES.in: Regenerate.
1338 * libcoff.h: Regenerate.
1339 * Makefile.in: Regenerate.
1340 * configure: Regenerate.
1342 2020-07-09 Nick Clifton <nickc@redhat.com>
1344 * po/fr.po: Updated French translation.
1346 2020-07-07 Alan Modra <amodra@gmail.com>
1348 * xcofflink.c (xcoff_mark): Don't mark const sections.
1349 (bfd_xcoff_record_link_assignment): Add FIXME.
1350 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
1351 sections being discarded by linker script.
1353 2020-07-07 Alan Modra <amodra@gmail.com>
1355 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
1356 time, uid, gid and mode for deterministic archive.
1357 (xcoff_write_archive_contents_big): Likewise.
1359 2020-07-07 Alan Modra <amodra@gmail.com>
1361 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
1364 2020-07-06 Nick Clifton <nickc@redhat.com>
1366 * po/pt.po: Updated Portuguese translation.
1367 * po/uk.po: Updated Ukranian translation.
1369 2020-07-04 Nick Clifton <nickc@redhat.com>
1371 * version.m4: Set version to 2.35.50.
1372 * configure: Regenerate.
1373 * po/bbfd.pot: Regenerate.
1375 2020-07-04 Nick Clifton <nickc@redhat.com>
1377 Binutils 2.35 branch created.
1379 2020-07-01 Alan Modra <amodra@gmail.com>
1382 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
1383 raw syment index before dereferencing.
1385 2020-07-01 Alan Modra <amodra@gmail.com>
1387 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
1389 2020-07-01 Alan Modra <amodra@gmail.com>
1391 * config.bfd: Obsolete xc16x.
1393 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
1395 * archures.c (bfd_mach_i386_nacl): Removed.
1396 (bfd_mach_i386_i386_nacl): Likewise.
1397 (bfd_mach_x86_64_nacl): Likewise.
1398 (bfd_mach_x64_32_nacl): Likewise.
1399 * config.bfd: Remove *-*-nacl* targets.
1400 * configure.ac: Remove x86 NaCl target vectors.
1401 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
1402 (bfd_x64_32_nacl_arch): Likewise.
1403 (bfd_x86_64_nacl_arch): Likewise.
1404 (bfd_i386_nacl_arch): Likewise.
1405 (bfd_x64_32_arch_intel_syntax): Updated.
1406 * elf32-i386.c: Don't include "elf-nacl.h".
1407 (elf_i386_nacl_plt): Removed.
1408 (elf_i386_nacl_plt0_entry): Likewise.
1409 (elf_i386_nacl_plt_entry): Likewise.
1410 (elf_i386_nacl_pic_plt0_entry): Likewise.
1411 (elf_i386_nacl_pic_plt_entry): Likewise.
1412 (elf_i386_nacl_eh_frame_plt): Likewise.
1413 (elf_i386_nacl_plt): Likewise.
1414 (elf32_i386_nacl_elf_object_p): Likewise.
1415 (elf_i386_get_synthetic_symtab): Updated.
1416 (elf_i386_link_setup_gnu_properties): Likewise.
1417 * elf64-x86-64.c: Don't include "elf-nacl.h".
1418 (elf_x86_64_nacl_plt): Removed.
1419 (elf64_x86_64_nacl_elf_object_p): Likewise.
1420 (elf_x86_64_nacl_plt0_entry): Likewise.
1421 (elf_x86_64_nacl_plt_entry): Likewise.
1422 (elf_x86_64_nacl_eh_frame_plt): Likewise.
1423 (elf_x86_64_nacl_plt): Likewise.
1424 (elf32_x86_64_nacl_elf_object_p): Likewise.
1425 (elf_x86_64_get_synthetic_symtab): Updated.
1426 (elf_x86_64_link_setup_gnu_properties): Likewise.
1427 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1428 * targets.c: Remove x86 NaCl target vectors.
1429 * bfd-in2.h: Regenerated.
1430 * configure: Likewise.
1432 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
1434 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
1435 _bfd_elf_add_dynamic_tags.
1437 2020-06-29 Alan Modra <amodra@gmail.com>
1439 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
1440 return value of bfd_bread. Don't read more than requested length.
1441 Sanity check length. Properly terminate file name.
1443 2020-06-29 Alan Modra <amodra@gmail.com>
1445 * arc-got.h: Use C style comments.
1446 * coff-z80.c: Likewise.
1447 * elf32-csky.c: Likewise.
1448 * peXXigen.c: Likewise.
1449 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
1452 2020-06-26 Pat Bernardi <bernardi@adacore.com>
1454 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
1455 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
1457 2020-06-26 Alan Modra <amodra@gmail.com>
1459 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
1460 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
1461 (riscv_get_priv_spec_name): Move to..
1462 * cpu-riscv.c: ..here.
1463 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
1464 Use %u to print unsigned numbers.
1466 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
1468 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
1469 default architecture.
1471 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1474 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
1475 _bfd_elf_add_dynamic_tags.
1477 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1480 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
1481 _bfd_elf_add_dynamic_tags.
1483 2020-06-24 Alan Modra <amodra@gmail.com>
1485 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
1486 shifts without undefined behaviour.
1488 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
1490 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
1492 (_bfd_elf_add_dynamic_tags): New.
1493 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
1494 _bfd_elf_add_dynamic_tags.
1495 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
1496 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
1497 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
1498 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
1499 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
1500 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
1501 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1502 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
1504 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
1505 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
1506 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
1507 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
1508 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
1509 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
1510 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1511 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
1512 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
1514 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
1515 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
1516 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
1517 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1518 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1519 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
1521 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1522 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1523 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
1524 dt_reloc_sz and dt_reloc_ent.
1525 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
1526 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
1528 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
1529 etab.dt_pltgot_required.
1530 (elf32_hppa_size_dynamic_sections): Call
1531 _bfd_elf_add_dynamic_tags.
1532 * elf32-metag.c (elf_metag_link_hash_table_create): Set
1533 etab.dt_pltgot_required.
1534 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
1535 * elf32-sh.c (sh_elf_link_hash_table_create): Set
1536 root.dt_pltgot_required for FDPIC output.
1537 (sh_elf_size_dynamic_sections): Call
1538 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1539 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
1540 elf.dt_pltgot_required.
1541 (elf_xtensa_size_dynamic_sections): Call
1542 _bfd_elf_add_dynamic_tags.
1543 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
1544 root.dt_pltgot_required.
1545 (elf64_hppa_size_dynamic_sections): Call
1546 _bfd_elf_add_dynamic_tags.
1547 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
1548 root.dt_pltgot_required.
1549 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
1550 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
1551 * elflink.c (_bfd_elf_add_dynamic_tags): New.
1553 2020-06-22 Saagar Jha <saagar@saagarjha.com>
1555 * mach-o.c: Support the new load commands by reading a linkedit
1556 data command for them.
1558 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1560 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
1561 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
1562 (riscv_get_priv_spec_class): Likewise.
1563 (riscv_get_priv_spec_name): Likewise.
1564 (riscv_get_priv_spec_class_from_numbers): New function, convert
1565 the version numbers into string, then call riscv_get_priv_spec_class
1566 to get the priv spec class.
1567 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
1568 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
1569 (riscv_get_priv_spec_name): Likewise.
1570 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
1571 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
1572 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
1573 of input and output objects form their priv spec attributes by
1574 riscv_get_priv_spec_class_from_numbers. Report warning rather than
1575 errors when linking objects with differnet priv spec versions. We do
1576 know v1.9.1 may have conflicts to other versions, so report the
1577 warning, too. After that, update the output priv spec version to the
1580 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1582 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
1583 priv attributes, we will check the conflicts for all of them (major,
1584 minor and revision), and then set the priv_attrs_merged to TRUE to
1585 indicate that we have handled all of the priv attributes. Remove
1586 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
1588 2020-06-21 Alan Modra <amodra@gmail.com>
1591 * configure.ac: Disable plugins by default for some targets.
1592 * plugin.c: Comment typo fix.
1593 * configure: Regenerate.
1595 2020-06-19 Nick Clifton <nickc@redhat.com>
1597 * plugin.c (try_load_plugin): Suppress the error message about
1598 being unable to open a plugin if creating a list of viable
1601 2020-06-16 Alan Modra <amodra@gmail.com>
1603 * aout-tic30.c: Delete file.
1604 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
1605 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
1606 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
1607 (xc16x-*-elf): Sort properly.
1608 * configure.ac: Remove tic30_aout_vec.
1609 * targets.c: Likewise.
1610 * Makefile.in: Regenerate.
1611 * configure: Regenerate.
1612 * po/SRC-POTFILES.in: Regenerate.
1614 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
1616 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
1617 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
1618 (elf32xtensa_abi): New global variable.
1619 (xtensa_abi_choice): New function.
1620 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
1621 XSHAL_ABI to select PLT code.
1623 2020-06-15 Roland McGrath <mcgrathr@google.com>
1625 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
1626 field of bfd_link_info.
1628 2020-06-15 Alan Modra <amodra@gmail.com>
1630 * config.bfd: Obsolete powerpcle-*-pe targets.
1632 2020-06-15 Alan Modra <amodra@gmail.com>
1635 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
1636 symbols that were defined in discarded sections.
1637 * cofflink.c (coff_link_check_archive_element): Likewise.
1638 (coff_link_add_symbols): Set indx to -3 for symbols defined in
1640 (_bfd_coff_write_global_sym): Don't emit such symbols.
1641 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
1642 libcoff.h: Regenerate.
1644 2020-06-11 Alan Modra <amodra@gmail.com>
1647 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
1649 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1651 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
1652 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
1653 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
1656 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1659 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
1660 Clear verinfo.verdef.
1662 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
1665 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
1666 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
1667 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
1669 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
1670 Set ifunc_resolvers if there are FUNC resolvers.
1671 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
1672 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
1673 with elf.ifunc_resolvers.
1674 (write_plt_relocs_for_local_syms): Likewise.
1675 (ppc64_elf_relocate_section): Likewise.
1676 (ppc64_elf_finish_dynamic_sections): Likewise.
1677 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
1679 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1680 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
1681 instead of readonly_dynrelocs_against_ifunc.
1682 * elfxx-x86.h (elf_x86_link_hash_table): Remove
1683 readonly_dynrelocs_against_ifunc.
1685 2020-06-09 Alan Modra <amodra@gmail.com>
1687 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1688 maybe_local_ifunc_resolver field.
1689 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
1690 cases where maybe_local_ifunc_resolver was set.
1691 (ppc64_elf_relocate_section): Likewise.
1692 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
1695 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
1697 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
1699 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
1701 (elf32_arm_size_dynamic_sections): Updated. Clear
1702 root.tlsdesc_plt for DF_BIND_NOW.
1703 (elf32_arm_finish_dynamic_sections): Updated.
1704 (elf32_arm_output_arch_local_syms): Likewise.
1705 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
1706 Clear root.tlsdesc_plt for DF_BIND_NOW.
1707 (nds32_elf_finish_dynamic_sections): Updated.
1708 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
1709 dt_tlsdesc_plt and dt_tlsdesc_got.
1710 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
1711 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1712 tlsdesc_plt and dt_tlsdesc_got.
1713 (elfNN_aarch64_allocate_dynrelocs): Updated.
1714 (elfNN_aarch64_finish_dynamic_sections): Likewise.
1715 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
1716 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
1718 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1719 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1720 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1721 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
1724 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1726 * elf32-tic6x.c (elf32_bed): Defined the default to
1729 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1731 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
1733 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
1734 root.splt/root.srelplt.
1735 (elf64_hppa_create_dynamic_sections): Likewise.
1736 (elf64_hppa_size_dynamic_sections): Likewise.
1737 (elf64_hppa_finish_dynamic_symbol): Likewise.
1738 (elf_hppa_final_link): Likewise.
1739 (elf_hppa_final_link_relocate): Likewise.
1741 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1743 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
1744 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1747 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1749 * elf-bfd.h (elf_target_os): New.
1750 (elf_link_hash_table): Add target_os.
1751 (elf_backend_data): Add target_os.
1752 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
1753 symbian_p and nacl_p.
1754 (create_got_section): Updated.
1755 (elf32_arm_create_dynamic_sections): Likewise.
1756 (arm_type_of_stub): Likewise.
1757 (elf32_arm_create_or_find_stub_sec): Likewise.
1758 (elf32_arm_allocate_plt_entry): Likewise.
1759 (elf32_arm_populate_plt_entry): Likewise.
1760 (elf32_arm_final_link_relocate): Likewise.
1761 (elf32_arm_check_relocs): Likewise.
1762 (allocate_dynrelocs_for_symbol): Likewise.
1763 (elf32_arm_finish_dynamic_symbol): Likewise.
1764 (elf32_arm_finish_dynamic_sections): Likewise.
1765 (elf32_arm_output_plt_map_1): Likewise.
1766 (elf32_arm_output_arch_local_syms): Likewise.
1767 (elf32_arm_add_symbol_hook): Likewise.
1768 (elf32_arm_nacl_link_hash_table_create): Likewise.
1769 (elf32_arm_vxworks_link_hash_table_create): Likewise.
1770 (elf32_arm_symbian_link_hash_table_create): Likewise.
1771 (ELF_TARGET_OS): New.
1772 * elf32-i386.c (elf_i386_arch_bed): Removed.
1773 (elf_backend_arch_data): Likewise.
1774 (elf_i386_solaris_arch_bed): Likewise.
1775 (elf_i386_nacl_arch_bed): Likewise.
1776 (elf_i386_vxworks_arch_bed): Likewise.
1777 (elf_i386_relocate_section): Updated.
1778 (elf_i386_finish_dynamic_sections): Likewise.
1779 (elf_i386_get_synthetic_symtab): Likewise.
1780 (elf_i386_link_setup_gnu_properties): Likewise.
1781 (ELF_TARGET_OS): New.
1782 * elf32-mips.c (ELF_TARGET_OS): New.
1783 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
1784 (ppc_elf_create_got): Updated.
1785 (ppc_elf_create_dynamic_sections): Likewise.
1786 (ppc_elf_check_relocs): Likewise.
1787 (ppc_elf_adjust_dynamic_symbol): Likewise.
1788 (ppc_elf_size_dynamic_sections): Likewise.
1789 (ppc_elf_relocate_section): Likewise.
1790 (ppc_elf_finish_dynamic_sections): Likewise.
1791 (ppc_elf_vxworks_link_hash_table_create): Likewise.
1792 (ELF_TARGET_OS): New.
1793 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
1794 (sh_elf_link_hash_table_create): Updated.
1795 (sh_elf_create_dynamic_sections): Likewise.
1796 (allocate_dynrelocs): Likewise.
1797 (sh_elf_size_dynamic_sections): Likewise.
1798 (sh_elf_relocate_section): Likewise.
1799 (sh_elf_finish_dynamic_symbol): Likewise.
1800 (sh_elf_finish_dynamic_sections): Likewise.
1801 (ELF_TARGET_OS): New.
1802 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
1804 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1805 (ELF_TARGET_OS): New.
1806 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
1807 (elf_x86_64_solaris_arch_bed): Likewise.
1808 (elf_x86_64_nacl_arch_bed): Likewise.
1809 (elf_x86_64_finish_dynamic_sections): Updated.
1810 (elf_x86_64_get_synthetic_symtab): Likewise.
1811 (elf_x86_64_link_setup_gnu_properties): Likewise.
1812 (ELF_TARGET_OS): New.
1813 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
1815 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
1816 (MIPS_ELF_REL_DYN_NAME): Updated.
1817 (ELF_MIPS_GP_OFFSET): Likewise.
1818 (mips_elf_create_local_got_entry): Likewise.
1819 (mips_elf_allocate_dynamic_relocations): Likewise.
1820 (mips_elf_count_got_symbols): Likewise.
1821 (is_gott_symbol): Likewise.
1822 (mips_elf_calculate_relocation): Likewise.
1823 (mips_elf_create_dynamic_relocation): Likewise.
1824 (_bfd_mips_elf_check_relocs): Likewise.
1825 (allocate_dynrelocs): Likewise.
1826 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
1827 (mips_elf_lay_out_got): Likewise.
1828 (mips_elf_set_plt_sym_value): Likewise.
1829 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1830 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1831 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1832 (_bfd_mips_elf_final_link): Likewise.
1833 (_bfd_mips_init_file_header): Likewise.
1834 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
1836 (allocate_dynrelocs): Likewise.
1837 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1838 (_bfd_sparc_elf_relocate_section): Likewise.
1839 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1840 (sparc_finish_dyn): Likewise.
1841 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1842 * elfxx-target.h (ELF_TARGET_OS): New.
1843 (elfNN_bed): Add ELF_TARGET_OS.
1844 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1845 (_bfd_x86_elf_link_hash_table_create): Likewise.
1846 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1847 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1848 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1849 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1850 * elfxx-x86.h (elf_x86_target_os): Removed.
1851 (elf_x86_backend_data): Likewise.
1852 (get_elf_x86_backend_data): Likewise.
1853 (elf_x86_link_hash_table): Remove target_os.
1855 2020-06-06 Alan Modra <amodra@gmail.com>
1858 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
1859 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
1860 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
1861 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
1862 * elf64-ppc.c: Update throughout for reloc renaming.
1863 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
1864 * libbfd.h: Regenerate.
1865 * bfd-in2.h: Regenerate.
1867 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
1870 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
1873 2020-06-05 Nick Clifton <nickc@redhat.com>
1875 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
1878 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
1880 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
1881 priv_may_conflict, in_priv_zero and out_priv_zero to decide
1882 whether the object can be linked according to it's priv
1883 attributes. The object without any priv spec attributes can
1884 be linked with others. If the first input object doesn't contain
1885 any priv attributes, then we need to copy the setting from the
1886 next input one. Also report more detailed error messages to user.
1888 2020-06-04 Stephen Casner <casner@acm.org>
1890 Extend pdp11-aout symbol table format to accommodate .stab
1891 symbols and implement correct handling of them.
1893 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
1894 (N_STAB, is_stab): Needed new function is_stab to disambiguate
1895 normal vs. .stab symbol table type values, replacing N_STAB mask.
1896 (translate_from_native_sym_flags): Determine correct section for
1897 different .stab types.
1898 (translate_to_native_sym_flags): Leave .stab types intact.
1899 (translate_symbol_table): Error if symbol indicates overlay;
1900 store desc field from .stab symbols.
1901 (write_syms): Output desc field with symbol.
1902 (aout_link_check_ar_symbols): Skip .stab symbols.
1903 (aout_link_add_symbols): Correctly distinguish .stab symbols.
1904 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
1905 (aout_link_write_symbols): Write 0 for desk and ovly fields;
1906 correctly distinguish .stab symbols and select calculate their
1907 section and value; and copy desc and ovly fields from input symbol
1910 2020-06-04 Stephen Casner <casner@acm.org>
1912 * aoutx.h (translate_symbol_table): Comment had external and
1914 * pdp11.c (translate_symbol_table): Likewise.
1916 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1918 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
1919 (is_x86_elf): Check elf.hash_table_id instead of target_id.
1920 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
1922 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1925 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
1926 in debug section against symbol defined in shared library to 0.
1927 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
1928 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
1929 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
1930 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
1931 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
1932 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1933 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
1934 * elf32-sh.c (sh_elf_check_relocs): Likewise.
1935 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1936 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1937 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1938 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1939 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1940 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
1942 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
1943 there is non-GOT reference.
1944 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
1945 non-alloced sections.
1947 2020-06-03 Stephen Casner <casner@acm.org>
1949 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
1951 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
1953 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
1954 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
1955 other size that doesn't qcover the header word.
1956 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
1957 string table, and zero it.
1958 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
1959 message and set bfd_error on finding an invalid name string offset.
1960 (add_to_stringtab): INLINE -> inline
1961 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
1963 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
1964 any relocs that could not be recognised.
1965 92744f05809 PR 20929 - Check for relocs without an associated symbol.
1966 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
1967 name exists and is long enough, before attempting to see if it is
1969 c3864421222 - Correct case for N_SO being the last symbol.
1970 50455f1ab29 PR 20891 - Handle the case where the main file name
1971 and the directory name are both empty.
1972 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
1973 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
1974 range string table offsets.
1975 531336e3a0b PR 20909 - Fix off-by-one error in check for an
1976 illegal string offset.
1977 (aout_link_includes_newfunc): Add comment.
1978 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
1979 on unexpected relocation type rather than ASSERT.
1981 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1984 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
1985 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
1987 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1990 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
1991 non-alloced sections.
1993 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1995 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
1996 dynamic relocations for non SEC_ALLOC sections.
1998 2020-06-03 Gunther Nikl <gnikl@justmail.de>
2000 * aout64.c (BMAGIC, QMAGIC): Do not define.
2001 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
2002 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
2003 to check the file format.
2004 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
2005 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
2006 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
2008 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2010 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
2011 relocations for non SEC_ALLOC sections.
2013 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2015 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
2016 * elf32-arm.c (maybe_set_textrel): Removed.
2017 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
2018 with _bfd_elf_maybe_set_textrel.
2019 * elf32-csky.c (maybe_set_textrel): Removed.
2020 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
2021 with _bfd_elf_maybe_set_textrel.
2022 * elf32-hppa.c (maybe_set_textrel): Removed.
2023 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
2024 with _bfd_elf_maybe_set_textrel.
2025 * elf32-lm32.c (maybe_set_textrel): Removed.
2026 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
2027 with _bfd_elf_maybe_set_textrel.
2028 * elf32-m32r.c (maybe_set_textrel): Removed.
2029 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
2030 with _bfd_elf_maybe_set_textrel.
2031 * elf32-metag.c (maybe_set_textrel): Removed.
2032 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
2033 with _bfd_elf_maybe_set_textrel.
2034 * elf32-nds32.c (maybe_set_textrel): Removed.
2035 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
2036 with _bfd_elf_maybe_set_textrel.
2037 * elf32-or1k.c (maybe_set_textrel): Removed.
2038 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
2039 with _bfd_elf_maybe_set_textrel.
2040 * elf32-ppc.c (maybe_set_textrel): Removed.
2041 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
2042 with _bfd_elf_maybe_set_textrel.
2043 * elf32-s390.c (maybe_set_textrel): Removed.
2044 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
2045 with _bfd_elf_maybe_set_textrel.
2046 * elf32-sh.c (maybe_set_textrel): Removed.
2047 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
2048 with _bfd_elf_maybe_set_textrel.
2049 * elf32-tic6x.c (maybe_set_textrel): Removed.
2050 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
2051 with _bfd_elf_maybe_set_textrel.
2052 * elf32-tilepro.c (maybe_set_textrel): Removed.
2053 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
2054 with _bfd_elf_maybe_set_textrel.
2055 * elf64-ppc.c (maybe_set_textrel): Removed.
2056 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
2057 with _bfd_elf_maybe_set_textrel.
2058 * elf64-s390.c (maybe_set_textrel): Removed.
2059 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
2060 with _bfd_elf_maybe_set_textrel.
2061 * elfnn-aarch64.c (maybe_set_textrel): Removed.
2062 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
2063 with _bfd_elf_maybe_set_textrel.
2064 * elfnn-riscv.c (maybe_set_textrel): Removed.
2065 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
2066 with _bfd_elf_maybe_set_textrel.
2067 * elfxx-sparc.c (maybe_set_textrel): Removed.
2068 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
2069 with _bfd_elf_maybe_set_textrel.
2070 * elfxx-tilegx.c (maybe_set_textrel): Removed.
2071 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
2072 with _bfd_elf_maybe_set_textrel.
2073 * elfxx-x86.c (maybe_set_textrel): Removed.
2074 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
2075 with _bfd_elf_maybe_set_textrel.
2076 * elflink.c (_bfd_elf_maybe_set_textrel): New.
2078 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2081 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
2083 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
2084 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
2085 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
2086 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
2088 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
2089 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
2090 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
2091 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2092 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
2093 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
2094 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2095 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
2096 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
2097 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2098 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
2099 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2100 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
2101 (elf_backend_copy_indirect_symbol): Likewise.
2102 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
2103 (elf_backend_copy_indirect_symbol): Likewise.
2104 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
2106 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2109 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
2110 * elf32-arm.c (readonly_dynrelocs): Removed.
2111 (maybe_set_textrel): Replace readonly_dynrelocs with
2112 _bfd_elf_readonly_dynrelocs.
2113 * elf32-csky.c (readonly_dynrelocs): Removed.
2114 (maybe_set_textrel): Replace readonly_dynrelocs with
2115 _bfd_elf_readonly_dynrelocs.
2116 * elf32-hppa.c(readonly_dynrelocs): Removed.
2117 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2118 _bfd_elf_readonly_dynrelocs.
2119 (maybe_set_textrel): Likewise.
2120 * elf32-lm32.c (readonly_dynrelocs): Removed.
2121 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2122 with _bfd_elf_readonly_dynrelocs.
2123 (maybe_set_textrel): Likewise.
2124 * elf32-m32r.c (readonly_dynrelocs): Removed.
2125 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2126 with _bfd_elf_readonly_dynrelocs.
2127 (maybe_set_textrel): Likewise.
2128 * elf32-metag.c (readonly_dynrelocs): Removed.
2129 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
2130 with _bfd_elf_readonly_dynrelocs.
2131 (maybe_set_textrel): Likewise.
2132 * elf32-microblaze.c (readonly_dynrelocs): Removed.
2133 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2134 with _bfd_elf_readonly_dynrelocs.
2135 * elf32-nds32.c (readonly_dynrelocs): Removed.
2136 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2137 with _bfd_elf_readonly_dynrelocs.
2138 (maybe_set_textrel): Likewise.
2139 * elf32-or1k.c (readonly_dynrelocs): Removed.
2140 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2141 with _bfd_elf_readonly_dynrelocs.
2142 * elf32-ppc.c (readonly_dynrelocs): Removed.
2143 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2144 _bfd_elf_readonly_dynrelocs.
2145 (ppc_elf_adjust_dynamic_symbol): Likewise.
2146 (maybe_set_textrel): Likewise.
2147 * elf32-s390.c (readonly_dynrelocs): Removed.
2148 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2149 with _bfd_elf_readonly_dynrelocs.
2150 (maybe_set_textrel): Likewise.
2151 * elf32-sh.c (readonly_dynrelocs): Removed.
2152 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
2153 _bfd_elf_readonly_dynrelocs.
2154 (maybe_set_textrel): Likewise.
2155 * elf32-tic6x.c (readonly_dynrelocs): Removed.
2156 (maybe_set_textrel): Replace readonly_dynrelocs with
2157 _bfd_elf_readonly_dynrelocs.
2158 * elf32-tilepro.c (readonly_dynrelocs): Removed.
2159 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2160 with _bfd_elf_readonly_dynrelocs.
2161 (maybe_set_textrel): Likewise.
2162 * elf64-ppc.c (readonly_dynrelocs): Removed.
2163 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2164 _bfd_elf_readonly_dynrelocs.
2165 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2166 (maybe_set_textrel): Likewise.
2167 * elf64-s390.c (readonly_dynrelocs): Removed.
2168 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2169 with _bfd_elf_readonly_dynrelocs.
2170 (maybe_set_textrel): Likewise.
2171 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
2172 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
2173 (maybe_set_textrel): Replace readonly_dynrelocs with
2174 _bfd_elf_readonly_dynrelocs.
2175 * elfnn-riscv.c (readonly_dynrelocs): Removed.
2176 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2177 with _bfd_elf_readonly_dynrelocs.
2178 (maybe_set_textrel): Likewise.
2179 * elfxx-sparc.c (readonly_dynrelocs): Removed.
2180 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
2181 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
2182 (maybe_set_textrel): Likewise.
2183 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
2184 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2185 with _bfd_elf_readonly_dynrelocs.
2186 (maybe_set_textrel): Likewise.
2187 * elfxx-x86.c (readonly_dynrelocs): Removed.
2188 (maybe_set_textrel): Replace readonly_dynrelocs with
2189 _bfd_elf_readonly_dynrelocs.
2190 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
2192 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2194 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
2195 -fsanitize=undefined.
2197 2020-06-03 Alan Modra <amodra@gmail.com>
2201 * peicode.h (pe_ILF_make_a_section): Align data for compilers
2203 (pe_ILF_build_a_bfd): Likewise.
2205 2020-06-03 Alan Modra <amodra@gmail.com>
2208 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
2209 core files as well as objects.
2211 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
2214 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
2215 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
2217 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
2218 (elf_arc_link_hash_newfunc): Updated.
2219 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
2220 (elf32_arm_link_hash_newfunc): Updated.
2221 (elf32_arm_copy_indirect_symbol): Likewise.
2222 (elf32_arm_check_relocs): Likewise.
2223 (readonly_dynrelocs): Likewise.
2224 (allocate_dynrelocs_for_symbol): Likewise.
2225 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
2226 (csky_elf_link_hash_newfunc): Updated.
2227 (csky_allocate_dynrelocs): Likewise.
2228 (readonly_dynrelocs): Likewise.
2229 (csky_elf_copy_indirect_symbol): Likewise.
2230 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
2231 (hppa_link_hash_newfunc): Updated.
2232 (elf32_hppa_copy_indirect_symbol): Likewise.
2233 (elf32_hppa_hide_symbol): Likewise.
2234 (elf32_hppa_adjust_dynamic_symbol): Likewise.
2235 (allocate_dynrelocs): Likewise.
2236 (elf32_hppa_relocate_section): Likewise.
2237 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2238 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
2239 (lm32_elf_link_hash_newfunc): Likewise.
2240 (lm32_elf_link_hash_table_create): Updated.
2241 (readonly_dynrelocs): Likewise.
2242 (allocate_dynrelocs): Likewise.
2243 (lm32_elf_copy_indirect_symbol): Likewise.
2244 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
2245 (m32r_elf_link_hash_newfunc): Likewise.
2246 (m32r_elf_link_hash_table_create): Updated.
2247 (m32r_elf_copy_indirect_symbol): Likewise.
2248 (allocate_dynrelocs): Likewise.
2249 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
2250 (metag_link_hash_newfunc): Updated.
2251 (elf_metag_copy_indirect_symbol): Likewise.
2252 (readonly_dynrelocs): Likewise.
2253 (allocate_dynrelocs): Likewise.
2254 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
2256 (link_hash_newfunc): Updated.
2257 (microblaze_elf_check_relocs): Likewise.
2258 (microblaze_elf_copy_indirect_symbol): Likewise.
2259 (readonly_dynrelocs): Likewise.
2260 (allocate_dynrelocs): Likewise.
2261 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
2262 (nds32_elf_link_hash_newfunc): Updated.
2263 (nds32_elf_copy_indirect_symbol): Likewise.
2264 (readonly_dynrelocs): Likewise.
2265 (allocate_dynrelocs): Likewise.
2266 (nds32_elf_check_relocs): Likewise.
2267 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
2268 (link_hash_newfunc): Updated.
2269 (nios2_elf32_copy_indirect_symbol): Likewise.
2270 (nios2_elf32_check_relocs): Likewise.
2271 (allocate_dynrelocs): Likewise.
2272 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
2273 (or1k_elf_link_hash_newfunc): Updated.
2274 (readonly_dynrelocs): Likewise.
2275 (allocate_dynrelocs): Likewise.
2276 (or1k_elf_copy_indirect_symbol): Likewise.
2277 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
2278 (ppc_elf_link_hash_newfunc): Updated.
2279 (ppc_elf_copy_indirect_symbol): Likewise.
2280 (ppc_elf_check_relocs): Likewise.
2281 (readonly_dynrelocs): Likewise.
2282 (ppc_elf_adjust_dynamic_symbol): Likewise.
2283 (allocate_dynrelocs): Likewise.
2284 (ppc_elf_relocate_section): Likewise.
2285 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2286 (link_hash_newfunc): Updated.
2287 (elf_s390_copy_indirect_symbol): Likewise.
2288 (readonly_dynrelocs): Likewise.
2289 (elf_s390_adjust_dynamic_symbol): Likewise.
2290 (allocate_dynrelocs): Likewise.
2291 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
2292 (sh_elf_link_hash_newfunc): Updated.
2293 (readonly_dynrelocs): Likewise.
2294 (allocate_dynrelocs): Likewise.
2295 (sh_elf_copy_indirect_symbol): Likewise.
2296 (sh_elf_check_relocs): Likewise.
2297 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
2298 (elf32_tic6x_link_hash_newfunc): Likewise.
2299 (elf32_tic6x_link_hash_table_create): Updated.
2300 (readonly_dynrelocs): Likewise.
2301 (elf32_tic6x_check_relocs): Likewise.
2302 (elf32_tic6x_allocate_dynrelocs): Likewise.
2303 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
2305 (link_hash_newfunc): Updated.
2306 (tilepro_elf_copy_indirect_symbol): Likewise.
2307 (tilepro_elf_check_relocs): Likewise.
2308 (allocate_dynrelocs): Likewise.
2309 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
2310 (ppc64_elf_copy_indirect_symbol): Updated.
2311 (ppc64_elf_check_relocs): Likewise.
2312 (readonly_dynrelocs): Likewise.
2313 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2314 (dec_dynrel_count): Likewise.
2315 (allocate_dynrelocs): Likewise.
2316 (ppc64_elf_relocate_section): Likewise.
2317 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2318 (link_hash_newfunc): Updated.
2319 (elf_s390_copy_indirect_symbol): Likewise.
2320 (readonly_dynrelocs): Likewise.
2321 (allocate_dynrelocs): Likewise.
2322 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2323 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
2325 (elfNN_aarch64_link_hash_newfunc): Updated.
2326 (elfNN_aarch64_copy_indirect_symbol): Likewise.
2327 (readonly_dynrelocs): Likewise.
2328 (need_copy_relocation_p): Likewise.
2329 (elfNN_aarch64_allocate_dynrelocs): Likewise.
2330 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
2331 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
2332 (link_hash_newfunc): Updated.
2333 (riscv_elf_copy_indirect_symbol): Likewise.
2334 (riscv_elf_check_relocs): Likewise.
2335 (readonly_dynrelocs): Likewise.
2336 (allocate_dynrelocs): Likewise.
2337 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
2339 (link_hash_newfunc): Updated.
2340 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2341 (_bfd_sparc_elf_check_relocs): Likewise.
2342 (readonly_dynrelocs): Likewise.
2343 (allocate_dynrelocs): Likewise.
2344 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
2345 (link_hash_newfunc): Updated.
2346 (tilegx_elf_copy_indirect_symbol): Likewise.
2347 (tilegx_elf_check_relocs): Likewise.
2348 (readonly_dynrelocs): Likewise.
2349 (allocate_dynrelocs): Likewise.
2350 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
2351 (readonly_dynrelocs): Likewise.
2352 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2353 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
2355 2020-06-01 Alan Modra <amodra@gmail.com>
2357 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
2358 command against cmd_length, not the end of record. For
2359 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
2360 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
2363 2020-05-28 David Faust <david.faust@oracle.com>
2365 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
2366 R_BPF_INSN_{32,64} relocations.
2368 2020-05-28 Stephen Casner <casner@acm.org>
2370 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
2371 addreses in .long (used in testsuites) and .stab values.
2373 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
2376 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
2377 Check bfd_link_dll when issue a DT_TEXTREL warning.
2378 * elfxx-x86.c (maybe_set_textrel): Likewise.
2379 (_bfd_x86_elf_size_dynamic_sections): Likewise.
2381 2020-05-26 Nick Clifton <nickc@redhat.com>
2383 * plugin.c (try_load_plugin): Extend error message when a plugin
2386 2020-05-23 Alan Modra <amodra@gmail.com>
2388 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
2390 2020-05-22 Alan Modra <amodra@gmail.com>
2393 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
2394 attributes from shared libraries, and do not return an error if
2397 2020-05-21 Alan Modra <amodra@gmail.com>
2400 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
2402 (_bfd_delete_bfd): Free the copy.
2403 (_bfd_new_bfd): Free nbfd->memory on error.
2405 2020-05-21 Alan Modra <amodra@gmail.com>
2407 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
2408 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
2409 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
2410 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
2411 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
2412 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
2413 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
2414 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
2415 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
2416 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
2417 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
2418 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
2419 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
2420 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
2421 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
2422 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
2423 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
2424 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
2425 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
2426 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
2428 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
2430 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
2431 get_default_version. It is used to find the default version for
2432 the specific extension.
2433 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
2434 default_major_version and default_minor_version. Add new bfd_boolean
2435 parameter *use_default_version. Set it to TRUE if we need to call
2436 the callback rps->get_default_version to find the default version.
2437 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
2438 the default version in riscv_parsing_subset_version, and then call
2439 riscv_add_subset to add the subset into subset list.
2440 (riscv_parse_prefixed_ext): Likewise.
2441 (riscv_std_z_ext_strtab): Support Zicsr extensions.
2442 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
2443 strings rather than characters.
2444 riscv_merge_arch_attr_info): The callback function get_default_version
2445 is only needed for assembler, so set it to NULL int the linker.
2446 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
2447 * elfxx-riscv.h: Updated.
2449 2020-05-20 Alan Modra <amodra@gmail.com>
2452 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
2453 use bfd_set_filename.
2454 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
2455 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
2456 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
2457 (bfd_create): Likewise.
2458 (_bfd_delete_bfd): Don't free filename.
2459 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
2460 return pointer to the copy or NULL on alloc fail.
2461 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
2462 result of bfd_set_filename.
2463 * bfd-in2.h: Regenerate.
2465 2020-05-20 Alan Modra <amodra@gmail.com>
2468 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
2469 section size against file size.
2470 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
2472 2020-05-19 Gunther Nikl <gnikl@justmail.de>
2475 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
2476 and memset when allocating memory for the sections_being_created
2479 2020-05-19 Stafford Horne <shorne@gmail.com>
2481 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
2483 (or1k_elf_relocate_section): Access srelgot via
2484 htab->root.srelgot. Add assertions for srelgot->contents.
2485 Introduce local variable for srelgot to not reuse global
2487 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
2488 (or1k_set_got_and_rela_sizes): New function.
2489 (or1k_initial_exec_offset): New function.
2490 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
2491 (or1k_elf_relocate_section): Allow for TLS to handle multiple
2493 (or1k_elf_check_relocs): Use OR to set TLS access.
2494 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
2496 (or1k_elf_size_dynamic_sections): Use
2497 or1k_set_got_and_rela_sizes to set sizes.
2498 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
2499 (TCB_SIZE): New macro.
2500 (tpoff): Use TCB_SIZE and alignment to calculate offset.
2501 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
2502 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
2503 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
2504 (tpoff): Add dynamic boolean argument.
2505 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
2507 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
2509 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
2510 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
2511 cases with BFD_RELOC_AARCH64_JUMP26.
2512 (elfNN_aarch64_check_relocs): Likewise.
2514 2020-05-19 Alan Modra <amodra@gmail.com>
2516 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
2517 bfd_get_filename rather than accessing bfd->filename directly.
2518 * aout-target.h (MY (object_p)): Likewise.
2519 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2520 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
2521 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
2522 (_bfd_archive_bsd44_construct_extended_name_table),
2523 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
2524 (_bfd_bsd_write_armap): Likewise.
2525 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
2526 * cache.c (bfd_open_file): Likewise.
2527 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
2528 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
2529 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2530 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2531 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
2532 * elf32-nds32.c (nds32_elf_output_symbol_hook),
2533 (patch_tls_desc_to_ie): Likewise.
2534 * elf32-spu.c (sort_bfds, print_one_overlay_section),
2535 (spu_elf_auto_overlay): Likewise.
2536 * elf64-hppa.c (elf_hppa_final_link): Likewise.
2537 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
2538 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
2539 * elflink.c (bfd_elf_size_dynamic_sections),
2540 (elf_link_input_bfd): Likewise.
2541 * linker.c (_bfd_generic_link_output_symbols): Likewise.
2542 * mach-o.c (bfd_mach_o_follow_dsym),
2543 (bfd_mach_o_close_and_cleanup): Likewise.
2544 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
2545 (find_separate_debug_file, get_build_id_name): Likewise.
2546 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2547 * plugin.c (bfd_plugin_open_input): Likewise.
2548 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
2549 * som.c (som_write_armap): Likewise.
2550 * srec.c (srec_write_record, srec_write_symbols): Likewise.
2551 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
2552 (_bfd_vms_lib_write_archive_contents): Likewise.
2553 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2555 2020-05-19 Alan Modra <amodra@gmail.com>
2558 * bfdio.c (_bfd_real_fopen): Typo fix.
2560 2020-05-18 Nick Clifton <nickc@redhat.com>
2563 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
2564 for the sections_being_created array.
2566 2020-05-18 Alan Modra <amodra@gmail.com>
2568 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
2569 they can be freed without also freeing internal_relocs.
2571 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2574 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
2575 separators into DOS style when creating a WIN32 fullpath.
2577 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
2579 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
2580 to initialize RISC-V tdata.
2582 2020-05-12 Gunther Nikl <gnikl@justmail.de>
2584 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
2587 2020-05-11 Alan Modra <amodra@gmail.com>
2589 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
2591 2020-05-11 Alan Modra <amodra@gmail.com>
2593 * elf64-ppc.c: Rename powerxx to power10 throughout.
2595 2020-05-11 Alan Modra <amodra@gmail.com>
2598 * coffgen.c (coff_get_normalized_symtab): Check that buffer
2599 contains required number of auxents before processing any auxent.
2600 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
2601 file name from auxents for PE.
2603 2020-05-04 Gunther Nikl <gnikl@justmail.de>
2605 * aout-cris.c (DEFAULT_ARCH): Delete define.
2606 (MY_set_arch_mach): Likewise.
2607 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
2609 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
2610 of r_type before the shift.
2612 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
2615 * elfnn-aarch64.c (group_sections): Copy implementation from
2618 2020-05-01 Alan Modra <amodra@gmail.com>
2621 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
2622 accessing root.u.def of symbols. Also check root.u.def.section
2623 is non-NULL. Reverse tests so as to make the logic positive.
2625 2020-05-01 Alan Modra <amodra@gmail.com>
2628 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
2629 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
2631 2020-05-01 Alan Modra <amodra@gmail.com>
2634 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
2635 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2636 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2637 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
2638 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
2639 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
2640 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
2641 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
2642 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
2643 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2645 2020-05-01 Alan Modra <amodra@gmail.com>
2648 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
2649 from shared libraries.
2651 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
2653 * elf32-xtensa.c (relax_section): Don't negate diff_value for
2654 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
2655 equals 0. Report overflow when the result has negative sign but
2656 all significant bits are zero.
2658 2020-04-29 Gunther Nikl <gnikl@justmail.de>
2660 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
2661 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2663 2020-04-28 Alan Modra <amodra@gmail.com>
2665 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
2666 Emit warning message.
2668 2020-04-27 Tamar Christina <tamar.christina@arm.com>
2670 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
2671 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
2672 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
2673 to x86_64_pe_big_vec as it not a big-endian format.
2674 (vec i386_pe_big_vec): New.
2675 * configure.ac: Likewise.
2676 * targets.c: Likewise.
2677 * configure: Regenerate.
2678 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
2679 COFF_WITH_PE_BIGOBJ): New.
2680 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
2682 (x86_64_pe_be_vec): Moved.
2684 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
2686 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
2687 * elf.c (elfcore_grok_arc_v2): New function.
2688 (elfcore_grok_note): Call the new function to handle the corresponding
2690 (elfcore_write_arc_v2): New function.
2691 (elfcore_write_register_note): Call the new function to handle the
2692 corresponding pseudo-sections.
2694 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
2697 * bfd-in2.h: Regenerated.
2698 * elf32-xtensa.c (elf_howto_table): New entries for
2699 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
2700 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
2701 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
2702 R_XTENSA_NDIFF{8,16,32}.
2703 * libbfd.h (bfd_reloc_code_real_names): Add names for
2704 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
2705 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2706 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
2707 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2709 2020-04-21 Tamar Christina <tamar.christina@arm.com>
2712 * compress.c (bfd_get_full_section_contents): Exclude sections with no
2715 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2718 * elf-bfd.h (elf_backend_data): Add
2719 elf_backend_strip_zero_sized_dynamic_sections.
2720 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
2721 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
2723 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
2725 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
2727 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
2729 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2731 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
2733 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
2735 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2737 2020-04-21 Nick Clifton <nickc@redhat.com>
2739 * po/sr.po: Updated Serbian translation.
2741 2020-04-21 Alan Modra <amodra@gmail.com>
2743 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
2746 2020-04-20 Stephen Casner <casner@acm.org>
2748 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
2749 causing globals from linker script to be treated as debug symbols.
2750 (translate_symbol_table): Don't sign-extend symbol values from 16
2751 to 64 bits in nm output.
2753 2020-04-20 Alan Modra <amodra@gmail.com>
2755 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
2757 2020-04-18 Alan Modra <amodra@gmail.com>
2759 * section.c (bfd_is_const_section): Correct test for special
2761 * bfd-in2.h: Regenerate.
2763 2020-04-17 Alan Modra <amodra@gmail.com>
2766 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
2769 2020-04-16 Nick Clifton <nickc@redhat.com>
2772 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
2773 abort with a more helpful error message.
2775 2020-04-16 Alan Modra <amodra@gmail.com>
2778 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
2781 2020-04-15 Fangrui Song <maskray@google.com>
2784 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
2785 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
2786 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2787 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
2788 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2789 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2790 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2791 * elf32-sh.c (sh_elf_relocate_section): Likewise.
2792 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2793 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2794 * elflink.c (elf_link_output_extsym): Likewise.
2795 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
2797 2020-04-15 Alan Modra <amodra@gmail.com>
2800 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
2801 pointer into strings that may be freed for section name, always
2802 allocate a new string.
2804 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2805 Jan W. Jagersma <jwjagersma@gmail.com>
2807 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
2808 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2809 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
2810 (_bfd_go32_mkobject): New functions.
2811 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
2812 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2813 (go32exe_mkobject): Call _bfd_go32_mkobject.
2814 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
2815 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
2817 (coff_write_relocs): Enable extended reloc counter code if
2818 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
2819 (coff_write_object_contents): Likewise. Pad section headers
2820 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
2821 instead of coff_swap_scnhdr_out.
2822 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
2823 enable extended reloc counter.
2824 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
2825 Declare with ATTRIBUTE_UNUSED.
2826 * libcoff-in.h: (struct coff_tdata): New field go32.
2828 * libcoff.h: Regenerate.
2830 2020-04-14 Fangrui Song <maskray@google.com>
2833 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
2836 2020-04-14 Stephen Casner <casner@acm.org>
2839 * pdp11.c: Add implementation of --imagic option.
2840 (adjust_o_magic): Fix objcopy --extract-symbol test.
2841 * libaout.h (enum aout_magic): Add i_magic.
2843 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2844 Nick Clifton <nickc@redhat.com>
2846 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
2848 <default>: Error rather than abort.
2850 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
2853 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
2854 relocation section from section group.
2856 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
2858 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
2859 bfd->origin to file offset.
2860 * bfdwin.c (bfd_get_file_window): Likewise.
2861 * bfd.c: Clarify the use of the bfd->origin field.
2862 * bfd-in2.h: Regenerate.
2863 * coff-i386.c: Don't include go32exe.h. Allow overriding
2864 coff_write_object_contents via COFF_WRITE_CONTENTS.
2865 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
2866 (go32exe_write_object_contents): New functions.
2867 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
2868 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
2869 (create_go32_stub): Remove check for 2k size limit. Read stub
2870 from go32exe_temp_stub if present.
2871 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
2872 copy variable-length stub.
2873 (go32_check_format): Read stub to go32exe_temp_stub, set
2874 origin, return go32exe_cleanup.
2875 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
2876 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
2877 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
2878 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
2879 Remove functions and their associated #defines.
2880 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
2881 * libcoff-in.h: (struct coff_tdata): New field stub_size.
2882 Rename field go32stub to stub.
2883 * libcoff.h: Regenerate.
2884 * coff-stgo32.c (go32_check_format): Rename to...
2885 (go32exe_check_format): ...this.
2886 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
2887 (go32exe_copy_private_bfd_data): ...this.
2888 (stub_bytes): Rename to...
2889 (go32exe_default_stub): ...this.
2890 (create_go32_stub): Rename to...
2891 (go32exe_create_stub): ...this.
2892 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
2895 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
2899 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
2900 relocation to R_386_32 for relocation against non-preemptible
2902 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
2903 allocate dynamic relocation for non-preemptible absolute symbol.
2904 (elf_i386_relocate_section): Pass sec to
2905 GENERATE_DYNAMIC_RELOCATION_P.
2906 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
2907 (elf_x86_64_convert_load_reloc): Covert load relocation to
2908 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
2909 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
2910 for non-preemptible absolute symbol if they overflow.
2911 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
2912 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
2913 symbol. Don't allocate dynamic relocation for non-preemptible
2915 (elf_x86_64_relocate_section): Don't generate relative relocation
2916 for GOTPCREL relocations aganst local absolute symbol. Pass sec
2917 to GENERATE_DYNAMIC_RELOCATION_P.
2918 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
2919 against non-preemptible absolute symbol.
2920 (_bfd_elf_x86_valid_reloc_p): New function.
2921 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
2923 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
2924 argument. Don't generate dynamic relocation against
2925 non-preemptible absolute symbol.
2926 (ABS_SYMBOL_P): New.
2927 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
2928 against non-preemptible absolute symbol.
2930 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
2931 (_bfd_elf_x86_valid_reloc_p): New.
2933 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2936 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
2937 address in the GOT if in thumb only mode.
2939 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2941 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
2943 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
2945 * mmo.c (mmo_scan): Create .text section only when needed, not
2948 2020-03-31 Alan Modra <amodra@gmail.com>
2950 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
2953 2020-03-31 Alan Modra <amodra@gmail.com>
2955 * vms-alpha.c (image_write): Check bounds for sections without
2956 contents too. Error on non-zero write to section without
2958 (_bfd_vms_slurp_etir): Check return of image_write* functions.
2960 2020-03-31 Alan Modra <amodra@gmail.com>
2962 * tekhex.c (pass_over): Check is_eof before reading buffer.
2964 2020-03-30 Nick Clifton <nickc@redhat.com>
2967 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
2968 field to timestamp and make it an integer.
2969 * libcoff.h: Regenerate.
2970 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
2971 field in the pe_data structure rather than the insert_timestamp
2974 2020-03-30 Alan Modra <amodra@gmail.com>
2977 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
2980 2020-03-26 Nick Clifton <nickc@redhat.com>
2982 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
2983 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
2985 * libbfd.h: Regenerate.
2987 2020-03-26 Alan Modra <amodra@gmail.com>
2989 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
2991 2020-03-26 Alan Modra <amodra@gmail.com>
2993 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
2995 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
2997 2020-03-25 Nick Clifton <nickc@redhat.com>
2999 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
3001 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
3002 * libbfd.h: Regenerate.
3004 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
3006 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
3007 correct field name in the output string.
3009 2020-03-25 Alan Modra <amodra@gmail.com>
3012 * elf.c (assign_file_positions_for_load_sections): Adjust offset
3013 for SHT_NOBITS section if first in segment.
3015 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3018 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
3019 (_bfd_elf_get_symbol_version_string): This.
3020 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
3021 (_bfd_elf_get_symbol_version_string): This.
3022 (bfd_elf_print_symbol): Pass TRUE to
3023 _bfd_elf_get_symbol_version_string.
3024 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
3025 bfd_boolean argument.
3026 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
3027 * targets.c (_bfd_get_symbol_version_string): Likewise.
3028 (bfd_get_symbol_version_string): Likewise.
3029 * bfd-in2.h: Regenerated.
3031 2020-03-24 Nick Clifton <nickc@redhat.com>
3032 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
3035 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
3038 2020-03-24 Nick Clifton <nickc@redhat.com>
3041 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
3042 segment to use for PT_GNU_RELRO, ignore empty sections in a
3043 segment's current list.
3045 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3048 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
3050 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3053 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
3054 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
3055 on the previous _bfd_elf_get_symbol_version_string.
3056 (_bfd_elf_get_symbol_version_string): Use it.
3058 2020-03-24 Alan Modra <amodra@gmail.com>
3060 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
3061 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
3064 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
3066 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
3068 2020-03-23 Alan Modra <amodra@gmail.com>
3070 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
3071 symbol count. Allocate an extra byte to ensure name strings
3072 are terminated. Sanity check name offsets. Release memory on
3075 2020-03-23 Alan Modra <amodra@gmail.com>
3077 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
3078 field hasn't been read. Remove unnecessary casts.
3080 2020-03-22 Alan Modra <amodra@gmail.com>
3082 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
3083 enough to read number of symbols.
3085 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
3087 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
3088 (EXECUTABLE_SUFFIX): Likewise.
3089 * config.in: Regenerated.
3090 * configure: Likewise.
3091 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
3092 _bfd_generic_close_and_cleanup.
3093 (plugin_list_entry): Remove resolution_file, resolution_option,
3094 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
3095 lto_wrapper, gcc_env and initialized,
3096 (need_lto_wrapper_p): Removed.
3097 (get_lto_wrapper): Likewise.
3098 (setup_lto_wrapper_env): Likewise.
3099 (register_all_symbols_read): Likewise.
3100 (egister_cleanup): Likewise.
3101 (get_symbols): Likewise.
3102 (add_input_file): Likewise.
3103 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
3104 (add_symbols): Updated.
3105 (try_claim): Likewise.
3106 (try_load_plugin): Likewise.
3107 (bfd_plugin_canonicalize_symtab): Likewise.
3108 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
3109 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
3111 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
3114 * plugin.c (plugin_list_entry): Add has_symbol_type.
3115 (add_symbols_v2): New function.
3116 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
3117 provides symbol type.
3118 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
3119 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
3122 2020-03-20 Alan Modra <amodra@gmail.com>
3124 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
3125 enough to read number of symbols.
3127 2020-03-20 Alan Modra <amodra@gmail.com>
3129 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
3130 backend functions for NULL before calling.
3131 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
3132 (bfd_section_from_shdr, assign_section_numbers): Likewise.
3133 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
3134 * elfnn-ia64.c (ignore_errors): New function.
3135 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
3137 2020-03-19 Nick Clifton <nickc@redhat.com>
3140 * dwarf2.c (struct varinfo): Add unit_offset field to record the
3141 location of the varinfo in the unit's debug info data. Change the
3142 type of the stack field to a boolean.
3143 (lookup_var_by_offset): New function. Returns the varinfo
3144 structure for the variable described at the given offset in the
3146 (scan_unit_for_symbols): Add support for variables which have the
3147 DW_AT_specification attribute.
3149 2020-03-19 Nick Clifton <nickc@redhat.com>
3152 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
3155 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
3157 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
3159 2020-03-18 Nick Clifton <nickc@redhat.com>
3162 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
3163 memory access when processing a corrupt secondary reloc section.
3165 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
3167 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
3168 instead of calling abort.
3169 * elf32-csky.c (csky_build_one_stub): Likewise.
3170 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3171 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3172 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3173 * elf32-metag.c (metag_build_one_stub): Likewise.
3174 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3175 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3176 (ppc_size_one_stub): Likewise.
3177 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3179 2020-03-17 Nick Clifton <nickc@redhat.com>
3182 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
3183 with error messages.
3185 2020-03-17 Nick Clifton <nickc@redhat.com>
3188 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
3189 free. Add free on another failure path.
3191 2020-03-16 Alan Modra <amodra@gmail.com>
3194 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
3195 we have a non-zero section count. Do lma comparison in octets.
3197 2020-03-16 Alan Modra <amodra@gmail.com>
3199 * vms-alpha.c (dst_restore_location): Validate index into
3200 dst_ptr_offsets array before accessing. Return status.
3201 (dst_retrieve_location): Similarly, making "loc" parameter a
3202 pointer to return value.
3203 (_bfd_vms_slurp_etir): Update calls to above functions.
3205 2020-03-14 Kamil Rytarowski <n54@gmx.com>
3207 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
3209 * configure: Regenerated.
3211 2020-03-14 Alan Modra <amodra@gmail.com>
3213 * section.c (BFD_FAKE_SECTIONS): Formatting.
3214 * bfd-in2.h: Regenerate.
3216 2020-03-13 Kamil Rytarowski <n54@gmx.com>
3218 * elf.c (elfcore_grok_netbsd_note): Add support for
3219 NT_NETBSDCORE_LWPSTATUS notes.
3221 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
3223 * bfd-in2.h: Regenerate.
3224 * section.c (asection): Add already_assigned field.
3225 (BFD_FAKE_SECTION): Add default initializer for it.
3226 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
3227 * elf32-arm.c (arm_build_one_stub): Add support for
3228 non_contiguous_regions.
3229 * elf32-csky.c (csky_build_one_stub): Likewise.
3230 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3231 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3232 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3233 * elf32-metag.c (metag_build_one_stub): Likewise.
3234 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3235 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3236 (ppc_size_one_stub): Likewise.
3237 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3238 * elflink.c (elf_link_input_bfd): Likewise.
3240 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
3243 * elf-linker-x86.h (elf_linker_x86_params): Add
3244 static_before_all_inputs and has_dynamic_linker.
3245 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
3246 dynamic input objects if -static is passed at command-line
3247 before all input files without --dynamic-linker unless
3248 --no-dynamic-linker is used.
3250 2020-03-13 Kamil Rytarowski <n54@gmx.com>
3252 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
3254 2020-03-13 Christian Eggers <ceggers@gmx.de>
3256 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
3257 "p_paddr" from "at".
3258 * elfcode.h (bfd_from_remote_memory): Add units to several
3259 parameters. New local "opb". Fix usage of p_align. Fix
3260 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
3261 call of target_read_memory.
3262 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
3263 calculation of "offset" and "output_offset".
3264 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
3265 from "offset" and fix calculation of "end" from "vma+size". Fix
3266 comparison between "sh_addr" and "vma"/"output_offset".
3267 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
3268 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
3270 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
3271 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
3272 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
3273 assignment of p_paddr from phdr_lma. Fix comparison between
3274 "lma+size" and "next->lma".
3275 (elf_sort_segments): Fix assignment from p_paddr to lma.
3276 (assign_file_positions_for_load_sections): Add unit (bytes) to
3277 local "align". Fix calculation of local "off_adjust". Fix
3278 calculation of local "filehdr_vaddr".
3279 (assign_file_positions_for_non_load_sections): New local "opb".
3280 Fix calculation of "end" from "p_size". Fix comparison between
3281 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
3282 from "end" and "p_vaddr".
3283 (rewrite_elf_program_header): Fix comparison between p_vaddr and
3284 vma. Fix assignment to p_paddr from lma. Fix comparison between
3285 p_paddr and lma. Fix assignment to p_paddr from lma.
3286 * merge.c (sec_merge_emit): New local "opb". Convert
3287 "alignment_power" to octets.
3288 (_bfd_add_merge_section): New locals "alignment_power" and
3289 "opb". Fix comparison between "alignment_power" and
3291 (_bfd_merge_sections): New local "opb". Divide size by opb
3292 before checking align mask.
3294 2020-03-13 Christian Eggers <ceggers@gmx.de>
3296 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
3297 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
3299 (_bfd_elf_make_section_from_phdr): Similarly.
3300 (elf_fake_sections): Fix calculation of
3301 Elf_Internal_shdr::sh_addr from section VMA.
3302 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
3304 (assign_file_positions_for_load_sections): Fix calculations of
3305 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
3306 comparison between program header address and section LMA.
3307 (assign_file_positions_for_non_load_sections): Likewise.
3308 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
3309 (IS_CONTAINED_BY_VMA): Add parameter opb.
3310 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
3311 INCLUDE_SECTION_IN_SEGMENT): Likewise.
3312 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
3313 Fix calculations of p_addr_valid and p_vaddr_offset.
3314 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
3315 with octets per byte when comparing against p_vaddr.
3317 2020-03-11 Alan Modra <amodra@gmail.com>
3319 * som.c (setup_sections): Sanity check subspace.name.
3321 2020-03-11 Alan Modra <amodra@gmail.com>
3323 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
3325 2020-03-10 Alan Modra <amodra@gmail.com>
3328 * ihex.c (ihex_write_object_contents): Don't assume ordering of
3331 2020-03-09 Alan Modra <amodra@gmail.com>
3333 * wasm-module.c (wasm_scan): Sanity check file name length
3334 before allocating memory. Move common section setup code. Do
3335 without bfd_tell to calculate section size.
3337 2020-03-06 Nick Clifton <nickc@redhat.com>
3339 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
3340 with error messages and failure return values.
3342 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
3344 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
3345 relocation sections for any removed reference to a dynamic symbol.
3347 2020-03-05 Nick Clifton <nickc@redhat.com>
3349 * elf-bfd.h (struct elf_backend_data): Add new fields:
3350 init_secondary_reloc_section, slurp_secondary_reloc_section,
3351 write_secondary_reloc_section.
3352 (_bfd_elf_init_secondary_reloc_section): Prototype.
3353 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
3354 (_bfd_elf_write_secondary_reloc_section): Prototype.
3355 * elf.c ( bfd_section_from_shdr): Invoke the new
3356 init_secondary_reloc_section backend function, if defined, when a
3357 second reloc section is encountered.
3358 (swap_out_syms): Invoke the new symbol_section_index function, if
3359 defined, when computing the section index of an OS/PROC specific
3361 (_bfd_elf_init_secondary_reloc_section): New function.
3362 (_bfd_elf_slurp_secondary_reloc_section): New function.
3363 (_bfd_elf_write_secondary_reloc_section): New function.
3364 (_bfd_elf_copy_special_section_fields): New function.
3365 * elfcode.h (elf_write_relocs): Invoke the new
3366 write_secondary_relocs function, if defined, in order to emit
3368 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
3369 function, if defined, in order to read in secondary relocs.
3370 * elfxx-target.h (elf_backend_copy_special_section_fields):
3371 Provide a non-NULL default definition.
3372 (elf_backend_init_secondary_reloc_section): Likewise.
3373 (elf_backend_slurp_secondary_reloc_section): Likewise.
3374 (elf_backend_write_secondary_reloc_section): Likewise.
3375 (struct elf_backend_data elfNN_bed): Add initialisers for the new
3377 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
3378 * configure: Regenerate.
3380 2020-03-05 Alan Modra <amodra@gmail.com>
3382 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
3383 against file size before allocating memory. Use bfd_alloc rather
3384 than bfd_zalloc for carsym/strings memory.
3386 2020-03-04 Alan Modra <amodra@gmail.com>
3388 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
3389 sh_addr mod sh_addalign is zero.
3391 2020-03-04 Alan Modra <amodra@gmail.com>
3393 * format.c (bfd_check_format_matches): Call cleanup on error exit.
3395 2020-03-03 Alan Modra <amodra@gmail.com>
3397 * format.c (struct bfd_preserve): Add cleanup field.
3398 (bfd_preserve_save): Add cleanup param and save.
3399 (bfd_preserve_restore): Return cleanup.
3400 (bfd_preserve_finish): Call the cleanup for the discarded match.
3401 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
3402 and clear when preserving a match. Restore cleanup too when
3403 restoring that match.
3405 2020-03-02 Alan Modra <amodra@gmail.com>
3407 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
3408 * hpux-core.c (hpux_core_core_file_p): Update prototype.
3409 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
3410 (core_sco5_vec): Correct initialisers.
3412 2020-03-02 Alan Modra <amodra@gmail.com>
3414 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
3415 * aix5ppc-core.c (xcoff64_core_p): Likewise.
3416 * cisco-core.c (cisco_core_file_validate): Likewise.
3417 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
3418 * hpux-core.c (hpux_core_core_file_p): Likewise.
3419 * irix-core.c (irix_core_core_file_p): Likewise.
3420 * lynx-core.c (lynx_core_file_p): Likewise.
3421 * netbsd-core.c (netbsd_core_file_p): Likewise.
3422 * osf-core.c (osf_core_core_file_p): Likewise.
3423 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3424 * sco5-core.c (sco5_core_file_p): Likewise.
3426 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
3428 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
3430 2020-03-02 Alan Modra <amodra@gmail.com>
3432 * targets.c (bfd_cleanup): New typedef.
3433 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
3434 * libbfd-in.h (_bfd_no_cleanup): Define.
3435 * format.c (bfd_reinit): Add cleanup parameter, call it.
3436 (bfd_check_format_matches): Set cleanup from _bfd_check_format
3437 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
3438 * aout-target.h (callback, object_p): Return bfd_cleanup.
3439 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
3440 * archive.c (bfd_generic_archive_p): Likewise.
3441 * binary.c (binary_object_p): Likewise.
3442 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
3443 * coff-ia64.c (ia64coff_object_p): Likewise.
3444 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
3445 * coff-sh.c (coff_small_object_p): Likewise.
3446 * coff-stgo32.c (go32_check_format): Likewise.
3447 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
3448 (xcoff64_core_p): Likewise.
3449 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
3450 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
3451 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
3452 * elfcode.h (elf_object_p): Likewise.
3453 * elfcore.h (elf_core_file_p): Likewise.
3454 * i386msdos.c (msdos_object_p): Likewise.
3455 * ihex.c (ihex_object_p): Likewise.
3456 * libaout.h (some_aout_object_p): Likewise.
3457 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
3458 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
3459 * libbfd.c (_bfd_dummy_target): Likewise.
3460 * libcoff-in.h (coff_object_p): Likewise.
3461 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
3462 (bfd_mach_o_arm64_core_p): Likewise.
3463 * mach-o-arm.c (bfd_mach_o_arm_object_p),
3464 (bfd_mach_o_arm_core_p): Likewise.
3465 * mach-o-i386.c (bfd_mach_o_i386_object_p),
3466 (bfd_mach_o_i386_core_p): Likewise.
3467 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
3468 (bfd_mach_o_x86_64_core_p): Likewise.
3469 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
3470 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
3471 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
3472 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
3473 * mmo.c (mmo_object_p): Likewise.
3474 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
3475 * peicode.h (coff_real_object_p, pe_ILF_object_p),
3476 (pe_bfd_object_p): Likewise.
3477 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
3478 * ppcboot.c (ppcboot_object_p): Likewise.
3479 * rs6000-core.c (rs6000coff_core_p): Likewise.
3480 * som.c (som_object_setup, som_object_p): Likewise.
3481 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
3482 * tekhex.c (tekhex_object_p): Likewise.
3483 * vms-alpha.c (alpha_vms_object_p): Likewise.
3484 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
3485 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
3486 * wasm-module.c (wasm_object_p): Likewise.
3487 * xsym.c (bfd_sym_object_p): Likewise.
3488 * xsym.h (bfd_sym_object_p): Likewise.
3489 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
3491 * pdp11.c (some_aout_object_p): Likewise.
3492 * plugin.c (register_ld_plugin_object_p): Update object_p
3494 * plugin.h (register_ld_plugin_object_p): Likewise.
3495 * bfd-in2.h: Regenerate.
3496 * libbfd.h: Regenerate.
3497 * libcoff.h: Regenerate.
3499 2020-03-02 Alan Modra <amodra@gmail.com>
3501 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
3502 applicable section flags.
3503 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
3504 (mips_ecoff_bele_vec): Likewise.
3505 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
3507 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
3508 (_bfd_ecoff_styp_to_sec_flags): Likewise.
3510 2020-03-02 Alan Modra <amodra@gmail.com>
3512 * elf32-m32r.c (m32r_elf_section_flags): New function.
3513 (elf_backend_section_flags): Define.
3514 * elf32-nds32.c (nds32_elf_section_flags): New function.
3515 (elf_backend_section_flags): Define.
3516 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
3517 .sbss and .sdata sections.
3518 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
3519 for SHF_V850_GPREL sections.
3520 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
3522 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
3523 for SHF_PARISC_SHORT sections.
3524 * elf64-ppc.c (ppc64_elf_section_flags): New function.
3525 (elf_backend_section_flags): Define.
3526 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
3527 for SHF_MIPS_GPREL sections. Delete FIXME.
3529 2020-03-02 Alan Modra <amodra@gmail.com>
3531 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
3532 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
3533 calling elf_backend_section_flags with adjusted params. Use
3534 newsect->flags past that point.
3535 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
3537 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
3538 to have their type overridden, and all sh_flags but processor and
3540 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
3541 * elf32-mep.c (mep_elf_section_flags): Likewise.
3542 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
3543 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
3544 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
3545 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
3546 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
3547 stub BFD and non-aarch64 input files when scanning for stubs.
3549 2020-03-02 Alan Modra <amodra@gmail.com>
3551 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
3552 limit to decompressed element size.
3554 2020-03-02 Alan Modra <amodra@gmail.com>
3556 * vms-lib.c (vms_traverse_index): Add recur_count param and
3557 update calls. Fail on excessive recursion.
3559 2020-03-02 Alan Modra <amodra@gmail.com>
3561 * vms-alpha.c (vms_get_remaining_object_record): Use
3562 bfd_realloc_or_free rather than bfd_realloc.
3563 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
3564 (dst_define_location, parse_module): Likewise, and check realloc
3565 return status before using memory. Return status from function
3566 adjusting all callers.
3568 2020-02-28 Alan Modra <amodra@gmail.com>
3570 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
3572 2020-02-28 Alan Modra <amodra@gmail.com>
3574 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
3575 Remove duplicate undersize check.
3577 2020-02-27 Alan Modra <amodra@gmail.com>
3580 * mmo.c (mmo_scan): Set SEC_DATA for .data.
3582 2020-02-27 Alan Modra <amodra@gmail.com>
3585 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
3586 (coff_section_type): Adjust comment.
3587 (decode_section_type): Likewise. Call coff_section_type before
3588 decode_section_type.
3589 (bfd_decode_symclass): Use 'c' for common sections other than
3592 2020-02-27 Alan Modra <amodra@gmail.com>
3594 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
3597 2020-02-27 Alan Modra <amodra@gmail.com>
3599 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
3600 if file is an archive element.
3601 * bfd-in2.h: Regenerate.
3603 2020-02-26 Alan Modra <amodra@gmail.com>
3605 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
3606 bfd_set_error on failing test. Don't bother changing bfd_error on
3607 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
3608 Check sym name is within string buffer. Use size_t for some vars.
3609 (do_slurp_coff_armap): Use size_t for some variables, fix size of
3610 int_buf. Don't change bfd_error on file read error. Use
3611 _bfd_mul_overflow when calculating carsym buffer size. Reorder
3612 calculations to catch overflows before they occur. malloc and
3613 free raw armap rather than using bfd_alloc. Read raw armap before
3614 allocating carsym+strings buffer.
3615 (_bfd_slurp_extended_name_table): Localize variables. Check
3616 name size against file size.
3618 2020-02-26 Alan Modra <amodra@gmail.com>
3620 * vms-lib.c (vms_lib_read_index): Release correct buffer.
3622 2020-02-26 Alan Modra <amodra@gmail.com>
3624 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
3625 malloc. Check for NULL return from bfd_malloc.
3626 (rx_table_find, rx_table_map): Likewise.
3627 (rx_set_section_contents): Check bfd_alloc return.
3628 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
3630 2020-02-26 Alan Modra <amodra@gmail.com>
3632 * aoutx.h: Indent labels correctly. Format error strings.
3633 * archive.c: Likewise.
3634 * archive64.c: Likewise.
3635 * coff-arm.c: Likewise.
3636 * coff-rs6000.c: Likewise.
3637 * coff-stgo32.c: Likewise.
3638 * cpu-arm.c: Likewise.
3639 * dwarf2.c: Likewise.
3640 * elf-ifunc.c: Likewise.
3641 * elf-properties.c: Likewise.
3642 * elf-s390-common.c: Likewise.
3643 * elf-strtab.c: Likewise.
3645 * elf32-arm.c: Likewise.
3646 * elf32-bfin.c: Likewise.
3647 * elf32-cr16.c: Likewise.
3648 * elf32-csky.c: Likewise.
3649 * elf32-i386.c: Likewise.
3650 * elf32-m68k.c: Likewise.
3651 * elf32-msp430.c: Likewise.
3652 * elf32-nds32.c: Likewise.
3653 * elf32-nios2.c: Likewise.
3654 * elf32-pru.c: Likewise.
3655 * elf32-xtensa.c: Likewise.
3656 * elf64-ia64-vms.c: Likewise.
3657 * elf64-x86-64.c: Likewise.
3658 * elfcode.h: Likewise.
3659 * elfcore.h: Likewise.
3660 * elflink.c: Likewise.
3661 * elfnn-aarch64.c: Likewise.
3662 * elfnn-ia64.c: Likewise.
3663 * elfnn-riscv.c: Likewise.
3664 * elfxx-mips.c: Likewise.
3665 * elfxx-sparc.c: Likewise.
3666 * elfxx-x86.c: Likewise.
3667 * i386lynx.c: Likewise.
3668 * merge.c: Likewise.
3669 * pdp11.c: Likewise.
3670 * plugin.c: Likewise.
3671 * reloc.c: Likewise.
3673 2020-02-26 Alan Modra <amodra@gmail.com>
3676 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
3678 (bfd_elf_add_dt_needed_tag): Declare.
3679 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
3680 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
3681 from elf_add_dt_needed_tag. Remove soname and doit param.
3682 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
3683 to see whether as-needed lib is already loaded, use dyn_loaded
3684 list instead. When saving and restoring around as-needed lib
3685 handle possibility that dynstr has not been initialised. Don't
3686 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
3687 Mark libs loaded via DT_NEEDED entries of other libs with
3688 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
3690 (elf_link_check_versioned_symbol): Remove now unneccesary
3691 DYNAMIC check when traversing dyn_loaded list.
3693 2020-02-26 Alan Modra <amodra@gmail.com>
3695 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
3697 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
3700 * plugin.c (need_lto_wrapper_p): New.
3701 (bfd_plugin_set_program_name): Add an int argument to set
3703 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
3705 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
3707 2020-02-24 Alan Modra <amodra@gmail.com>
3709 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
3711 2020-02-24 Alan Modra <amodra@gmail.com>
3713 * vms-lib.c (struct carsym_mem): Add limit.
3714 (vms_add_index): Heed limit.
3715 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
3716 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
3717 Always return actual number read.
3718 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
3719 assertion with error exit.
3721 2020-02-22 Alan Modra <amodra@gmail.com>
3724 * elf.c (assign_file_positions_for_load_sections): Continue linking
3725 on "PHDR segment not covered by LOAD segment" errors.
3727 2020-02-21 Alan Modra <amodra@gmail.com>
3729 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
3731 (bfd_mach_o_canonicalize_reloc): Likewise.
3732 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
3733 counts and offsets against file size.
3734 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
3735 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
3736 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
3737 against file size. Delete symbol table error message.
3738 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
3740 (bfd_mach_o_read_symtab): Likewise.
3741 (bfd_mach_o_read_command): Pass file size.
3742 (bfd_mach_o_scan): Sanity check command count against file size.
3744 2020-02-21 Alan Modra <amodra@gmail.com>
3747 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
3748 "text", "data" and "bss" section pointer vars. Don't update
3749 section size, just exec header sizes.
3750 (adjust_sizes_and_vmas): Don't update text section size. Set
3751 initial exec header a_text. Print exec headers sizes.
3752 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
3753 (adjust_sizes_and_vmas): Similarly. Formatting.
3754 (final_link): Correct final file extension.
3756 2020-02-20 Nick Clifton <nickc@redhat.com>
3758 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
3760 * elfxx-target.h (elf_backend_symbol_section_index): Provide
3762 (elfNN_bed): Initialise the symbol_section_index field.
3763 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
3764 OS and PROC specific section indicies. Warn if converting other
3765 reserved incidies to SHN_ABS.
3767 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
3770 * cpu-z80.c: Add machine type compatibility checking.
3772 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
3775 * plugin.c (plugin_list_entry): Remove handle.
3776 (try_load_plugin): Call dlclose before return.
3778 2020-02-19 Alan Modra <amodra@gmail.com>
3780 * libbfd-in.h (_bfd_constant_p): Define.
3781 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
3782 file size before allocating memory.
3783 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
3784 * elf.c (bfd_elf_get_str_section): Likewise.
3785 (_bfd_elf_slurp_version_tables): Likewise.
3786 * libbfd.h: Regenerate.
3788 2020-02-19 Alan Modra <amodra@gmail.com>
3790 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
3791 * aoutx.h (aout_get_external_symbols): Replace calls to
3792 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
3793 (slurp_reloc_table): Likewise.
3794 * archive.c (do_slurp_bsd_armap): Likewise.
3795 (do_slurp_coff_armap): Likewise.
3796 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
3797 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
3798 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
3799 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
3800 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
3801 (_bfd_coff_get_external_symbols): Likewise.
3802 * ecoff.c (ecoff_slurp_symbolic_header),
3803 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
3804 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
3805 (ecoff_indirect_link_order): Likewise.
3806 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
3807 (_bfd_elf_slurp_version_tables): Likewise.
3808 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3809 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3810 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3811 * elf64-alpha.c (READ): Likewise.
3812 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
3813 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3814 * elfcode.h (elf_slurp_symbol_table),
3815 (elf_slurp_reloc_table_from_section): Likewise.
3816 * elflink.c (elf_link_add_object_symbols),
3817 (elf_link_check_versioned_symbol): Likewise.
3818 * elfxx-mips.c (READ): Likewise.
3819 * i386lynx.c (slurp_reloc_table): Likewise.
3820 * lynx-core.c (lynx_core_file_p): Likewise.
3821 * mach-o.c (bfd_mach_o_canonicalize_relocs),
3822 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
3823 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
3824 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
3825 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
3826 (bfd_pef_parse_symbols): Likewise.
3827 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
3828 * som.c (setup_sections, som_slurp_string_table),
3829 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3830 (som_bfd_fill_in_ar_symbols): Likewise.
3831 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
3832 (evax_bfd_print_image): Likewise.
3833 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
3834 * wasm-module.c (wasm_scan): Likewise.
3835 * xcofflink.c (xcoff_link_add_symbols): Likewise.
3836 * xsym.c (bfd_sym_read_name_table),
3837 (bfd_sym_print_type_information_table_entry): Likewise.
3838 * libbfd.h: Regenerate.
3840 2020-02-19 Alan Modra <amodra@gmail.com>
3842 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
3843 reading external relocs.
3844 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
3845 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
3847 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
3849 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
3850 (m32c_elf_relax_section): Likewise.
3851 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
3852 (rl78_elf_relax_section): Likewise.
3853 * elf32-rx.c (rx_offset_for_reloc): Likewise.
3854 (elf32_rx_relax_section): Likewise.
3855 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
3856 parameter types and use..
3857 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
3858 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
3859 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
3860 being read from file, just the extra.
3861 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
3862 after reading external syms. Free on failure.
3864 2020-02-19 Alan Modra <amodra@gmail.com>
3866 * coffcode.h (buy_and_read, coff_slurp_line_table),
3867 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
3868 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
3869 corresponding bfd_alloc call. Adjust variables to suit.
3870 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
3871 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
3872 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
3873 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
3874 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
3875 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3876 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3877 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3878 * elf64-alpha.c (READ): Likewise.
3879 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
3880 (elf_slurp_symbol_table, elf_slurp_reloc_table),
3881 (bfd_from_remote_memory): Likewise.
3882 * elfcore.h (core_find_build_id): Likewise.
3883 * elfxx-mips.c (READ): Likewise.
3884 * mach-o.c (bfd_mach_o_mangle_sections),
3885 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
3886 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
3887 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
3888 * som.c (setup_sections, som_prep_for_fixups)
3889 (som_build_and_write_symbol_table, som_slurp_symbol_table),
3890 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3891 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
3892 (som_bfd_ar_write_symbol_stuff): Likewise.
3893 * vms-alpha.c (vector_grow1): Likewise.
3894 * vms-lib.c (vms_add_index): Likewise.
3895 * wasm-module.c (wasm_scan_name_function_section): Likewise.
3896 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
3897 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
3898 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
3899 (bfd_alloc2, bfd_zalloc2): Delete.
3900 (_bfd_mul_overflow): Define.
3901 * libbfd.h: Regenerate.
3903 2020-02-19 Alan Modra <amodra@gmail.com>
3905 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
3907 (assign_section_numbers): Likewise.
3908 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
3909 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
3910 bfd_malloc2, size_t amt, and unsigned tls_count.
3911 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
3912 * elflink.c (elf_create_symbuf): Use bfd_malloc.
3913 (elf_output_implib): Use bfd_alloc.
3915 2020-02-19 Alan Modra <amodra@gmail.com>
3917 * bfd.c (struct bfd): Move format and direction to other
3918 bitfields. Add "size".
3919 * bfdio.c (bfd_get_size): Cache size when not writing file.
3920 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
3921 returning zero, ie. unknown.
3922 (bfd_get_alt_debug_link_info): Likewise.
3923 * bfd-in2.h: Regenerate.
3925 2020-02-19 Alan Modra <amodra@gmail.com>
3927 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
3928 bfd_get_file_size twice.
3929 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
3930 zero, ie. unknown, return.
3931 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
3932 * elfcode.h (elf_swap_shdr_in): Likewise.
3933 (elf_object_p): Don't call bfd_get_file_size twice and correct
3936 2020-02-19 Alan Modra <amodra@gmail.com>
3938 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
3939 FALSE if memory alloc fails. Adjust calls.
3940 * som.c (som_prep_for_fixups): Likewise.
3941 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
3942 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
3943 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
3944 * som.c (som_build_and_write_symbol_table): Return via error_return
3946 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
3947 (VEC_APPEND_EL): Delete.
3948 (vector_grow1): Return pointer to element. Catch overflow.
3949 Return NULL on memory allocation failure.
3950 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
3951 (alpha_vms_add_fixup_ca): Likewise.
3952 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
3954 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
3956 2020-02-19 Alan Modra <amodra@gmail.com>
3958 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
3959 * aout-target.h (object_p): Likewise.
3960 * aout-tic30.c (tic30_aout_object_p): Likewise.
3961 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
3962 (emit_stringtab, write_syms, link_hash_table_create),
3963 (aout_link_write_other_symbol): Likewise.
3964 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
3965 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
3966 (_bfd_compute_and_write_armap): Likewise.
3967 * archures.c (bfd_arch_list): Likewise.
3968 * bfd.c (bfd_record_phdr): Likewise.
3969 * binary.c (binary_canonicalize_symtab): Likewise.
3970 * cisco-core.c (cisco_core_file_validate): Likewise.
3971 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
3972 (find_arm_glue, record_arm_to_thumb_glue),
3973 (record_thumb_to_arm_glue): Likewise.
3974 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
3975 (ppc_allocate_toc_section): Likewise.
3976 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
3977 * coff-sh.c (sh_relax_section): Likewise.
3978 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
3979 * coffcode.h (handle_COMDAT, coff_new_section_hook),
3980 (coff_set_alignment_hook, coff_mkobject),
3981 (coff_compute_section_file_positions): Likewise.
3982 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
3983 (coff_find_nearest_line_with_names),
3984 ( bfd_coff_set_symbol_class): Likewise.
3985 * cofflink.c (_bfd_coff_link_hash_table_create),
3986 (_bfd_coff_link_input_bfd): Likewise.
3987 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
3988 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
3989 (build_line_info_table, sort_line_sequences),
3990 (line_info_add_include_dir, line_info_add_file_name),
3991 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
3992 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
3993 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
3994 (_bfd_ecoff_find_nearest_line),
3995 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
3996 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
3997 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
3998 * elf-m10300.c (mn10300_elf_relax_section),
3999 (elf32_mn10300_link_hash_table_create): Likewise.
4000 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
4001 * elf.c (make_mapping, copy_elf_program_header): Likewise.
4002 * elf32-arm.c (elf32_arm_link_hash_table_create),
4003 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
4004 (elf32_arm_new_section_hook): Likewise.
4005 * elf32-avr.c (elf_avr_new_section_hook),
4006 (elf32_avr_link_hash_table_create, get_local_syms),
4007 (elf32_avr_setup_section_lists): Likewise.
4008 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
4009 (bfin_link_hash_table_create): Likewise.
4010 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
4011 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
4012 * elf32-csky.c (csky_elf_link_hash_table_create),
4013 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
4014 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
4015 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
4016 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
4017 * elf32-i386.c (elf_i386_check_relocs): Likewise.
4018 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
4019 * elf32-m32r.c (m32r_elf_link_hash_table_create),
4020 (m32r_elf_check_relocs): Likewise.
4021 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
4022 (elf32_m68hc11_setup_section_lists),
4023 (elf32_m68hc11_size_stubs): Likewise.
4024 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
4025 * elf32-metag.c (elf_metag_link_hash_table_create),
4026 (elf_metag_setup_section_lists): Likewise.
4027 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
4028 (microblaze_elf_check_relocs): Likewise.
4029 * elf32-nds32.c (nds32_elf_link_hash_table_create),
4030 (nds32_elf_check_relocs): Likewise.
4031 * elf32-nios2.c (nios2_elf32_setup_section_lists),
4032 (get_local_syms, nios2_elf32_check_relocs),
4033 (nios2_elf32_link_hash_table_create): Likewise.
4034 * elf32-or1k.c (or1k_elf_link_hash_table_create),
4035 (or1k_elf_check_relocs): Likewise.
4036 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
4037 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
4038 * elf32-s390.c (elf_s390_link_hash_table_create),
4039 (elf_s390_check_relocs): Likewise.
4040 * elf32-score.c (score_elf_create_got_section),
4041 (s3_elf32_score_new_section_hook),
4042 (elf32_score_link_hash_table_create): Likewise.
4043 * elf32-score7.c (score_elf_create_got_section),
4044 (s7_elf32_score_new_section_hook): Likewise.
4045 * elf32-sh.c (sh_elf_link_hash_table_create),
4046 (sh_elf_check_relocs): Likewise.
4047 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
4048 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
4049 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
4050 (tilepro_elf_check_relocs): Likewise.
4051 * elf32-v850.c (remember_hi16s_reloc): Likewise.
4052 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
4053 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
4054 (elf_xtensa_new_section_hook): Likewise.
4055 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
4056 (get_got_entry, elf64_alpha_check_relocs): Likewise.
4057 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
4058 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
4059 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
4060 * elf64-ppc.c (ppc64_elf_new_section_hook),
4061 (ppc64_elf_link_hash_table_create, update_local_sym_info),
4062 (update_plt_info, ppc64_elf_check_relocs): Likewise.
4063 * elf64-s390.c (elf_s390_link_hash_table_create),
4064 (elf_s390_check_relocs): Likewise.
4065 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
4066 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
4067 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
4068 (elf_link_add_archive_symbols, compute_bucket_count),
4069 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
4070 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
4071 (bfd_elf_final_link): Likewise.
4072 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
4073 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
4074 (elfNN_aarch64_new_section_hook): Likewise.
4075 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
4076 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
4077 (riscv_elf_check_relocs): Likewise.
4078 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
4079 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
4080 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
4081 (_bfd_mips_elf_link_hash_table_create): Likewise.
4082 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
4083 (_bfd_sparc_elf_check_relocs),
4084 (_bfd_sparc_elf_new_section_hook): Likewise.
4085 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
4086 (tilegx_elf_check_relocs): Likewise.
4087 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
4088 * format.c (bfd_check_format_matches): Likewise.
4089 * hash.c (_bfd_stringtab_init): Likewise.
4090 * ihex.c (ihex_scan): Likewise.
4091 * irix-core.c (irix_core_core_file_p): Likewise.
4092 * linker.c (bfd_wrapped_link_hash_lookup),
4093 (_bfd_generic_link_hash_table_create),
4094 (_bfd_generic_reloc_link_order): Likewise.
4095 * lynx-core.c (lynx_core_file_p): Likewise.
4096 * netbsd-core.c (netbsd_core_file_p): Likewise.
4097 * osf-core.c (osf_core_core_file_p): Likewise.
4098 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
4099 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
4100 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
4101 * peicode.h (pe_mkobject): Likewise.
4102 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
4103 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
4104 * sco5-core.c (read_uarea): Likewise.
4105 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
4106 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
4107 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
4108 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
4109 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
4110 * srec.c (srec_scan): Likewise.
4111 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
4112 * targets.c (bfd_target_list): Likewise.
4113 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
4114 * trad-core.c (trad_unix_core_file_p): Likewise.
4115 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
4116 (vms_new_section_hook): Likewise.
4117 * wasm-module.c (wasm_make_empty_symbol): Likewise.
4118 * xcofflink.c (xcoff_get_section_contents),
4119 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
4120 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
4121 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
4123 2020-02-19 Alan Modra <amodra@gmail.com>
4125 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
4127 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
4129 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
4130 and use it if it isn't NULL. Remove has_plugin_p argument. Add
4131 a build_list_p argument. Don't search plugin_list. Short circuit
4132 when building the plugin list.
4133 (has_plugin): Renamed to has_plugin_list.
4134 (bfd_plugin_set_plugin): Don't set has_plugin.
4135 (bfd_plugin_specified_p): Check plugin_list instead.
4136 (build_plugin_list): New function.
4137 (load_plugin): Call build_plugin_list and use plugin_list.
4139 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4142 * plugin.c (try_claim): Always clean up for LTO wrapper.
4143 (try_load_plugin): Treat each object as independent. Create a
4144 copy for plugin name.
4146 2020-02-11 Nick Clifton <nickc@redhat.com>
4148 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
4149 for addresses in print statements.
4150 (msp430_elf_relax_delete_bytes): Likewise.
4151 (msp430_elf_relax_add_words): Likewise.
4152 (msp430_elf_relax_section): Likewise.
4154 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4156 * plugin.c (add_symbols): Clear plugin_data memory.
4158 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
4161 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
4162 (EXECUTABLE_SUFFIX): Likewise.
4163 * config.in: Regenerated.
4164 * configure: Likewise.
4165 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
4166 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
4167 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
4168 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
4169 (get_lto_wrapper): New.
4170 (setup_lto_wrapper_env): Likewise.
4171 (current_plugin): Likewise.
4172 (register_all_symbols_read): Likewise.
4173 (register_cleanup): Likewise.
4174 (get_symbols): Likewise.
4175 (add_input_file): Likewise.
4176 (bfd_plugin_close_and_cleanup): Likewise.
4177 (claim_file): Removed.
4178 (register_claim_file): Set current_plugin->claim_file.
4179 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
4180 lto_syms in current_plugin.
4181 (try_claim): Use current_plugin->claim_file. Call LTO plugin
4182 all_symbols_read handler. Copy real symbols to plugin_data.
4183 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
4184 (try_load_plugin): Don't reuse the previous plugin for LTO
4185 wrapper. Set up GCC LTO wrapper if possible. Don't set
4186 plugin_list_iter->claim_file.
4187 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
4189 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
4192 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4194 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
4195 check if previous instruction matches a conditional jump inserted
4196 earlier. Invert conditional jump and delete branch in this case.
4198 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4200 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
4201 msp430_elf_relax_add_words. Support insertion of either one or two
4203 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
4204 needs to be grown. Handle insertion of branch instruction to replace
4207 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4209 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
4210 debugging relocations.
4211 (msp430_elf_relax_delete_bytes): Likewise.
4212 (msp430_elf_relax_add_two_words): Likewise.
4213 (msp430_elf_relax_section): Likewise.
4215 2020-02-10 Alan Modra <amodra@gmail.com>
4217 * archures.c: Wrap overlong z80 comments.
4218 * bfd-in2.h: Regenerate.
4220 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
4223 * archures.c: Add GBZ80 and Z80N machine values.
4224 * reloc.c: Add BFD_RELOC_Z80_16_BE.
4225 * coff-z80.c: Add support for new reloc.
4226 * coffcode.h: Add support for new machine values.
4227 * cpu-z80.c: Add support for new machine names.
4228 * elf32-z80.c: Add support for new reloc.
4229 * bfd-in2.h: Regenerate.
4230 * libbfd.h: Regenerate.
4232 2020-02-07 Nick Clifton <nickc@redhat.com>
4235 * elf.c (rewrite_elf_program_header): Do not complain if no
4236 sections are mapped to a segment.
4238 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4241 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
4242 for garbage collection on __patchable_function_entries section
4243 without linked-to section.
4245 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4248 * bfd-in2.h: Regenerated.
4249 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
4250 on section if gc_mark of any of its linked-to sections is set
4251 and don't set gc_mark again.
4252 * section.c (asection): Add linked_to_symbol_name to map_head
4255 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
4257 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
4258 reporting an unrecognized instruction with R_V850_LONGJUMP.
4260 2020-02-05 Alan Modra <amodra@gmail.com>
4262 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
4264 2020-02-04 Alan Modra <amodra@gmail.com>
4266 * elf32-ppc.c (ppc_elf_relocate_section): After applying
4267 R_PPC_VLE_ADDR20, goto copy_reloc.
4269 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4271 * bfd-in2.h: Regenerated.
4272 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
4274 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4277 * bfd-in2.h: Regenerated.
4278 * ecoff.c (bfd_debug_section): Add section_id.
4279 * section.c (bfd_section): Add section_id.
4280 (SEC_ASSEMBLER_SECTION_ID): New.
4281 (BFD_FAKE_SECTION): Add section_id.
4283 2020-02-01 Nick Clifton <nickc@redhat.com>
4285 * config.bfd: Move the c30-aout and tic30-aout targets onto the
4288 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
4290 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
4291 encodings are relative to the GOT on nios2, too.
4293 2020-01-31 Alan Modra <amodra@gmail.com>
4295 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
4296 file. Use $< and $@ in rules.
4297 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
4298 (elf32-ia64.c, elf64-ia64.c): Likewise.
4299 (elf32-riscv.c, elf64-riscv.c): Likewise.
4300 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4301 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
4302 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
4303 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
4304 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4305 * Makefile.in: Regenerate.
4307 2020-01-31 Alan Modra <amodra@gmail.com>
4310 * elf.c (setup_group): Don't clear entire section contents,
4311 just the padding after group flags. Release alloc'd memory
4312 after a seek or read failure.
4314 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4316 * peXXigen.c (pe_is_repro): New function.
4317 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
4318 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
4320 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4322 * peXXigen.c (debug_type_names): Add names for new debug data type
4325 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4327 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
4328 inner loop. Fix a memory leak.
4330 2020-01-30 Alan Modra <amodra@gmail.com>
4332 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
4333 or obj_coff_keep_strings here.
4334 (coff_get_normalized_symtab): Free external syms directly.
4335 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
4338 2020-01-27 Jim Wilson <jimw@sifive.com>
4340 * cpu-riscv.c (riscv_scan): New.
4341 (N): Change bfd_default_scan to riscv_scan.
4343 2020-01-27 Andreas Schwab <schwab@suse.de>
4345 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
4346 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
4347 * Makefile.in: Regenerate.
4348 * cpu-plugin.c: Remove.
4349 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
4350 (bfd_plugin_arch): Remove declaration.
4351 * bfd-in2.h: Regenerate.
4352 * po/SRC-POTFILES.in: Regenerate.
4354 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
4355 Alan Modra <amodra@gmail.com>
4358 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
4360 2020-01-24 Jim Wilson <jimw@sifive.com>
4362 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
4363 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
4364 avoid over long line.
4366 2020-01-24 Nick Clifton <nickc@redhat.com>
4369 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
4370 syms and keep strings flags as these may have been set in order to
4371 prevent a bogus call to free.
4373 2020-01-23 Nick Clifton <nickc@redhat.com>
4375 * po/fr.po: Updated French translation.
4377 2020-01-23 Alan Modra <amodra@gmail.com>
4380 * elf.c (assign_file_positions_for_load_sections): Avoid divide
4381 by zero when p_align is zero.
4383 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
4385 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
4386 (riscv_prefix_cmp): Likewise.
4387 (riscv_non_std_ext_p): Deleted.
4388 (riscv_std_sv_ext_p): Likewise.
4389 (riscv_non_std_sv_ext_p): Likewise.
4390 (riscv_merge_non_std_and_sv_ext): Rename to...
4391 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
4392 (riscv_merge_arch_attr_info): Replace 3 calls to
4393 riscv_merge_non_std_and_sv_ext with single call to
4394 riscv_merge_multi_letter_ext.
4395 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
4396 encounter a 'z' prefix.
4397 (riscv_get_prefix_class): New function, return prefix class based
4398 on first few characters of input string.
4399 (riscv_parse_config): New structure to factor out minor differences
4400 in extension class parsing behaviour.
4401 (riscv_parse_sv_or_non_std_ext): Rename to...
4402 (riscv_parse_prefixed_ext): and parameterise with
4404 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
4405 (riscv_multi_letter_ext_valid_p): New.
4406 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
4407 (riscv_parse_subset): Delegate all non-single-letter parsing work
4408 to riscv_parse_prefixed_ext.
4409 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
4410 (riscv_get_prefix_class): Declare.
4412 2020-01-22 Alan Modra <amodra@gmail.com>
4414 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
4415 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
4416 __tls_get_addr_desc.
4417 (ppc64_elf_size_stubs): Add section for linker generated
4418 __tls_get_addr_desc wrapper function. Loop at least once if
4419 generating this function.
4420 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
4421 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
4423 2020-01-22 Alan Modra <amodra@gmail.com>
4425 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
4426 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
4428 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
4429 (STDU_R1_0R1, ADDI_R1_R1): Define.
4430 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
4431 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
4432 tga_desc_fd to opt_fd, and tga_desc to opt. Set
4433 no_tls_get_addr_regsave.
4434 (branch_reloc_hash_match): Add hash3 and hash4.
4435 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
4436 (ppc64_elf_size_dynamic_sections): Likewise.
4437 (ppc64_elf_relocate_section): Likewise.
4438 (plt_stub_size, build_plt_stub): Likewise. Size regsave
4439 __tls_get_addr stub.
4440 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
4442 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
4443 eh_frame for regsave __tls_get_addr.
4445 2020-01-22 Alan Modra <amodra@gmail.com>
4447 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
4448 which __tls_get_addr calls will be eliminated.
4450 2020-01-20 Nick Clifton <nickc@redhat.com>
4452 * po/pt.po: Updates Portuguese translation.
4453 * po/ru.po: Updated Russian translation.
4454 * po/uk.po: Updated Ukranian translation.
4456 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
4459 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
4460 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
4462 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
4463 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
4464 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
4465 "rex leal x@tlsdesc(%rip), %reg" to
4466 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
4467 "call *(%eax)" to "nopl (%rax)".
4469 2020-01-20 Alan Modra <amodra@gmail.com>
4471 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
4472 (MTLR_R11): Don't define.
4473 (LD_R0_0R3, CMPDI_R0_0): Define.
4474 (build_tls_get_addr_stub): Don't use r11 in stub.
4476 2020-01-20 Alan Modra <amodra@gmail.com>
4478 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
4479 (defined_sym_val, is_tls_get_addr): Likewise.
4481 2020-01-18 Nick Clifton <nickc@redhat.com>
4483 * version.m4 (BFD_VERSION): Set to 2.34.50.
4484 * configure: Regenerate.
4485 * po/bfd.pot: Regenerate.
4487 2020-01-18 Nick Clifton <nickc@redhat.com>
4489 Binutils 2.34 branch created.
4491 2020-01-17 Christian Biesinger <cbiesinger@google.com>
4493 * coff-arm.c: Fix spelling error (seperate).
4494 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
4496 * sysdep.h (strnlen): Fix spelling error (seperate).
4498 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
4501 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
4503 2020-01-15 Alan Modra <amodra@gmail.com>
4506 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
4507 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
4508 of function symbols unless dot symbols are present. Do warn
4509 whenever one is created, regardles of whether a PLT entry is
4510 also emitted for the function symbol.
4512 2020-01-14 Alan Modra <amodra@gmail.com>
4514 * som.c (som_bfd_count_ar_symbols): Error when file position
4515 of symbols on chains is not strictly increasing.
4517 2020-01-14 Alan Modra <amodra@gmail.com>
4519 * vms.h (VMS_DEBUG): Define as 0.
4520 * vms-alpha.c (image_write): Move debug output after bounds check.
4522 (_bfd_vms_slurp_eihd): Warning fix.
4523 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
4525 2020-01-13 Alan Modra <amodra@gmail.com>
4527 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
4528 for "ignored" records.
4530 2020-01-13 Alan Modra <amodra@gmail.com>
4532 * wasm-module.c (wasm_scan_name_function_section): Formatting.
4533 Delete asect name check. Move asect NULL check to wasm_object_p.
4534 Correct bounds check of sizes against end. Replace uses of
4535 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
4536 just one bfd_release.
4537 (wasm_scan): Don't use malloc/strdup for section names,
4538 bfd_alloc instead. Simplify code prefixing section name.
4539 Formatting. Don't attempt to free memory here..
4540 (wasm_object_p): ..do so here.
4542 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
4545 * elf32-arm.c (elf32_arm_final_link_relocate): Use
4546 UNDEFWEAK_NO_DYNAMIC_RELOC.
4547 (allocate_dynrelocs_for_symbol): Likewise.
4549 2020-01-10 Tamar Christina <tamar.christina@arm.com>
4552 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
4554 2020-01-10 Alan Modra <amodra@gmail.com>
4556 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
4558 2020-01-09 Nick Clifton <nickc@redhat.com>
4561 * bfd.c (bfd_convert_section_contents): Check for a compress
4562 header size that is larger than the actual section size.
4564 2020-01-08 Alan Modra <amodra@gmail.com>
4567 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
4568 after removing sections.
4570 2020-01-06 Jim Wilson <jimw@sifive.com>
4573 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
4574 check for !bfd_link_pic (info).
4575 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
4576 <R_RISCV_JAL>: Add comment.
4577 (_bfd_riscv_relax_section): For plt.offset check, add check for
4578 bfd_link_pic (info). Add comment.
4580 2020-01-06 Alan Modra <amodra@gmail.com>
4582 * format.c (bfd_check_format_matches): Ignore bfd_error on target
4583 match failures. Don't init to bfd_error_wrong_format before
4584 calling _bfd_check_format.
4586 2020-01-06 Alan Modra <amodra@gmail.com>
4588 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
4589 status rather than exiting on stack overflow or underflow.
4590 (_bfd_vms_slurp_etir): Adjust to suit.
4592 2020-01-06 Alan Modra <amodra@gmail.com>
4594 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
4596 2020-01-06 Alan Modra <amodra@gmail.com>
4598 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
4599 command. Check name offset is within command.
4600 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
4601 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
4602 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
4603 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
4604 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
4605 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
4606 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
4607 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
4608 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
4609 (bfd_mach_o_read_segment): Similarly.
4610 (bfd_mach_o_read_thread): Properly bound check thread struct.
4611 Don't repeat checks on second loop.
4612 (bfd_mach_o_read_command): Fail on invalid command length.
4614 2020-01-04 Alan Modra <amodra@gmail.com>
4616 * format.c (bfd_check_format_matches): Add preserve_match.
4617 Save initial bfd state in "preserve", matched bfd state in
4618 "preserve_match". Save just the first match. Release
4619 bfd_alloc memory. Restore and finish preserved state as
4620 appropriate on all function exit paths.
4622 2020-01-04 Alan Modra <amodra@gmail.com>
4624 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
4626 2020-01-04 Alan Modra <amodra@gmail.com>
4628 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
4631 2020-01-03 Nick Clifton <nickc@redhat.com>
4634 (bfd_pef_parse_function_stubs): Correct the test that ensures that
4635 there is enough data remaining in the code buffer before
4636 attempting to read a function stub.
4638 2020-01-03 Nick Clifton <nickc@redhat.com>
4641 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
4642 return value from bfd_malloc.
4643 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
4644 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
4645 (elf32_arm_filter_cmse_symbols): Likewise.
4646 (elf32_arm_write_section): Likewise.
4647 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
4648 (bfd_mach_o_follow_dsym): Likewise.
4649 * pef.c (bfd_pef_print_loader_section): Likewise.
4650 (bfd_pef_scan_start_address): Likewise.
4651 (bfd_pef_parse_function_stubs): Likewise.
4652 (bfd_pef_parse_symbols): Likewise.
4654 2020-01-03 Sergei Trofimovich <siarheit@google.com>
4656 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
4657 on binary inputs ld/PR25316.
4658 (is_ia64_elf): new helper to filter on ia64 objects.
4660 2020-01-03 Jan Beulich <jbeulich@suse.com>
4662 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
4664 (bfd_mach_o_scan): Insert underscore in two variable names.
4666 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
4668 * Makefile.am: Add z80-elf target support.
4669 * configure.ac: Likewise.
4670 * targets.c: Likewise.
4671 * Makefile.in: Regenerate.
4672 * configure: Regenerate.
4673 * config.bfd: Add z80-elf target support and new arches: ez80 and
4675 * elf32-z80.c: New file.
4676 * archures.c: Add new z80 architectures: eZ80 and Z180.
4677 * coffcode.h: Likewise.
4678 * cpu-z80.c: Likewise.
4679 * coff-z80.c: Add new relocations for Z80 target and local label
4681 * reloc.c: Add new relocs.
4682 * bfd-in2.h: Regenerate.
4683 * libbfd.h: Regenerate.
4685 2020-01-02 Tamar Christina <tamar.christina@arm.com>
4689 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
4691 2020-01-01 Alan Modra <amodra@gmail.com>
4693 Update year range in copyright notice of all files.
4695 For older changes see ChangeLog-2019
4697 Copyright (C) 2020 Free Software Foundation, Inc.
4699 Copying and distribution of this file, with or without modification,
4700 are permitted in any medium without royalty provided the copyright
4701 notice and this notice are preserved.
4707 version-control: never