1 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
4 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
5 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
7 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
8 (elf_arc_link_hash_newfunc): Updated.
9 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
10 (elf32_arm_link_hash_newfunc): Updated.
11 (elf32_arm_copy_indirect_symbol): Likewise.
12 (elf32_arm_check_relocs): Likewise.
13 (readonly_dynrelocs): Likewise.
14 (allocate_dynrelocs_for_symbol): Likewise.
15 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
16 (csky_elf_link_hash_newfunc): Updated.
17 (csky_allocate_dynrelocs): Likewise.
18 (readonly_dynrelocs): Likewise.
19 (csky_elf_copy_indirect_symbol): Likewise.
20 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
21 (hppa_link_hash_newfunc): Updated.
22 (elf32_hppa_copy_indirect_symbol): Likewise.
23 (elf32_hppa_hide_symbol): Likewise.
24 (elf32_hppa_adjust_dynamic_symbol): Likewise.
25 (allocate_dynrelocs): Likewise.
26 (elf32_hppa_relocate_section): Likewise.
27 * elf32-i386.c (elf_i386_check_relocs): Likewise.
28 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
29 (lm32_elf_link_hash_newfunc): Likewise.
30 (lm32_elf_link_hash_table_create): Updated.
31 (readonly_dynrelocs): Likewise.
32 (allocate_dynrelocs): Likewise.
33 (lm32_elf_copy_indirect_symbol): Likewise.
34 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
35 (m32r_elf_link_hash_newfunc): Likewise.
36 (m32r_elf_link_hash_table_create): Updated.
37 (m32r_elf_copy_indirect_symbol): Likewise.
38 (allocate_dynrelocs): Likewise.
39 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
40 (metag_link_hash_newfunc): Updated.
41 (elf_metag_copy_indirect_symbol): Likewise.
42 (readonly_dynrelocs): Likewise.
43 (allocate_dynrelocs): Likewise.
44 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
46 (link_hash_newfunc): Updated.
47 (microblaze_elf_check_relocs): Likewise.
48 (microblaze_elf_copy_indirect_symbol): Likewise.
49 (readonly_dynrelocs): Likewise.
50 (allocate_dynrelocs): Likewise.
51 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
52 (nds32_elf_link_hash_newfunc): Updated.
53 (nds32_elf_copy_indirect_symbol): Likewise.
54 (readonly_dynrelocs): Likewise.
55 (allocate_dynrelocs): Likewise.
56 (nds32_elf_check_relocs): Likewise.
57 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
58 (link_hash_newfunc): Updated.
59 (nios2_elf32_copy_indirect_symbol): Likewise.
60 (nios2_elf32_check_relocs): Likewise.
61 (allocate_dynrelocs): Likewise.
62 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
63 (or1k_elf_link_hash_newfunc): Updated.
64 (readonly_dynrelocs): Likewise.
65 (allocate_dynrelocs): Likewise.
66 (or1k_elf_copy_indirect_symbol): Likewise.
67 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
68 (ppc_elf_link_hash_newfunc): Updated.
69 (ppc_elf_copy_indirect_symbol): Likewise.
70 (ppc_elf_check_relocs): Likewise.
71 (readonly_dynrelocs): Likewise.
72 (ppc_elf_adjust_dynamic_symbol): Likewise.
73 (allocate_dynrelocs): Likewise.
74 (ppc_elf_relocate_section): Likewise.
75 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
76 (link_hash_newfunc): Updated.
77 (elf_s390_copy_indirect_symbol): Likewise.
78 (readonly_dynrelocs): Likewise.
79 (elf_s390_adjust_dynamic_symbol): Likewise.
80 (allocate_dynrelocs): Likewise.
81 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
82 (sh_elf_link_hash_newfunc): Updated.
83 (readonly_dynrelocs): Likewise.
84 (allocate_dynrelocs): Likewise.
85 (sh_elf_copy_indirect_symbol): Likewise.
86 (sh_elf_check_relocs): Likewise.
87 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
88 (elf32_tic6x_link_hash_newfunc): Likewise.
89 (elf32_tic6x_link_hash_table_create): Updated.
90 (readonly_dynrelocs): Likewise.
91 (elf32_tic6x_check_relocs): Likewise.
92 (elf32_tic6x_allocate_dynrelocs): Likewise.
93 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
95 (link_hash_newfunc): Updated.
96 (tilepro_elf_copy_indirect_symbol): Likewise.
97 (tilepro_elf_check_relocs): Likewise.
98 (allocate_dynrelocs): Likewise.
99 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
100 (ppc64_elf_copy_indirect_symbol): Updated.
101 (ppc64_elf_check_relocs): Likewise.
102 (readonly_dynrelocs): Likewise.
103 (ppc64_elf_adjust_dynamic_symbol): Likewise.
104 (dec_dynrel_count): Likewise.
105 (allocate_dynrelocs): Likewise.
106 (ppc64_elf_relocate_section): Likewise.
107 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
108 (link_hash_newfunc): Updated.
109 (elf_s390_copy_indirect_symbol): Likewise.
110 (readonly_dynrelocs): Likewise.
111 (allocate_dynrelocs): Likewise.
112 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
113 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
115 (elfNN_aarch64_link_hash_newfunc): Updated.
116 (elfNN_aarch64_copy_indirect_symbol): Likewise.
117 (readonly_dynrelocs): Likewise.
118 (need_copy_relocation_p): Likewise.
119 (elfNN_aarch64_allocate_dynrelocs): Likewise.
120 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
121 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
122 (link_hash_newfunc): Updated.
123 (riscv_elf_copy_indirect_symbol): Likewise.
124 (riscv_elf_check_relocs): Likewise.
125 (readonly_dynrelocs): Likewise.
126 (allocate_dynrelocs): Likewise.
127 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
129 (link_hash_newfunc): Updated.
130 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
131 (_bfd_sparc_elf_check_relocs): Likewise.
132 (readonly_dynrelocs): Likewise.
133 (allocate_dynrelocs): Likewise.
134 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
135 (link_hash_newfunc): Updated.
136 (tilegx_elf_copy_indirect_symbol): Likewise.
137 (tilegx_elf_check_relocs): Likewise.
138 (readonly_dynrelocs): Likewise.
139 (allocate_dynrelocs): Likewise.
140 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
141 (readonly_dynrelocs): Likewise.
142 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
143 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
145 2020-06-01 Alan Modra <amodra@gmail.com>
147 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
148 command against cmd_length, not the end of record. For
149 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
150 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
153 2020-05-28 David Faust <david.faust@oracle.com>
155 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
156 R_BPF_INSN_{32,64} relocations.
158 2020-05-28 Stephen Casner <casner@acm.org>
160 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
161 addreses in .long (used in testsuites) and .stab values.
163 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
166 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
167 Check bfd_link_dll when issue a DT_TEXTREL warning.
168 * elfxx-x86.c (maybe_set_textrel): Likewise.
169 (_bfd_x86_elf_size_dynamic_sections): Likewise.
171 2020-05-26 Nick Clifton <nickc@redhat.com>
173 * plugin.c (try_load_plugin): Extend error message when a plugin
176 2020-05-23 Alan Modra <amodra@gmail.com>
178 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
180 2020-05-22 Alan Modra <amodra@gmail.com>
183 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
184 attributes from shared libraries, and do not return an error if
187 2020-05-21 Alan Modra <amodra@gmail.com>
190 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
192 (_bfd_delete_bfd): Free the copy.
193 (_bfd_new_bfd): Free nbfd->memory on error.
195 2020-05-21 Alan Modra <amodra@gmail.com>
197 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
198 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
199 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
200 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
201 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
202 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
203 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
204 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
205 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
206 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
207 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
208 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
209 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
210 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
211 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
212 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
213 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
214 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
215 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
216 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
218 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
220 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
221 get_default_version. It is used to find the default version for
222 the specific extension.
223 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
224 default_major_version and default_minor_version. Add new bfd_boolean
225 parameter *use_default_version. Set it to TRUE if we need to call
226 the callback rps->get_default_version to find the default version.
227 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
228 the default version in riscv_parsing_subset_version, and then call
229 riscv_add_subset to add the subset into subset list.
230 (riscv_parse_prefixed_ext): Likewise.
231 (riscv_std_z_ext_strtab): Support Zicsr extensions.
232 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
233 strings rather than characters.
234 riscv_merge_arch_attr_info): The callback function get_default_version
235 is only needed for assembler, so set it to NULL int the linker.
236 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
237 * elfxx-riscv.h: Updated.
239 2020-05-20 Alan Modra <amodra@gmail.com>
242 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
243 use bfd_set_filename.
244 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
245 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
246 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
247 (bfd_create): Likewise.
248 (_bfd_delete_bfd): Don't free filename.
249 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
250 return pointer to the copy or NULL on alloc fail.
251 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
252 result of bfd_set_filename.
253 * bfd-in2.h: Regenerate.
255 2020-05-20 Alan Modra <amodra@gmail.com>
258 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
259 section size against file size.
260 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
262 2020-05-19 Gunther Nikl <gnikl@justmail.de>
265 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
266 and memset when allocating memory for the sections_being_created
269 2020-05-19 Stafford Horne <shorne@gmail.com>
271 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
273 (or1k_elf_relocate_section): Access srelgot via
274 htab->root.srelgot. Add assertions for srelgot->contents.
275 Introduce local variable for srelgot to not reuse global
277 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
278 (or1k_set_got_and_rela_sizes): New function.
279 (or1k_initial_exec_offset): New function.
280 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
281 (or1k_elf_relocate_section): Allow for TLS to handle multiple
283 (or1k_elf_check_relocs): Use OR to set TLS access.
284 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
286 (or1k_elf_size_dynamic_sections): Use
287 or1k_set_got_and_rela_sizes to set sizes.
288 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
289 (TCB_SIZE): New macro.
290 (tpoff): Use TCB_SIZE and alignment to calculate offset.
291 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
292 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
293 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
294 (tpoff): Add dynamic boolean argument.
295 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
297 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
299 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
300 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
301 cases with BFD_RELOC_AARCH64_JUMP26.
302 (elfNN_aarch64_check_relocs): Likewise.
304 2020-05-19 Alan Modra <amodra@gmail.com>
306 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
307 bfd_get_filename rather than accessing bfd->filename directly.
308 * aout-target.h (MY (object_p)): Likewise.
309 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
310 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
311 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
312 (_bfd_archive_bsd44_construct_extended_name_table),
313 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
314 (_bfd_bsd_write_armap): Likewise.
315 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
316 * cache.c (bfd_open_file): Likewise.
317 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
318 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
319 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
320 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
321 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
322 * elf32-nds32.c (nds32_elf_output_symbol_hook),
323 (patch_tls_desc_to_ie): Likewise.
324 * elf32-spu.c (sort_bfds, print_one_overlay_section),
325 (spu_elf_auto_overlay): Likewise.
326 * elf64-hppa.c (elf_hppa_final_link): Likewise.
327 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
328 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
329 * elflink.c (bfd_elf_size_dynamic_sections),
330 (elf_link_input_bfd): Likewise.
331 * linker.c (_bfd_generic_link_output_symbols): Likewise.
332 * mach-o.c (bfd_mach_o_follow_dsym),
333 (bfd_mach_o_close_and_cleanup): Likewise.
334 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
335 (find_separate_debug_file, get_build_id_name): Likewise.
336 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
337 * plugin.c (bfd_plugin_open_input): Likewise.
338 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
339 * som.c (som_write_armap): Likewise.
340 * srec.c (srec_write_record, srec_write_symbols): Likewise.
341 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
342 (_bfd_vms_lib_write_archive_contents): Likewise.
343 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
345 2020-05-19 Alan Modra <amodra@gmail.com>
348 * bfdio.c (_bfd_real_fopen): Typo fix.
350 2020-05-18 Nick Clifton <nickc@redhat.com>
353 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
354 for the sections_being_created array.
356 2020-05-18 Alan Modra <amodra@gmail.com>
358 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
359 they can be freed without also freeing internal_relocs.
361 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
364 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
365 separators into DOS style when creating a WIN32 fullpath.
367 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
369 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
370 to initialize RISC-V tdata.
372 2020-05-12 Gunther Nikl <gnikl@justmail.de>
374 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
377 2020-05-11 Alan Modra <amodra@gmail.com>
379 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
381 2020-05-11 Alan Modra <amodra@gmail.com>
383 * elf64-ppc.c: Rename powerxx to power10 throughout.
385 2020-05-11 Alan Modra <amodra@gmail.com>
388 * coffgen.c (coff_get_normalized_symtab): Check that buffer
389 contains required number of auxents before processing any auxent.
390 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
391 file name from auxents for PE.
393 2020-05-04 Gunther Nikl <gnikl@justmail.de>
395 * aout-cris.c (DEFAULT_ARCH): Delete define.
396 (MY_set_arch_mach): Likewise.
397 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
399 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
400 of r_type before the shift.
402 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
405 * elfnn-aarch64.c (group_sections): Copy implementation from
408 2020-05-01 Alan Modra <amodra@gmail.com>
411 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
412 accessing root.u.def of symbols. Also check root.u.def.section
413 is non-NULL. Reverse tests so as to make the logic positive.
415 2020-05-01 Alan Modra <amodra@gmail.com>
418 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
419 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
421 2020-05-01 Alan Modra <amodra@gmail.com>
424 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
425 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
426 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
427 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
428 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
429 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
430 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
431 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
432 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
433 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
435 2020-05-01 Alan Modra <amodra@gmail.com>
438 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
439 from shared libraries.
441 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
443 * elf32-xtensa.c (relax_section): Don't negate diff_value for
444 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
445 equals 0. Report overflow when the result has negative sign but
446 all significant bits are zero.
448 2020-04-29 Gunther Nikl <gnikl@justmail.de>
450 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
451 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
453 2020-04-28 Alan Modra <amodra@gmail.com>
455 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
456 Emit warning message.
458 2020-04-27 Tamar Christina <tamar.christina@arm.com>
460 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
461 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
462 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
463 to x86_64_pe_big_vec as it not a big-endian format.
464 (vec i386_pe_big_vec): New.
465 * configure.ac: Likewise.
466 * targets.c: Likewise.
467 * configure: Regenerate.
468 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
469 COFF_WITH_PE_BIGOBJ): New.
470 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
472 (x86_64_pe_be_vec): Moved.
474 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
476 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
477 * elf.c (elfcore_grok_arc_v2): New function.
478 (elfcore_grok_note): Call the new function to handle the corresponding
480 (elfcore_write_arc_v2): New function.
481 (elfcore_write_register_note): Call the new function to handle the
482 corresponding pseudo-sections.
484 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
487 * bfd-in2.h: Regenerated.
488 * elf32-xtensa.c (elf_howto_table): New entries for
489 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
490 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
491 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
492 R_XTENSA_NDIFF{8,16,32}.
493 * libbfd.h (bfd_reloc_code_real_names): Add names for
494 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
495 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
496 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
497 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
499 2020-04-21 Tamar Christina <tamar.christina@arm.com>
502 * compress.c (bfd_get_full_section_contents): Exclude sections with no
505 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
508 * elf-bfd.h (elf_backend_data): Add
509 elf_backend_strip_zero_sized_dynamic_sections.
510 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
511 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
513 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
515 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
517 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
519 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
521 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
523 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
525 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
527 2020-04-21 Nick Clifton <nickc@redhat.com>
529 * po/sr.po: Updated Serbian translation.
531 2020-04-21 Alan Modra <amodra@gmail.com>
533 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
536 2020-04-20 Stephen Casner <casner@acm.org>
538 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
539 causing globals from linker script to be treated as debug symbols.
540 (translate_symbol_table): Don't sign-extend symbol values from 16
541 to 64 bits in nm output.
543 2020-04-20 Alan Modra <amodra@gmail.com>
545 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
547 2020-04-18 Alan Modra <amodra@gmail.com>
549 * section.c (bfd_is_const_section): Correct test for special
551 * bfd-in2.h: Regenerate.
553 2020-04-17 Alan Modra <amodra@gmail.com>
556 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
559 2020-04-16 Nick Clifton <nickc@redhat.com>
562 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
563 abort with a more helpful error message.
565 2020-04-16 Alan Modra <amodra@gmail.com>
568 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
571 2020-04-15 Fangrui Song <maskray@google.com>
574 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
575 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
576 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
577 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
578 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
579 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
580 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
581 * elf32-sh.c (sh_elf_relocate_section): Likewise.
582 * elf32-spu.c (spu_elf_relocate_section): Likewise.
583 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
584 * elflink.c (elf_link_output_extsym): Likewise.
585 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
587 2020-04-15 Alan Modra <amodra@gmail.com>
590 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
591 pointer into strings that may be freed for section name, always
592 allocate a new string.
594 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
595 Jan W. Jagersma <jwjagersma@gmail.com>
597 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
598 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
599 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
600 (_bfd_go32_mkobject): New functions.
601 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
602 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
603 (go32exe_mkobject): Call _bfd_go32_mkobject.
604 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
605 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
607 (coff_write_relocs): Enable extended reloc counter code if
608 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
609 (coff_write_object_contents): Likewise. Pad section headers
610 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
611 instead of coff_swap_scnhdr_out.
612 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
613 enable extended reloc counter.
614 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
615 Declare with ATTRIBUTE_UNUSED.
616 * libcoff-in.h: (struct coff_tdata): New field go32.
618 * libcoff.h: Regenerate.
620 2020-04-14 Fangrui Song <maskray@google.com>
623 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
626 2020-04-14 Stephen Casner <casner@acm.org>
629 * pdp11.c: Add implementation of --imagic option.
630 (adjust_o_magic): Fix objcopy --extract-symbol test.
631 * libaout.h (enum aout_magic): Add i_magic.
633 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
634 Nick Clifton <nickc@redhat.com>
636 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
638 <default>: Error rather than abort.
640 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
643 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
644 relocation section from section group.
646 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
648 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
649 bfd->origin to file offset.
650 * bfdwin.c (bfd_get_file_window): Likewise.
651 * bfd.c: Clarify the use of the bfd->origin field.
652 * bfd-in2.h: Regenerate.
653 * coff-i386.c: Don't include go32exe.h. Allow overriding
654 coff_write_object_contents via COFF_WRITE_CONTENTS.
655 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
656 (go32exe_write_object_contents): New functions.
657 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
658 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
659 (create_go32_stub): Remove check for 2k size limit. Read stub
660 from go32exe_temp_stub if present.
661 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
662 copy variable-length stub.
663 (go32_check_format): Read stub to go32exe_temp_stub, set
664 origin, return go32exe_cleanup.
665 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
666 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
667 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
668 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
669 Remove functions and their associated #defines.
670 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
671 * libcoff-in.h: (struct coff_tdata): New field stub_size.
672 Rename field go32stub to stub.
673 * libcoff.h: Regenerate.
674 * coff-stgo32.c (go32_check_format): Rename to...
675 (go32exe_check_format): ...this.
676 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
677 (go32exe_copy_private_bfd_data): ...this.
678 (stub_bytes): Rename to...
679 (go32exe_default_stub): ...this.
680 (create_go32_stub): Rename to...
681 (go32exe_create_stub): ...this.
682 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
685 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
689 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
690 relocation to R_386_32 for relocation against non-preemptible
692 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
693 allocate dynamic relocation for non-preemptible absolute symbol.
694 (elf_i386_relocate_section): Pass sec to
695 GENERATE_DYNAMIC_RELOCATION_P.
696 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
697 (elf_x86_64_convert_load_reloc): Covert load relocation to
698 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
699 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
700 for non-preemptible absolute symbol if they overflow.
701 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
702 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
703 symbol. Don't allocate dynamic relocation for non-preemptible
705 (elf_x86_64_relocate_section): Don't generate relative relocation
706 for GOTPCREL relocations aganst local absolute symbol. Pass sec
707 to GENERATE_DYNAMIC_RELOCATION_P.
708 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
709 against non-preemptible absolute symbol.
710 (_bfd_elf_x86_valid_reloc_p): New function.
711 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
713 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
714 argument. Don't generate dynamic relocation against
715 non-preemptible absolute symbol.
717 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
718 against non-preemptible absolute symbol.
720 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
721 (_bfd_elf_x86_valid_reloc_p): New.
723 2020-04-01 Tamar Christina <tamar.christina@arm.com>
726 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
727 address in the GOT if in thumb only mode.
729 2020-04-01 Tamar Christina <tamar.christina@arm.com>
731 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
733 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
735 * mmo.c (mmo_scan): Create .text section only when needed, not
738 2020-03-31 Alan Modra <amodra@gmail.com>
740 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
743 2020-03-31 Alan Modra <amodra@gmail.com>
745 * vms-alpha.c (image_write): Check bounds for sections without
746 contents too. Error on non-zero write to section without
748 (_bfd_vms_slurp_etir): Check return of image_write* functions.
750 2020-03-31 Alan Modra <amodra@gmail.com>
752 * tekhex.c (pass_over): Check is_eof before reading buffer.
754 2020-03-30 Nick Clifton <nickc@redhat.com>
757 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
758 field to timestamp and make it an integer.
759 * libcoff.h: Regenerate.
760 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
761 field in the pe_data structure rather than the insert_timestamp
764 2020-03-30 Alan Modra <amodra@gmail.com>
767 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
770 2020-03-26 Nick Clifton <nickc@redhat.com>
772 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
773 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
775 * libbfd.h: Regenerate.
777 2020-03-26 Alan Modra <amodra@gmail.com>
779 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
781 2020-03-26 Alan Modra <amodra@gmail.com>
783 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
785 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
787 2020-03-25 Nick Clifton <nickc@redhat.com>
789 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
791 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
792 * libbfd.h: Regenerate.
794 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
796 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
797 correct field name in the output string.
799 2020-03-25 Alan Modra <amodra@gmail.com>
802 * elf.c (assign_file_positions_for_load_sections): Adjust offset
803 for SHT_NOBITS section if first in segment.
805 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
808 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
809 (_bfd_elf_get_symbol_version_string): This.
810 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
811 (_bfd_elf_get_symbol_version_string): This.
812 (bfd_elf_print_symbol): Pass TRUE to
813 _bfd_elf_get_symbol_version_string.
814 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
815 bfd_boolean argument.
816 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
817 * targets.c (_bfd_get_symbol_version_string): Likewise.
818 (bfd_get_symbol_version_string): Likewise.
819 * bfd-in2.h: Regenerated.
821 2020-03-24 Nick Clifton <nickc@redhat.com>
822 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
825 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
828 2020-03-24 Nick Clifton <nickc@redhat.com>
831 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
832 segment to use for PT_GNU_RELRO, ignore empty sections in a
833 segment's current list.
835 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
838 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
840 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
843 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
844 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
845 on the previous _bfd_elf_get_symbol_version_string.
846 (_bfd_elf_get_symbol_version_string): Use it.
848 2020-03-24 Alan Modra <amodra@gmail.com>
850 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
851 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
854 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
856 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
858 2020-03-23 Alan Modra <amodra@gmail.com>
860 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
861 symbol count. Allocate an extra byte to ensure name strings
862 are terminated. Sanity check name offsets. Release memory on
865 2020-03-23 Alan Modra <amodra@gmail.com>
867 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
868 field hasn't been read. Remove unnecessary casts.
870 2020-03-22 Alan Modra <amodra@gmail.com>
872 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
873 enough to read number of symbols.
875 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
877 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
878 (EXECUTABLE_SUFFIX): Likewise.
879 * config.in: Regenerated.
880 * configure: Likewise.
881 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
882 _bfd_generic_close_and_cleanup.
883 (plugin_list_entry): Remove resolution_file, resolution_option,
884 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
885 lto_wrapper, gcc_env and initialized,
886 (need_lto_wrapper_p): Removed.
887 (get_lto_wrapper): Likewise.
888 (setup_lto_wrapper_env): Likewise.
889 (register_all_symbols_read): Likewise.
890 (egister_cleanup): Likewise.
891 (get_symbols): Likewise.
892 (add_input_file): Likewise.
893 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
894 (add_symbols): Updated.
895 (try_claim): Likewise.
896 (try_load_plugin): Likewise.
897 (bfd_plugin_canonicalize_symtab): Likewise.
898 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
899 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
901 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
904 * plugin.c (plugin_list_entry): Add has_symbol_type.
905 (add_symbols_v2): New function.
906 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
907 provides symbol type.
908 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
909 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
912 2020-03-20 Alan Modra <amodra@gmail.com>
914 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
915 enough to read number of symbols.
917 2020-03-20 Alan Modra <amodra@gmail.com>
919 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
920 backend functions for NULL before calling.
921 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
922 (bfd_section_from_shdr, assign_section_numbers): Likewise.
923 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
924 * elfnn-ia64.c (ignore_errors): New function.
925 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
927 2020-03-19 Nick Clifton <nickc@redhat.com>
930 * dwarf2.c (struct varinfo): Add unit_offset field to record the
931 location of the varinfo in the unit's debug info data. Change the
932 type of the stack field to a boolean.
933 (lookup_var_by_offset): New function. Returns the varinfo
934 structure for the variable described at the given offset in the
936 (scan_unit_for_symbols): Add support for variables which have the
937 DW_AT_specification attribute.
939 2020-03-19 Nick Clifton <nickc@redhat.com>
942 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
945 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
947 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
949 2020-03-18 Nick Clifton <nickc@redhat.com>
952 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
953 memory access when processing a corrupt secondary reloc section.
955 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
957 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
958 instead of calling abort.
959 * elf32-csky.c (csky_build_one_stub): Likewise.
960 * elf32-hppa.c (hppa_build_one_stub): Likewise.
961 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
962 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
963 * elf32-metag.c (metag_build_one_stub): Likewise.
964 * elf32-nios2.c (nios2_build_one_stub): Likewise.
965 * elf64-ppc.c (ppc_build_one_stub): Likewise.
966 (ppc_size_one_stub): Likewise.
967 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
969 2020-03-17 Nick Clifton <nickc@redhat.com>
972 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
975 2020-03-17 Nick Clifton <nickc@redhat.com>
978 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
979 free. Add free on another failure path.
981 2020-03-16 Alan Modra <amodra@gmail.com>
984 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
985 we have a non-zero section count. Do lma comparison in octets.
987 2020-03-16 Alan Modra <amodra@gmail.com>
989 * vms-alpha.c (dst_restore_location): Validate index into
990 dst_ptr_offsets array before accessing. Return status.
991 (dst_retrieve_location): Similarly, making "loc" parameter a
992 pointer to return value.
993 (_bfd_vms_slurp_etir): Update calls to above functions.
995 2020-03-14 Kamil Rytarowski <n54@gmx.com>
997 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
999 * configure: Regenerated.
1001 2020-03-14 Alan Modra <amodra@gmail.com>
1003 * section.c (BFD_FAKE_SECTIONS): Formatting.
1004 * bfd-in2.h: Regenerate.
1006 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1008 * elf.c (elfcore_grok_netbsd_note): Add support for
1009 NT_NETBSDCORE_LWPSTATUS notes.
1011 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1013 * bfd-in2.h: Regenerate.
1014 * section.c (asection): Add already_assigned field.
1015 (BFD_FAKE_SECTION): Add default initializer for it.
1016 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1017 * elf32-arm.c (arm_build_one_stub): Add support for
1018 non_contiguous_regions.
1019 * elf32-csky.c (csky_build_one_stub): Likewise.
1020 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1021 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1022 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1023 * elf32-metag.c (metag_build_one_stub): Likewise.
1024 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1025 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1026 (ppc_size_one_stub): Likewise.
1027 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1028 * elflink.c (elf_link_input_bfd): Likewise.
1030 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1033 * elf-linker-x86.h (elf_linker_x86_params): Add
1034 static_before_all_inputs and has_dynamic_linker.
1035 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1036 dynamic input objects if -static is passed at command-line
1037 before all input files without --dynamic-linker unless
1038 --no-dynamic-linker is used.
1040 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1042 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1044 2020-03-13 Christian Eggers <ceggers@gmx.de>
1046 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1047 "p_paddr" from "at".
1048 * elfcode.h (bfd_from_remote_memory): Add units to several
1049 parameters. New local "opb". Fix usage of p_align. Fix
1050 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1051 call of target_read_memory.
1052 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1053 calculation of "offset" and "output_offset".
1054 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1055 from "offset" and fix calculation of "end" from "vma+size". Fix
1056 comparison between "sh_addr" and "vma"/"output_offset".
1057 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1058 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1060 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1061 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1062 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1063 assignment of p_paddr from phdr_lma. Fix comparison between
1064 "lma+size" and "next->lma".
1065 (elf_sort_segments): Fix assignment from p_paddr to lma.
1066 (assign_file_positions_for_load_sections): Add unit (bytes) to
1067 local "align". Fix calculation of local "off_adjust". Fix
1068 calculation of local "filehdr_vaddr".
1069 (assign_file_positions_for_non_load_sections): New local "opb".
1070 Fix calculation of "end" from "p_size". Fix comparison between
1071 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1072 from "end" and "p_vaddr".
1073 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1074 vma. Fix assignment to p_paddr from lma. Fix comparison between
1075 p_paddr and lma. Fix assignment to p_paddr from lma.
1076 * merge.c (sec_merge_emit): New local "opb". Convert
1077 "alignment_power" to octets.
1078 (_bfd_add_merge_section): New locals "alignment_power" and
1079 "opb". Fix comparison between "alignment_power" and
1081 (_bfd_merge_sections): New local "opb". Divide size by opb
1082 before checking align mask.
1084 2020-03-13 Christian Eggers <ceggers@gmx.de>
1086 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1087 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1089 (_bfd_elf_make_section_from_phdr): Similarly.
1090 (elf_fake_sections): Fix calculation of
1091 Elf_Internal_shdr::sh_addr from section VMA.
1092 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1094 (assign_file_positions_for_load_sections): Fix calculations of
1095 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1096 comparison between program header address and section LMA.
1097 (assign_file_positions_for_non_load_sections): Likewise.
1098 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1099 (IS_CONTAINED_BY_VMA): Add parameter opb.
1100 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1101 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1102 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1103 Fix calculations of p_addr_valid and p_vaddr_offset.
1104 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1105 with octets per byte when comparing against p_vaddr.
1107 2020-03-11 Alan Modra <amodra@gmail.com>
1109 * som.c (setup_sections): Sanity check subspace.name.
1111 2020-03-11 Alan Modra <amodra@gmail.com>
1113 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1115 2020-03-10 Alan Modra <amodra@gmail.com>
1118 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1121 2020-03-09 Alan Modra <amodra@gmail.com>
1123 * wasm-module.c (wasm_scan): Sanity check file name length
1124 before allocating memory. Move common section setup code. Do
1125 without bfd_tell to calculate section size.
1127 2020-03-06 Nick Clifton <nickc@redhat.com>
1129 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1130 with error messages and failure return values.
1132 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1134 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1135 relocation sections for any removed reference to a dynamic symbol.
1137 2020-03-05 Nick Clifton <nickc@redhat.com>
1139 * elf-bfd.h (struct elf_backend_data): Add new fields:
1140 init_secondary_reloc_section, slurp_secondary_reloc_section,
1141 write_secondary_reloc_section.
1142 (_bfd_elf_init_secondary_reloc_section): Prototype.
1143 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1144 (_bfd_elf_write_secondary_reloc_section): Prototype.
1145 * elf.c ( bfd_section_from_shdr): Invoke the new
1146 init_secondary_reloc_section backend function, if defined, when a
1147 second reloc section is encountered.
1148 (swap_out_syms): Invoke the new symbol_section_index function, if
1149 defined, when computing the section index of an OS/PROC specific
1151 (_bfd_elf_init_secondary_reloc_section): New function.
1152 (_bfd_elf_slurp_secondary_reloc_section): New function.
1153 (_bfd_elf_write_secondary_reloc_section): New function.
1154 (_bfd_elf_copy_special_section_fields): New function.
1155 * elfcode.h (elf_write_relocs): Invoke the new
1156 write_secondary_relocs function, if defined, in order to emit
1158 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1159 function, if defined, in order to read in secondary relocs.
1160 * elfxx-target.h (elf_backend_copy_special_section_fields):
1161 Provide a non-NULL default definition.
1162 (elf_backend_init_secondary_reloc_section): Likewise.
1163 (elf_backend_slurp_secondary_reloc_section): Likewise.
1164 (elf_backend_write_secondary_reloc_section): Likewise.
1165 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1167 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1168 * configure: Regenerate.
1170 2020-03-05 Alan Modra <amodra@gmail.com>
1172 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1173 against file size before allocating memory. Use bfd_alloc rather
1174 than bfd_zalloc for carsym/strings memory.
1176 2020-03-04 Alan Modra <amodra@gmail.com>
1178 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1179 sh_addr mod sh_addalign is zero.
1181 2020-03-04 Alan Modra <amodra@gmail.com>
1183 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1185 2020-03-03 Alan Modra <amodra@gmail.com>
1187 * format.c (struct bfd_preserve): Add cleanup field.
1188 (bfd_preserve_save): Add cleanup param and save.
1189 (bfd_preserve_restore): Return cleanup.
1190 (bfd_preserve_finish): Call the cleanup for the discarded match.
1191 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1192 and clear when preserving a match. Restore cleanup too when
1193 restoring that match.
1195 2020-03-02 Alan Modra <amodra@gmail.com>
1197 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1198 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1199 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1200 (core_sco5_vec): Correct initialisers.
1202 2020-03-02 Alan Modra <amodra@gmail.com>
1204 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1205 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1206 * cisco-core.c (cisco_core_file_validate): Likewise.
1207 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1208 * hpux-core.c (hpux_core_core_file_p): Likewise.
1209 * irix-core.c (irix_core_core_file_p): Likewise.
1210 * lynx-core.c (lynx_core_file_p): Likewise.
1211 * netbsd-core.c (netbsd_core_file_p): Likewise.
1212 * osf-core.c (osf_core_core_file_p): Likewise.
1213 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1214 * sco5-core.c (sco5_core_file_p): Likewise.
1216 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1218 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1220 2020-03-02 Alan Modra <amodra@gmail.com>
1222 * targets.c (bfd_cleanup): New typedef.
1223 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1224 * libbfd-in.h (_bfd_no_cleanup): Define.
1225 * format.c (bfd_reinit): Add cleanup parameter, call it.
1226 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1227 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1228 * aout-target.h (callback, object_p): Return bfd_cleanup.
1229 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1230 * archive.c (bfd_generic_archive_p): Likewise.
1231 * binary.c (binary_object_p): Likewise.
1232 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1233 * coff-ia64.c (ia64coff_object_p): Likewise.
1234 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1235 * coff-sh.c (coff_small_object_p): Likewise.
1236 * coff-stgo32.c (go32_check_format): Likewise.
1237 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1238 (xcoff64_core_p): Likewise.
1239 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1240 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1241 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1242 * elfcode.h (elf_object_p): Likewise.
1243 * elfcore.h (elf_core_file_p): Likewise.
1244 * i386msdos.c (msdos_object_p): Likewise.
1245 * ihex.c (ihex_object_p): Likewise.
1246 * libaout.h (some_aout_object_p): Likewise.
1247 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1248 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1249 * libbfd.c (_bfd_dummy_target): Likewise.
1250 * libcoff-in.h (coff_object_p): Likewise.
1251 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1252 (bfd_mach_o_arm64_core_p): Likewise.
1253 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1254 (bfd_mach_o_arm_core_p): Likewise.
1255 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1256 (bfd_mach_o_i386_core_p): Likewise.
1257 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1258 (bfd_mach_o_x86_64_core_p): Likewise.
1259 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1260 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1261 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1262 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1263 * mmo.c (mmo_object_p): Likewise.
1264 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1265 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1266 (pe_bfd_object_p): Likewise.
1267 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1268 * ppcboot.c (ppcboot_object_p): Likewise.
1269 * rs6000-core.c (rs6000coff_core_p): Likewise.
1270 * som.c (som_object_setup, som_object_p): Likewise.
1271 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1272 * tekhex.c (tekhex_object_p): Likewise.
1273 * vms-alpha.c (alpha_vms_object_p): Likewise.
1274 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1275 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1276 * wasm-module.c (wasm_object_p): Likewise.
1277 * xsym.c (bfd_sym_object_p): Likewise.
1278 * xsym.h (bfd_sym_object_p): Likewise.
1279 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1281 * pdp11.c (some_aout_object_p): Likewise.
1282 * plugin.c (register_ld_plugin_object_p): Update object_p
1284 * plugin.h (register_ld_plugin_object_p): Likewise.
1285 * bfd-in2.h: Regenerate.
1286 * libbfd.h: Regenerate.
1287 * libcoff.h: Regenerate.
1289 2020-03-02 Alan Modra <amodra@gmail.com>
1291 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1292 applicable section flags.
1293 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1294 (mips_ecoff_bele_vec): Likewise.
1295 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1297 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1298 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1300 2020-03-02 Alan Modra <amodra@gmail.com>
1302 * elf32-m32r.c (m32r_elf_section_flags): New function.
1303 (elf_backend_section_flags): Define.
1304 * elf32-nds32.c (nds32_elf_section_flags): New function.
1305 (elf_backend_section_flags): Define.
1306 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1307 .sbss and .sdata sections.
1308 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1309 for SHF_V850_GPREL sections.
1310 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1312 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1313 for SHF_PARISC_SHORT sections.
1314 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1315 (elf_backend_section_flags): Define.
1316 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1317 for SHF_MIPS_GPREL sections. Delete FIXME.
1319 2020-03-02 Alan Modra <amodra@gmail.com>
1321 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1322 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1323 calling elf_backend_section_flags with adjusted params. Use
1324 newsect->flags past that point.
1325 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1327 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1328 to have their type overridden, and all sh_flags but processor and
1330 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1331 * elf32-mep.c (mep_elf_section_flags): Likewise.
1332 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1333 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1334 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1335 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1336 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1337 stub BFD and non-aarch64 input files when scanning for stubs.
1339 2020-03-02 Alan Modra <amodra@gmail.com>
1341 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1342 limit to decompressed element size.
1344 2020-03-02 Alan Modra <amodra@gmail.com>
1346 * vms-lib.c (vms_traverse_index): Add recur_count param and
1347 update calls. Fail on excessive recursion.
1349 2020-03-02 Alan Modra <amodra@gmail.com>
1351 * vms-alpha.c (vms_get_remaining_object_record): Use
1352 bfd_realloc_or_free rather than bfd_realloc.
1353 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1354 (dst_define_location, parse_module): Likewise, and check realloc
1355 return status before using memory. Return status from function
1356 adjusting all callers.
1358 2020-02-28 Alan Modra <amodra@gmail.com>
1360 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1362 2020-02-28 Alan Modra <amodra@gmail.com>
1364 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1365 Remove duplicate undersize check.
1367 2020-02-27 Alan Modra <amodra@gmail.com>
1370 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1372 2020-02-27 Alan Modra <amodra@gmail.com>
1375 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1376 (coff_section_type): Adjust comment.
1377 (decode_section_type): Likewise. Call coff_section_type before
1378 decode_section_type.
1379 (bfd_decode_symclass): Use 'c' for common sections other than
1382 2020-02-27 Alan Modra <amodra@gmail.com>
1384 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1387 2020-02-27 Alan Modra <amodra@gmail.com>
1389 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1390 if file is an archive element.
1391 * bfd-in2.h: Regenerate.
1393 2020-02-26 Alan Modra <amodra@gmail.com>
1395 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1396 bfd_set_error on failing test. Don't bother changing bfd_error on
1397 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1398 Check sym name is within string buffer. Use size_t for some vars.
1399 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1400 int_buf. Don't change bfd_error on file read error. Use
1401 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1402 calculations to catch overflows before they occur. malloc and
1403 free raw armap rather than using bfd_alloc. Read raw armap before
1404 allocating carsym+strings buffer.
1405 (_bfd_slurp_extended_name_table): Localize variables. Check
1406 name size against file size.
1408 2020-02-26 Alan Modra <amodra@gmail.com>
1410 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1412 2020-02-26 Alan Modra <amodra@gmail.com>
1414 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1415 malloc. Check for NULL return from bfd_malloc.
1416 (rx_table_find, rx_table_map): Likewise.
1417 (rx_set_section_contents): Check bfd_alloc return.
1418 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1420 2020-02-26 Alan Modra <amodra@gmail.com>
1422 * aoutx.h: Indent labels correctly. Format error strings.
1423 * archive.c: Likewise.
1424 * archive64.c: Likewise.
1425 * coff-arm.c: Likewise.
1426 * coff-rs6000.c: Likewise.
1427 * coff-stgo32.c: Likewise.
1428 * cpu-arm.c: Likewise.
1429 * dwarf2.c: Likewise.
1430 * elf-ifunc.c: Likewise.
1431 * elf-properties.c: Likewise.
1432 * elf-s390-common.c: Likewise.
1433 * elf-strtab.c: Likewise.
1435 * elf32-arm.c: Likewise.
1436 * elf32-bfin.c: Likewise.
1437 * elf32-cr16.c: Likewise.
1438 * elf32-csky.c: Likewise.
1439 * elf32-i386.c: Likewise.
1440 * elf32-m68k.c: Likewise.
1441 * elf32-msp430.c: Likewise.
1442 * elf32-nds32.c: Likewise.
1443 * elf32-nios2.c: Likewise.
1444 * elf32-pru.c: Likewise.
1445 * elf32-xtensa.c: Likewise.
1446 * elf64-ia64-vms.c: Likewise.
1447 * elf64-x86-64.c: Likewise.
1448 * elfcode.h: Likewise.
1449 * elfcore.h: Likewise.
1450 * elflink.c: Likewise.
1451 * elfnn-aarch64.c: Likewise.
1452 * elfnn-ia64.c: Likewise.
1453 * elfnn-riscv.c: Likewise.
1454 * elfxx-mips.c: Likewise.
1455 * elfxx-sparc.c: Likewise.
1456 * elfxx-x86.c: Likewise.
1457 * i386lynx.c: Likewise.
1458 * merge.c: Likewise.
1459 * pdp11.c: Likewise.
1460 * plugin.c: Likewise.
1461 * reloc.c: Likewise.
1463 2020-02-26 Alan Modra <amodra@gmail.com>
1466 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1468 (bfd_elf_add_dt_needed_tag): Declare.
1469 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1470 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1471 from elf_add_dt_needed_tag. Remove soname and doit param.
1472 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1473 to see whether as-needed lib is already loaded, use dyn_loaded
1474 list instead. When saving and restoring around as-needed lib
1475 handle possibility that dynstr has not been initialised. Don't
1476 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1477 Mark libs loaded via DT_NEEDED entries of other libs with
1478 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1480 (elf_link_check_versioned_symbol): Remove now unneccesary
1481 DYNAMIC check when traversing dyn_loaded list.
1483 2020-02-26 Alan Modra <amodra@gmail.com>
1485 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1487 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1490 * plugin.c (need_lto_wrapper_p): New.
1491 (bfd_plugin_set_program_name): Add an int argument to set
1493 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1495 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1497 2020-02-24 Alan Modra <amodra@gmail.com>
1499 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1501 2020-02-24 Alan Modra <amodra@gmail.com>
1503 * vms-lib.c (struct carsym_mem): Add limit.
1504 (vms_add_index): Heed limit.
1505 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1506 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1507 Always return actual number read.
1508 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1509 assertion with error exit.
1511 2020-02-22 Alan Modra <amodra@gmail.com>
1514 * elf.c (assign_file_positions_for_load_sections): Continue linking
1515 on "PHDR segment not covered by LOAD segment" errors.
1517 2020-02-21 Alan Modra <amodra@gmail.com>
1519 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1521 (bfd_mach_o_canonicalize_reloc): Likewise.
1522 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1523 counts and offsets against file size.
1524 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1525 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1526 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1527 against file size. Delete symbol table error message.
1528 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1530 (bfd_mach_o_read_symtab): Likewise.
1531 (bfd_mach_o_read_command): Pass file size.
1532 (bfd_mach_o_scan): Sanity check command count against file size.
1534 2020-02-21 Alan Modra <amodra@gmail.com>
1537 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1538 "text", "data" and "bss" section pointer vars. Don't update
1539 section size, just exec header sizes.
1540 (adjust_sizes_and_vmas): Don't update text section size. Set
1541 initial exec header a_text. Print exec headers sizes.
1542 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1543 (adjust_sizes_and_vmas): Similarly. Formatting.
1544 (final_link): Correct final file extension.
1546 2020-02-20 Nick Clifton <nickc@redhat.com>
1548 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1550 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1552 (elfNN_bed): Initialise the symbol_section_index field.
1553 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1554 OS and PROC specific section indicies. Warn if converting other
1555 reserved incidies to SHN_ABS.
1557 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1560 * cpu-z80.c: Add machine type compatibility checking.
1562 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1565 * plugin.c (plugin_list_entry): Remove handle.
1566 (try_load_plugin): Call dlclose before return.
1568 2020-02-19 Alan Modra <amodra@gmail.com>
1570 * libbfd-in.h (_bfd_constant_p): Define.
1571 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1572 file size before allocating memory.
1573 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1574 * elf.c (bfd_elf_get_str_section): Likewise.
1575 (_bfd_elf_slurp_version_tables): Likewise.
1576 * libbfd.h: Regenerate.
1578 2020-02-19 Alan Modra <amodra@gmail.com>
1580 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1581 * aoutx.h (aout_get_external_symbols): Replace calls to
1582 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1583 (slurp_reloc_table): Likewise.
1584 * archive.c (do_slurp_bsd_armap): Likewise.
1585 (do_slurp_coff_armap): Likewise.
1586 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1587 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1588 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1589 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1590 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1591 (_bfd_coff_get_external_symbols): Likewise.
1592 * ecoff.c (ecoff_slurp_symbolic_header),
1593 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1594 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1595 (ecoff_indirect_link_order): Likewise.
1596 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1597 (_bfd_elf_slurp_version_tables): Likewise.
1598 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1599 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1600 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1601 * elf64-alpha.c (READ): Likewise.
1602 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1603 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1604 * elfcode.h (elf_slurp_symbol_table),
1605 (elf_slurp_reloc_table_from_section): Likewise.
1606 * elflink.c (elf_link_add_object_symbols),
1607 (elf_link_check_versioned_symbol): Likewise.
1608 * elfxx-mips.c (READ): Likewise.
1609 * i386lynx.c (slurp_reloc_table): Likewise.
1610 * lynx-core.c (lynx_core_file_p): Likewise.
1611 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1612 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1613 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1614 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1615 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1616 (bfd_pef_parse_symbols): Likewise.
1617 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1618 * som.c (setup_sections, som_slurp_string_table),
1619 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1620 (som_bfd_fill_in_ar_symbols): Likewise.
1621 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1622 (evax_bfd_print_image): Likewise.
1623 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1624 * wasm-module.c (wasm_scan): Likewise.
1625 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1626 * xsym.c (bfd_sym_read_name_table),
1627 (bfd_sym_print_type_information_table_entry): Likewise.
1628 * libbfd.h: Regenerate.
1630 2020-02-19 Alan Modra <amodra@gmail.com>
1632 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1633 reading external relocs.
1634 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1635 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1637 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1639 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1640 (m32c_elf_relax_section): Likewise.
1641 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1642 (rl78_elf_relax_section): Likewise.
1643 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1644 (elf32_rx_relax_section): Likewise.
1645 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1646 parameter types and use..
1647 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1648 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1649 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1650 being read from file, just the extra.
1651 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1652 after reading external syms. Free on failure.
1654 2020-02-19 Alan Modra <amodra@gmail.com>
1656 * coffcode.h (buy_and_read, coff_slurp_line_table),
1657 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1658 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1659 corresponding bfd_alloc call. Adjust variables to suit.
1660 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1661 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1662 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1663 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1664 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1665 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1666 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1667 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1668 * elf64-alpha.c (READ): Likewise.
1669 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1670 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1671 (bfd_from_remote_memory): Likewise.
1672 * elfcore.h (core_find_build_id): Likewise.
1673 * elfxx-mips.c (READ): Likewise.
1674 * mach-o.c (bfd_mach_o_mangle_sections),
1675 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1676 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1677 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1678 * som.c (setup_sections, som_prep_for_fixups)
1679 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1680 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1681 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1682 (som_bfd_ar_write_symbol_stuff): Likewise.
1683 * vms-alpha.c (vector_grow1): Likewise.
1684 * vms-lib.c (vms_add_index): Likewise.
1685 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1686 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1687 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1688 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1689 (bfd_alloc2, bfd_zalloc2): Delete.
1690 (_bfd_mul_overflow): Define.
1691 * libbfd.h: Regenerate.
1693 2020-02-19 Alan Modra <amodra@gmail.com>
1695 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1697 (assign_section_numbers): Likewise.
1698 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1699 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1700 bfd_malloc2, size_t amt, and unsigned tls_count.
1701 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1702 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1703 (elf_output_implib): Use bfd_alloc.
1705 2020-02-19 Alan Modra <amodra@gmail.com>
1707 * bfd.c (struct bfd): Move format and direction to other
1708 bitfields. Add "size".
1709 * bfdio.c (bfd_get_size): Cache size when not writing file.
1710 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1711 returning zero, ie. unknown.
1712 (bfd_get_alt_debug_link_info): Likewise.
1713 * bfd-in2.h: Regenerate.
1715 2020-02-19 Alan Modra <amodra@gmail.com>
1717 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1718 bfd_get_file_size twice.
1719 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1720 zero, ie. unknown, return.
1721 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1722 * elfcode.h (elf_swap_shdr_in): Likewise.
1723 (elf_object_p): Don't call bfd_get_file_size twice and correct
1726 2020-02-19 Alan Modra <amodra@gmail.com>
1728 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1729 FALSE if memory alloc fails. Adjust calls.
1730 * som.c (som_prep_for_fixups): Likewise.
1731 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1732 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1733 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1734 * som.c (som_build_and_write_symbol_table): Return via error_return
1736 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1737 (VEC_APPEND_EL): Delete.
1738 (vector_grow1): Return pointer to element. Catch overflow.
1739 Return NULL on memory allocation failure.
1740 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1741 (alpha_vms_add_fixup_ca): Likewise.
1742 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1744 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1746 2020-02-19 Alan Modra <amodra@gmail.com>
1748 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1749 * aout-target.h (object_p): Likewise.
1750 * aout-tic30.c (tic30_aout_object_p): Likewise.
1751 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1752 (emit_stringtab, write_syms, link_hash_table_create),
1753 (aout_link_write_other_symbol): Likewise.
1754 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1755 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1756 (_bfd_compute_and_write_armap): Likewise.
1757 * archures.c (bfd_arch_list): Likewise.
1758 * bfd.c (bfd_record_phdr): Likewise.
1759 * binary.c (binary_canonicalize_symtab): Likewise.
1760 * cisco-core.c (cisco_core_file_validate): Likewise.
1761 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1762 (find_arm_glue, record_arm_to_thumb_glue),
1763 (record_thumb_to_arm_glue): Likewise.
1764 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1765 (ppc_allocate_toc_section): Likewise.
1766 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1767 * coff-sh.c (sh_relax_section): Likewise.
1768 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1769 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1770 (coff_set_alignment_hook, coff_mkobject),
1771 (coff_compute_section_file_positions): Likewise.
1772 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1773 (coff_find_nearest_line_with_names),
1774 ( bfd_coff_set_symbol_class): Likewise.
1775 * cofflink.c (_bfd_coff_link_hash_table_create),
1776 (_bfd_coff_link_input_bfd): Likewise.
1777 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1778 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1779 (build_line_info_table, sort_line_sequences),
1780 (line_info_add_include_dir, line_info_add_file_name),
1781 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1782 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1783 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1784 (_bfd_ecoff_find_nearest_line),
1785 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1786 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1787 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1788 * elf-m10300.c (mn10300_elf_relax_section),
1789 (elf32_mn10300_link_hash_table_create): Likewise.
1790 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1791 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1792 * elf32-arm.c (elf32_arm_link_hash_table_create),
1793 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1794 (elf32_arm_new_section_hook): Likewise.
1795 * elf32-avr.c (elf_avr_new_section_hook),
1796 (elf32_avr_link_hash_table_create, get_local_syms),
1797 (elf32_avr_setup_section_lists): Likewise.
1798 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1799 (bfin_link_hash_table_create): Likewise.
1800 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1801 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1802 * elf32-csky.c (csky_elf_link_hash_table_create),
1803 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1804 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1805 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1806 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1807 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1808 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1809 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1810 (m32r_elf_check_relocs): Likewise.
1811 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1812 (elf32_m68hc11_setup_section_lists),
1813 (elf32_m68hc11_size_stubs): Likewise.
1814 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1815 * elf32-metag.c (elf_metag_link_hash_table_create),
1816 (elf_metag_setup_section_lists): Likewise.
1817 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1818 (microblaze_elf_check_relocs): Likewise.
1819 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1820 (nds32_elf_check_relocs): Likewise.
1821 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1822 (get_local_syms, nios2_elf32_check_relocs),
1823 (nios2_elf32_link_hash_table_create): Likewise.
1824 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1825 (or1k_elf_check_relocs): Likewise.
1826 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1827 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1828 * elf32-s390.c (elf_s390_link_hash_table_create),
1829 (elf_s390_check_relocs): Likewise.
1830 * elf32-score.c (score_elf_create_got_section),
1831 (s3_elf32_score_new_section_hook),
1832 (elf32_score_link_hash_table_create): Likewise.
1833 * elf32-score7.c (score_elf_create_got_section),
1834 (s7_elf32_score_new_section_hook): Likewise.
1835 * elf32-sh.c (sh_elf_link_hash_table_create),
1836 (sh_elf_check_relocs): Likewise.
1837 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1838 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1839 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1840 (tilepro_elf_check_relocs): Likewise.
1841 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1842 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1843 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1844 (elf_xtensa_new_section_hook): Likewise.
1845 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1846 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1847 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1848 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1849 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1850 * elf64-ppc.c (ppc64_elf_new_section_hook),
1851 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1852 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1853 * elf64-s390.c (elf_s390_link_hash_table_create),
1854 (elf_s390_check_relocs): Likewise.
1855 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1856 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1857 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1858 (elf_link_add_archive_symbols, compute_bucket_count),
1859 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1860 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1861 (bfd_elf_final_link): Likewise.
1862 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1863 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1864 (elfNN_aarch64_new_section_hook): Likewise.
1865 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1866 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1867 (riscv_elf_check_relocs): Likewise.
1868 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1869 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1870 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1871 (_bfd_mips_elf_link_hash_table_create): Likewise.
1872 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1873 (_bfd_sparc_elf_check_relocs),
1874 (_bfd_sparc_elf_new_section_hook): Likewise.
1875 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1876 (tilegx_elf_check_relocs): Likewise.
1877 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1878 * format.c (bfd_check_format_matches): Likewise.
1879 * hash.c (_bfd_stringtab_init): Likewise.
1880 * ihex.c (ihex_scan): Likewise.
1881 * irix-core.c (irix_core_core_file_p): Likewise.
1882 * linker.c (bfd_wrapped_link_hash_lookup),
1883 (_bfd_generic_link_hash_table_create),
1884 (_bfd_generic_reloc_link_order): Likewise.
1885 * lynx-core.c (lynx_core_file_p): Likewise.
1886 * netbsd-core.c (netbsd_core_file_p): Likewise.
1887 * osf-core.c (osf_core_core_file_p): Likewise.
1888 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1889 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1890 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1891 * peicode.h (pe_mkobject): Likewise.
1892 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1893 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1894 * sco5-core.c (read_uarea): Likewise.
1895 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1896 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1897 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1898 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1899 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1900 * srec.c (srec_scan): Likewise.
1901 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1902 * targets.c (bfd_target_list): Likewise.
1903 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1904 * trad-core.c (trad_unix_core_file_p): Likewise.
1905 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1906 (vms_new_section_hook): Likewise.
1907 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1908 * xcofflink.c (xcoff_get_section_contents),
1909 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1910 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1911 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1913 2020-02-19 Alan Modra <amodra@gmail.com>
1915 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1917 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1919 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1920 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1921 a build_list_p argument. Don't search plugin_list. Short circuit
1922 when building the plugin list.
1923 (has_plugin): Renamed to has_plugin_list.
1924 (bfd_plugin_set_plugin): Don't set has_plugin.
1925 (bfd_plugin_specified_p): Check plugin_list instead.
1926 (build_plugin_list): New function.
1927 (load_plugin): Call build_plugin_list and use plugin_list.
1929 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1932 * plugin.c (try_claim): Always clean up for LTO wrapper.
1933 (try_load_plugin): Treat each object as independent. Create a
1934 copy for plugin name.
1936 2020-02-11 Nick Clifton <nickc@redhat.com>
1938 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1939 for addresses in print statements.
1940 (msp430_elf_relax_delete_bytes): Likewise.
1941 (msp430_elf_relax_add_words): Likewise.
1942 (msp430_elf_relax_section): Likewise.
1944 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1946 * plugin.c (add_symbols): Clear plugin_data memory.
1948 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1951 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1952 (EXECUTABLE_SUFFIX): Likewise.
1953 * config.in: Regenerated.
1954 * configure: Likewise.
1955 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1956 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1957 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1958 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1959 (get_lto_wrapper): New.
1960 (setup_lto_wrapper_env): Likewise.
1961 (current_plugin): Likewise.
1962 (register_all_symbols_read): Likewise.
1963 (register_cleanup): Likewise.
1964 (get_symbols): Likewise.
1965 (add_input_file): Likewise.
1966 (bfd_plugin_close_and_cleanup): Likewise.
1967 (claim_file): Removed.
1968 (register_claim_file): Set current_plugin->claim_file.
1969 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1970 lto_syms in current_plugin.
1971 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1972 all_symbols_read handler. Copy real symbols to plugin_data.
1973 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1974 (try_load_plugin): Don't reuse the previous plugin for LTO
1975 wrapper. Set up GCC LTO wrapper if possible. Don't set
1976 plugin_list_iter->claim_file.
1977 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1979 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1982 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1984 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1985 check if previous instruction matches a conditional jump inserted
1986 earlier. Invert conditional jump and delete branch in this case.
1988 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1990 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1991 msp430_elf_relax_add_words. Support insertion of either one or two
1993 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1994 needs to be grown. Handle insertion of branch instruction to replace
1997 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1999 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2000 debugging relocations.
2001 (msp430_elf_relax_delete_bytes): Likewise.
2002 (msp430_elf_relax_add_two_words): Likewise.
2003 (msp430_elf_relax_section): Likewise.
2005 2020-02-10 Alan Modra <amodra@gmail.com>
2007 * archures.c: Wrap overlong z80 comments.
2008 * bfd-in2.h: Regenerate.
2010 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2013 * archures.c: Add GBZ80 and Z80N machine values.
2014 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2015 * coff-z80.c: Add support for new reloc.
2016 * coffcode.h: Add support for new machine values.
2017 * cpu-z80.c: Add support for new machine names.
2018 * elf32-z80.c: Add support for new reloc.
2019 * bfd-in2.h: Regenerate.
2020 * libbfd.h: Regenerate.
2022 2020-02-07 Nick Clifton <nickc@redhat.com>
2025 * elf.c (rewrite_elf_program_header): Do not complain if no
2026 sections are mapped to a segment.
2028 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2031 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2032 for garbage collection on __patchable_function_entries section
2033 without linked-to section.
2035 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2038 * bfd-in2.h: Regenerated.
2039 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2040 on section if gc_mark of any of its linked-to sections is set
2041 and don't set gc_mark again.
2042 * section.c (asection): Add linked_to_symbol_name to map_head
2045 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
2047 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2048 reporting an unrecognized instruction with R_V850_LONGJUMP.
2050 2020-02-05 Alan Modra <amodra@gmail.com>
2052 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2054 2020-02-04 Alan Modra <amodra@gmail.com>
2056 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2057 R_PPC_VLE_ADDR20, goto copy_reloc.
2059 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2061 * bfd-in2.h: Regenerated.
2062 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2064 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2067 * bfd-in2.h: Regenerated.
2068 * ecoff.c (bfd_debug_section): Add section_id.
2069 * section.c (bfd_section): Add section_id.
2070 (SEC_ASSEMBLER_SECTION_ID): New.
2071 (BFD_FAKE_SECTION): Add section_id.
2073 2020-02-01 Nick Clifton <nickc@redhat.com>
2075 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2078 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2080 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2081 encodings are relative to the GOT on nios2, too.
2083 2020-01-31 Alan Modra <amodra@gmail.com>
2085 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2086 file. Use $< and $@ in rules.
2087 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2088 (elf32-ia64.c, elf64-ia64.c): Likewise.
2089 (elf32-riscv.c, elf64-riscv.c): Likewise.
2090 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2091 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2092 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2093 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2094 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2095 * Makefile.in: Regenerate.
2097 2020-01-31 Alan Modra <amodra@gmail.com>
2100 * elf.c (setup_group): Don't clear entire section contents,
2101 just the padding after group flags. Release alloc'd memory
2102 after a seek or read failure.
2104 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2106 * peXXigen.c (pe_is_repro): New function.
2107 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2108 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2110 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2112 * peXXigen.c (debug_type_names): Add names for new debug data type
2115 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2117 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2118 inner loop. Fix a memory leak.
2120 2020-01-30 Alan Modra <amodra@gmail.com>
2122 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2123 or obj_coff_keep_strings here.
2124 (coff_get_normalized_symtab): Free external syms directly.
2125 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2128 2020-01-27 Jim Wilson <jimw@sifive.com>
2130 * cpu-riscv.c (riscv_scan): New.
2131 (N): Change bfd_default_scan to riscv_scan.
2133 2020-01-27 Andreas Schwab <schwab@suse.de>
2135 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2136 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2137 * Makefile.in: Regenerate.
2138 * cpu-plugin.c: Remove.
2139 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2140 (bfd_plugin_arch): Remove declaration.
2141 * bfd-in2.h: Regenerate.
2142 * po/SRC-POTFILES.in: Regenerate.
2144 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2145 Alan Modra <amodra@gmail.com>
2148 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2150 2020-01-24 Jim Wilson <jimw@sifive.com>
2152 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2153 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2154 avoid over long line.
2156 2020-01-24 Nick Clifton <nickc@redhat.com>
2159 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2160 syms and keep strings flags as these may have been set in order to
2161 prevent a bogus call to free.
2163 2020-01-23 Nick Clifton <nickc@redhat.com>
2165 * po/fr.po: Updated French translation.
2167 2020-01-23 Alan Modra <amodra@gmail.com>
2170 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2171 by zero when p_align is zero.
2173 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2175 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2176 (riscv_prefix_cmp): Likewise.
2177 (riscv_non_std_ext_p): Deleted.
2178 (riscv_std_sv_ext_p): Likewise.
2179 (riscv_non_std_sv_ext_p): Likewise.
2180 (riscv_merge_non_std_and_sv_ext): Rename to...
2181 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2182 (riscv_merge_arch_attr_info): Replace 3 calls to
2183 riscv_merge_non_std_and_sv_ext with single call to
2184 riscv_merge_multi_letter_ext.
2185 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2186 encounter a 'z' prefix.
2187 (riscv_get_prefix_class): New function, return prefix class based
2188 on first few characters of input string.
2189 (riscv_parse_config): New structure to factor out minor differences
2190 in extension class parsing behaviour.
2191 (riscv_parse_sv_or_non_std_ext): Rename to...
2192 (riscv_parse_prefixed_ext): and parameterise with
2194 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2195 (riscv_multi_letter_ext_valid_p): New.
2196 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2197 (riscv_parse_subset): Delegate all non-single-letter parsing work
2198 to riscv_parse_prefixed_ext.
2199 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2200 (riscv_get_prefix_class): Declare.
2202 2020-01-22 Alan Modra <amodra@gmail.com>
2204 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2205 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2206 __tls_get_addr_desc.
2207 (ppc64_elf_size_stubs): Add section for linker generated
2208 __tls_get_addr_desc wrapper function. Loop at least once if
2209 generating this function.
2210 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2211 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2213 2020-01-22 Alan Modra <amodra@gmail.com>
2215 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2216 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2218 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2219 (STDU_R1_0R1, ADDI_R1_R1): Define.
2220 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2221 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2222 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2223 no_tls_get_addr_regsave.
2224 (branch_reloc_hash_match): Add hash3 and hash4.
2225 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2226 (ppc64_elf_size_dynamic_sections): Likewise.
2227 (ppc64_elf_relocate_section): Likewise.
2228 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2229 __tls_get_addr stub.
2230 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2232 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2233 eh_frame for regsave __tls_get_addr.
2235 2020-01-22 Alan Modra <amodra@gmail.com>
2237 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2238 which __tls_get_addr calls will be eliminated.
2240 2020-01-20 Nick Clifton <nickc@redhat.com>
2242 * po/pt.po: Updates Portuguese translation.
2243 * po/ru.po: Updated Russian translation.
2244 * po/uk.po: Updated Ukranian translation.
2246 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2249 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2250 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2252 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2253 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2254 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2255 "rex leal x@tlsdesc(%rip), %reg" to
2256 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2257 "call *(%eax)" to "nopl (%rax)".
2259 2020-01-20 Alan Modra <amodra@gmail.com>
2261 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2262 (MTLR_R11): Don't define.
2263 (LD_R0_0R3, CMPDI_R0_0): Define.
2264 (build_tls_get_addr_stub): Don't use r11 in stub.
2266 2020-01-20 Alan Modra <amodra@gmail.com>
2268 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2269 (defined_sym_val, is_tls_get_addr): Likewise.
2271 2020-01-18 Nick Clifton <nickc@redhat.com>
2273 * version.m4 (BFD_VERSION): Set to 2.34.50.
2274 * configure: Regenerate.
2275 * po/bfd.pot: Regenerate.
2277 2020-01-18 Nick Clifton <nickc@redhat.com>
2279 Binutils 2.34 branch created.
2281 2020-01-17 Christian Biesinger <cbiesinger@google.com>
2283 * coff-arm.c: Fix spelling error (seperate).
2284 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2286 * sysdep.h (strnlen): Fix spelling error (seperate).
2288 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
2291 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2293 2020-01-15 Alan Modra <amodra@gmail.com>
2296 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2297 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2298 of function symbols unless dot symbols are present. Do warn
2299 whenever one is created, regardles of whether a PLT entry is
2300 also emitted for the function symbol.
2302 2020-01-14 Alan Modra <amodra@gmail.com>
2304 * som.c (som_bfd_count_ar_symbols): Error when file position
2305 of symbols on chains is not strictly increasing.
2307 2020-01-14 Alan Modra <amodra@gmail.com>
2309 * vms.h (VMS_DEBUG): Define as 0.
2310 * vms-alpha.c (image_write): Move debug output after bounds check.
2312 (_bfd_vms_slurp_eihd): Warning fix.
2313 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2315 2020-01-13 Alan Modra <amodra@gmail.com>
2317 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2318 for "ignored" records.
2320 2020-01-13 Alan Modra <amodra@gmail.com>
2322 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2323 Delete asect name check. Move asect NULL check to wasm_object_p.
2324 Correct bounds check of sizes against end. Replace uses of
2325 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2326 just one bfd_release.
2327 (wasm_scan): Don't use malloc/strdup for section names,
2328 bfd_alloc instead. Simplify code prefixing section name.
2329 Formatting. Don't attempt to free memory here..
2330 (wasm_object_p): ..do so here.
2332 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2335 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2336 UNDEFWEAK_NO_DYNAMIC_RELOC.
2337 (allocate_dynrelocs_for_symbol): Likewise.
2339 2020-01-10 Tamar Christina <tamar.christina@arm.com>
2342 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2344 2020-01-10 Alan Modra <amodra@gmail.com>
2346 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2348 2020-01-09 Nick Clifton <nickc@redhat.com>
2351 * bfd.c (bfd_convert_section_contents): Check for a compress
2352 header size that is larger than the actual section size.
2354 2020-01-08 Alan Modra <amodra@gmail.com>
2357 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2358 after removing sections.
2360 2020-01-06 Jim Wilson <jimw@sifive.com>
2363 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2364 check for !bfd_link_pic (info).
2365 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2366 <R_RISCV_JAL>: Add comment.
2367 (_bfd_riscv_relax_section): For plt.offset check, add check for
2368 bfd_link_pic (info). Add comment.
2370 2020-01-06 Alan Modra <amodra@gmail.com>
2372 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2373 match failures. Don't init to bfd_error_wrong_format before
2374 calling _bfd_check_format.
2376 2020-01-06 Alan Modra <amodra@gmail.com>
2378 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2379 status rather than exiting on stack overflow or underflow.
2380 (_bfd_vms_slurp_etir): Adjust to suit.
2382 2020-01-06 Alan Modra <amodra@gmail.com>
2384 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2386 2020-01-06 Alan Modra <amodra@gmail.com>
2388 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2389 command. Check name offset is within command.
2390 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2391 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2392 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2393 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2394 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2395 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2396 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2397 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2398 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2399 (bfd_mach_o_read_segment): Similarly.
2400 (bfd_mach_o_read_thread): Properly bound check thread struct.
2401 Don't repeat checks on second loop.
2402 (bfd_mach_o_read_command): Fail on invalid command length.
2404 2020-01-04 Alan Modra <amodra@gmail.com>
2406 * format.c (bfd_check_format_matches): Add preserve_match.
2407 Save initial bfd state in "preserve", matched bfd state in
2408 "preserve_match". Save just the first match. Release
2409 bfd_alloc memory. Restore and finish preserved state as
2410 appropriate on all function exit paths.
2412 2020-01-04 Alan Modra <amodra@gmail.com>
2414 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2416 2020-01-04 Alan Modra <amodra@gmail.com>
2418 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2421 2020-01-03 Nick Clifton <nickc@redhat.com>
2424 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2425 there is enough data remaining in the code buffer before
2426 attempting to read a function stub.
2428 2020-01-03 Nick Clifton <nickc@redhat.com>
2431 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2432 return value from bfd_malloc.
2433 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2434 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2435 (elf32_arm_filter_cmse_symbols): Likewise.
2436 (elf32_arm_write_section): Likewise.
2437 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2438 (bfd_mach_o_follow_dsym): Likewise.
2439 * pef.c (bfd_pef_print_loader_section): Likewise.
2440 (bfd_pef_scan_start_address): Likewise.
2441 (bfd_pef_parse_function_stubs): Likewise.
2442 (bfd_pef_parse_symbols): Likewise.
2444 2020-01-03 Sergei Trofimovich <siarheit@google.com>
2446 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2447 on binary inputs ld/PR25316.
2448 (is_ia64_elf): new helper to filter on ia64 objects.
2450 2020-01-03 Jan Beulich <jbeulich@suse.com>
2452 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2454 (bfd_mach_o_scan): Insert underscore in two variable names.
2456 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2458 * Makefile.am: Add z80-elf target support.
2459 * configure.ac: Likewise.
2460 * targets.c: Likewise.
2461 * Makefile.in: Regenerate.
2462 * configure: Regenerate.
2463 * config.bfd: Add z80-elf target support and new arches: ez80 and
2465 * elf32-z80.c: New file.
2466 * archures.c: Add new z80 architectures: eZ80 and Z180.
2467 * coffcode.h: Likewise.
2468 * cpu-z80.c: Likewise.
2469 * coff-z80.c: Add new relocations for Z80 target and local label
2471 * reloc.c: Add new relocs.
2472 * bfd-in2.h: Regenerate.
2473 * libbfd.h: Regenerate.
2475 2020-01-02 Tamar Christina <tamar.christina@arm.com>
2479 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2481 2020-01-01 Alan Modra <amodra@gmail.com>
2483 Update year range in copyright notice of all files.
2485 For older changes see ChangeLog-2019
2487 Copyright (C) 2020 Free Software Foundation, Inc.
2489 Copying and distribution of this file, with or without modification,
2490 are permitted in any medium without royalty provided the copyright
2491 notice and this notice are preserved.
2497 version-control: never