1 2020-12-18 Alan Modra <amodra@gmail.com>
3 * coff-z80.c (bfd_howto_type): Make typedef const.
4 * elf32-z80.c (bfd_howto_type): Likewise.
5 * elf32-m32c.c (EncodingTable): Likewise.
6 * elf32-csky.c (csky_arch_for_merge): Likewise.
7 (csky_archs): Use typedef.
8 * elf32-m68hc11.c (m68hc11_direct_relax_table): Make const.
9 (find_relaxable_insn, m68hc11_elf_relax_section): Adjust to suit.
10 * elf32-ppc.c (ppc_alt_plt): Make const.
11 * elf32-rl78.c (relax_addr16): Likewise.
12 * targets.c (_bfd_associated_vector): Likewise.
13 (bfd_target_vector, bfd_associated_vector): Likewise.
14 * libbfd-in.h (bfd_target_vector, bfd_associated_vector): Likewise.
15 * libbfd.h: Regenerate.
17 2020-12-18 Alan Modra <amodra@gmail.com>
19 * ecoff.c (bfd_debug_section): Init using BFD_FAKE_SECTION.
20 (ecoff_scom_section, ecoff_scom_symbol): Statically init using
21 BFD_FAKE_SECTION and GLOBAL_SYM_INIT. Delete initialisation code.
22 * elf32-m32r.c (m32r_elf_scom_section, m32r_elf_scom_symbol),
23 * elf32-score.c (score_elf_scom_section, score_elf_scom_symbol),
24 * elf32-score7.c (score_elf_scom_section, score_elf_scom_symbol),
25 * elf32-tic6x.c (tic6x_elf_scom_section, tic6x_elf_scom_symbol),
26 * elf32-v850.c (v850_elf_scom_section, v850_elf_scom_symbol),
27 (v850_elf_tcom_section, v850_elf_tcom_symbol),
28 (v850_elf_zcom_section, v850_elf_zcom_symbol),
29 * elf64-mmix.c (mmix_elf_reg_section, mmix_elf_reg_section_symbol),
30 * elfxx-mips.c (mips_elf_scom_section, mips_elf_scom_symbol): Likewise.
32 2020-12-16 Alan Modra <amodra@gmail.com>
34 * elfxx-target.h (elfNN_bed): Constify.
35 * bfd.c (bfd_elf_set_pagesize): Delete.
36 (bfd_emul_set_maxpagesize, bfd_emul_set_commonpagesize): Delete.
37 * elf.c (get_program_header_size): Get commonpagesize from
39 (_bfd_elf_map_sections_to_segments): Get maxpagesize from link info.
40 (assign_file_positions_for_load_sections): Likewise.
41 (assign_file_positions_for_non_load_sections): Likewise.
42 (rewrite_elf_program_header): Add maxpagesize param. Set map_p_align.
43 (copy_private_bfd_data): Don't call bfd_elf_set_maxpagesize.
44 Instead pass maxpagesize to rewrite_elf_program_header.
45 * elf32-nds32.c (relax_range_measurement): Add link_info param.
46 Get maxpagesize from link_info. Adjust caller.
47 * bfd-in2.h: Regenerate.
49 2020-12-16 Alan Modra <amodra@gmail.com>
51 * elflink.c (elf_flags_to_names): Constify.
53 2020-12-16 Alan Modra <amodra@gmail.com>
55 * libxcoff.h (struct xcoff_backend_data_rec): Constify
57 (XCOFF_RELOC_FUNCTION_ARGS, XCOFF_COMPLAIN_FUNCTION_ARGS): Delete.
58 (xcoff_reloc_function, xcoff_complain_function): New typedef.
59 (xcoff_calculate_relocation, xcoff_complain_overflow),
60 (xcoff_reloc_type_noop, xcoff_reloc_type_fail),
61 (xcoff_reloc_type_pos, xcoff_reloc_type_neg),
62 (xcoff_reloc_type_rel, xcoff_reloc_type_toc),
63 (xcoff_reloc_type_ba, xcoff_reloc_type_crel): Update declaration.
64 * coff-rs6000.c (xcoff_reloc_type_br): Declare using typedef.
65 (xcoff_complain_overflow_dont_func): Likewise.
66 (xcoff_complain_overflow_bitfield_func): Likewise.
67 (xcoff_complain_overflow_signed_func): Likewise.
68 (xcoff_complain_overflow_unsigned_func): Likewise.
69 (xcoff_calculate_relocation, xcoff_complain_overflow): Constify.
70 (xcoff_glink_code): Constify.
71 * coff64-rs6000.c (xcoff64_reloc_type_br): Declare using typedef.
72 (xcoff64_calculate_relocation, xcoff64_glink_code): Constify.
74 2020-12-16 Alan Modra <amodra@gmail.com>
76 * elf32-xtensa.c (narrowable, widenable): Constify.
77 * xtensa-modules.c: Constify many arrays.
79 2020-12-16 Alan Modra <amodra@gmail.com>
81 * elf64-ppc.c (synthetic_opd): Constify.
83 2020-12-16 Alan Modra <amodra@gmail.com>
85 * arc-plt.h (plt_versions): Constify.
86 * elf32-arc.c (arc_get_plt_version): Constify return pointer,
87 adjust uses throughout.
89 2020-12-16 Alan Modra <amodra@gmail.com>
91 * coffcode.h (pelength, peheader): Delete static variables.
92 (coff_apply_checksum): Instead, define them as auto vars, and pass..
93 (coff_read_word, coff_compute_checksum): ..to here. Delete
94 unnecessary forward declarations.
95 * pei-x86_64.c (pdata_count): Delete static variable.
96 (struct pex64_paps): New.
97 (pex64_print_all_pdata_sections, pex64_bfd_print_pdata): Pass
98 a pex64_paps for counting.
99 * peicode.h (jtab): Constify.
101 2020-12-15 Vivek Das Mohapatra <vivek@collabora.com>
103 * elflink.c (bfd_elf_size_dynamic_sections): Call
104 _bfd_elf_add_dynamic_entry to add a DT_GNU_FLAGS_1 section.
106 2020-12-14 Alan Modra <amodra@gmail.com>
108 * elf-bfd.h (struct elf_obj_tdata): Add being_created.
109 * elf.c (bfd_section_from_shdr): Delete static vars for loop
110 detection. Use new tdata variable instead.
111 * elfcode.h (elf_object_p): Allocate being_created.
113 2020-12-10 Nelson Chu <nelson.chu@sifive.com>
115 * elfxx-riscv.c (riscv_ext_dont_care_version): New function. Return
116 TRUE if we don't care the versions of the extensions. These extensions
117 are added to the subset list for special purposes, with the explicit
118 versions or the RISCV_UNKNOWN_VERSION versions.
119 (riscv_parse_add_subset): If we do care the versions of the extension,
120 and the versions are unknown, then report errors for the non-implicit
121 extensions, and return directly for the implicit one.
122 (riscv_arch_str1): Do not output i extension after e, and the extensions
123 which versions are unknown.
125 2020-12-07 Siddhesh Poyarekar <siddhesh@sourceware.org>
128 * opncls.c (bfd_fdopenw): New function.
129 * bfd-in2.h: Regenerate.
131 2020-12-07 Alan Modra <amodra@gmail.com>
133 * elf32-csky.c (csky_relocate_contents): Correct negate test.
134 * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Likewise.
135 * elf32-nds32.c (nds32_relocate_contents): Likewise.
137 2020-12-05 Maciej W. Rozycki <macro@linux-mips.org>
139 * elf32-vax.c (elf_vax_check_relocs) <R_VAX_GOT32>: Use
140 SYMBOL_REFERENCES_LOCAL rather than `h->forced_local' to check
141 whether the symbol referred is local or not.
143 2020-12-04 H.J. Lu <hongjiu.lu@intel.com>
146 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Convert load
147 to mov only for GOTPCRELX relocations.
149 2020-12-04 Alan Modra <amodra@gmail.com>
152 * elflink.c (_bfd_elf_add_default_symbol): Handle the case where
153 a new weak sym@@ver should be overridden by an existing sym@ver.
154 (elf_link_add_object_symbols): Don't _bfd_elf_add_default_symbol
155 for a new weak sym@ver when sym@@ver already exists.
156 * linker.c (link_action): Choose MIND for previous indirect,
157 current def, rather than MDEF.
158 (_bfd_generic_link_add_one_symbol <MIND>): Handle redefinition of
159 weak indirect symbol.
161 2020-12-01 Nelson Chu <nelson.chu@sifive.com>
163 * elfxx-riscv.c (riscv_parse_prefixed_ext): Use riscv_compare_subsets
164 to check the Z* extensions' order.
166 2020-12-01 Nelson Chu <nelson.chu@sifive.com>
168 * elfxx-riscv.c (riscv_parse_add_subset): Allow to add g with
169 RISCV_UNKNOWN_VERSION versions.
170 (riscv_parse_std_ext): Add g to the subset list, we only use it
171 to add the implicit extensions, but won't output it to arch string.
172 (riscv_parse_add_implicit_subsets): Add implicit zicsr and zifencei
174 (riscv_arch_str1): Do not output g to the arch string.
175 * elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Moved to include/opcode/riscv.h.
177 2020-12-01 Nelson Chu <nelson.chu@sifive.com>
179 * elfnn-riscv.c (riscv_merge_std_ext): Updated since
180 riscv_lookup_subset is changed.
181 * elfxx-riscv.c (riscv_ext_order): New Array used to compare the
182 extensions' order quickly.
183 (riscv_init_ext_order): New function. Init the riscv_ext_order
184 according to the riscv_supported_std_ext and parse_config[i].class
186 (riscv_compare_subsets): New function. Similar to the strcmp, but
187 compare the subsets with the specific order.
188 (riscv_lookup_subset): Return TRUE and set `current` to the subset
189 if it is found. Otherwise, return FALSE and set `current` to the
190 place where we should insert the subset.
191 (riscv_add_implicit_subset): New function. Search the list first,
192 and then find the right place to add the implicit_subset.
193 (riscv_parse_add_subset): Since We have to add all arch string
194 extensions first, and then start to add their implicit extensions.
195 We can add arch string extensions in order by the original
196 riscv_add_subset, and then add the implicit subsets by the
197 riscv_add_implicit_subset. Besides, do not add the implicit
198 extensions if we failed to find their default versions.
199 (riscv_parse_std_ext): Updated.
200 (riscv_parse_add_implicit_subsets): New function. Add all implicit
201 extensions according to the arch string extensions.
202 (riscv_parse_subset): Call riscv_init_ext_order and
203 riscv_parse_add_implicit_subsets, before and after parsing the
204 arch string. Remove parts of the ISA conflict checking since
205 the implicit extensions are added.
206 * elfxx-riscv.h (riscv_lookup_subset): Updated.
208 2020-12-01 Nelson Chu <nelson.chu@sifive.com>
210 * elfxx-riscv.c (riscv_lookup_subset): Moved to front.
211 (riscv_add_subset): Likewise.
212 (riscv_release_subset_list): Likewise.
213 (riscv_parse_add_subset): New function. Find and check the
214 versions before adding them by riscv_add_subset.
215 (riscv_parsing_subset_version): Remove use_default_version
216 and change the version type from unsigned to int. Set the
217 versions to RISCV_UNKNOWN_VERSION if we can not find them
219 (riscv_parse_std_ext): Updated.
220 (riscv_parse_prefixed_ext): Updated. Since we use as_bad
221 rather than as_fatal to report more errors, return NULL
222 string if the parsed end_of_version is NULL, too.
223 (riscv_parse_subset): Use a new boolean, no_conflict, to
224 report more errors when we have more than one ISA conflicts.
225 * elfxx-riscv.h (RISCV_DONT_CARE_VERSION): Changed to
226 RISCV_UNKNOWN_VERSION.
227 (riscv_lookup_subset_version): Removed.
228 (riscv_parse_subset_t): Updated.
230 2020-12-01 Nelson Chu <nelson.chu@sifive.com>
232 * elfxx-riscv.c (riscv_parse_std_ext): Stop parsing standard
233 extensions when parsed h keyword.
234 (riscv_get_prefix_class): Support prefixed h class.
235 (riscv_std_h_ext_strtab): Likewise.
236 (riscv_ext_h_valid_p): Likewise.
237 (parse_config): Likewise.
238 (riscv_std_z_ext_strtab): Add zifencei.
239 * elfxx-riscv.h (riscv_isa_ext_class): Add RV_ISA_CLASS_H.
241 2020-12-01 Nelson Chu <nelson.chu@sifive.com>
243 * elfxx-riscv.c (riscv_parse_subset): ISA string cannot contain
244 any uppercase letter.
246 2020-12-01 Nelson Chu <nelson.chu@sifive.com>
248 * elfxx-riscv.c: Re-indent codes, unify and improve the error
249 messages and comments.
250 (riscv_parse_prefixed_ext): Stop parsing the prefixed class
251 extensions if the class is RV_ISA_CLASS_UNKNOWN, I get internal
252 errors before adding this check for march-fail-porder* testcases.
253 (riscv_parse_subset): Move the rv32 with q checking in front.
254 * elfxx-riscv.h: Likewise.
256 2020-12-01 Alan Modra <amodra@gmail.com>
259 * elf-bfd.h (elf_backend_merge_symbol_attribute): Update prototype.
260 * elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Likewise.
261 * elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Likewise.
262 * elfxx-x86.h (_bfd_x86_elf_merge_symbol_attribute): Likewise.
263 * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): Replace
264 isym parameter with st_other. Adjust code.
265 * elf64-alpha.c (elf64_alpha_merge_symbol_attribute): Likewise.
266 * elf64-ppc.c (ppc64_elf_merge_symbol_attribute): Likewise.
267 * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): Likewise.
268 * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): Likewise.
269 * elfxx-x86.c (_bfd_x86_elf_merge_symbol_attribute): Likewise.
270 * elflink.c (elf_merge_st_other): Likewise.
271 (_bfd_elf_merge_symbol, elf_link_add_object_symbols): Adjust to suit.
272 (_bfd_elf_copy_link_hash_symbol_type): Likewise.
273 (_bfd_elf_add_default_symbol): Merge st_other from undecorated
274 symbol and @VER symbol to @@VER symbol.
276 2020-11-28 Alan Modra <amodra@gmail.com>
279 * elf.c (elf_sort_sections): Don't sort zero size !load sections
282 2020-11-27 Jozef Lawrynowicz <jozef.l@mittosystems.com>
284 * elf.c (special_sections_g): Add .gnu.linkonce.n and .gnu.linkonce.p.
285 (special_sections_n): Add .noinit.
286 (special_sections_p): Add .persistent.
288 2020-11-26 Nick Clifton <nickc@redhat.com>
291 * dwarf2.c (read_section): Check for debug sections with excessive
294 2020-11-25 H.J. Lu <hongjiu.lu@intel.com>
297 * elflink.c (_bfd_elf_check_kept_section): Get the real kept
300 2020-11-23 Nick Clifton <nickc@redhat.com>
303 * elf-bfd.h (struct elf_backend_data): Add bfd_boolean field to
304 slurp_secondary_relocs field.
305 (_bfd_elf_slurp_secondary_reloc_section): Update prototype.
306 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Add new
307 parameter. Compute number of symbols based upon the new
309 * elfcode.h (elf_slurp_reloc_table): Pass dynamic as new
312 2020-11-23 H.J. Lu <hongjiu.lu@intel.com>
315 * elf64-s390.c (elf_s390_finish_dynamic_sections): Set .got
316 sh_entsize only if .got size > 0.
318 2020-11-21 Nelson Chu <nelson.chu@sifive.com>
320 * elfnn-riscv.c (_bfd_riscv_relax_section): Add a new relax pass
321 to do the pcgp relaxation later, after the lui and call relaxations,
322 but before the delete and alignment relaxations.
324 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
326 * elflink.c (elf_finalize_dynstr): Call examine_strtab after
328 (elf_link_swap_symbols_out): Don't call it here. Call
329 ctf_new_symbol before swap_symbol_out.
330 (elf_link_output_extsym): Call ctf_new_dynsym before
332 (bfd_elf_final_link): Likewise.
333 * elf.c (swap_out_syms): Pass in bfd_link_info. Call
334 ctf_new_symbol before swap_symbol_out.
335 (_bfd_elf_compute_section_file_positions): Adjust.
337 2020-11-19 Nick Clifton <nickc@redhat.com>
340 * elf64-s390.c (elf_s390_finish_dynamic_sections): Check for the
341 existance of an sgot output section before setting the
344 2020-11-18 Jozef Lawrynowicz <jozef.l@mittosystems.com>
345 H.J. Lu <hongjiu.lu@intel.com>
347 * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_retain.
348 (struct elf_obj_tdata): Increase has_gnu_osabi to 4 bits.
349 * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_retain
351 (_bfd_elf_final_write_processing): Report if SHF_GNU_RETAIN is
352 not supported by the OSABI.
353 Adjust error messages.
354 * elflink.c (elf_link_input_bfd): Copy enabled has_gnu_osabi bits from
355 input BFD to output BFD.
356 (bfd_elf_gc_sections): gc_mark the section if SHF_GNU_RETAIN is set.
358 2020-11-16 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
360 * cpu-arm.c (processors): Add Cortex-A78C.
362 2020-11-11 Tom Tromey <tromey@adacore.com>
364 * archive.c (getuid, getgid): Move...
365 * sysdep.h (getuid, getgid): ...here.
367 2020-11-09 Alan Modra <amodra@gmail.com>
369 * vms-alpha.c (alpha_vms_write_exec): Write 16 bits to eihd.alias.
371 2020-11-09 Alan Modra <amodra@gmail.com>
373 * archive.c (bfd_ar_hdr_from_filesystem): Use bfd_set_input_error
374 when stat of archive member fails.
375 * coff-rs6000.c (xcoff_write_archive_contents_old),
376 (xcoff_write_archive_contents_big): Likewise, and handle in-memory
379 2020-11-03 Alan Modra <amodra@gmail.com>
381 * elf.c (bfd_section_from_shdr): Free sections_being_created.
384 2020-11-02 Alan Modra <amodra@gmail.com>
390 * elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
391 for plugin syms. Do allow plugin syms to mark as-needed libs.
393 2020-10-30 H.J. Lu <hongjiu.lu@intel.com>
396 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Generate
397 GNU_PROPERTY_X86_ISA_1_BASELINE for -z x86-64-baseline.
399 2020-10-29 Nick Clifton <nickc@redhat.com>
402 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Use the correct
403 sized reloc reading function.
404 (_bfd_elf_write_secondary_reloc_section): Use the correct sized
405 reloc writing function.
407 2020-10-28 Nick Clifton <nickc@redhat.com>
410 * srec.c (srec_write_symbols): Do not emit symbols in sections
411 that have been removed from the output.
413 2020-10-27 Nick Clifton <nickc@redhat.com>
415 * elf64-hppa.c (elf_hppa_final_link_relocate): Check that the
416 symbol's section is being output before adding its offset to the
417 addend when processing R_PARISC_SECREL32.
419 2020-10-25 Alan Modra <amodra@gmail.com>
421 * vms-misc.c (_bfd_vms_save_counted_string): Count length byte
424 2020-10-20 Dr. David Alan Gilbert <dgilbert@redhat.com>
426 * po/es.po: Fix printf format.
428 2020-10-16 Nelson Chu <nelson.chu@sifive.com>
430 * elfnn-riscv.c (riscv_elf_link_hash_table): Add last_iplt_index.
431 (riscv_elf_size_dynamic_sections): Initialize the last_iplt_index.
432 (riscv_elf_relocate_section): Use riscv_elf_append_rela.
433 (riscv_elf_finish_dynamic_symbol): If the use_elf_append_rela is
434 false, then we should add the dynamic relocs from the last of
435 the .rela.iplt, and don't use the riscv_elf_append_rela to add.
437 2020-10-16 Nelson Chu <nelson.chu@sifive.com>
439 * elfnn-riscv.c: Include "objalloc.h" since we need objalloc_alloc.
440 (riscv_elf_link_hash_table): Add loc_hash_table and loc_hash_memory
441 for local STT_GNU_IFUNC symbols.
442 (riscv_elf_got_plt_val): Removed.
443 (riscv_elf_local_htab_hash, riscv_elf_local_htab_eq): New functions.
444 Use to compare local hash entries.
445 (riscv_elf_get_local_sym_hash): New function. Find a hash entry for
446 local symbol, and create a new one if needed.
447 (riscv_elf_link_hash_table_free): New function. Destroy an riscv
448 elf linker hash table.
449 (riscv_elf_link_hash_table_create): Create hash table for local ifunc.
450 (riscv_elf_check_relocs): Create a fake global symbol to track the
451 local ifunc symbol. Add support to check and handle the relocations
452 reference to ifunc symbols.
453 (allocate_dynrelocs): Let allocate_ifunc_dynrelocs and
454 allocate_local_ifunc_dynrelocs to handle the ifunc symbols if they
455 are defined and referenced in a non-shared object.
456 (allocate_ifunc_dynrelocs): New function. Allocate space in .plt,
457 .got and associated reloc sections for ifunc dynamic relocs.
458 (allocate_local_ifunc_dynrelocs): Likewise, but for local ifunc
460 (riscv_elf_relocate_section): Add support to handle the relocation
461 referenced to ifunc symbols.
462 (riscv_elf_size_dynamic_sections): Updated.
463 (riscv_elf_adjust_dynamic_symbol): Updated.
464 (riscv_elf_finish_dynamic_symbol): Finish up the ifunc handling,
465 including fill the PLT and GOT entries for ifunc symbols.
466 (riscv_elf_finish_local_dynamic_symbol): New function. Called by
467 riscv_elf_finish_dynamic_symbol to handle the local ifunc symbols.
468 (_bfd_riscv_relax_section): Don't do the relaxation for ifunc.
469 * elfxx-riscv.c: Add R_RISCV_IRELATIVE.
470 * configure.ac: Link elf-ifunc.lo to use the generic ifunc support.
471 * configure: Regenerated.
473 2020-10-16 Alan Modra <amodra@gmail.com>
475 * elf32-arc.c (replace_func): Correct return type.
476 (get_replace_function): Use a replace_func function pointer rather
477 than void*. Update associated ARC_RELOC_HOWTO define.
479 2020-10-16 Alan Modra <amodra@gmail.com>
481 * elf32-cr16.c: Formatting.
482 (cr16_elf_final_link_relocate): Sign extend rather than clumsy
483 "add or subtract" of offset value. Simplify range checks. Move
484 common code out of "if" branches. Don't refetch insn fields
487 2020-10-16 Alan Modra <amodra@gmail.com>
489 * elf64-ppc.c (ppc64_elf_relocate_section): Tighten sanity check
490 on R_PPC64_GOT_LO_DS and R_PPC64_GOT_HA instructions.
492 2020-10-09 Alan Modra <amodra@gmail.com>
494 * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't do local
495 entry offset optimisation.
497 2020-10-09 H.J. Lu <hongjiu.lu@intel.com>
500 * elf-linker-x86.h (elf_linker_x86_params): Add isa_level.
501 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge
502 GNU_PROPERTY_X86_ISA_1_V[234].
503 (_bfd_x86_elf_link_setup_gnu_properties): Generate
504 GNU_PROPERTY_X86_ISA_1_V[234] for -z x86-64-v[234].
506 2020-10-06 H.J. Lu <hongjiu.lu@intel.com>
509 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge -z ibt
510 and -z shstk only with GNU_PROPERTY_X86_FEATURE_1_AND.
512 2020-10-06 Brandon Bergren <bdragon@FreeBSD.org>
514 * config.bfd: Add powerpc64le-*-freebsd*.
515 * configure.ac: Add powerpc_elf64_fbsd_le_vec.
516 * elf64-ppc.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define for
518 * targets.c (powerpc_elf64_fbsd_le_vec): Declare.
519 (_bfd_target_vector): Add it.
520 * configure: Regenerate.
522 2020-10-05 Kamil Rytarowski <n54@gmx.com>
524 * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.
526 2020-10-05 Nick Clifton <nickc@redhat.com>
529 * elf.c (_bfd_elf_setup_sections): Do not complain about an
530 sh_link value of zero when the SLF_LINK_ORDER flag is set.
531 (assign_section_numbers): Likewise.
533 2020-10-02 H.J. Lu <hongjiu.lu@intel.com>
536 * elflink.c (bfd_elf_gc_sections): Do not arbitrarily keep note
537 sections which are linked to another section.
539 2020-09-30 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
541 * cpu-arm.c: Add cortex-a78 and cortex-a78ae.
543 2020-09-28 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
545 * cpu-arm.c: (processors) Add Cortex-X1.
547 2020-09-28 Alan Modra <amodra@gmail.com>
550 * elf64-ppc.c (ppc_build_one_stub, ppc_size_one_stub): Check for
551 NULL stub_entry->h before calling is_tls_get_addr.
553 2020-09-26 Alan Modra <amodra@gmail.com>
555 * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Depend on has_plt_localentry0.
556 (LD_R0_0R11, ADD_R11_R0_R11): Define.
557 (ppc64_elf_tls_setup): Disable params->plt_localentry0 when power10
559 (ppc64_elf_size_stubs): Update __glink_PLTresolve eh_frame.
560 (ppc64_elf_build_stubs): Move r2 save to start of __glink_PLTresolve,
561 and only emit for has_plt_localentry0. Don't use r2 in the stub.
563 2020-09-24 Alan Modra <amodra@gmail.com>
566 * elf64-ppc.c (plt_stub_size): Add "odd" param. Use it with
567 size_power10_offset rather than calculating from start of stub.
568 Add size for notoc tls_get_addr_opt stub.
569 (plt_stub_pad): Add "odd" param, pass to plt_stub_size.
570 (build_tls_get_addr_head, build_tls_get_addr_tail): New functions.
571 (build_tls_get_addr_stub): Delete.
572 (ppc_build_one_stub): Use a temp for htab->params->stub_bfd.
573 Emit notoc tls_get_addr_opt stub. Move eh_frame code to
574 suit. Adjust code to use bfd_tls_get_addr_head/tail in place
575 of build_tls_get_addr_stub.
576 (ppc_size_one_stub): Size notoc tls_get_addr_opt stub.
577 Adjust plt_stub_size and plt_stub_pad calls. Correct "odd"
578 when padding stub. Size eh_frame for notoc stub too.
579 Correct lr_restore value.
580 (ppc64_elf_relocate_section): Don't skip over first insn of
581 notoc tls_get_addr_opt stub.
583 2020-09-24 Alan Modra <amodra@gmail.com>
586 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Rename to..
587 (ppc64_elf_edit): Call params->edit.
588 (ppc64_elf_tls_setup): Don't call _bfd_elf_tls_setup. Return a
590 * elf64-ppc.h (struct ppc64_elf_params): Add "edit".
591 (ppc64_elf_tls_setup): Update declaration.
593 2020-09-21 Alan Modra <amodra@gmail.com>
596 * elfxx-riscv.c (howto_table): Correct size and bitsize of
597 R_RISCV_RVC_BRANCH, R_RISCV_RVC_JUMP, and R_RISCV_RVC_LUI.
598 Correct size for R_RISCV_TLS_DTPMOD32, R_RISCV_TLS_DTPREL32,
599 R_RISCV_CALL, and R_RISCV_CALL_PLT. Make R_RISCV_TPREL_ADD and
600 R_RISCV_ALIGN like R_RISCV_NONE. Correct dst_mask many relocs.
602 2020-09-17 Mikael Pettersson <mikpelinux@gmail.com>
605 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC
606 relocations in debug sections, change abort to _bfd_error_handler.
608 2020-09-16 H.J. Lu <hongjiu.lu@intel.com>
611 * config.bfd (targ64_selvecs, targ_selvecs): Add x86_64_pe_vec
613 * reloc.c: Include "coff/internal.h".
614 (bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs.
616 2020-09-16 Alan Modra <amodra@gmail.com>
618 * elf-bfd.h (elf_symbol_from): Remove unused ABFD parameter.
619 * elf.c (ignore_section_sym, _bfd_elf_copy_private_symbol_data),
620 (swap_out_syms): Adjust elf_symbol_from invocation.
622 2020-09-16 Alan Modra <amodra@gmail.com>
625 * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.
627 2020-09-15 H.J. Lu <hongjiu.lu@intel.com>
629 * coff-x86_64.c (howto_table): Display PE relocation names.
631 2020-09-15 Hans-Peter Nilsson <hp@axis.com>
634 * elf32-cris.c (cris_elf_check_relocs): Add missing NULL check
635 on argument before calling UNDEFWEAK_NO_DYNAMIC_RELOC.
637 2020-09-12 H.J. Lu <hongjiu.lu@intel.com>
640 * elflink.c (elf_final_link_info): Add local_hash_table.
641 (local_hash_entry): New.
642 (local_hash_newfunc): Likewise.
643 (elf_link_output_symstrtab): Append ".COUNT" to duplicated local
645 (bfd_elf_final_link): Initialize and free local_hash_table for
648 2020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
650 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Revert
651 changes in 7e05773767820b441b23a16628b55c98cb1aef46. Set
652 error for undefined symbol in BFD_RELOC_AARCH64_BRANCH19 and
653 BFD_RELOC_AARCH64_TSTBR14 relocations.
655 2020-09-09 Nick Clifton <nickc@redhat.com>
657 * cofflink.c (coff_link_check_archive_element): Move the check for
658 coff type input to the start of the function.
660 2020-09-09 Alan Modra <amodra@gmail.com>
662 * libbfd-in.h (_bfd_write_unsigned_leb128): Declare.
663 * libbfd.h: Regenerate.
665 2020-09-08 Jozef Lawrynowicz <jozef.l@mittosystems.com>
666 Kuan-Lin Chen <kuanlinchentw@gmail.com>
668 * bfd-in2.h (bfd_reloc_code_real): Add
669 BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
670 * elf32-msp430.c (msp430_elf_ignore_reloc): New.
671 (elf_msp430_howto_table): Add R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
672 (msp430_reloc_map): Add R_MSP430_GNU_{SET,SUB}_ULEB128.
673 (msp430x_reloc_map): Add R_MSP430X_GNU_{SET,SUB}_ULEB128.
674 (write_uleb128): New.
675 (msp430_final_link_relocate): Handle R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
676 * libbfd.c (_bfd_write_unsigned_leb128): New.
677 * libbfd.h (_bfd_write_unsigned_leb128): New prototype.
678 Add BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
679 * reloc.c: Document BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
681 2020-09-08 Alex Coplan <alex.coplan@arm.com>
683 * archures.c (bfd_mach_aarch64_8R): New.
684 * bfd-in2.h: Regenerate.
685 * cpu-aarch64.c (bfd_aarch64_arch_v8_r): New.
686 (bfd_aarch64_arch_ilp32): Update tail pointer.
688 2020-09-08 Alan Modra <amodra@gmail.com>
692 * elflink.c (_bfd_elf_merge_symbol): Make "override" a bfd**.
693 Return oldbfd in override when old common should override new
695 (_bfd_elf_add_default_symbol): Adjust to suit.
696 (elf_link_add_object_symbols): Likewise. Pass "override" to
697 _bfd_generic_link_add_one_symbol. Save and restore common u.c.p
698 field for --as-needed shared libraries. Revert pr13250 changes.
700 2020-09-08 Nick Clifton <nickc@redhat.com>
702 * plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an
703 unrecognized symbol type in a weak definition.
705 2020-09-04 Alan Modra <amodra@gmail.com>
708 * elfcode.h (elf_object_p): Sanity check section header offset.
709 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
712 2020-09-04 Alan Modra <amodra@gmail.com>
717 * elflink.c (elf_link_add_object_symbols): Do set def_regular
718 and ref_regular for IR symbols. Don't clear dynsym, allowing
719 IR symbols to load --as-needed shared libraries, but prevent
720 IR symbols from becoming dynamic.
722 2020-09-03 Nick Clifton <nickc@redhat.com>
725 * elf.c (_bfd_elf_write_secondary_reloc_section): Check for
726 secondary reloc sections with a zero sh_entsize field.
728 2020-09-03 Nelson Chu <nelson.chu@sifive.com>
730 * elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors.
731 (riscv_merge_std_ext): Likewise.
732 (riscv_merge_arch_attr_info): Likewise.
733 (riscv_merge_attributes): Likewise and fix comment typos.
735 2020-09-03 Nelson Chu <nelson.chu@sifive.com>
737 * elfnn-riscv.c (riscv_version_mismatch): Change the return type
738 from void to bfd_boolean. Report warnings rather than errors
739 when the ISA versions are mis-matched. Afterwards, remember to
740 update the output ISA versions to the newest ones.
741 (riscv_merge_std_ext): Allow to link objects with different
742 standard ISA versions. Try to add output ISA versions to
743 merged_subsets first.
744 (riscv_merge_multi_letter_ext): Likewise. But for standard additional
745 ISA and non-standard ISA versions.
747 2020-09-03 Kito Cheng <kito.cheng@sifive.com>
749 * elfnn-riscv.c (riscv_merge_std_ext): Fix to report the correct
750 error message when the versions of extension are mis-matched.
751 * elfxx-riscv.c (riscv_parse_subset): Don't issue the error when
754 2020-09-03 Alan Modra <amodra@gmail.com>
756 * xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info
757 on the output bfd objalloc memory.
759 2020-09-02 Alan Modra <amodra@gmail.com>
761 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
762 of constant shifted left.
764 2020-09-02 Alan Modra <amodra@gmail.com>
766 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned
767 type for "relocation".
769 2020-09-01 Alan Modra <amodra@gmail.com>
771 * reloc.c (N_ONES): Handle N=0.
772 * elf32-arm.c (elf32_arm_howto_table_1): Set complain_overflow_dont
773 for R_ARM_TLS_DESCSEQ and R_ARM_THM_TLS_DESCSEQ.
775 2020-09-01 Alan Modra <amodra@gmail.com>
778 * elf32-arm.c (elf32_arm_allocate_local_sym_info): Allocate arrays
779 in descending order of alignment.
781 2020-09-01 Alan Modra <amodra@gmail.com>
784 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
786 2020-08-31 Alan Modra <amodra@gmail.com>
789 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to
790 unsigned when using with RISCV_ITYPE.
791 (_bfd_riscv_relax_call): Use an unsigned foff.
793 2020-08-31 Alan Modra <amodra@gmail.com>
797 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO),
798 (CRINFO_RELVADDR): Make unsigned.
799 (mips_elf_nullify_got_load): Use unsigned constant when shifting
802 2020-08-31 Alan Modra <amodra@gmail.com>
805 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u"
806 variable and rewrite signed overflow check.
807 * elf32-mep.c: Regenerate.
808 (mep_final_link_relocate): Delete "s".
810 2020-08-31 Alan Modra <amodra@gmail.com>
813 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
814 that might shift values into sign bit.
816 2020-08-31 Alan Modra <amodra@gmail.com>
819 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma,
820 and similarly for variables dealing with overflow.
822 2020-08-31 Alan Modra <amodra@gmail.com>
825 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits
826 without undefined behaviour. Tidy excess casts.
828 2020-08-31 Alan Modra <amodra@gmail.com>
830 * elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
831 alignment from reloc addend after reloc type R_MN10300_ALIGN is
834 2020-08-30 Alan Modra <amodra@gmail.com>
838 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits
839 without undefined behaviour.
841 2020-08-29 Nick Clifton <nickc@redhat.com>
844 * dwarf2.c (scan_unit_for_symbols): Add member entries to the
847 2020-08-29 Alan Modra <amodra@gmail.com>
850 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last
851 element when count is zero. bfd_realloc when shrinking.
853 2020-08-28 Alan Modra <amodra@gmail.com>
856 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write
859 2020-08-28 Alan Modra <amodra@gmail.com>
862 * ecofflink.c (WRITE): Really don't write zero size chunks.
864 2020-08-28 Tuckker <tuckkern+sourceware@gmail.com>
867 * linker.c (bfd_generic_define_common_symbol): Force the alignment
868 to 1 if the section has now alignment requirement.
870 2020-08-28 Cooper Qu <cooper.qu@linux.alibaba.com>
872 * elf32-csky.c (csky_archs): Fix arch names.
873 (csky_find_arch_with_name): New.
874 (elf32_csky_merge_attributes): New.
875 (csky_elf_merge_private_bfd_data): Add process of merge
877 (elf32_csky_obj_attrs_arg_type): New.
878 (elf32_csky_obj_attrs_handle_unknown): New.
879 (elf_backend_obj_attrs_vendor): Define.
880 (elf_backend_obj_attrs_section): Define.
881 (elf_backend_obj_attrs_arg_type): Define.
882 (elf_backend_obj_attrs_section_type): Define.
884 2020-08-28 Nick Clifton <nickc@redhat.com>
887 * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value
888 for undefined symbols which will not generate extra warning
889 messages about truncated relocs.
891 2020-08-28 Nelson Chu <nelson.chu@sifive.com>
893 * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
894 and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
895 (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
896 unresolved reloc checks.
898 2020-08-27 John David Anglin <danglin@gcc.gnu.org>
901 * som.c (som_bfd_copy_private_section_data): Issue error when a
902 subspace is specified without its containing space.
904 2020-08-27 Alan Modra <amodra@gmail.com>
907 * elflink.c: Include limits.h.
908 (CHAR_BIT): Provide fallback define.
909 (set_symbol_value): Correct complex reloc comment.
910 (undefined_reference): Set bfd_error.
911 (BINARY_OP_HEAD, BINARY_OP_TAIL): Split out from..
913 (eval_symbol): Limit shifts. Force unsigned for left shift.
914 Catch divide by zero.
915 * configure.ac (AC_CHECK_HEADERS): Combine, sort and add limits.h.
916 * configure: Regenerate.
917 * config.in: Regenerate.
919 2020-08-27 Alan Modra <amodra@gmail.com>
922 * reloc.c (bfd_check_overflow): Return early if zero bitsize.
924 2020-08-27 Alan Modra <amodra@gmail.com>
926 * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
927 on sym_sec not being output.
929 2020-08-27 Alan Modra <amodra@gmail.com>
932 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Correct "dynamic".
934 2020-08-26 Nick Clifton <nickc@redhat.com>
937 * elf32-avr.c (avr_final_link_relocate): Fix undefined shift
939 (avr_elf32_load_records_from_section): Use bfd_get_16 and
940 bfd_get_32 to load values from potentially unaligned pointers.
943 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Test for and
944 ignore local symbols.
945 (elf64_alpha_relax_got_load): Do not check for local dynamic
947 (OP_LDA, OP_LDAH, OP_LDQ, OP_BR, OP_BSR): Use unsigned constant
949 (INSN_A) Cast the A parameter to unsigned.
950 (INSN_AB): Define in terms of INSN_A.
951 (INSN_ABC): Likewise.
952 (INSN_ABO): Likewise.
956 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
957 unsigned long constant when creating a mask to test for alignment
960 2020-08-26 Alan Modra <amodra@gmail.com>
963 * elf32-xtensa.c (find_removed_literal): Don't bsearch empty map.
965 2020-08-26 Alan Modra <amodra@gmail.com>
968 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early
969 when section is empty.
971 2020-08-26 Alan Modra <amodra@gmail.com>
974 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
977 2020-08-26 Alan Modra <amodra@gmail.com>
985 * elf64-ppc.c (is_tls_get_addr): Avoid UB &h->elf when h is NULL.
986 (ppc64_elf_tls_setup): Likewise.
987 (branch_reloc_hash_match): Likewise.
988 (build_plt_stub): Likewise.
989 (ppc64_elf_relocate_section): Likewise.
991 2020-08-26 Alan Modra <amodra@gmail.com>
994 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
996 2020-08-26 Alan Modra <amodra@gmail.com>
999 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
1000 sstubs->contents != NULL.
1002 2020-08-26 Alan Modra <amodra@gmail.com>
1005 * som.c (som_prep_for_fixups): Return early when no symbols.
1007 2020-08-26 Alan Modra <amodra@gmail.com>
1010 * ecofflink.c (WRITE): Don't write size 0 chunks.
1012 2020-08-26 Alan Modra <amodra@gmail.com>
1014 * bfdio.c (bfd_get_file_size): Don't segv on NULL adata.
1016 2020-08-26 Alan Modra <amodra@gmail.com>
1019 * vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
1021 2020-08-26 David Faust <david.faust@oracle.com>
1023 * archures.c (bfd_mach_xbpf): Define.
1024 * bfd-in2.h: Regenerate.
1025 * cpu-bpf.c (bfd_xbpf_arch) New.
1026 (bfd_bpf_arch) Update next in list field to point to xbpf arch.
1028 2020-08-26 Alan Modra <amodra@gmail.com>
1030 * archures.c (bfd_mach_ck860): Define.
1032 2020-08-25 Mark Wielaard <mark@klomp.org>
1034 * dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
1035 and dwarf_rnglists_size fields.
1036 (dwarf_debug_sections): Add debug_rnglists.
1037 (dwarf_debug_section_enum): Likewise.
1038 (read_debug_rnglists): New function.
1039 (read_rangelist): New function to call either read_ranges or
1040 read_rnglists. Rename original function to...
1041 (read_ranges): ...this.
1042 (read_rnglists): New function.
1044 2020-08-25 Alan Modra <amodra@gmail.com>
1047 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check
1048 is_elf_hash_table before accessing elf fields.
1050 2020-08-25 Alan Modra <amodra@gmail.com>
1053 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
1056 2020-08-25 Alan Modra <amodra@gmail.com>
1059 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
1060 before accessing elf fields.
1062 2020-08-25 Alan Modra <amodra@gmail.com>
1065 * som.c (som_compute_checksum): XOR 32-bit words in header,
1066 not unsigned long sized words.
1068 2020-08-25 Alan Modra <amodra@gmail.com>
1071 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
1072 amount copied for elf_segment_map defined with one element
1075 2020-08-25 Alan Modra <amodra@gmail.com>
1078 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
1079 bfd_get_x size function to read addends out of fields. Apply
1080 rightshift adjustment too. Don't apply the now unnecessary
1081 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
1082 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
1083 Correct R_ARM_THM_JUMP6 addend.
1085 2020-08-25 Alan Modra <amodra@gmail.com>
1088 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
1089 before start of section.
1091 2020-08-25 Alan Modra <amodra@gmail.com>
1093 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
1094 before accessing elf_hash_table_id.
1095 * elf32-arc.c (elf_arc_hash_table): Likewise.
1096 * elf32-arm.c (elf32_arm_hash_table): Likewise.
1097 * elf32-avr.c (avr_link_hash_table): Likewise.
1098 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
1099 * elf32-cris.c (elf_cris_hash_table): Likewise.
1100 * elf32-csky.c (csky_elf_hash_table): Likewise.
1101 * elf32-frv.c (frvfdpic_hash_table): Likewise.
1102 * elf32-hppa.c (hppa_link_hash_table): Likewise.
1103 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
1104 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
1105 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
1106 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
1107 * elf32-metag.c (metag_link_hash_table): Likewise.
1108 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
1109 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
1110 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
1111 * elf32-s390.c (elf_s390_hash_table): Likewise.
1112 * elf32-sh.c (sh_elf_hash_table): Likewise.
1113 * elf32-spu.c (spu_hash_table): Likewise.
1114 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
1115 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
1116 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
1117 * elf64-hppa.c (hppa_link_hash_table): Likewise.
1118 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
1119 * elf64-s390.c (elf_s390_hash_table): Likewise.
1120 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
1121 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
1122 * elfxx-mips.c (mips_elf_hash_table): Likewise.
1123 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
1124 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
1126 2020-08-21 Jon Turney <jon.turney@dronecode.org.uk>
1128 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
1129 int. Use '%u' format with _bfd_error_handler to render it.
1131 2020-08-25 Alan Modra <amodra@gmail.com>
1134 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
1135 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
1137 2020-08-25 Alan Modra <amodra@gmail.com>
1140 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
1141 accessing elf_hash_table_id.
1143 2020-08-25 Alan Modra <amodra@gmail.com>
1146 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
1147 accessing elf_hash_table_id.
1149 2020-08-24 Mark Wielaard <mark@klomp.org>
1151 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
1152 (read_formatted_entries): Likewise. And skip zero entry.
1154 2020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
1156 * bfd-in2.h (bfd_mach_ck860): New.
1157 * cpu-csky.c (arch_info_struct): Add item for CK860.
1159 2020-08-24 Alan Modra <amodra@gmail.com>
1161 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
1162 high part tprel16 relocs.
1163 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
1164 Clear do_tls_opt on odd instructions.
1165 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
1166 Don't sanity check them here.
1167 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
1168 high part tprel16 relocs.
1169 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
1170 Clear do_tls_opt on odd instructions.
1171 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
1173 2020-08-23 John David Anglin <danglin@gcc.gnu.org>
1176 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
1177 * configure: Regenerate.
1179 2020-08-22 H.J. Lu <hongjiu.lu@intel.com>
1182 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
1183 versioned symbols, which are defined in shared objects, in
1184 symbol string table.
1186 2020-08-21 Nick Clifton <nickc@redhat.com>
1188 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
1189 the data map if there are entries in it.
1190 (_bfd_aarch64_erratum_843419_scan): Likewise.
1192 2020-08-21 Jan Beulich <jbeulich@suse.com>
1194 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
1195 last byte of debug dir, not first.
1197 2020-08-20 Nick Clifton <nickc@redhat.com>
1200 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
1201 field in the ELF header of the compressed sections.
1203 2020-08-20 Nick Clifton <nickc@redhat.com>
1206 * elf-bfd.h (struct bfd_elf_section_data): Add
1207 has_secondary_relocs field.
1208 * elf.c (_bfd_elf_copy_special_section_fields): Set the
1209 has_secondary_relocs field for sections which have associated
1211 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
1212 on sections which have associated secondary relocs.
1214 2020-08-15 Alan Modra <amodra@gmail.com>
1216 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
1217 small common section.
1218 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
1219 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
1220 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
1221 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
1222 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
1223 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
1224 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
1225 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
1226 * elf32-v850.c (v850_elf_check_relocs): Likewise.
1227 (v850_elf_add_symbol_hook): Likewise.
1228 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
1229 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
1230 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
1231 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
1233 2020-08-15 Alan Modra <amodra@gmail.com>
1236 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
1238 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
1239 on small common section.
1240 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
1241 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
1242 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
1243 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
1244 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
1245 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
1247 2020-08-14 Alan Modra <amodra@gmail.com>
1249 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
1250 rather than another copy of primes. Increase maximum default
1253 2020-08-13 Alan Modra <amodra@gmail.com>
1255 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
1257 2020-08-13 Alan Modra <amodra@gmail.com>
1259 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
1260 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
1261 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
1262 optimization when --no-pcrel-optimize.
1264 2020-08-13 Alan Modra <amodra@gmail.com>
1267 * bfd.c (struct bfd): Add read_only.
1268 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
1269 Set read_only on warning.
1270 (elf_object_p): Sanity check program header alignment. Set
1271 read_only on warning.
1272 * bfd-in2.h: Regenerate.
1274 2020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
1276 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
1277 win32pstatus note type to avoid signedness comparison warning.
1279 2020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
1281 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
1282 win32pstatus notes, and return TRUE so we continue rather than
1283 stopping as if it was an error.
1285 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1287 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
1289 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
1291 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
1292 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
1293 appropriate size constraint for each win32pstatus note type.
1295 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1297 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
1298 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
1301 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
1303 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
1304 (elfcore_grok_win32pstatus): Use.
1306 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1308 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
1309 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
1310 offsets used to read NOTE_INFO_PROCESS.
1312 2020-08-12 Nick Clifton <nickc@redhat.com>
1314 * po/ru.po: Updated Russian translation.
1315 * po/sr.po: Updated Serbian translation.
1317 2020-08-07 David Faust <david.faust@oracle.com>
1319 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
1320 DISP16 and DISP32 relocations.
1322 2020-08-05 David Faust <david.faust@oracle.com>
1324 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
1325 (bpf_elf_howto_table): Use it here.
1326 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
1327 instruction and data relocations.
1329 2020-08-03 Alan Modra <amodra@gmail.com>
1331 * vms-lib.c (vms_traverse_index): Sanity check size remaining
1332 before accessing vms_idx or vms_elfidx.
1334 2020-08-03 Alan Modra <amodra@gmail.com>
1337 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
1338 size against file size. Correct LONG_MAX limit check.
1339 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
1340 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
1341 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1342 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
1343 bfd_malloc_and_get_section.
1345 2020-07-31 Alan Modra <amodra@gmail.com>
1348 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
1349 IR symbols to become dynamic.
1350 (elf_link_add_object_symbols): Don't exclude IR symbols when
1351 deciding whether an as-needed shared library is needed.
1353 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1356 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
1358 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
1360 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1362 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
1363 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
1364 Don't define _STRUCTURED_PROC.
1365 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
1366 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
1367 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
1368 * configure, config.in: Regenerate.
1369 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
1370 * Makefile.in, doc/Makefile.in: Regenerate.
1372 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
1374 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
1375 (elf_link_hash_table): Add sym_cache.
1376 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
1377 (elf32_arm_check_relocs): Updated.
1378 (elf32_arm_size_dynamic_sections): Likewise.
1379 * elf32-bfin.c (bfin_link_hash_table): Removed.
1380 (bfin_link_hash_newfunc): Updated.
1381 (bfin_hash_table): Removed.
1382 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
1383 (csky_elf_check_relocs): Updated.
1384 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
1385 (elf32_hppa_check_relocs): Updated.
1386 * elf32-i386.c (elf_i386_tls_transition): Updated.
1387 (elf_i386_convert_load_reloc): Likewise.
1388 (elf_i386_check_relocs): Likewise.
1389 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
1390 (m32r_elf_hash_table): Updated.
1391 (m32r_elf_link_hash_table_create): Likewise.
1392 (m32r_elf_create_dynamic_sections): Likewise.
1393 (m32r_elf_adjust_dynamic_symbol): Likewise.
1394 (allocate_dynrelocs): Likewise.
1395 (m32r_elf_size_dynamic_sections): Likewise.
1396 (m32r_elf_relocate_section): Likewise.
1397 (m32r_elf_finish_dynamic_symbol): Likewise.
1398 (m32r_elf_check_relocs): Likewise.
1399 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
1401 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
1402 (elf_m68k_check_relocs): Updated.
1403 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
1404 (elf_metag_check_relocs): Updated.
1405 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
1406 (microblaze_elf_check_relocs): Updated.
1407 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
1408 (nds32_elf_create_dynamic_sections): Likewise.
1409 (nds32_elf_adjust_dynamic_symbol): Likewise.
1410 (nds32_elf_check_relocs): Likewise.
1411 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
1412 srelbss and aym_cache.
1413 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
1414 (nios2_elf32_check_relocs): Updated.
1415 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
1416 (or1k_elf_check_relocs): Updated.
1417 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
1418 (ppc_elf_check_relocs): Updated.
1419 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1420 (elf_s390_check_relocs): Updated.
1421 (elf_s390_finish_dynamic_sections): Likewise.
1422 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
1424 (sh_elf_create_dynamic_sections): Updated.
1425 (sh_elf_adjust_dynamic_symbol): Likewise.
1426 (sh_elf_size_dynamic_sections): Likewise.
1427 (sh_elf_check_relocs): Likewise.
1428 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
1429 (elf32_tic6x_check_relocs): Updated.
1430 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
1431 (tilepro_elf_hash_table): Updated.
1432 (tilepro_elf_link_hash_table_create): Likewise.
1433 (tilepro_elf_check_relocs): Likewise.
1434 (tilepro_elf_adjust_dynamic_symbol): Likewise.
1435 (allocate_dynrelocs): Likewise.
1436 (tilepro_elf_size_dynamic_sections): Likewise.
1437 (tilepro_elf_relocate_section): Likewise.
1438 (tilepro_elf_finish_dynamic_symbol): Likewise.
1439 (tilepro_finish_dyn): Likewise.
1440 (tilepro_elf_finish_dynamic_sections): Likewise.
1441 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
1442 (ppc64_elf_before_check_relocs): Updated.
1443 (ppc64_elf_check_relocs): Likewise.
1444 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1445 (elf_s390_check_relocs): Updated.
1446 (elf_s390_relocate_section): Likewise.
1447 (elf_s390_finish_dynamic_sections): Likewise.
1448 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1449 (elf_x86_64_check_relocs): Likewise.
1450 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1452 (elfNN_aarch64_check_relocs): Updated.
1453 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
1454 (riscv_elf_check_relocs): Updated.
1455 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
1456 (mips_elf_resolve_got_page_ref): Updated.
1457 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1458 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1460 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
1461 (tilegx_elf_check_relocs): Updated.
1462 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
1464 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1466 * elflink.c (bfd_elf_final_link): Give local symbols a name if
1468 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
1469 return TRUE if making ET_REL output.
1471 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1473 * elf-bfd.h (elf_backend_data): Add
1474 `elf_backend_elfsym_local_is_section' member.
1475 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
1477 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
1478 * elflink.c (bfd_elf_final_link): Use it to determine whether
1479 set the `.symtab' section's `sh_info' value to the index of the
1480 first non-local or non-section symbol.
1481 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
1483 (elf_backend_elfsym_local_is_section): New macro.
1484 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
1486 (elf_backend_elfsym_local_is_section): New macro.
1488 2020-07-29 Alan Modra <amodra@gmail.com>
1490 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
1491 defined in excluded sections.
1493 2020-07-28 Alan Modra <amodra@gmail.com>
1495 * elf.c (assign_section_numbers): Comment. Don't segfault on
1496 discarded sections when setting linked-to section for generic
1498 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
1500 2020-07-27 Alan Modra <amodra@gmail.com>
1502 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
1503 similar as absolute.
1504 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
1507 2020-07-24 Nick Clifton <nickc@redhat.com>
1509 * config.bfd: Move xc16x target to the obsolete list.
1511 2020-07-22 Kevin Buettner <kevinb@redhat.com>
1513 * binary.c (binary_get_section_contents): Seek using offset
1514 from section's file position.
1516 2020-07-22 Kevin Buettner <kevinb@redhat.com>
1518 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
1520 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
1523 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
1524 type for the first function argument. Rename pointers to reflect
1525 that they have distinct types.
1527 2020-07-20 Alan Modra <amodra@gmail.com>
1529 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
1531 2020-07-19 Alan Modra <amodra@gmail.com>
1533 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
1534 (select_alt_stub): New function.
1535 (ppc_get_stub_entry): Use it here.
1536 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
1538 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
1539 merge notoc stubs with other varieties when power10_stubs is "auto".
1540 Instead dup the stub hash table entry.
1541 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1542 tests of power10_stubs.
1544 2020-07-15 Alan Modra <amodra@gmail.com>
1547 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
1549 2020-07-15 Nick Clifton <nickc@redhat.com>
1552 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
1553 check for aux entries that overflow the buufer.
1555 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
1557 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
1558 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
1560 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
1561 Alan Modra <amodra@gmail.com>
1564 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
1565 objects both before and after normal object files.
1566 * elflink.c (_bfd_elf_section_already_linked): Likewise.
1568 2020-07-10 Alan Modra <amodra@gmail.com>
1570 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
1571 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1573 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
1574 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1575 uses of power10_stubs.
1577 2020-07-09 Alan Modra <amodra@gmail.com>
1579 * coff-ppc.c: Delete.
1581 * pei-ppc.c: Delete.
1582 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
1583 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
1585 (coff_write_object_contents): Remove PPC_PE code.
1586 * config.bfd: Move powerpcle-pe to removed targets.
1587 * configure.ac: Remove powerpc PE entries.
1588 * libcoff-in.h (ppc_allocate_toc_section): Delete.
1589 (ppc_process_before_allocation): Delete.
1590 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
1591 * targets.c: Remove powerpc PE vectors.
1592 * po/SRC-POTFILES.in: Regenerate.
1593 * libcoff.h: Regenerate.
1594 * Makefile.in: Regenerate.
1595 * configure: Regenerate.
1597 2020-07-09 Nick Clifton <nickc@redhat.com>
1599 * po/fr.po: Updated French translation.
1601 2020-07-07 Alan Modra <amodra@gmail.com>
1603 * xcofflink.c (xcoff_mark): Don't mark const sections.
1604 (bfd_xcoff_record_link_assignment): Add FIXME.
1605 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
1606 sections being discarded by linker script.
1608 2020-07-07 Alan Modra <amodra@gmail.com>
1610 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
1611 time, uid, gid and mode for deterministic archive.
1612 (xcoff_write_archive_contents_big): Likewise.
1614 2020-07-07 Alan Modra <amodra@gmail.com>
1616 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
1619 2020-07-06 Nick Clifton <nickc@redhat.com>
1621 * po/pt.po: Updated Portuguese translation.
1622 * po/uk.po: Updated Ukranian translation.
1624 2020-07-04 Nick Clifton <nickc@redhat.com>
1626 * version.m4: Set version to 2.35.50.
1627 * configure: Regenerate.
1628 * po/bbfd.pot: Regenerate.
1630 2020-07-04 Nick Clifton <nickc@redhat.com>
1632 Binutils 2.35 branch created.
1634 2020-07-01 Alan Modra <amodra@gmail.com>
1637 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
1638 raw syment index before dereferencing.
1640 2020-07-01 Alan Modra <amodra@gmail.com>
1642 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
1644 2020-07-01 Alan Modra <amodra@gmail.com>
1646 * config.bfd: Obsolete xc16x.
1648 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
1650 * archures.c (bfd_mach_i386_nacl): Removed.
1651 (bfd_mach_i386_i386_nacl): Likewise.
1652 (bfd_mach_x86_64_nacl): Likewise.
1653 (bfd_mach_x64_32_nacl): Likewise.
1654 * config.bfd: Remove *-*-nacl* targets.
1655 * configure.ac: Remove x86 NaCl target vectors.
1656 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
1657 (bfd_x64_32_nacl_arch): Likewise.
1658 (bfd_x86_64_nacl_arch): Likewise.
1659 (bfd_i386_nacl_arch): Likewise.
1660 (bfd_x64_32_arch_intel_syntax): Updated.
1661 * elf32-i386.c: Don't include "elf-nacl.h".
1662 (elf_i386_nacl_plt): Removed.
1663 (elf_i386_nacl_plt0_entry): Likewise.
1664 (elf_i386_nacl_plt_entry): Likewise.
1665 (elf_i386_nacl_pic_plt0_entry): Likewise.
1666 (elf_i386_nacl_pic_plt_entry): Likewise.
1667 (elf_i386_nacl_eh_frame_plt): Likewise.
1668 (elf_i386_nacl_plt): Likewise.
1669 (elf32_i386_nacl_elf_object_p): Likewise.
1670 (elf_i386_get_synthetic_symtab): Updated.
1671 (elf_i386_link_setup_gnu_properties): Likewise.
1672 * elf64-x86-64.c: Don't include "elf-nacl.h".
1673 (elf_x86_64_nacl_plt): Removed.
1674 (elf64_x86_64_nacl_elf_object_p): Likewise.
1675 (elf_x86_64_nacl_plt0_entry): Likewise.
1676 (elf_x86_64_nacl_plt_entry): Likewise.
1677 (elf_x86_64_nacl_eh_frame_plt): Likewise.
1678 (elf_x86_64_nacl_plt): Likewise.
1679 (elf32_x86_64_nacl_elf_object_p): Likewise.
1680 (elf_x86_64_get_synthetic_symtab): Updated.
1681 (elf_x86_64_link_setup_gnu_properties): Likewise.
1682 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1683 * targets.c: Remove x86 NaCl target vectors.
1684 * bfd-in2.h: Regenerated.
1685 * configure: Likewise.
1687 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
1689 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
1690 _bfd_elf_add_dynamic_tags.
1692 2020-06-29 Alan Modra <amodra@gmail.com>
1694 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
1695 return value of bfd_bread. Don't read more than requested length.
1696 Sanity check length. Properly terminate file name.
1698 2020-06-29 Alan Modra <amodra@gmail.com>
1700 * arc-got.h: Use C style comments.
1701 * coff-z80.c: Likewise.
1702 * elf32-csky.c: Likewise.
1703 * peXXigen.c: Likewise.
1704 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
1707 2020-06-26 Pat Bernardi <bernardi@adacore.com>
1709 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
1710 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
1712 2020-06-26 Alan Modra <amodra@gmail.com>
1714 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
1715 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
1716 (riscv_get_priv_spec_name): Move to..
1717 * cpu-riscv.c: ..here.
1718 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
1719 Use %u to print unsigned numbers.
1721 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
1723 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
1724 default architecture.
1726 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1729 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
1730 _bfd_elf_add_dynamic_tags.
1732 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1735 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
1736 _bfd_elf_add_dynamic_tags.
1738 2020-06-24 Alan Modra <amodra@gmail.com>
1740 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
1741 shifts without undefined behaviour.
1743 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
1745 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
1747 (_bfd_elf_add_dynamic_tags): New.
1748 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
1749 _bfd_elf_add_dynamic_tags.
1750 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
1751 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
1752 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
1753 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
1754 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
1755 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
1756 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1757 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
1759 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
1760 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
1761 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
1762 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
1763 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
1764 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
1765 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1766 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
1767 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
1769 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
1770 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
1771 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
1772 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1773 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1774 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
1776 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1777 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1778 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
1779 dt_reloc_sz and dt_reloc_ent.
1780 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
1781 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
1783 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
1784 etab.dt_pltgot_required.
1785 (elf32_hppa_size_dynamic_sections): Call
1786 _bfd_elf_add_dynamic_tags.
1787 * elf32-metag.c (elf_metag_link_hash_table_create): Set
1788 etab.dt_pltgot_required.
1789 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
1790 * elf32-sh.c (sh_elf_link_hash_table_create): Set
1791 root.dt_pltgot_required for FDPIC output.
1792 (sh_elf_size_dynamic_sections): Call
1793 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1794 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
1795 elf.dt_pltgot_required.
1796 (elf_xtensa_size_dynamic_sections): Call
1797 _bfd_elf_add_dynamic_tags.
1798 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
1799 root.dt_pltgot_required.
1800 (elf64_hppa_size_dynamic_sections): Call
1801 _bfd_elf_add_dynamic_tags.
1802 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
1803 root.dt_pltgot_required.
1804 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
1805 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
1806 * elflink.c (_bfd_elf_add_dynamic_tags): New.
1808 2020-06-22 Saagar Jha <saagar@saagarjha.com>
1810 * mach-o.c: Support the new load commands by reading a linkedit
1811 data command for them.
1813 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1815 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
1816 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
1817 (riscv_get_priv_spec_class): Likewise.
1818 (riscv_get_priv_spec_name): Likewise.
1819 (riscv_get_priv_spec_class_from_numbers): New function, convert
1820 the version numbers into string, then call riscv_get_priv_spec_class
1821 to get the priv spec class.
1822 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
1823 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
1824 (riscv_get_priv_spec_name): Likewise.
1825 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
1826 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
1827 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
1828 of input and output objects form their priv spec attributes by
1829 riscv_get_priv_spec_class_from_numbers. Report warning rather than
1830 errors when linking objects with differnet priv spec versions. We do
1831 know v1.9.1 may have conflicts to other versions, so report the
1832 warning, too. After that, update the output priv spec version to the
1835 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1837 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
1838 priv attributes, we will check the conflicts for all of them (major,
1839 minor and revision), and then set the priv_attrs_merged to TRUE to
1840 indicate that we have handled all of the priv attributes. Remove
1841 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
1843 2020-06-21 Alan Modra <amodra@gmail.com>
1846 * configure.ac: Disable plugins by default for some targets.
1847 * plugin.c: Comment typo fix.
1848 * configure: Regenerate.
1850 2020-06-19 Nick Clifton <nickc@redhat.com>
1852 * plugin.c (try_load_plugin): Suppress the error message about
1853 being unable to open a plugin if creating a list of viable
1856 2020-06-16 Alan Modra <amodra@gmail.com>
1858 * aout-tic30.c: Delete file.
1859 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
1860 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
1861 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
1862 (xc16x-*-elf): Sort properly.
1863 * configure.ac: Remove tic30_aout_vec.
1864 * targets.c: Likewise.
1865 * Makefile.in: Regenerate.
1866 * configure: Regenerate.
1867 * po/SRC-POTFILES.in: Regenerate.
1869 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
1871 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
1872 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
1873 (elf32xtensa_abi): New global variable.
1874 (xtensa_abi_choice): New function.
1875 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
1876 XSHAL_ABI to select PLT code.
1878 2020-06-15 Roland McGrath <mcgrathr@google.com>
1880 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
1881 field of bfd_link_info.
1883 2020-06-15 Alan Modra <amodra@gmail.com>
1885 * config.bfd: Obsolete powerpcle-*-pe targets.
1887 2020-06-15 Alan Modra <amodra@gmail.com>
1890 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
1891 symbols that were defined in discarded sections.
1892 * cofflink.c (coff_link_check_archive_element): Likewise.
1893 (coff_link_add_symbols): Set indx to -3 for symbols defined in
1895 (_bfd_coff_write_global_sym): Don't emit such symbols.
1896 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
1897 libcoff.h: Regenerate.
1899 2020-06-11 Alan Modra <amodra@gmail.com>
1902 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
1904 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1906 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
1907 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
1908 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
1911 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1914 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
1915 Clear verinfo.verdef.
1917 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
1920 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
1921 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
1922 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
1924 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
1925 Set ifunc_resolvers if there are FUNC resolvers.
1926 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
1927 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
1928 with elf.ifunc_resolvers.
1929 (write_plt_relocs_for_local_syms): Likewise.
1930 (ppc64_elf_relocate_section): Likewise.
1931 (ppc64_elf_finish_dynamic_sections): Likewise.
1932 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
1934 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1935 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
1936 instead of readonly_dynrelocs_against_ifunc.
1937 * elfxx-x86.h (elf_x86_link_hash_table): Remove
1938 readonly_dynrelocs_against_ifunc.
1940 2020-06-09 Alan Modra <amodra@gmail.com>
1942 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1943 maybe_local_ifunc_resolver field.
1944 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
1945 cases where maybe_local_ifunc_resolver was set.
1946 (ppc64_elf_relocate_section): Likewise.
1947 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
1950 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
1952 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
1954 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
1956 (elf32_arm_size_dynamic_sections): Updated. Clear
1957 root.tlsdesc_plt for DF_BIND_NOW.
1958 (elf32_arm_finish_dynamic_sections): Updated.
1959 (elf32_arm_output_arch_local_syms): Likewise.
1960 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
1961 Clear root.tlsdesc_plt for DF_BIND_NOW.
1962 (nds32_elf_finish_dynamic_sections): Updated.
1963 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
1964 dt_tlsdesc_plt and dt_tlsdesc_got.
1965 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
1966 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1967 tlsdesc_plt and dt_tlsdesc_got.
1968 (elfNN_aarch64_allocate_dynrelocs): Updated.
1969 (elfNN_aarch64_finish_dynamic_sections): Likewise.
1970 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
1971 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
1973 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1974 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1975 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1976 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
1979 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1981 * elf32-tic6x.c (elf32_bed): Defined the default to
1984 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1986 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
1988 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
1989 root.splt/root.srelplt.
1990 (elf64_hppa_create_dynamic_sections): Likewise.
1991 (elf64_hppa_size_dynamic_sections): Likewise.
1992 (elf64_hppa_finish_dynamic_symbol): Likewise.
1993 (elf_hppa_final_link): Likewise.
1994 (elf_hppa_final_link_relocate): Likewise.
1996 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1998 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
1999 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
2002 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
2004 * elf-bfd.h (elf_target_os): New.
2005 (elf_link_hash_table): Add target_os.
2006 (elf_backend_data): Add target_os.
2007 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
2008 symbian_p and nacl_p.
2009 (create_got_section): Updated.
2010 (elf32_arm_create_dynamic_sections): Likewise.
2011 (arm_type_of_stub): Likewise.
2012 (elf32_arm_create_or_find_stub_sec): Likewise.
2013 (elf32_arm_allocate_plt_entry): Likewise.
2014 (elf32_arm_populate_plt_entry): Likewise.
2015 (elf32_arm_final_link_relocate): Likewise.
2016 (elf32_arm_check_relocs): Likewise.
2017 (allocate_dynrelocs_for_symbol): Likewise.
2018 (elf32_arm_finish_dynamic_symbol): Likewise.
2019 (elf32_arm_finish_dynamic_sections): Likewise.
2020 (elf32_arm_output_plt_map_1): Likewise.
2021 (elf32_arm_output_arch_local_syms): Likewise.
2022 (elf32_arm_add_symbol_hook): Likewise.
2023 (elf32_arm_nacl_link_hash_table_create): Likewise.
2024 (elf32_arm_vxworks_link_hash_table_create): Likewise.
2025 (elf32_arm_symbian_link_hash_table_create): Likewise.
2026 (ELF_TARGET_OS): New.
2027 * elf32-i386.c (elf_i386_arch_bed): Removed.
2028 (elf_backend_arch_data): Likewise.
2029 (elf_i386_solaris_arch_bed): Likewise.
2030 (elf_i386_nacl_arch_bed): Likewise.
2031 (elf_i386_vxworks_arch_bed): Likewise.
2032 (elf_i386_relocate_section): Updated.
2033 (elf_i386_finish_dynamic_sections): Likewise.
2034 (elf_i386_get_synthetic_symtab): Likewise.
2035 (elf_i386_link_setup_gnu_properties): Likewise.
2036 (ELF_TARGET_OS): New.
2037 * elf32-mips.c (ELF_TARGET_OS): New.
2038 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
2039 (ppc_elf_create_got): Updated.
2040 (ppc_elf_create_dynamic_sections): Likewise.
2041 (ppc_elf_check_relocs): Likewise.
2042 (ppc_elf_adjust_dynamic_symbol): Likewise.
2043 (ppc_elf_size_dynamic_sections): Likewise.
2044 (ppc_elf_relocate_section): Likewise.
2045 (ppc_elf_finish_dynamic_sections): Likewise.
2046 (ppc_elf_vxworks_link_hash_table_create): Likewise.
2047 (ELF_TARGET_OS): New.
2048 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
2049 (sh_elf_link_hash_table_create): Updated.
2050 (sh_elf_create_dynamic_sections): Likewise.
2051 (allocate_dynrelocs): Likewise.
2052 (sh_elf_size_dynamic_sections): Likewise.
2053 (sh_elf_relocate_section): Likewise.
2054 (sh_elf_finish_dynamic_symbol): Likewise.
2055 (sh_elf_finish_dynamic_sections): Likewise.
2056 (ELF_TARGET_OS): New.
2057 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
2059 (bfd_elf32_bfd_link_hash_table_create): Likewise.
2060 (ELF_TARGET_OS): New.
2061 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
2062 (elf_x86_64_solaris_arch_bed): Likewise.
2063 (elf_x86_64_nacl_arch_bed): Likewise.
2064 (elf_x86_64_finish_dynamic_sections): Updated.
2065 (elf_x86_64_get_synthetic_symtab): Likewise.
2066 (elf_x86_64_link_setup_gnu_properties): Likewise.
2067 (ELF_TARGET_OS): New.
2068 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
2070 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
2071 (MIPS_ELF_REL_DYN_NAME): Updated.
2072 (ELF_MIPS_GP_OFFSET): Likewise.
2073 (mips_elf_create_local_got_entry): Likewise.
2074 (mips_elf_allocate_dynamic_relocations): Likewise.
2075 (mips_elf_count_got_symbols): Likewise.
2076 (is_gott_symbol): Likewise.
2077 (mips_elf_calculate_relocation): Likewise.
2078 (mips_elf_create_dynamic_relocation): Likewise.
2079 (_bfd_mips_elf_check_relocs): Likewise.
2080 (allocate_dynrelocs): Likewise.
2081 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
2082 (mips_elf_lay_out_got): Likewise.
2083 (mips_elf_set_plt_sym_value): Likewise.
2084 (_bfd_mips_elf_size_dynamic_sections): Likewise.
2085 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
2086 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
2087 (_bfd_mips_elf_final_link): Likewise.
2088 (_bfd_mips_init_file_header): Likewise.
2089 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
2091 (allocate_dynrelocs): Likewise.
2092 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
2093 (_bfd_sparc_elf_relocate_section): Likewise.
2094 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2095 (sparc_finish_dyn): Likewise.
2096 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
2097 * elfxx-target.h (ELF_TARGET_OS): New.
2098 (elfNN_bed): Add ELF_TARGET_OS.
2099 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
2100 (_bfd_x86_elf_link_hash_table_create): Likewise.
2101 (_bfd_x86_elf_size_dynamic_sections): Likewise.
2102 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
2103 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
2104 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
2105 * elfxx-x86.h (elf_x86_target_os): Removed.
2106 (elf_x86_backend_data): Likewise.
2107 (get_elf_x86_backend_data): Likewise.
2108 (elf_x86_link_hash_table): Remove target_os.
2110 2020-06-06 Alan Modra <amodra@gmail.com>
2113 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
2114 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
2115 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
2116 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
2117 * elf64-ppc.c: Update throughout for reloc renaming.
2118 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
2119 * libbfd.h: Regenerate.
2120 * bfd-in2.h: Regenerate.
2122 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
2125 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
2128 2020-06-05 Nick Clifton <nickc@redhat.com>
2130 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
2133 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
2135 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
2136 priv_may_conflict, in_priv_zero and out_priv_zero to decide
2137 whether the object can be linked according to it's priv
2138 attributes. The object without any priv spec attributes can
2139 be linked with others. If the first input object doesn't contain
2140 any priv attributes, then we need to copy the setting from the
2141 next input one. Also report more detailed error messages to user.
2143 2020-06-04 Stephen Casner <casner@acm.org>
2145 Extend pdp11-aout symbol table format to accommodate .stab
2146 symbols and implement correct handling of them.
2148 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
2149 (N_STAB, is_stab): Needed new function is_stab to disambiguate
2150 normal vs. .stab symbol table type values, replacing N_STAB mask.
2151 (translate_from_native_sym_flags): Determine correct section for
2152 different .stab types.
2153 (translate_to_native_sym_flags): Leave .stab types intact.
2154 (translate_symbol_table): Error if symbol indicates overlay;
2155 store desc field from .stab symbols.
2156 (write_syms): Output desc field with symbol.
2157 (aout_link_check_ar_symbols): Skip .stab symbols.
2158 (aout_link_add_symbols): Correctly distinguish .stab symbols.
2159 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
2160 (aout_link_write_symbols): Write 0 for desk and ovly fields;
2161 correctly distinguish .stab symbols and select calculate their
2162 section and value; and copy desc and ovly fields from input symbol
2165 2020-06-04 Stephen Casner <casner@acm.org>
2167 * aoutx.h (translate_symbol_table): Comment had external and
2169 * pdp11.c (translate_symbol_table): Likewise.
2171 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
2173 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
2174 (is_x86_elf): Check elf.hash_table_id instead of target_id.
2175 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
2177 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
2180 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
2181 in debug section against symbol defined in shared library to 0.
2182 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
2183 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
2184 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
2185 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
2186 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
2187 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
2188 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
2189 * elf32-sh.c (sh_elf_check_relocs): Likewise.
2190 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2191 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
2192 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2193 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2194 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2195 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
2197 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
2198 there is non-GOT reference.
2199 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
2200 non-alloced sections.
2202 2020-06-03 Stephen Casner <casner@acm.org>
2204 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
2206 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
2208 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
2209 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
2210 other size that doesn't qcover the header word.
2211 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
2212 string table, and zero it.
2213 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
2214 message and set bfd_error on finding an invalid name string offset.
2215 (add_to_stringtab): INLINE -> inline
2216 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
2218 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
2219 any relocs that could not be recognised.
2220 92744f05809 PR 20929 - Check for relocs without an associated symbol.
2221 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
2222 name exists and is long enough, before attempting to see if it is
2224 c3864421222 - Correct case for N_SO being the last symbol.
2225 50455f1ab29 PR 20891 - Handle the case where the main file name
2226 and the directory name are both empty.
2227 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
2228 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
2229 range string table offsets.
2230 531336e3a0b PR 20909 - Fix off-by-one error in check for an
2231 illegal string offset.
2232 (aout_link_includes_newfunc): Add comment.
2233 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
2234 on unexpected relocation type rather than ASSERT.
2236 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2239 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
2240 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
2242 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2245 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
2246 non-alloced sections.
2248 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2250 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
2251 dynamic relocations for non SEC_ALLOC sections.
2253 2020-06-03 Gunther Nikl <gnikl@justmail.de>
2255 * aout64.c (BMAGIC, QMAGIC): Do not define.
2256 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
2257 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
2258 to check the file format.
2259 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
2260 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
2261 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
2263 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2265 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
2266 relocations for non SEC_ALLOC sections.
2268 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2270 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
2271 * elf32-arm.c (maybe_set_textrel): Removed.
2272 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
2273 with _bfd_elf_maybe_set_textrel.
2274 * elf32-csky.c (maybe_set_textrel): Removed.
2275 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
2276 with _bfd_elf_maybe_set_textrel.
2277 * elf32-hppa.c (maybe_set_textrel): Removed.
2278 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
2279 with _bfd_elf_maybe_set_textrel.
2280 * elf32-lm32.c (maybe_set_textrel): Removed.
2281 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
2282 with _bfd_elf_maybe_set_textrel.
2283 * elf32-m32r.c (maybe_set_textrel): Removed.
2284 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
2285 with _bfd_elf_maybe_set_textrel.
2286 * elf32-metag.c (maybe_set_textrel): Removed.
2287 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
2288 with _bfd_elf_maybe_set_textrel.
2289 * elf32-nds32.c (maybe_set_textrel): Removed.
2290 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
2291 with _bfd_elf_maybe_set_textrel.
2292 * elf32-or1k.c (maybe_set_textrel): Removed.
2293 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
2294 with _bfd_elf_maybe_set_textrel.
2295 * elf32-ppc.c (maybe_set_textrel): Removed.
2296 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
2297 with _bfd_elf_maybe_set_textrel.
2298 * elf32-s390.c (maybe_set_textrel): Removed.
2299 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
2300 with _bfd_elf_maybe_set_textrel.
2301 * elf32-sh.c (maybe_set_textrel): Removed.
2302 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
2303 with _bfd_elf_maybe_set_textrel.
2304 * elf32-tic6x.c (maybe_set_textrel): Removed.
2305 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
2306 with _bfd_elf_maybe_set_textrel.
2307 * elf32-tilepro.c (maybe_set_textrel): Removed.
2308 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
2309 with _bfd_elf_maybe_set_textrel.
2310 * elf64-ppc.c (maybe_set_textrel): Removed.
2311 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
2312 with _bfd_elf_maybe_set_textrel.
2313 * elf64-s390.c (maybe_set_textrel): Removed.
2314 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
2315 with _bfd_elf_maybe_set_textrel.
2316 * elfnn-aarch64.c (maybe_set_textrel): Removed.
2317 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
2318 with _bfd_elf_maybe_set_textrel.
2319 * elfnn-riscv.c (maybe_set_textrel): Removed.
2320 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
2321 with _bfd_elf_maybe_set_textrel.
2322 * elfxx-sparc.c (maybe_set_textrel): Removed.
2323 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
2324 with _bfd_elf_maybe_set_textrel.
2325 * elfxx-tilegx.c (maybe_set_textrel): Removed.
2326 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
2327 with _bfd_elf_maybe_set_textrel.
2328 * elfxx-x86.c (maybe_set_textrel): Removed.
2329 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
2330 with _bfd_elf_maybe_set_textrel.
2331 * elflink.c (_bfd_elf_maybe_set_textrel): New.
2333 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2336 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
2338 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
2339 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
2340 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
2341 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
2343 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
2344 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
2345 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
2346 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2347 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
2348 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
2349 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2350 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
2351 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
2352 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2353 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
2354 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2355 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
2356 (elf_backend_copy_indirect_symbol): Likewise.
2357 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
2358 (elf_backend_copy_indirect_symbol): Likewise.
2359 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
2361 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2364 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
2365 * elf32-arm.c (readonly_dynrelocs): Removed.
2366 (maybe_set_textrel): Replace readonly_dynrelocs with
2367 _bfd_elf_readonly_dynrelocs.
2368 * elf32-csky.c (readonly_dynrelocs): Removed.
2369 (maybe_set_textrel): Replace readonly_dynrelocs with
2370 _bfd_elf_readonly_dynrelocs.
2371 * elf32-hppa.c(readonly_dynrelocs): Removed.
2372 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2373 _bfd_elf_readonly_dynrelocs.
2374 (maybe_set_textrel): Likewise.
2375 * elf32-lm32.c (readonly_dynrelocs): Removed.
2376 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2377 with _bfd_elf_readonly_dynrelocs.
2378 (maybe_set_textrel): Likewise.
2379 * elf32-m32r.c (readonly_dynrelocs): Removed.
2380 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2381 with _bfd_elf_readonly_dynrelocs.
2382 (maybe_set_textrel): Likewise.
2383 * elf32-metag.c (readonly_dynrelocs): Removed.
2384 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
2385 with _bfd_elf_readonly_dynrelocs.
2386 (maybe_set_textrel): Likewise.
2387 * elf32-microblaze.c (readonly_dynrelocs): Removed.
2388 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2389 with _bfd_elf_readonly_dynrelocs.
2390 * elf32-nds32.c (readonly_dynrelocs): Removed.
2391 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2392 with _bfd_elf_readonly_dynrelocs.
2393 (maybe_set_textrel): Likewise.
2394 * elf32-or1k.c (readonly_dynrelocs): Removed.
2395 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2396 with _bfd_elf_readonly_dynrelocs.
2397 * elf32-ppc.c (readonly_dynrelocs): Removed.
2398 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2399 _bfd_elf_readonly_dynrelocs.
2400 (ppc_elf_adjust_dynamic_symbol): Likewise.
2401 (maybe_set_textrel): Likewise.
2402 * elf32-s390.c (readonly_dynrelocs): Removed.
2403 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2404 with _bfd_elf_readonly_dynrelocs.
2405 (maybe_set_textrel): Likewise.
2406 * elf32-sh.c (readonly_dynrelocs): Removed.
2407 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
2408 _bfd_elf_readonly_dynrelocs.
2409 (maybe_set_textrel): Likewise.
2410 * elf32-tic6x.c (readonly_dynrelocs): Removed.
2411 (maybe_set_textrel): Replace readonly_dynrelocs with
2412 _bfd_elf_readonly_dynrelocs.
2413 * elf32-tilepro.c (readonly_dynrelocs): Removed.
2414 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2415 with _bfd_elf_readonly_dynrelocs.
2416 (maybe_set_textrel): Likewise.
2417 * elf64-ppc.c (readonly_dynrelocs): Removed.
2418 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2419 _bfd_elf_readonly_dynrelocs.
2420 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2421 (maybe_set_textrel): Likewise.
2422 * elf64-s390.c (readonly_dynrelocs): Removed.
2423 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2424 with _bfd_elf_readonly_dynrelocs.
2425 (maybe_set_textrel): Likewise.
2426 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
2427 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
2428 (maybe_set_textrel): Replace readonly_dynrelocs with
2429 _bfd_elf_readonly_dynrelocs.
2430 * elfnn-riscv.c (readonly_dynrelocs): Removed.
2431 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2432 with _bfd_elf_readonly_dynrelocs.
2433 (maybe_set_textrel): Likewise.
2434 * elfxx-sparc.c (readonly_dynrelocs): Removed.
2435 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
2436 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
2437 (maybe_set_textrel): Likewise.
2438 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
2439 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2440 with _bfd_elf_readonly_dynrelocs.
2441 (maybe_set_textrel): Likewise.
2442 * elfxx-x86.c (readonly_dynrelocs): Removed.
2443 (maybe_set_textrel): Replace readonly_dynrelocs with
2444 _bfd_elf_readonly_dynrelocs.
2445 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
2447 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2449 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
2450 -fsanitize=undefined.
2452 2020-06-03 Alan Modra <amodra@gmail.com>
2456 * peicode.h (pe_ILF_make_a_section): Align data for compilers
2458 (pe_ILF_build_a_bfd): Likewise.
2460 2020-06-03 Alan Modra <amodra@gmail.com>
2463 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
2464 core files as well as objects.
2466 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
2469 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
2470 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
2472 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
2473 (elf_arc_link_hash_newfunc): Updated.
2474 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
2475 (elf32_arm_link_hash_newfunc): Updated.
2476 (elf32_arm_copy_indirect_symbol): Likewise.
2477 (elf32_arm_check_relocs): Likewise.
2478 (readonly_dynrelocs): Likewise.
2479 (allocate_dynrelocs_for_symbol): Likewise.
2480 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
2481 (csky_elf_link_hash_newfunc): Updated.
2482 (csky_allocate_dynrelocs): Likewise.
2483 (readonly_dynrelocs): Likewise.
2484 (csky_elf_copy_indirect_symbol): Likewise.
2485 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
2486 (hppa_link_hash_newfunc): Updated.
2487 (elf32_hppa_copy_indirect_symbol): Likewise.
2488 (elf32_hppa_hide_symbol): Likewise.
2489 (elf32_hppa_adjust_dynamic_symbol): Likewise.
2490 (allocate_dynrelocs): Likewise.
2491 (elf32_hppa_relocate_section): Likewise.
2492 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2493 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
2494 (lm32_elf_link_hash_newfunc): Likewise.
2495 (lm32_elf_link_hash_table_create): Updated.
2496 (readonly_dynrelocs): Likewise.
2497 (allocate_dynrelocs): Likewise.
2498 (lm32_elf_copy_indirect_symbol): Likewise.
2499 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
2500 (m32r_elf_link_hash_newfunc): Likewise.
2501 (m32r_elf_link_hash_table_create): Updated.
2502 (m32r_elf_copy_indirect_symbol): Likewise.
2503 (allocate_dynrelocs): Likewise.
2504 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
2505 (metag_link_hash_newfunc): Updated.
2506 (elf_metag_copy_indirect_symbol): Likewise.
2507 (readonly_dynrelocs): Likewise.
2508 (allocate_dynrelocs): Likewise.
2509 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
2511 (link_hash_newfunc): Updated.
2512 (microblaze_elf_check_relocs): Likewise.
2513 (microblaze_elf_copy_indirect_symbol): Likewise.
2514 (readonly_dynrelocs): Likewise.
2515 (allocate_dynrelocs): Likewise.
2516 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
2517 (nds32_elf_link_hash_newfunc): Updated.
2518 (nds32_elf_copy_indirect_symbol): Likewise.
2519 (readonly_dynrelocs): Likewise.
2520 (allocate_dynrelocs): Likewise.
2521 (nds32_elf_check_relocs): Likewise.
2522 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
2523 (link_hash_newfunc): Updated.
2524 (nios2_elf32_copy_indirect_symbol): Likewise.
2525 (nios2_elf32_check_relocs): Likewise.
2526 (allocate_dynrelocs): Likewise.
2527 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
2528 (or1k_elf_link_hash_newfunc): Updated.
2529 (readonly_dynrelocs): Likewise.
2530 (allocate_dynrelocs): Likewise.
2531 (or1k_elf_copy_indirect_symbol): Likewise.
2532 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
2533 (ppc_elf_link_hash_newfunc): Updated.
2534 (ppc_elf_copy_indirect_symbol): Likewise.
2535 (ppc_elf_check_relocs): Likewise.
2536 (readonly_dynrelocs): Likewise.
2537 (ppc_elf_adjust_dynamic_symbol): Likewise.
2538 (allocate_dynrelocs): Likewise.
2539 (ppc_elf_relocate_section): Likewise.
2540 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2541 (link_hash_newfunc): Updated.
2542 (elf_s390_copy_indirect_symbol): Likewise.
2543 (readonly_dynrelocs): Likewise.
2544 (elf_s390_adjust_dynamic_symbol): Likewise.
2545 (allocate_dynrelocs): Likewise.
2546 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
2547 (sh_elf_link_hash_newfunc): Updated.
2548 (readonly_dynrelocs): Likewise.
2549 (allocate_dynrelocs): Likewise.
2550 (sh_elf_copy_indirect_symbol): Likewise.
2551 (sh_elf_check_relocs): Likewise.
2552 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
2553 (elf32_tic6x_link_hash_newfunc): Likewise.
2554 (elf32_tic6x_link_hash_table_create): Updated.
2555 (readonly_dynrelocs): Likewise.
2556 (elf32_tic6x_check_relocs): Likewise.
2557 (elf32_tic6x_allocate_dynrelocs): Likewise.
2558 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
2560 (link_hash_newfunc): Updated.
2561 (tilepro_elf_copy_indirect_symbol): Likewise.
2562 (tilepro_elf_check_relocs): Likewise.
2563 (allocate_dynrelocs): Likewise.
2564 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
2565 (ppc64_elf_copy_indirect_symbol): Updated.
2566 (ppc64_elf_check_relocs): Likewise.
2567 (readonly_dynrelocs): Likewise.
2568 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2569 (dec_dynrel_count): Likewise.
2570 (allocate_dynrelocs): Likewise.
2571 (ppc64_elf_relocate_section): Likewise.
2572 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2573 (link_hash_newfunc): Updated.
2574 (elf_s390_copy_indirect_symbol): Likewise.
2575 (readonly_dynrelocs): Likewise.
2576 (allocate_dynrelocs): Likewise.
2577 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2578 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
2580 (elfNN_aarch64_link_hash_newfunc): Updated.
2581 (elfNN_aarch64_copy_indirect_symbol): Likewise.
2582 (readonly_dynrelocs): Likewise.
2583 (need_copy_relocation_p): Likewise.
2584 (elfNN_aarch64_allocate_dynrelocs): Likewise.
2585 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
2586 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
2587 (link_hash_newfunc): Updated.
2588 (riscv_elf_copy_indirect_symbol): Likewise.
2589 (riscv_elf_check_relocs): Likewise.
2590 (readonly_dynrelocs): Likewise.
2591 (allocate_dynrelocs): Likewise.
2592 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
2594 (link_hash_newfunc): Updated.
2595 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2596 (_bfd_sparc_elf_check_relocs): Likewise.
2597 (readonly_dynrelocs): Likewise.
2598 (allocate_dynrelocs): Likewise.
2599 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
2600 (link_hash_newfunc): Updated.
2601 (tilegx_elf_copy_indirect_symbol): Likewise.
2602 (tilegx_elf_check_relocs): Likewise.
2603 (readonly_dynrelocs): Likewise.
2604 (allocate_dynrelocs): Likewise.
2605 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
2606 (readonly_dynrelocs): Likewise.
2607 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2608 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
2610 2020-06-01 Alan Modra <amodra@gmail.com>
2612 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
2613 command against cmd_length, not the end of record. For
2614 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
2615 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
2618 2020-05-28 David Faust <david.faust@oracle.com>
2620 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
2621 R_BPF_INSN_{32,64} relocations.
2623 2020-05-28 Stephen Casner <casner@acm.org>
2625 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
2626 addreses in .long (used in testsuites) and .stab values.
2628 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
2631 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
2632 Check bfd_link_dll when issue a DT_TEXTREL warning.
2633 * elfxx-x86.c (maybe_set_textrel): Likewise.
2634 (_bfd_x86_elf_size_dynamic_sections): Likewise.
2636 2020-05-26 Nick Clifton <nickc@redhat.com>
2638 * plugin.c (try_load_plugin): Extend error message when a plugin
2641 2020-05-23 Alan Modra <amodra@gmail.com>
2643 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
2645 2020-05-22 Alan Modra <amodra@gmail.com>
2648 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
2649 attributes from shared libraries, and do not return an error if
2652 2020-05-21 Alan Modra <amodra@gmail.com>
2655 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
2657 (_bfd_delete_bfd): Free the copy.
2658 (_bfd_new_bfd): Free nbfd->memory on error.
2660 2020-05-21 Alan Modra <amodra@gmail.com>
2662 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
2663 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
2664 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
2665 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
2666 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
2667 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
2668 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
2669 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
2670 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
2671 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
2672 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
2673 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
2674 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
2675 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
2676 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
2677 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
2678 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
2679 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
2680 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
2681 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
2683 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
2685 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
2686 get_default_version. It is used to find the default version for
2687 the specific extension.
2688 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
2689 default_major_version and default_minor_version. Add new bfd_boolean
2690 parameter *use_default_version. Set it to TRUE if we need to call
2691 the callback rps->get_default_version to find the default version.
2692 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
2693 the default version in riscv_parsing_subset_version, and then call
2694 riscv_add_subset to add the subset into subset list.
2695 (riscv_parse_prefixed_ext): Likewise.
2696 (riscv_std_z_ext_strtab): Support Zicsr extensions.
2697 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
2698 strings rather than characters.
2699 riscv_merge_arch_attr_info): The callback function get_default_version
2700 is only needed for assembler, so set it to NULL int the linker.
2701 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
2702 * elfxx-riscv.h: Updated.
2704 2020-05-20 Alan Modra <amodra@gmail.com>
2707 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
2708 use bfd_set_filename.
2709 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
2710 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
2711 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
2712 (bfd_create): Likewise.
2713 (_bfd_delete_bfd): Don't free filename.
2714 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
2715 return pointer to the copy or NULL on alloc fail.
2716 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
2717 result of bfd_set_filename.
2718 * bfd-in2.h: Regenerate.
2720 2020-05-20 Alan Modra <amodra@gmail.com>
2723 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
2724 section size against file size.
2725 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
2727 2020-05-19 Gunther Nikl <gnikl@justmail.de>
2730 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
2731 and memset when allocating memory for the sections_being_created
2734 2020-05-19 Stafford Horne <shorne@gmail.com>
2736 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
2738 (or1k_elf_relocate_section): Access srelgot via
2739 htab->root.srelgot. Add assertions for srelgot->contents.
2740 Introduce local variable for srelgot to not reuse global
2742 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
2743 (or1k_set_got_and_rela_sizes): New function.
2744 (or1k_initial_exec_offset): New function.
2745 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
2746 (or1k_elf_relocate_section): Allow for TLS to handle multiple
2748 (or1k_elf_check_relocs): Use OR to set TLS access.
2749 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
2751 (or1k_elf_size_dynamic_sections): Use
2752 or1k_set_got_and_rela_sizes to set sizes.
2753 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
2754 (TCB_SIZE): New macro.
2755 (tpoff): Use TCB_SIZE and alignment to calculate offset.
2756 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
2757 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
2758 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
2759 (tpoff): Add dynamic boolean argument.
2760 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
2762 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
2764 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
2765 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
2766 cases with BFD_RELOC_AARCH64_JUMP26.
2767 (elfNN_aarch64_check_relocs): Likewise.
2769 2020-05-19 Alan Modra <amodra@gmail.com>
2771 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
2772 bfd_get_filename rather than accessing bfd->filename directly.
2773 * aout-target.h (MY (object_p)): Likewise.
2774 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2775 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
2776 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
2777 (_bfd_archive_bsd44_construct_extended_name_table),
2778 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
2779 (_bfd_bsd_write_armap): Likewise.
2780 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
2781 * cache.c (bfd_open_file): Likewise.
2782 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
2783 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
2784 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2785 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2786 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
2787 * elf32-nds32.c (nds32_elf_output_symbol_hook),
2788 (patch_tls_desc_to_ie): Likewise.
2789 * elf32-spu.c (sort_bfds, print_one_overlay_section),
2790 (spu_elf_auto_overlay): Likewise.
2791 * elf64-hppa.c (elf_hppa_final_link): Likewise.
2792 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
2793 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
2794 * elflink.c (bfd_elf_size_dynamic_sections),
2795 (elf_link_input_bfd): Likewise.
2796 * linker.c (_bfd_generic_link_output_symbols): Likewise.
2797 * mach-o.c (bfd_mach_o_follow_dsym),
2798 (bfd_mach_o_close_and_cleanup): Likewise.
2799 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
2800 (find_separate_debug_file, get_build_id_name): Likewise.
2801 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2802 * plugin.c (bfd_plugin_open_input): Likewise.
2803 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
2804 * som.c (som_write_armap): Likewise.
2805 * srec.c (srec_write_record, srec_write_symbols): Likewise.
2806 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
2807 (_bfd_vms_lib_write_archive_contents): Likewise.
2808 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2810 2020-05-19 Alan Modra <amodra@gmail.com>
2813 * bfdio.c (_bfd_real_fopen): Typo fix.
2815 2020-05-18 Nick Clifton <nickc@redhat.com>
2818 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
2819 for the sections_being_created array.
2821 2020-05-18 Alan Modra <amodra@gmail.com>
2823 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
2824 they can be freed without also freeing internal_relocs.
2826 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2829 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
2830 separators into DOS style when creating a WIN32 fullpath.
2832 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
2834 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
2835 to initialize RISC-V tdata.
2837 2020-05-12 Gunther Nikl <gnikl@justmail.de>
2839 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
2842 2020-05-11 Alan Modra <amodra@gmail.com>
2844 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
2846 2020-05-11 Alan Modra <amodra@gmail.com>
2848 * elf64-ppc.c: Rename powerxx to power10 throughout.
2850 2020-05-11 Alan Modra <amodra@gmail.com>
2853 * coffgen.c (coff_get_normalized_symtab): Check that buffer
2854 contains required number of auxents before processing any auxent.
2855 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
2856 file name from auxents for PE.
2858 2020-05-04 Gunther Nikl <gnikl@justmail.de>
2860 * aout-cris.c (DEFAULT_ARCH): Delete define.
2861 (MY_set_arch_mach): Likewise.
2862 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
2864 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
2865 of r_type before the shift.
2867 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
2870 * elfnn-aarch64.c (group_sections): Copy implementation from
2873 2020-05-01 Alan Modra <amodra@gmail.com>
2876 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
2877 accessing root.u.def of symbols. Also check root.u.def.section
2878 is non-NULL. Reverse tests so as to make the logic positive.
2880 2020-05-01 Alan Modra <amodra@gmail.com>
2883 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
2884 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
2886 2020-05-01 Alan Modra <amodra@gmail.com>
2889 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
2890 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2891 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2892 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
2893 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
2894 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
2895 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
2896 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
2897 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
2898 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2900 2020-05-01 Alan Modra <amodra@gmail.com>
2903 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
2904 from shared libraries.
2906 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
2908 * elf32-xtensa.c (relax_section): Don't negate diff_value for
2909 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
2910 equals 0. Report overflow when the result has negative sign but
2911 all significant bits are zero.
2913 2020-04-29 Gunther Nikl <gnikl@justmail.de>
2915 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
2916 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2918 2020-04-28 Alan Modra <amodra@gmail.com>
2920 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
2921 Emit warning message.
2923 2020-04-27 Tamar Christina <tamar.christina@arm.com>
2925 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
2926 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
2927 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
2928 to x86_64_pe_big_vec as it not a big-endian format.
2929 (vec i386_pe_big_vec): New.
2930 * configure.ac: Likewise.
2931 * targets.c: Likewise.
2932 * configure: Regenerate.
2933 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
2934 COFF_WITH_PE_BIGOBJ): New.
2935 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
2937 (x86_64_pe_be_vec): Moved.
2939 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
2941 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
2942 * elf.c (elfcore_grok_arc_v2): New function.
2943 (elfcore_grok_note): Call the new function to handle the corresponding
2945 (elfcore_write_arc_v2): New function.
2946 (elfcore_write_register_note): Call the new function to handle the
2947 corresponding pseudo-sections.
2949 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
2952 * bfd-in2.h: Regenerated.
2953 * elf32-xtensa.c (elf_howto_table): New entries for
2954 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
2955 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
2956 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
2957 R_XTENSA_NDIFF{8,16,32}.
2958 * libbfd.h (bfd_reloc_code_real_names): Add names for
2959 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
2960 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2961 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
2962 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2964 2020-04-21 Tamar Christina <tamar.christina@arm.com>
2967 * compress.c (bfd_get_full_section_contents): Exclude sections with no
2970 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2973 * elf-bfd.h (elf_backend_data): Add
2974 elf_backend_strip_zero_sized_dynamic_sections.
2975 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
2976 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
2978 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
2980 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
2982 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
2984 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2986 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
2988 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
2990 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2992 2020-04-21 Nick Clifton <nickc@redhat.com>
2994 * po/sr.po: Updated Serbian translation.
2996 2020-04-21 Alan Modra <amodra@gmail.com>
2998 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
3001 2020-04-20 Stephen Casner <casner@acm.org>
3003 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
3004 causing globals from linker script to be treated as debug symbols.
3005 (translate_symbol_table): Don't sign-extend symbol values from 16
3006 to 64 bits in nm output.
3008 2020-04-20 Alan Modra <amodra@gmail.com>
3010 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
3012 2020-04-18 Alan Modra <amodra@gmail.com>
3014 * section.c (bfd_is_const_section): Correct test for special
3016 * bfd-in2.h: Regenerate.
3018 2020-04-17 Alan Modra <amodra@gmail.com>
3021 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
3024 2020-04-16 Nick Clifton <nickc@redhat.com>
3027 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
3028 abort with a more helpful error message.
3030 2020-04-16 Alan Modra <amodra@gmail.com>
3033 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
3036 2020-04-15 Fangrui Song <maskray@google.com>
3039 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
3040 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
3041 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
3042 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
3043 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
3044 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
3045 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3046 * elf32-sh.c (sh_elf_relocate_section): Likewise.
3047 * elf32-spu.c (spu_elf_relocate_section): Likewise.
3048 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
3049 * elflink.c (elf_link_output_extsym): Likewise.
3050 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
3052 2020-04-15 Alan Modra <amodra@gmail.com>
3055 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
3056 pointer into strings that may be freed for section name, always
3057 allocate a new string.
3059 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3060 Jan W. Jagersma <jwjagersma@gmail.com>
3062 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
3063 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
3064 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
3065 (_bfd_go32_mkobject): New functions.
3066 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
3067 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
3068 (go32exe_mkobject): Call _bfd_go32_mkobject.
3069 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
3070 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
3072 (coff_write_relocs): Enable extended reloc counter code if
3073 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
3074 (coff_write_object_contents): Likewise. Pad section headers
3075 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
3076 instead of coff_swap_scnhdr_out.
3077 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
3078 enable extended reloc counter.
3079 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
3080 Declare with ATTRIBUTE_UNUSED.
3081 * libcoff-in.h: (struct coff_tdata): New field go32.
3083 * libcoff.h: Regenerate.
3085 2020-04-14 Fangrui Song <maskray@google.com>
3088 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
3091 2020-04-14 Stephen Casner <casner@acm.org>
3094 * pdp11.c: Add implementation of --imagic option.
3095 (adjust_o_magic): Fix objcopy --extract-symbol test.
3096 * libaout.h (enum aout_magic): Add i_magic.
3098 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3099 Nick Clifton <nickc@redhat.com>
3101 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
3103 <default>: Error rather than abort.
3105 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
3108 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
3109 relocation section from section group.
3111 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
3113 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
3114 bfd->origin to file offset.
3115 * bfdwin.c (bfd_get_file_window): Likewise.
3116 * bfd.c: Clarify the use of the bfd->origin field.
3117 * bfd-in2.h: Regenerate.
3118 * coff-i386.c: Don't include go32exe.h. Allow overriding
3119 coff_write_object_contents via COFF_WRITE_CONTENTS.
3120 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
3121 (go32exe_write_object_contents): New functions.
3122 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
3123 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
3124 (create_go32_stub): Remove check for 2k size limit. Read stub
3125 from go32exe_temp_stub if present.
3126 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
3127 copy variable-length stub.
3128 (go32_check_format): Read stub to go32exe_temp_stub, set
3129 origin, return go32exe_cleanup.
3130 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
3131 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
3132 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
3133 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
3134 Remove functions and their associated #defines.
3135 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
3136 * libcoff-in.h: (struct coff_tdata): New field stub_size.
3137 Rename field go32stub to stub.
3138 * libcoff.h: Regenerate.
3139 * coff-stgo32.c (go32_check_format): Rename to...
3140 (go32exe_check_format): ...this.
3141 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
3142 (go32exe_copy_private_bfd_data): ...this.
3143 (stub_bytes): Rename to...
3144 (go32exe_default_stub): ...this.
3145 (create_go32_stub): Rename to...
3146 (go32exe_create_stub): ...this.
3147 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
3150 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
3154 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
3155 relocation to R_386_32 for relocation against non-preemptible
3157 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
3158 allocate dynamic relocation for non-preemptible absolute symbol.
3159 (elf_i386_relocate_section): Pass sec to
3160 GENERATE_DYNAMIC_RELOCATION_P.
3161 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
3162 (elf_x86_64_convert_load_reloc): Covert load relocation to
3163 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
3164 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
3165 for non-preemptible absolute symbol if they overflow.
3166 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
3167 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
3168 symbol. Don't allocate dynamic relocation for non-preemptible
3170 (elf_x86_64_relocate_section): Don't generate relative relocation
3171 for GOTPCREL relocations aganst local absolute symbol. Pass sec
3172 to GENERATE_DYNAMIC_RELOCATION_P.
3173 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
3174 against non-preemptible absolute symbol.
3175 (_bfd_elf_x86_valid_reloc_p): New function.
3176 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
3178 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
3179 argument. Don't generate dynamic relocation against
3180 non-preemptible absolute symbol.
3181 (ABS_SYMBOL_P): New.
3182 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
3183 against non-preemptible absolute symbol.
3185 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
3186 (_bfd_elf_x86_valid_reloc_p): New.
3188 2020-04-01 Tamar Christina <tamar.christina@arm.com>
3191 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
3192 address in the GOT if in thumb only mode.
3194 2020-04-01 Tamar Christina <tamar.christina@arm.com>
3196 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
3198 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
3200 * mmo.c (mmo_scan): Create .text section only when needed, not
3203 2020-03-31 Alan Modra <amodra@gmail.com>
3205 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
3208 2020-03-31 Alan Modra <amodra@gmail.com>
3210 * vms-alpha.c (image_write): Check bounds for sections without
3211 contents too. Error on non-zero write to section without
3213 (_bfd_vms_slurp_etir): Check return of image_write* functions.
3215 2020-03-31 Alan Modra <amodra@gmail.com>
3217 * tekhex.c (pass_over): Check is_eof before reading buffer.
3219 2020-03-30 Nick Clifton <nickc@redhat.com>
3222 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
3223 field to timestamp and make it an integer.
3224 * libcoff.h: Regenerate.
3225 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
3226 field in the pe_data structure rather than the insert_timestamp
3229 2020-03-30 Alan Modra <amodra@gmail.com>
3232 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
3235 2020-03-26 Nick Clifton <nickc@redhat.com>
3237 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
3238 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
3240 * libbfd.h: Regenerate.
3242 2020-03-26 Alan Modra <amodra@gmail.com>
3244 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
3246 2020-03-26 Alan Modra <amodra@gmail.com>
3248 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
3250 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
3252 2020-03-25 Nick Clifton <nickc@redhat.com>
3254 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
3256 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
3257 * libbfd.h: Regenerate.
3259 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
3261 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
3262 correct field name in the output string.
3264 2020-03-25 Alan Modra <amodra@gmail.com>
3267 * elf.c (assign_file_positions_for_load_sections): Adjust offset
3268 for SHT_NOBITS section if first in segment.
3270 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3273 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
3274 (_bfd_elf_get_symbol_version_string): This.
3275 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
3276 (_bfd_elf_get_symbol_version_string): This.
3277 (bfd_elf_print_symbol): Pass TRUE to
3278 _bfd_elf_get_symbol_version_string.
3279 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
3280 bfd_boolean argument.
3281 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
3282 * targets.c (_bfd_get_symbol_version_string): Likewise.
3283 (bfd_get_symbol_version_string): Likewise.
3284 * bfd-in2.h: Regenerated.
3286 2020-03-24 Nick Clifton <nickc@redhat.com>
3287 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
3290 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
3293 2020-03-24 Nick Clifton <nickc@redhat.com>
3296 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
3297 segment to use for PT_GNU_RELRO, ignore empty sections in a
3298 segment's current list.
3300 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3303 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
3305 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3308 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
3309 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
3310 on the previous _bfd_elf_get_symbol_version_string.
3311 (_bfd_elf_get_symbol_version_string): Use it.
3313 2020-03-24 Alan Modra <amodra@gmail.com>
3315 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
3316 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
3319 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
3321 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
3323 2020-03-23 Alan Modra <amodra@gmail.com>
3325 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
3326 symbol count. Allocate an extra byte to ensure name strings
3327 are terminated. Sanity check name offsets. Release memory on
3330 2020-03-23 Alan Modra <amodra@gmail.com>
3332 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
3333 field hasn't been read. Remove unnecessary casts.
3335 2020-03-22 Alan Modra <amodra@gmail.com>
3337 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
3338 enough to read number of symbols.
3340 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
3342 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
3343 (EXECUTABLE_SUFFIX): Likewise.
3344 * config.in: Regenerated.
3345 * configure: Likewise.
3346 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
3347 _bfd_generic_close_and_cleanup.
3348 (plugin_list_entry): Remove resolution_file, resolution_option,
3349 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
3350 lto_wrapper, gcc_env and initialized,
3351 (need_lto_wrapper_p): Removed.
3352 (get_lto_wrapper): Likewise.
3353 (setup_lto_wrapper_env): Likewise.
3354 (register_all_symbols_read): Likewise.
3355 (egister_cleanup): Likewise.
3356 (get_symbols): Likewise.
3357 (add_input_file): Likewise.
3358 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
3359 (add_symbols): Updated.
3360 (try_claim): Likewise.
3361 (try_load_plugin): Likewise.
3362 (bfd_plugin_canonicalize_symtab): Likewise.
3363 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
3364 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
3366 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
3369 * plugin.c (plugin_list_entry): Add has_symbol_type.
3370 (add_symbols_v2): New function.
3371 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
3372 provides symbol type.
3373 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
3374 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
3377 2020-03-20 Alan Modra <amodra@gmail.com>
3379 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
3380 enough to read number of symbols.
3382 2020-03-20 Alan Modra <amodra@gmail.com>
3384 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
3385 backend functions for NULL before calling.
3386 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
3387 (bfd_section_from_shdr, assign_section_numbers): Likewise.
3388 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
3389 * elfnn-ia64.c (ignore_errors): New function.
3390 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
3392 2020-03-19 Nick Clifton <nickc@redhat.com>
3395 * dwarf2.c (struct varinfo): Add unit_offset field to record the
3396 location of the varinfo in the unit's debug info data. Change the
3397 type of the stack field to a boolean.
3398 (lookup_var_by_offset): New function. Returns the varinfo
3399 structure for the variable described at the given offset in the
3401 (scan_unit_for_symbols): Add support for variables which have the
3402 DW_AT_specification attribute.
3404 2020-03-19 Nick Clifton <nickc@redhat.com>
3407 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
3410 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
3412 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
3414 2020-03-18 Nick Clifton <nickc@redhat.com>
3417 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
3418 memory access when processing a corrupt secondary reloc section.
3420 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
3422 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
3423 instead of calling abort.
3424 * elf32-csky.c (csky_build_one_stub): Likewise.
3425 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3426 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3427 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3428 * elf32-metag.c (metag_build_one_stub): Likewise.
3429 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3430 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3431 (ppc_size_one_stub): Likewise.
3432 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3434 2020-03-17 Nick Clifton <nickc@redhat.com>
3437 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
3438 with error messages.
3440 2020-03-17 Nick Clifton <nickc@redhat.com>
3443 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
3444 free. Add free on another failure path.
3446 2020-03-16 Alan Modra <amodra@gmail.com>
3449 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
3450 we have a non-zero section count. Do lma comparison in octets.
3452 2020-03-16 Alan Modra <amodra@gmail.com>
3454 * vms-alpha.c (dst_restore_location): Validate index into
3455 dst_ptr_offsets array before accessing. Return status.
3456 (dst_retrieve_location): Similarly, making "loc" parameter a
3457 pointer to return value.
3458 (_bfd_vms_slurp_etir): Update calls to above functions.
3460 2020-03-14 Kamil Rytarowski <n54@gmx.com>
3462 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
3464 * configure: Regenerated.
3466 2020-03-14 Alan Modra <amodra@gmail.com>
3468 * section.c (BFD_FAKE_SECTIONS): Formatting.
3469 * bfd-in2.h: Regenerate.
3471 2020-03-13 Kamil Rytarowski <n54@gmx.com>
3473 * elf.c (elfcore_grok_netbsd_note): Add support for
3474 NT_NETBSDCORE_LWPSTATUS notes.
3476 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
3478 * bfd-in2.h: Regenerate.
3479 * section.c (asection): Add already_assigned field.
3480 (BFD_FAKE_SECTION): Add default initializer for it.
3481 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
3482 * elf32-arm.c (arm_build_one_stub): Add support for
3483 non_contiguous_regions.
3484 * elf32-csky.c (csky_build_one_stub): Likewise.
3485 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3486 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3487 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3488 * elf32-metag.c (metag_build_one_stub): Likewise.
3489 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3490 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3491 (ppc_size_one_stub): Likewise.
3492 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3493 * elflink.c (elf_link_input_bfd): Likewise.
3495 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
3498 * elf-linker-x86.h (elf_linker_x86_params): Add
3499 static_before_all_inputs and has_dynamic_linker.
3500 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
3501 dynamic input objects if -static is passed at command-line
3502 before all input files without --dynamic-linker unless
3503 --no-dynamic-linker is used.
3505 2020-03-13 Kamil Rytarowski <n54@gmx.com>
3507 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
3509 2020-03-13 Christian Eggers <ceggers@gmx.de>
3511 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
3512 "p_paddr" from "at".
3513 * elfcode.h (bfd_from_remote_memory): Add units to several
3514 parameters. New local "opb". Fix usage of p_align. Fix
3515 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
3516 call of target_read_memory.
3517 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
3518 calculation of "offset" and "output_offset".
3519 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
3520 from "offset" and fix calculation of "end" from "vma+size". Fix
3521 comparison between "sh_addr" and "vma"/"output_offset".
3522 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
3523 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
3525 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
3526 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
3527 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
3528 assignment of p_paddr from phdr_lma. Fix comparison between
3529 "lma+size" and "next->lma".
3530 (elf_sort_segments): Fix assignment from p_paddr to lma.
3531 (assign_file_positions_for_load_sections): Add unit (bytes) to
3532 local "align". Fix calculation of local "off_adjust". Fix
3533 calculation of local "filehdr_vaddr".
3534 (assign_file_positions_for_non_load_sections): New local "opb".
3535 Fix calculation of "end" from "p_size". Fix comparison between
3536 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
3537 from "end" and "p_vaddr".
3538 (rewrite_elf_program_header): Fix comparison between p_vaddr and
3539 vma. Fix assignment to p_paddr from lma. Fix comparison between
3540 p_paddr and lma. Fix assignment to p_paddr from lma.
3541 * merge.c (sec_merge_emit): New local "opb". Convert
3542 "alignment_power" to octets.
3543 (_bfd_add_merge_section): New locals "alignment_power" and
3544 "opb". Fix comparison between "alignment_power" and
3546 (_bfd_merge_sections): New local "opb". Divide size by opb
3547 before checking align mask.
3549 2020-03-13 Christian Eggers <ceggers@gmx.de>
3551 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
3552 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
3554 (_bfd_elf_make_section_from_phdr): Similarly.
3555 (elf_fake_sections): Fix calculation of
3556 Elf_Internal_shdr::sh_addr from section VMA.
3557 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
3559 (assign_file_positions_for_load_sections): Fix calculations of
3560 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
3561 comparison between program header address and section LMA.
3562 (assign_file_positions_for_non_load_sections): Likewise.
3563 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
3564 (IS_CONTAINED_BY_VMA): Add parameter opb.
3565 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
3566 INCLUDE_SECTION_IN_SEGMENT): Likewise.
3567 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
3568 Fix calculations of p_addr_valid and p_vaddr_offset.
3569 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
3570 with octets per byte when comparing against p_vaddr.
3572 2020-03-11 Alan Modra <amodra@gmail.com>
3574 * som.c (setup_sections): Sanity check subspace.name.
3576 2020-03-11 Alan Modra <amodra@gmail.com>
3578 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
3580 2020-03-10 Alan Modra <amodra@gmail.com>
3583 * ihex.c (ihex_write_object_contents): Don't assume ordering of
3586 2020-03-09 Alan Modra <amodra@gmail.com>
3588 * wasm-module.c (wasm_scan): Sanity check file name length
3589 before allocating memory. Move common section setup code. Do
3590 without bfd_tell to calculate section size.
3592 2020-03-06 Nick Clifton <nickc@redhat.com>
3594 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
3595 with error messages and failure return values.
3597 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
3599 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
3600 relocation sections for any removed reference to a dynamic symbol.
3602 2020-03-05 Nick Clifton <nickc@redhat.com>
3604 * elf-bfd.h (struct elf_backend_data): Add new fields:
3605 init_secondary_reloc_section, slurp_secondary_reloc_section,
3606 write_secondary_reloc_section.
3607 (_bfd_elf_init_secondary_reloc_section): Prototype.
3608 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
3609 (_bfd_elf_write_secondary_reloc_section): Prototype.
3610 * elf.c ( bfd_section_from_shdr): Invoke the new
3611 init_secondary_reloc_section backend function, if defined, when a
3612 second reloc section is encountered.
3613 (swap_out_syms): Invoke the new symbol_section_index function, if
3614 defined, when computing the section index of an OS/PROC specific
3616 (_bfd_elf_init_secondary_reloc_section): New function.
3617 (_bfd_elf_slurp_secondary_reloc_section): New function.
3618 (_bfd_elf_write_secondary_reloc_section): New function.
3619 (_bfd_elf_copy_special_section_fields): New function.
3620 * elfcode.h (elf_write_relocs): Invoke the new
3621 write_secondary_relocs function, if defined, in order to emit
3623 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
3624 function, if defined, in order to read in secondary relocs.
3625 * elfxx-target.h (elf_backend_copy_special_section_fields):
3626 Provide a non-NULL default definition.
3627 (elf_backend_init_secondary_reloc_section): Likewise.
3628 (elf_backend_slurp_secondary_reloc_section): Likewise.
3629 (elf_backend_write_secondary_reloc_section): Likewise.
3630 (struct elf_backend_data elfNN_bed): Add initialisers for the new
3632 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
3633 * configure: Regenerate.
3635 2020-03-05 Alan Modra <amodra@gmail.com>
3637 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
3638 against file size before allocating memory. Use bfd_alloc rather
3639 than bfd_zalloc for carsym/strings memory.
3641 2020-03-04 Alan Modra <amodra@gmail.com>
3643 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
3644 sh_addr mod sh_addalign is zero.
3646 2020-03-04 Alan Modra <amodra@gmail.com>
3648 * format.c (bfd_check_format_matches): Call cleanup on error exit.
3650 2020-03-03 Alan Modra <amodra@gmail.com>
3652 * format.c (struct bfd_preserve): Add cleanup field.
3653 (bfd_preserve_save): Add cleanup param and save.
3654 (bfd_preserve_restore): Return cleanup.
3655 (bfd_preserve_finish): Call the cleanup for the discarded match.
3656 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
3657 and clear when preserving a match. Restore cleanup too when
3658 restoring that match.
3660 2020-03-02 Alan Modra <amodra@gmail.com>
3662 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
3663 * hpux-core.c (hpux_core_core_file_p): Update prototype.
3664 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
3665 (core_sco5_vec): Correct initialisers.
3667 2020-03-02 Alan Modra <amodra@gmail.com>
3669 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
3670 * aix5ppc-core.c (xcoff64_core_p): Likewise.
3671 * cisco-core.c (cisco_core_file_validate): Likewise.
3672 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
3673 * hpux-core.c (hpux_core_core_file_p): Likewise.
3674 * irix-core.c (irix_core_core_file_p): Likewise.
3675 * lynx-core.c (lynx_core_file_p): Likewise.
3676 * netbsd-core.c (netbsd_core_file_p): Likewise.
3677 * osf-core.c (osf_core_core_file_p): Likewise.
3678 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3679 * sco5-core.c (sco5_core_file_p): Likewise.
3681 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
3683 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
3685 2020-03-02 Alan Modra <amodra@gmail.com>
3687 * targets.c (bfd_cleanup): New typedef.
3688 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
3689 * libbfd-in.h (_bfd_no_cleanup): Define.
3690 * format.c (bfd_reinit): Add cleanup parameter, call it.
3691 (bfd_check_format_matches): Set cleanup from _bfd_check_format
3692 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
3693 * aout-target.h (callback, object_p): Return bfd_cleanup.
3694 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
3695 * archive.c (bfd_generic_archive_p): Likewise.
3696 * binary.c (binary_object_p): Likewise.
3697 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
3698 * coff-ia64.c (ia64coff_object_p): Likewise.
3699 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
3700 * coff-sh.c (coff_small_object_p): Likewise.
3701 * coff-stgo32.c (go32_check_format): Likewise.
3702 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
3703 (xcoff64_core_p): Likewise.
3704 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
3705 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
3706 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
3707 * elfcode.h (elf_object_p): Likewise.
3708 * elfcore.h (elf_core_file_p): Likewise.
3709 * i386msdos.c (msdos_object_p): Likewise.
3710 * ihex.c (ihex_object_p): Likewise.
3711 * libaout.h (some_aout_object_p): Likewise.
3712 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
3713 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
3714 * libbfd.c (_bfd_dummy_target): Likewise.
3715 * libcoff-in.h (coff_object_p): Likewise.
3716 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
3717 (bfd_mach_o_arm64_core_p): Likewise.
3718 * mach-o-arm.c (bfd_mach_o_arm_object_p),
3719 (bfd_mach_o_arm_core_p): Likewise.
3720 * mach-o-i386.c (bfd_mach_o_i386_object_p),
3721 (bfd_mach_o_i386_core_p): Likewise.
3722 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
3723 (bfd_mach_o_x86_64_core_p): Likewise.
3724 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
3725 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
3726 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
3727 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
3728 * mmo.c (mmo_object_p): Likewise.
3729 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
3730 * peicode.h (coff_real_object_p, pe_ILF_object_p),
3731 (pe_bfd_object_p): Likewise.
3732 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
3733 * ppcboot.c (ppcboot_object_p): Likewise.
3734 * rs6000-core.c (rs6000coff_core_p): Likewise.
3735 * som.c (som_object_setup, som_object_p): Likewise.
3736 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
3737 * tekhex.c (tekhex_object_p): Likewise.
3738 * vms-alpha.c (alpha_vms_object_p): Likewise.
3739 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
3740 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
3741 * wasm-module.c (wasm_object_p): Likewise.
3742 * xsym.c (bfd_sym_object_p): Likewise.
3743 * xsym.h (bfd_sym_object_p): Likewise.
3744 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
3746 * pdp11.c (some_aout_object_p): Likewise.
3747 * plugin.c (register_ld_plugin_object_p): Update object_p
3749 * plugin.h (register_ld_plugin_object_p): Likewise.
3750 * bfd-in2.h: Regenerate.
3751 * libbfd.h: Regenerate.
3752 * libcoff.h: Regenerate.
3754 2020-03-02 Alan Modra <amodra@gmail.com>
3756 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
3757 applicable section flags.
3758 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
3759 (mips_ecoff_bele_vec): Likewise.
3760 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
3762 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
3763 (_bfd_ecoff_styp_to_sec_flags): Likewise.
3765 2020-03-02 Alan Modra <amodra@gmail.com>
3767 * elf32-m32r.c (m32r_elf_section_flags): New function.
3768 (elf_backend_section_flags): Define.
3769 * elf32-nds32.c (nds32_elf_section_flags): New function.
3770 (elf_backend_section_flags): Define.
3771 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
3772 .sbss and .sdata sections.
3773 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
3774 for SHF_V850_GPREL sections.
3775 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
3777 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
3778 for SHF_PARISC_SHORT sections.
3779 * elf64-ppc.c (ppc64_elf_section_flags): New function.
3780 (elf_backend_section_flags): Define.
3781 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
3782 for SHF_MIPS_GPREL sections. Delete FIXME.
3784 2020-03-02 Alan Modra <amodra@gmail.com>
3786 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
3787 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
3788 calling elf_backend_section_flags with adjusted params. Use
3789 newsect->flags past that point.
3790 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
3792 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
3793 to have their type overridden, and all sh_flags but processor and
3795 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
3796 * elf32-mep.c (mep_elf_section_flags): Likewise.
3797 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
3798 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
3799 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
3800 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
3801 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
3802 stub BFD and non-aarch64 input files when scanning for stubs.
3804 2020-03-02 Alan Modra <amodra@gmail.com>
3806 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
3807 limit to decompressed element size.
3809 2020-03-02 Alan Modra <amodra@gmail.com>
3811 * vms-lib.c (vms_traverse_index): Add recur_count param and
3812 update calls. Fail on excessive recursion.
3814 2020-03-02 Alan Modra <amodra@gmail.com>
3816 * vms-alpha.c (vms_get_remaining_object_record): Use
3817 bfd_realloc_or_free rather than bfd_realloc.
3818 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
3819 (dst_define_location, parse_module): Likewise, and check realloc
3820 return status before using memory. Return status from function
3821 adjusting all callers.
3823 2020-02-28 Alan Modra <amodra@gmail.com>
3825 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
3827 2020-02-28 Alan Modra <amodra@gmail.com>
3829 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
3830 Remove duplicate undersize check.
3832 2020-02-27 Alan Modra <amodra@gmail.com>
3835 * mmo.c (mmo_scan): Set SEC_DATA for .data.
3837 2020-02-27 Alan Modra <amodra@gmail.com>
3840 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
3841 (coff_section_type): Adjust comment.
3842 (decode_section_type): Likewise. Call coff_section_type before
3843 decode_section_type.
3844 (bfd_decode_symclass): Use 'c' for common sections other than
3847 2020-02-27 Alan Modra <amodra@gmail.com>
3849 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
3852 2020-02-27 Alan Modra <amodra@gmail.com>
3854 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
3855 if file is an archive element.
3856 * bfd-in2.h: Regenerate.
3858 2020-02-26 Alan Modra <amodra@gmail.com>
3860 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
3861 bfd_set_error on failing test. Don't bother changing bfd_error on
3862 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
3863 Check sym name is within string buffer. Use size_t for some vars.
3864 (do_slurp_coff_armap): Use size_t for some variables, fix size of
3865 int_buf. Don't change bfd_error on file read error. Use
3866 _bfd_mul_overflow when calculating carsym buffer size. Reorder
3867 calculations to catch overflows before they occur. malloc and
3868 free raw armap rather than using bfd_alloc. Read raw armap before
3869 allocating carsym+strings buffer.
3870 (_bfd_slurp_extended_name_table): Localize variables. Check
3871 name size against file size.
3873 2020-02-26 Alan Modra <amodra@gmail.com>
3875 * vms-lib.c (vms_lib_read_index): Release correct buffer.
3877 2020-02-26 Alan Modra <amodra@gmail.com>
3879 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
3880 malloc. Check for NULL return from bfd_malloc.
3881 (rx_table_find, rx_table_map): Likewise.
3882 (rx_set_section_contents): Check bfd_alloc return.
3883 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
3885 2020-02-26 Alan Modra <amodra@gmail.com>
3887 * aoutx.h: Indent labels correctly. Format error strings.
3888 * archive.c: Likewise.
3889 * archive64.c: Likewise.
3890 * coff-arm.c: Likewise.
3891 * coff-rs6000.c: Likewise.
3892 * coff-stgo32.c: Likewise.
3893 * cpu-arm.c: Likewise.
3894 * dwarf2.c: Likewise.
3895 * elf-ifunc.c: Likewise.
3896 * elf-properties.c: Likewise.
3897 * elf-s390-common.c: Likewise.
3898 * elf-strtab.c: Likewise.
3900 * elf32-arm.c: Likewise.
3901 * elf32-bfin.c: Likewise.
3902 * elf32-cr16.c: Likewise.
3903 * elf32-csky.c: Likewise.
3904 * elf32-i386.c: Likewise.
3905 * elf32-m68k.c: Likewise.
3906 * elf32-msp430.c: Likewise.
3907 * elf32-nds32.c: Likewise.
3908 * elf32-nios2.c: Likewise.
3909 * elf32-pru.c: Likewise.
3910 * elf32-xtensa.c: Likewise.
3911 * elf64-ia64-vms.c: Likewise.
3912 * elf64-x86-64.c: Likewise.
3913 * elfcode.h: Likewise.
3914 * elfcore.h: Likewise.
3915 * elflink.c: Likewise.
3916 * elfnn-aarch64.c: Likewise.
3917 * elfnn-ia64.c: Likewise.
3918 * elfnn-riscv.c: Likewise.
3919 * elfxx-mips.c: Likewise.
3920 * elfxx-sparc.c: Likewise.
3921 * elfxx-x86.c: Likewise.
3922 * i386lynx.c: Likewise.
3923 * merge.c: Likewise.
3924 * pdp11.c: Likewise.
3925 * plugin.c: Likewise.
3926 * reloc.c: Likewise.
3928 2020-02-26 Alan Modra <amodra@gmail.com>
3931 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
3933 (bfd_elf_add_dt_needed_tag): Declare.
3934 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
3935 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
3936 from elf_add_dt_needed_tag. Remove soname and doit param.
3937 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
3938 to see whether as-needed lib is already loaded, use dyn_loaded
3939 list instead. When saving and restoring around as-needed lib
3940 handle possibility that dynstr has not been initialised. Don't
3941 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
3942 Mark libs loaded via DT_NEEDED entries of other libs with
3943 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
3945 (elf_link_check_versioned_symbol): Remove now unneccesary
3946 DYNAMIC check when traversing dyn_loaded list.
3948 2020-02-26 Alan Modra <amodra@gmail.com>
3950 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
3952 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
3955 * plugin.c (need_lto_wrapper_p): New.
3956 (bfd_plugin_set_program_name): Add an int argument to set
3958 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
3960 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
3962 2020-02-24 Alan Modra <amodra@gmail.com>
3964 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
3966 2020-02-24 Alan Modra <amodra@gmail.com>
3968 * vms-lib.c (struct carsym_mem): Add limit.
3969 (vms_add_index): Heed limit.
3970 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
3971 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
3972 Always return actual number read.
3973 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
3974 assertion with error exit.
3976 2020-02-22 Alan Modra <amodra@gmail.com>
3979 * elf.c (assign_file_positions_for_load_sections): Continue linking
3980 on "PHDR segment not covered by LOAD segment" errors.
3982 2020-02-21 Alan Modra <amodra@gmail.com>
3984 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
3986 (bfd_mach_o_canonicalize_reloc): Likewise.
3987 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
3988 counts and offsets against file size.
3989 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
3990 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
3991 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
3992 against file size. Delete symbol table error message.
3993 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
3995 (bfd_mach_o_read_symtab): Likewise.
3996 (bfd_mach_o_read_command): Pass file size.
3997 (bfd_mach_o_scan): Sanity check command count against file size.
3999 2020-02-21 Alan Modra <amodra@gmail.com>
4002 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
4003 "text", "data" and "bss" section pointer vars. Don't update
4004 section size, just exec header sizes.
4005 (adjust_sizes_and_vmas): Don't update text section size. Set
4006 initial exec header a_text. Print exec headers sizes.
4007 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
4008 (adjust_sizes_and_vmas): Similarly. Formatting.
4009 (final_link): Correct final file extension.
4011 2020-02-20 Nick Clifton <nickc@redhat.com>
4013 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
4015 * elfxx-target.h (elf_backend_symbol_section_index): Provide
4017 (elfNN_bed): Initialise the symbol_section_index field.
4018 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
4019 OS and PROC specific section indicies. Warn if converting other
4020 reserved incidies to SHN_ABS.
4022 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
4025 * cpu-z80.c: Add machine type compatibility checking.
4027 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
4030 * plugin.c (plugin_list_entry): Remove handle.
4031 (try_load_plugin): Call dlclose before return.
4033 2020-02-19 Alan Modra <amodra@gmail.com>
4035 * libbfd-in.h (_bfd_constant_p): Define.
4036 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
4037 file size before allocating memory.
4038 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
4039 * elf.c (bfd_elf_get_str_section): Likewise.
4040 (_bfd_elf_slurp_version_tables): Likewise.
4041 * libbfd.h: Regenerate.
4043 2020-02-19 Alan Modra <amodra@gmail.com>
4045 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
4046 * aoutx.h (aout_get_external_symbols): Replace calls to
4047 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
4048 (slurp_reloc_table): Likewise.
4049 * archive.c (do_slurp_bsd_armap): Likewise.
4050 (do_slurp_coff_armap): Likewise.
4051 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
4052 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
4053 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
4054 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
4055 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
4056 (_bfd_coff_get_external_symbols): Likewise.
4057 * ecoff.c (ecoff_slurp_symbolic_header),
4058 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
4059 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
4060 (ecoff_indirect_link_order): Likewise.
4061 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
4062 (_bfd_elf_slurp_version_tables): Likewise.
4063 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
4064 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
4065 * elf32-rx.c (elf32_rx_relax_section): Likewise.
4066 * elf64-alpha.c (READ): Likewise.
4067 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
4068 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
4069 * elfcode.h (elf_slurp_symbol_table),
4070 (elf_slurp_reloc_table_from_section): Likewise.
4071 * elflink.c (elf_link_add_object_symbols),
4072 (elf_link_check_versioned_symbol): Likewise.
4073 * elfxx-mips.c (READ): Likewise.
4074 * i386lynx.c (slurp_reloc_table): Likewise.
4075 * lynx-core.c (lynx_core_file_p): Likewise.
4076 * mach-o.c (bfd_mach_o_canonicalize_relocs),
4077 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
4078 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
4079 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
4080 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
4081 (bfd_pef_parse_symbols): Likewise.
4082 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
4083 * som.c (setup_sections, som_slurp_string_table),
4084 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
4085 (som_bfd_fill_in_ar_symbols): Likewise.
4086 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
4087 (evax_bfd_print_image): Likewise.
4088 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
4089 * wasm-module.c (wasm_scan): Likewise.
4090 * xcofflink.c (xcoff_link_add_symbols): Likewise.
4091 * xsym.c (bfd_sym_read_name_table),
4092 (bfd_sym_print_type_information_table_entry): Likewise.
4093 * libbfd.h: Regenerate.
4095 2020-02-19 Alan Modra <amodra@gmail.com>
4097 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
4098 reading external relocs.
4099 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
4100 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
4102 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
4104 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
4105 (m32c_elf_relax_section): Likewise.
4106 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
4107 (rl78_elf_relax_section): Likewise.
4108 * elf32-rx.c (rx_offset_for_reloc): Likewise.
4109 (elf32_rx_relax_section): Likewise.
4110 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
4111 parameter types and use..
4112 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
4113 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
4114 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
4115 being read from file, just the extra.
4116 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
4117 after reading external syms. Free on failure.
4119 2020-02-19 Alan Modra <amodra@gmail.com>
4121 * coffcode.h (buy_and_read, coff_slurp_line_table),
4122 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
4123 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
4124 corresponding bfd_alloc call. Adjust variables to suit.
4125 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
4126 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
4127 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
4128 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
4129 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
4130 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
4131 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
4132 * elf32-rx.c (elf32_rx_relax_section): Likewise.
4133 * elf64-alpha.c (READ): Likewise.
4134 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
4135 (elf_slurp_symbol_table, elf_slurp_reloc_table),
4136 (bfd_from_remote_memory): Likewise.
4137 * elfcore.h (core_find_build_id): Likewise.
4138 * elfxx-mips.c (READ): Likewise.
4139 * mach-o.c (bfd_mach_o_mangle_sections),
4140 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
4141 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
4142 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
4143 * som.c (setup_sections, som_prep_for_fixups)
4144 (som_build_and_write_symbol_table, som_slurp_symbol_table),
4145 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
4146 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
4147 (som_bfd_ar_write_symbol_stuff): Likewise.
4148 * vms-alpha.c (vector_grow1): Likewise.
4149 * vms-lib.c (vms_add_index): Likewise.
4150 * wasm-module.c (wasm_scan_name_function_section): Likewise.
4151 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
4152 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
4153 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
4154 (bfd_alloc2, bfd_zalloc2): Delete.
4155 (_bfd_mul_overflow): Define.
4156 * libbfd.h: Regenerate.
4158 2020-02-19 Alan Modra <amodra@gmail.com>
4160 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
4162 (assign_section_numbers): Likewise.
4163 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
4164 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
4165 bfd_malloc2, size_t amt, and unsigned tls_count.
4166 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
4167 * elflink.c (elf_create_symbuf): Use bfd_malloc.
4168 (elf_output_implib): Use bfd_alloc.
4170 2020-02-19 Alan Modra <amodra@gmail.com>
4172 * bfd.c (struct bfd): Move format and direction to other
4173 bitfields. Add "size".
4174 * bfdio.c (bfd_get_size): Cache size when not writing file.
4175 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
4176 returning zero, ie. unknown.
4177 (bfd_get_alt_debug_link_info): Likewise.
4178 * bfd-in2.h: Regenerate.
4180 2020-02-19 Alan Modra <amodra@gmail.com>
4182 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
4183 bfd_get_file_size twice.
4184 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
4185 zero, ie. unknown, return.
4186 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
4187 * elfcode.h (elf_swap_shdr_in): Likewise.
4188 (elf_object_p): Don't call bfd_get_file_size twice and correct
4191 2020-02-19 Alan Modra <amodra@gmail.com>
4193 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
4194 FALSE if memory alloc fails. Adjust calls.
4195 * som.c (som_prep_for_fixups): Likewise.
4196 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
4197 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
4198 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
4199 * som.c (som_build_and_write_symbol_table): Return via error_return
4201 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
4202 (VEC_APPEND_EL): Delete.
4203 (vector_grow1): Return pointer to element. Catch overflow.
4204 Return NULL on memory allocation failure.
4205 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
4206 (alpha_vms_add_fixup_ca): Likewise.
4207 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
4209 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
4211 2020-02-19 Alan Modra <amodra@gmail.com>
4213 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
4214 * aout-target.h (object_p): Likewise.
4215 * aout-tic30.c (tic30_aout_object_p): Likewise.
4216 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
4217 (emit_stringtab, write_syms, link_hash_table_create),
4218 (aout_link_write_other_symbol): Likewise.
4219 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
4220 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
4221 (_bfd_compute_and_write_armap): Likewise.
4222 * archures.c (bfd_arch_list): Likewise.
4223 * bfd.c (bfd_record_phdr): Likewise.
4224 * binary.c (binary_canonicalize_symtab): Likewise.
4225 * cisco-core.c (cisco_core_file_validate): Likewise.
4226 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
4227 (find_arm_glue, record_arm_to_thumb_glue),
4228 (record_thumb_to_arm_glue): Likewise.
4229 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
4230 (ppc_allocate_toc_section): Likewise.
4231 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
4232 * coff-sh.c (sh_relax_section): Likewise.
4233 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
4234 * coffcode.h (handle_COMDAT, coff_new_section_hook),
4235 (coff_set_alignment_hook, coff_mkobject),
4236 (coff_compute_section_file_positions): Likewise.
4237 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
4238 (coff_find_nearest_line_with_names),
4239 ( bfd_coff_set_symbol_class): Likewise.
4240 * cofflink.c (_bfd_coff_link_hash_table_create),
4241 (_bfd_coff_link_input_bfd): Likewise.
4242 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
4243 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
4244 (build_line_info_table, sort_line_sequences),
4245 (line_info_add_include_dir, line_info_add_file_name),
4246 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
4247 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
4248 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
4249 (_bfd_ecoff_find_nearest_line),
4250 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
4251 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
4252 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
4253 * elf-m10300.c (mn10300_elf_relax_section),
4254 (elf32_mn10300_link_hash_table_create): Likewise.
4255 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
4256 * elf.c (make_mapping, copy_elf_program_header): Likewise.
4257 * elf32-arm.c (elf32_arm_link_hash_table_create),
4258 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
4259 (elf32_arm_new_section_hook): Likewise.
4260 * elf32-avr.c (elf_avr_new_section_hook),
4261 (elf32_avr_link_hash_table_create, get_local_syms),
4262 (elf32_avr_setup_section_lists): Likewise.
4263 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
4264 (bfin_link_hash_table_create): Likewise.
4265 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
4266 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
4267 * elf32-csky.c (csky_elf_link_hash_table_create),
4268 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
4269 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
4270 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
4271 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
4272 * elf32-i386.c (elf_i386_check_relocs): Likewise.
4273 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
4274 * elf32-m32r.c (m32r_elf_link_hash_table_create),
4275 (m32r_elf_check_relocs): Likewise.
4276 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
4277 (elf32_m68hc11_setup_section_lists),
4278 (elf32_m68hc11_size_stubs): Likewise.
4279 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
4280 * elf32-metag.c (elf_metag_link_hash_table_create),
4281 (elf_metag_setup_section_lists): Likewise.
4282 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
4283 (microblaze_elf_check_relocs): Likewise.
4284 * elf32-nds32.c (nds32_elf_link_hash_table_create),
4285 (nds32_elf_check_relocs): Likewise.
4286 * elf32-nios2.c (nios2_elf32_setup_section_lists),
4287 (get_local_syms, nios2_elf32_check_relocs),
4288 (nios2_elf32_link_hash_table_create): Likewise.
4289 * elf32-or1k.c (or1k_elf_link_hash_table_create),
4290 (or1k_elf_check_relocs): Likewise.
4291 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
4292 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
4293 * elf32-s390.c (elf_s390_link_hash_table_create),
4294 (elf_s390_check_relocs): Likewise.
4295 * elf32-score.c (score_elf_create_got_section),
4296 (s3_elf32_score_new_section_hook),
4297 (elf32_score_link_hash_table_create): Likewise.
4298 * elf32-score7.c (score_elf_create_got_section),
4299 (s7_elf32_score_new_section_hook): Likewise.
4300 * elf32-sh.c (sh_elf_link_hash_table_create),
4301 (sh_elf_check_relocs): Likewise.
4302 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
4303 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
4304 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
4305 (tilepro_elf_check_relocs): Likewise.
4306 * elf32-v850.c (remember_hi16s_reloc): Likewise.
4307 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
4308 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
4309 (elf_xtensa_new_section_hook): Likewise.
4310 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
4311 (get_got_entry, elf64_alpha_check_relocs): Likewise.
4312 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
4313 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
4314 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
4315 * elf64-ppc.c (ppc64_elf_new_section_hook),
4316 (ppc64_elf_link_hash_table_create, update_local_sym_info),
4317 (update_plt_info, ppc64_elf_check_relocs): Likewise.
4318 * elf64-s390.c (elf_s390_link_hash_table_create),
4319 (elf_s390_check_relocs): Likewise.
4320 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
4321 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
4322 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
4323 (elf_link_add_archive_symbols, compute_bucket_count),
4324 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
4325 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
4326 (bfd_elf_final_link): Likewise.
4327 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
4328 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
4329 (elfNN_aarch64_new_section_hook): Likewise.
4330 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
4331 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
4332 (riscv_elf_check_relocs): Likewise.
4333 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
4334 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
4335 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
4336 (_bfd_mips_elf_link_hash_table_create): Likewise.
4337 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
4338 (_bfd_sparc_elf_check_relocs),
4339 (_bfd_sparc_elf_new_section_hook): Likewise.
4340 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
4341 (tilegx_elf_check_relocs): Likewise.
4342 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
4343 * format.c (bfd_check_format_matches): Likewise.
4344 * hash.c (_bfd_stringtab_init): Likewise.
4345 * ihex.c (ihex_scan): Likewise.
4346 * irix-core.c (irix_core_core_file_p): Likewise.
4347 * linker.c (bfd_wrapped_link_hash_lookup),
4348 (_bfd_generic_link_hash_table_create),
4349 (_bfd_generic_reloc_link_order): Likewise.
4350 * lynx-core.c (lynx_core_file_p): Likewise.
4351 * netbsd-core.c (netbsd_core_file_p): Likewise.
4352 * osf-core.c (osf_core_core_file_p): Likewise.
4353 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
4354 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
4355 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
4356 * peicode.h (pe_mkobject): Likewise.
4357 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
4358 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
4359 * sco5-core.c (read_uarea): Likewise.
4360 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
4361 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
4362 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
4363 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
4364 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
4365 * srec.c (srec_scan): Likewise.
4366 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
4367 * targets.c (bfd_target_list): Likewise.
4368 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
4369 * trad-core.c (trad_unix_core_file_p): Likewise.
4370 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
4371 (vms_new_section_hook): Likewise.
4372 * wasm-module.c (wasm_make_empty_symbol): Likewise.
4373 * xcofflink.c (xcoff_get_section_contents),
4374 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
4375 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
4376 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
4378 2020-02-19 Alan Modra <amodra@gmail.com>
4380 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
4382 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
4384 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
4385 and use it if it isn't NULL. Remove has_plugin_p argument. Add
4386 a build_list_p argument. Don't search plugin_list. Short circuit
4387 when building the plugin list.
4388 (has_plugin): Renamed to has_plugin_list.
4389 (bfd_plugin_set_plugin): Don't set has_plugin.
4390 (bfd_plugin_specified_p): Check plugin_list instead.
4391 (build_plugin_list): New function.
4392 (load_plugin): Call build_plugin_list and use plugin_list.
4394 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4397 * plugin.c (try_claim): Always clean up for LTO wrapper.
4398 (try_load_plugin): Treat each object as independent. Create a
4399 copy for plugin name.
4401 2020-02-11 Nick Clifton <nickc@redhat.com>
4403 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
4404 for addresses in print statements.
4405 (msp430_elf_relax_delete_bytes): Likewise.
4406 (msp430_elf_relax_add_words): Likewise.
4407 (msp430_elf_relax_section): Likewise.
4409 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4411 * plugin.c (add_symbols): Clear plugin_data memory.
4413 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
4416 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
4417 (EXECUTABLE_SUFFIX): Likewise.
4418 * config.in: Regenerated.
4419 * configure: Likewise.
4420 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
4421 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
4422 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
4423 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
4424 (get_lto_wrapper): New.
4425 (setup_lto_wrapper_env): Likewise.
4426 (current_plugin): Likewise.
4427 (register_all_symbols_read): Likewise.
4428 (register_cleanup): Likewise.
4429 (get_symbols): Likewise.
4430 (add_input_file): Likewise.
4431 (bfd_plugin_close_and_cleanup): Likewise.
4432 (claim_file): Removed.
4433 (register_claim_file): Set current_plugin->claim_file.
4434 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
4435 lto_syms in current_plugin.
4436 (try_claim): Use current_plugin->claim_file. Call LTO plugin
4437 all_symbols_read handler. Copy real symbols to plugin_data.
4438 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
4439 (try_load_plugin): Don't reuse the previous plugin for LTO
4440 wrapper. Set up GCC LTO wrapper if possible. Don't set
4441 plugin_list_iter->claim_file.
4442 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
4444 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
4447 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4449 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
4450 check if previous instruction matches a conditional jump inserted
4451 earlier. Invert conditional jump and delete branch in this case.
4453 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4455 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
4456 msp430_elf_relax_add_words. Support insertion of either one or two
4458 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
4459 needs to be grown. Handle insertion of branch instruction to replace
4462 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4464 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
4465 debugging relocations.
4466 (msp430_elf_relax_delete_bytes): Likewise.
4467 (msp430_elf_relax_add_two_words): Likewise.
4468 (msp430_elf_relax_section): Likewise.
4470 2020-02-10 Alan Modra <amodra@gmail.com>
4472 * archures.c: Wrap overlong z80 comments.
4473 * bfd-in2.h: Regenerate.
4475 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
4478 * archures.c: Add GBZ80 and Z80N machine values.
4479 * reloc.c: Add BFD_RELOC_Z80_16_BE.
4480 * coff-z80.c: Add support for new reloc.
4481 * coffcode.h: Add support for new machine values.
4482 * cpu-z80.c: Add support for new machine names.
4483 * elf32-z80.c: Add support for new reloc.
4484 * bfd-in2.h: Regenerate.
4485 * libbfd.h: Regenerate.
4487 2020-02-07 Nick Clifton <nickc@redhat.com>
4490 * elf.c (rewrite_elf_program_header): Do not complain if no
4491 sections are mapped to a segment.
4493 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4496 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
4497 for garbage collection on __patchable_function_entries section
4498 without linked-to section.
4500 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4503 * bfd-in2.h: Regenerated.
4504 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
4505 on section if gc_mark of any of its linked-to sections is set
4506 and don't set gc_mark again.
4507 * section.c (asection): Add linked_to_symbol_name to map_head
4510 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
4512 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
4513 reporting an unrecognized instruction with R_V850_LONGJUMP.
4515 2020-02-05 Alan Modra <amodra@gmail.com>
4517 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
4519 2020-02-04 Alan Modra <amodra@gmail.com>
4521 * elf32-ppc.c (ppc_elf_relocate_section): After applying
4522 R_PPC_VLE_ADDR20, goto copy_reloc.
4524 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4526 * bfd-in2.h: Regenerated.
4527 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
4529 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4532 * bfd-in2.h: Regenerated.
4533 * ecoff.c (bfd_debug_section): Add section_id.
4534 * section.c (bfd_section): Add section_id.
4535 (SEC_ASSEMBLER_SECTION_ID): New.
4536 (BFD_FAKE_SECTION): Add section_id.
4538 2020-02-01 Nick Clifton <nickc@redhat.com>
4540 * config.bfd: Move the c30-aout and tic30-aout targets onto the
4543 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
4545 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
4546 encodings are relative to the GOT on nios2, too.
4548 2020-01-31 Alan Modra <amodra@gmail.com>
4550 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
4551 file. Use $< and $@ in rules.
4552 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
4553 (elf32-ia64.c, elf64-ia64.c): Likewise.
4554 (elf32-riscv.c, elf64-riscv.c): Likewise.
4555 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4556 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
4557 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
4558 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
4559 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4560 * Makefile.in: Regenerate.
4562 2020-01-31 Alan Modra <amodra@gmail.com>
4565 * elf.c (setup_group): Don't clear entire section contents,
4566 just the padding after group flags. Release alloc'd memory
4567 after a seek or read failure.
4569 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4571 * peXXigen.c (pe_is_repro): New function.
4572 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
4573 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
4575 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4577 * peXXigen.c (debug_type_names): Add names for new debug data type
4580 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4582 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
4583 inner loop. Fix a memory leak.
4585 2020-01-30 Alan Modra <amodra@gmail.com>
4587 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
4588 or obj_coff_keep_strings here.
4589 (coff_get_normalized_symtab): Free external syms directly.
4590 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
4593 2020-01-27 Jim Wilson <jimw@sifive.com>
4595 * cpu-riscv.c (riscv_scan): New.
4596 (N): Change bfd_default_scan to riscv_scan.
4598 2020-01-27 Andreas Schwab <schwab@suse.de>
4600 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
4601 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
4602 * Makefile.in: Regenerate.
4603 * cpu-plugin.c: Remove.
4604 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
4605 (bfd_plugin_arch): Remove declaration.
4606 * bfd-in2.h: Regenerate.
4607 * po/SRC-POTFILES.in: Regenerate.
4609 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
4610 Alan Modra <amodra@gmail.com>
4613 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
4615 2020-01-24 Jim Wilson <jimw@sifive.com>
4617 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
4618 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
4619 avoid over long line.
4621 2020-01-24 Nick Clifton <nickc@redhat.com>
4624 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
4625 syms and keep strings flags as these may have been set in order to
4626 prevent a bogus call to free.
4628 2020-01-23 Nick Clifton <nickc@redhat.com>
4630 * po/fr.po: Updated French translation.
4632 2020-01-23 Alan Modra <amodra@gmail.com>
4635 * elf.c (assign_file_positions_for_load_sections): Avoid divide
4636 by zero when p_align is zero.
4638 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
4640 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
4641 (riscv_prefix_cmp): Likewise.
4642 (riscv_non_std_ext_p): Deleted.
4643 (riscv_std_sv_ext_p): Likewise.
4644 (riscv_non_std_sv_ext_p): Likewise.
4645 (riscv_merge_non_std_and_sv_ext): Rename to...
4646 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
4647 (riscv_merge_arch_attr_info): Replace 3 calls to
4648 riscv_merge_non_std_and_sv_ext with single call to
4649 riscv_merge_multi_letter_ext.
4650 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
4651 encounter a 'z' prefix.
4652 (riscv_get_prefix_class): New function, return prefix class based
4653 on first few characters of input string.
4654 (riscv_parse_config): New structure to factor out minor differences
4655 in extension class parsing behaviour.
4656 (riscv_parse_sv_or_non_std_ext): Rename to...
4657 (riscv_parse_prefixed_ext): and parameterise with
4659 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
4660 (riscv_multi_letter_ext_valid_p): New.
4661 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
4662 (riscv_parse_subset): Delegate all non-single-letter parsing work
4663 to riscv_parse_prefixed_ext.
4664 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
4665 (riscv_get_prefix_class): Declare.
4667 2020-01-22 Alan Modra <amodra@gmail.com>
4669 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
4670 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
4671 __tls_get_addr_desc.
4672 (ppc64_elf_size_stubs): Add section for linker generated
4673 __tls_get_addr_desc wrapper function. Loop at least once if
4674 generating this function.
4675 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
4676 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
4678 2020-01-22 Alan Modra <amodra@gmail.com>
4680 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
4681 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
4683 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
4684 (STDU_R1_0R1, ADDI_R1_R1): Define.
4685 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
4686 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
4687 tga_desc_fd to opt_fd, and tga_desc to opt. Set
4688 no_tls_get_addr_regsave.
4689 (branch_reloc_hash_match): Add hash3 and hash4.
4690 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
4691 (ppc64_elf_size_dynamic_sections): Likewise.
4692 (ppc64_elf_relocate_section): Likewise.
4693 (plt_stub_size, build_plt_stub): Likewise. Size regsave
4694 __tls_get_addr stub.
4695 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
4697 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
4698 eh_frame for regsave __tls_get_addr.
4700 2020-01-22 Alan Modra <amodra@gmail.com>
4702 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
4703 which __tls_get_addr calls will be eliminated.
4705 2020-01-20 Nick Clifton <nickc@redhat.com>
4707 * po/pt.po: Updates Portuguese translation.
4708 * po/ru.po: Updated Russian translation.
4709 * po/uk.po: Updated Ukranian translation.
4711 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
4714 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
4715 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
4717 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
4718 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
4719 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
4720 "rex leal x@tlsdesc(%rip), %reg" to
4721 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
4722 "call *(%eax)" to "nopl (%rax)".
4724 2020-01-20 Alan Modra <amodra@gmail.com>
4726 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
4727 (MTLR_R11): Don't define.
4728 (LD_R0_0R3, CMPDI_R0_0): Define.
4729 (build_tls_get_addr_stub): Don't use r11 in stub.
4731 2020-01-20 Alan Modra <amodra@gmail.com>
4733 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
4734 (defined_sym_val, is_tls_get_addr): Likewise.
4736 2020-01-18 Nick Clifton <nickc@redhat.com>
4738 * version.m4 (BFD_VERSION): Set to 2.34.50.
4739 * configure: Regenerate.
4740 * po/bfd.pot: Regenerate.
4742 2020-01-18 Nick Clifton <nickc@redhat.com>
4744 Binutils 2.34 branch created.
4746 2020-01-17 Christian Biesinger <cbiesinger@google.com>
4748 * coff-arm.c: Fix spelling error (seperate).
4749 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
4751 * sysdep.h (strnlen): Fix spelling error (seperate).
4753 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
4756 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
4758 2020-01-15 Alan Modra <amodra@gmail.com>
4761 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
4762 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
4763 of function symbols unless dot symbols are present. Do warn
4764 whenever one is created, regardles of whether a PLT entry is
4765 also emitted for the function symbol.
4767 2020-01-14 Alan Modra <amodra@gmail.com>
4769 * som.c (som_bfd_count_ar_symbols): Error when file position
4770 of symbols on chains is not strictly increasing.
4772 2020-01-14 Alan Modra <amodra@gmail.com>
4774 * vms.h (VMS_DEBUG): Define as 0.
4775 * vms-alpha.c (image_write): Move debug output after bounds check.
4777 (_bfd_vms_slurp_eihd): Warning fix.
4778 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
4780 2020-01-13 Alan Modra <amodra@gmail.com>
4782 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
4783 for "ignored" records.
4785 2020-01-13 Alan Modra <amodra@gmail.com>
4787 * wasm-module.c (wasm_scan_name_function_section): Formatting.
4788 Delete asect name check. Move asect NULL check to wasm_object_p.
4789 Correct bounds check of sizes against end. Replace uses of
4790 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
4791 just one bfd_release.
4792 (wasm_scan): Don't use malloc/strdup for section names,
4793 bfd_alloc instead. Simplify code prefixing section name.
4794 Formatting. Don't attempt to free memory here..
4795 (wasm_object_p): ..do so here.
4797 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
4800 * elf32-arm.c (elf32_arm_final_link_relocate): Use
4801 UNDEFWEAK_NO_DYNAMIC_RELOC.
4802 (allocate_dynrelocs_for_symbol): Likewise.
4804 2020-01-10 Tamar Christina <tamar.christina@arm.com>
4807 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
4809 2020-01-10 Alan Modra <amodra@gmail.com>
4811 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
4813 2020-01-09 Nick Clifton <nickc@redhat.com>
4816 * bfd.c (bfd_convert_section_contents): Check for a compress
4817 header size that is larger than the actual section size.
4819 2020-01-08 Alan Modra <amodra@gmail.com>
4822 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
4823 after removing sections.
4825 2020-01-06 Jim Wilson <jimw@sifive.com>
4828 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
4829 check for !bfd_link_pic (info).
4830 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
4831 <R_RISCV_JAL>: Add comment.
4832 (_bfd_riscv_relax_section): For plt.offset check, add check for
4833 bfd_link_pic (info). Add comment.
4835 2020-01-06 Alan Modra <amodra@gmail.com>
4837 * format.c (bfd_check_format_matches): Ignore bfd_error on target
4838 match failures. Don't init to bfd_error_wrong_format before
4839 calling _bfd_check_format.
4841 2020-01-06 Alan Modra <amodra@gmail.com>
4843 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
4844 status rather than exiting on stack overflow or underflow.
4845 (_bfd_vms_slurp_etir): Adjust to suit.
4847 2020-01-06 Alan Modra <amodra@gmail.com>
4849 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
4851 2020-01-06 Alan Modra <amodra@gmail.com>
4853 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
4854 command. Check name offset is within command.
4855 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
4856 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
4857 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
4858 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
4859 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
4860 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
4861 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
4862 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
4863 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
4864 (bfd_mach_o_read_segment): Similarly.
4865 (bfd_mach_o_read_thread): Properly bound check thread struct.
4866 Don't repeat checks on second loop.
4867 (bfd_mach_o_read_command): Fail on invalid command length.
4869 2020-01-04 Alan Modra <amodra@gmail.com>
4871 * format.c (bfd_check_format_matches): Add preserve_match.
4872 Save initial bfd state in "preserve", matched bfd state in
4873 "preserve_match". Save just the first match. Release
4874 bfd_alloc memory. Restore and finish preserved state as
4875 appropriate on all function exit paths.
4877 2020-01-04 Alan Modra <amodra@gmail.com>
4879 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
4881 2020-01-04 Alan Modra <amodra@gmail.com>
4883 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
4886 2020-01-03 Nick Clifton <nickc@redhat.com>
4889 (bfd_pef_parse_function_stubs): Correct the test that ensures that
4890 there is enough data remaining in the code buffer before
4891 attempting to read a function stub.
4893 2020-01-03 Nick Clifton <nickc@redhat.com>
4896 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
4897 return value from bfd_malloc.
4898 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
4899 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
4900 (elf32_arm_filter_cmse_symbols): Likewise.
4901 (elf32_arm_write_section): Likewise.
4902 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
4903 (bfd_mach_o_follow_dsym): Likewise.
4904 * pef.c (bfd_pef_print_loader_section): Likewise.
4905 (bfd_pef_scan_start_address): Likewise.
4906 (bfd_pef_parse_function_stubs): Likewise.
4907 (bfd_pef_parse_symbols): Likewise.
4909 2020-01-03 Sergei Trofimovich <siarheit@google.com>
4911 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
4912 on binary inputs ld/PR25316.
4913 (is_ia64_elf): new helper to filter on ia64 objects.
4915 2020-01-03 Jan Beulich <jbeulich@suse.com>
4917 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
4919 (bfd_mach_o_scan): Insert underscore in two variable names.
4921 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
4923 * Makefile.am: Add z80-elf target support.
4924 * configure.ac: Likewise.
4925 * targets.c: Likewise.
4926 * Makefile.in: Regenerate.
4927 * configure: Regenerate.
4928 * config.bfd: Add z80-elf target support and new arches: ez80 and
4930 * elf32-z80.c: New file.
4931 * archures.c: Add new z80 architectures: eZ80 and Z180.
4932 * coffcode.h: Likewise.
4933 * cpu-z80.c: Likewise.
4934 * coff-z80.c: Add new relocations for Z80 target and local label
4936 * reloc.c: Add new relocs.
4937 * bfd-in2.h: Regenerate.
4938 * libbfd.h: Regenerate.
4940 2020-01-02 Tamar Christina <tamar.christina@arm.com>
4944 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
4946 2020-01-01 Alan Modra <amodra@gmail.com>
4948 Update year range in copyright notice of all files.
4950 For older changes see ChangeLog-2019
4952 Copyright (C) 2020 Free Software Foundation, Inc.
4954 Copying and distribution of this file, with or without modification,
4955 are permitted in any medium without royalty provided the copyright
4956 notice and this notice are preserved.
4962 version-control: never