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