1 2020-07-09 Alan Modra <amodra@gmail.com>
6 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
7 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
9 (coff_write_object_contents): Remove PPC_PE code.
10 * config.bfd: Move powerpcle-pe to removed targets.
11 * configure.ac: Remove powerpc PE entries.
12 * libcoff-in.h (ppc_allocate_toc_section): Delete.
13 (ppc_process_before_allocation): Delete.
14 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
15 * targets.c: Remove powerpc PE vectors.
16 * po/SRC-POTFILES.in: Regenerate.
17 * libcoff.h: Regenerate.
18 * Makefile.in: Regenerate.
19 * configure: Regenerate.
21 2020-07-09 Nick Clifton <nickc@redhat.com>
23 * po/fr.po: Updated French translation.
25 2020-07-07 Alan Modra <amodra@gmail.com>
27 * xcofflink.c (xcoff_mark): Don't mark const sections.
28 (bfd_xcoff_record_link_assignment): Add FIXME.
29 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
30 sections being discarded by linker script.
32 2020-07-07 Alan Modra <amodra@gmail.com>
34 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
35 time, uid, gid and mode for deterministic archive.
36 (xcoff_write_archive_contents_big): Likewise.
38 2020-07-07 Alan Modra <amodra@gmail.com>
40 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
43 2020-07-06 Nick Clifton <nickc@redhat.com>
45 * po/pt.po: Updated Portuguese translation.
46 * po/uk.po: Updated Ukranian translation.
48 2020-07-04 Nick Clifton <nickc@redhat.com>
50 * version.m4: Set version to 2.35.50.
51 * configure: Regenerate.
52 * po/bbfd.pot: Regenerate.
54 2020-07-04 Nick Clifton <nickc@redhat.com>
56 Binutils 2.35 branch created.
58 2020-07-01 Alan Modra <amodra@gmail.com>
61 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
62 raw syment index before dereferencing.
64 2020-07-01 Alan Modra <amodra@gmail.com>
66 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
68 2020-07-01 Alan Modra <amodra@gmail.com>
70 * config.bfd: Obsolete xc16x.
72 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
74 * archures.c (bfd_mach_i386_nacl): Removed.
75 (bfd_mach_i386_i386_nacl): Likewise.
76 (bfd_mach_x86_64_nacl): Likewise.
77 (bfd_mach_x64_32_nacl): Likewise.
78 * config.bfd: Remove *-*-nacl* targets.
79 * configure.ac: Remove x86 NaCl target vectors.
80 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
81 (bfd_x64_32_nacl_arch): Likewise.
82 (bfd_x86_64_nacl_arch): Likewise.
83 (bfd_i386_nacl_arch): Likewise.
84 (bfd_x64_32_arch_intel_syntax): Updated.
85 * elf32-i386.c: Don't include "elf-nacl.h".
86 (elf_i386_nacl_plt): Removed.
87 (elf_i386_nacl_plt0_entry): Likewise.
88 (elf_i386_nacl_plt_entry): Likewise.
89 (elf_i386_nacl_pic_plt0_entry): Likewise.
90 (elf_i386_nacl_pic_plt_entry): Likewise.
91 (elf_i386_nacl_eh_frame_plt): Likewise.
92 (elf_i386_nacl_plt): Likewise.
93 (elf32_i386_nacl_elf_object_p): Likewise.
94 (elf_i386_get_synthetic_symtab): Updated.
95 (elf_i386_link_setup_gnu_properties): Likewise.
96 * elf64-x86-64.c: Don't include "elf-nacl.h".
97 (elf_x86_64_nacl_plt): Removed.
98 (elf64_x86_64_nacl_elf_object_p): Likewise.
99 (elf_x86_64_nacl_plt0_entry): Likewise.
100 (elf_x86_64_nacl_plt_entry): Likewise.
101 (elf_x86_64_nacl_eh_frame_plt): Likewise.
102 (elf_x86_64_nacl_plt): Likewise.
103 (elf32_x86_64_nacl_elf_object_p): Likewise.
104 (elf_x86_64_get_synthetic_symtab): Updated.
105 (elf_x86_64_link_setup_gnu_properties): Likewise.
106 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
107 * targets.c: Remove x86 NaCl target vectors.
108 * bfd-in2.h: Regenerated.
109 * configure: Likewise.
111 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
113 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
114 _bfd_elf_add_dynamic_tags.
116 2020-06-29 Alan Modra <amodra@gmail.com>
118 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
119 return value of bfd_bread. Don't read more than requested length.
120 Sanity check length. Properly terminate file name.
122 2020-06-29 Alan Modra <amodra@gmail.com>
124 * arc-got.h: Use C style comments.
125 * coff-z80.c: Likewise.
126 * elf32-csky.c: Likewise.
127 * peXXigen.c: Likewise.
128 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
131 2020-06-26 Pat Bernardi <bernardi@adacore.com>
133 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
134 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
136 2020-06-26 Alan Modra <amodra@gmail.com>
138 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
139 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
140 (riscv_get_priv_spec_name): Move to..
141 * cpu-riscv.c: ..here.
142 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
143 Use %u to print unsigned numbers.
145 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
147 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
148 default architecture.
150 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
153 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
154 _bfd_elf_add_dynamic_tags.
156 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
159 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
160 _bfd_elf_add_dynamic_tags.
162 2020-06-24 Alan Modra <amodra@gmail.com>
164 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
165 shifts without undefined behaviour.
167 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
169 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
171 (_bfd_elf_add_dynamic_tags): New.
172 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
173 _bfd_elf_add_dynamic_tags.
174 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
175 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
176 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
177 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
178 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
179 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
180 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
181 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
183 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
184 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
185 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
186 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
187 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
188 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
189 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
190 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
191 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
193 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
194 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
195 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
196 _bfd_elf_maybe_vxworks_add_dynamic_tags.
197 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
198 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
200 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
201 (_bfd_x86_elf_size_dynamic_sections): Likewise.
202 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
203 dt_reloc_sz and dt_reloc_ent.
204 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
205 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
207 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
208 etab.dt_pltgot_required.
209 (elf32_hppa_size_dynamic_sections): Call
210 _bfd_elf_add_dynamic_tags.
211 * elf32-metag.c (elf_metag_link_hash_table_create): Set
212 etab.dt_pltgot_required.
213 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
214 * elf32-sh.c (sh_elf_link_hash_table_create): Set
215 root.dt_pltgot_required for FDPIC output.
216 (sh_elf_size_dynamic_sections): Call
217 _bfd_elf_maybe_vxworks_add_dynamic_tags.
218 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
219 elf.dt_pltgot_required.
220 (elf_xtensa_size_dynamic_sections): Call
221 _bfd_elf_add_dynamic_tags.
222 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
223 root.dt_pltgot_required.
224 (elf64_hppa_size_dynamic_sections): Call
225 _bfd_elf_add_dynamic_tags.
226 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
227 root.dt_pltgot_required.
228 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
229 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
230 * elflink.c (_bfd_elf_add_dynamic_tags): New.
232 2020-06-22 Saagar Jha <saagar@saagarjha.com>
234 * mach-o.c: Support the new load commands by reading a linkedit
235 data command for them.
237 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
239 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
240 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
241 (riscv_get_priv_spec_class): Likewise.
242 (riscv_get_priv_spec_name): Likewise.
243 (riscv_get_priv_spec_class_from_numbers): New function, convert
244 the version numbers into string, then call riscv_get_priv_spec_class
245 to get the priv spec class.
246 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
247 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
248 (riscv_get_priv_spec_name): Likewise.
249 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
250 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
251 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
252 of input and output objects form their priv spec attributes by
253 riscv_get_priv_spec_class_from_numbers. Report warning rather than
254 errors when linking objects with differnet priv spec versions. We do
255 know v1.9.1 may have conflicts to other versions, so report the
256 warning, too. After that, update the output priv spec version to the
259 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
261 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
262 priv attributes, we will check the conflicts for all of them (major,
263 minor and revision), and then set the priv_attrs_merged to TRUE to
264 indicate that we have handled all of the priv attributes. Remove
265 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
267 2020-06-21 Alan Modra <amodra@gmail.com>
270 * configure.ac: Disable plugins by default for some targets.
271 * plugin.c: Comment typo fix.
272 * configure: Regenerate.
274 2020-06-19 Nick Clifton <nickc@redhat.com>
276 * plugin.c (try_load_plugin): Suppress the error message about
277 being unable to open a plugin if creating a list of viable
280 2020-06-16 Alan Modra <amodra@gmail.com>
282 * aout-tic30.c: Delete file.
283 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
284 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
285 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
286 (xc16x-*-elf): Sort properly.
287 * configure.ac: Remove tic30_aout_vec.
288 * targets.c: Likewise.
289 * Makefile.in: Regenerate.
290 * configure: Regenerate.
291 * po/SRC-POTFILES.in: Regenerate.
293 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
295 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
296 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
297 (elf32xtensa_abi): New global variable.
298 (xtensa_abi_choice): New function.
299 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
300 XSHAL_ABI to select PLT code.
302 2020-06-15 Roland McGrath <mcgrathr@google.com>
304 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
305 field of bfd_link_info.
307 2020-06-15 Alan Modra <amodra@gmail.com>
309 * config.bfd: Obsolete powerpcle-*-pe targets.
311 2020-06-15 Alan Modra <amodra@gmail.com>
314 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
315 symbols that were defined in discarded sections.
316 * cofflink.c (coff_link_check_archive_element): Likewise.
317 (coff_link_add_symbols): Set indx to -3 for symbols defined in
319 (_bfd_coff_write_global_sym): Don't emit such symbols.
320 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
321 libcoff.h: Regenerate.
323 2020-06-11 Alan Modra <amodra@gmail.com>
326 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
328 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
330 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
331 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
332 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
335 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
338 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
339 Clear verinfo.verdef.
341 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
344 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
345 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
346 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
348 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
349 Set ifunc_resolvers if there are FUNC resolvers.
350 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
351 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
352 with elf.ifunc_resolvers.
353 (write_plt_relocs_for_local_syms): Likewise.
354 (ppc64_elf_relocate_section): Likewise.
355 (ppc64_elf_finish_dynamic_sections): Likewise.
356 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
358 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
359 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
360 instead of readonly_dynrelocs_against_ifunc.
361 * elfxx-x86.h (elf_x86_link_hash_table): Remove
362 readonly_dynrelocs_against_ifunc.
364 2020-06-09 Alan Modra <amodra@gmail.com>
366 * elf64-ppc.c (struct ppc_link_hash_table): Delete
367 maybe_local_ifunc_resolver field.
368 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
369 cases where maybe_local_ifunc_resolver was set.
370 (ppc64_elf_relocate_section): Likewise.
371 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
374 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
376 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
378 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
380 (elf32_arm_size_dynamic_sections): Updated. Clear
381 root.tlsdesc_plt for DF_BIND_NOW.
382 (elf32_arm_finish_dynamic_sections): Updated.
383 (elf32_arm_output_arch_local_syms): Likewise.
384 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
385 Clear root.tlsdesc_plt for DF_BIND_NOW.
386 (nds32_elf_finish_dynamic_sections): Updated.
387 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
388 dt_tlsdesc_plt and dt_tlsdesc_got.
389 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
390 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
391 tlsdesc_plt and dt_tlsdesc_got.
392 (elfNN_aarch64_allocate_dynrelocs): Updated.
393 (elfNN_aarch64_finish_dynamic_sections): Likewise.
394 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
395 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
397 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
398 (_bfd_x86_elf_size_dynamic_sections): Likewise.
399 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
400 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
403 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
405 * elf32-tic6x.c (elf32_bed): Defined the default to
408 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
410 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
412 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
413 root.splt/root.srelplt.
414 (elf64_hppa_create_dynamic_sections): Likewise.
415 (elf64_hppa_size_dynamic_sections): Likewise.
416 (elf64_hppa_finish_dynamic_symbol): Likewise.
417 (elf_hppa_final_link): Likewise.
418 (elf_hppa_final_link_relocate): Likewise.
420 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
422 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
423 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
426 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
428 * elf-bfd.h (elf_target_os): New.
429 (elf_link_hash_table): Add target_os.
430 (elf_backend_data): Add target_os.
431 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
432 symbian_p and nacl_p.
433 (create_got_section): Updated.
434 (elf32_arm_create_dynamic_sections): Likewise.
435 (arm_type_of_stub): Likewise.
436 (elf32_arm_create_or_find_stub_sec): Likewise.
437 (elf32_arm_allocate_plt_entry): Likewise.
438 (elf32_arm_populate_plt_entry): Likewise.
439 (elf32_arm_final_link_relocate): Likewise.
440 (elf32_arm_check_relocs): Likewise.
441 (allocate_dynrelocs_for_symbol): Likewise.
442 (elf32_arm_finish_dynamic_symbol): Likewise.
443 (elf32_arm_finish_dynamic_sections): Likewise.
444 (elf32_arm_output_plt_map_1): Likewise.
445 (elf32_arm_output_arch_local_syms): Likewise.
446 (elf32_arm_add_symbol_hook): Likewise.
447 (elf32_arm_nacl_link_hash_table_create): Likewise.
448 (elf32_arm_vxworks_link_hash_table_create): Likewise.
449 (elf32_arm_symbian_link_hash_table_create): Likewise.
450 (ELF_TARGET_OS): New.
451 * elf32-i386.c (elf_i386_arch_bed): Removed.
452 (elf_backend_arch_data): Likewise.
453 (elf_i386_solaris_arch_bed): Likewise.
454 (elf_i386_nacl_arch_bed): Likewise.
455 (elf_i386_vxworks_arch_bed): Likewise.
456 (elf_i386_relocate_section): Updated.
457 (elf_i386_finish_dynamic_sections): Likewise.
458 (elf_i386_get_synthetic_symtab): Likewise.
459 (elf_i386_link_setup_gnu_properties): Likewise.
460 (ELF_TARGET_OS): New.
461 * elf32-mips.c (ELF_TARGET_OS): New.
462 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
463 (ppc_elf_create_got): Updated.
464 (ppc_elf_create_dynamic_sections): Likewise.
465 (ppc_elf_check_relocs): Likewise.
466 (ppc_elf_adjust_dynamic_symbol): Likewise.
467 (ppc_elf_size_dynamic_sections): Likewise.
468 (ppc_elf_relocate_section): Likewise.
469 (ppc_elf_finish_dynamic_sections): Likewise.
470 (ppc_elf_vxworks_link_hash_table_create): Likewise.
471 (ELF_TARGET_OS): New.
472 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
473 (sh_elf_link_hash_table_create): Updated.
474 (sh_elf_create_dynamic_sections): Likewise.
475 (allocate_dynrelocs): Likewise.
476 (sh_elf_size_dynamic_sections): Likewise.
477 (sh_elf_relocate_section): Likewise.
478 (sh_elf_finish_dynamic_symbol): Likewise.
479 (sh_elf_finish_dynamic_sections): Likewise.
480 (ELF_TARGET_OS): New.
481 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
483 (bfd_elf32_bfd_link_hash_table_create): Likewise.
484 (ELF_TARGET_OS): New.
485 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
486 (elf_x86_64_solaris_arch_bed): Likewise.
487 (elf_x86_64_nacl_arch_bed): Likewise.
488 (elf_x86_64_finish_dynamic_sections): Updated.
489 (elf_x86_64_get_synthetic_symtab): Likewise.
490 (elf_x86_64_link_setup_gnu_properties): Likewise.
491 (ELF_TARGET_OS): New.
492 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
494 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
495 (MIPS_ELF_REL_DYN_NAME): Updated.
496 (ELF_MIPS_GP_OFFSET): Likewise.
497 (mips_elf_create_local_got_entry): Likewise.
498 (mips_elf_allocate_dynamic_relocations): Likewise.
499 (mips_elf_count_got_symbols): Likewise.
500 (is_gott_symbol): Likewise.
501 (mips_elf_calculate_relocation): Likewise.
502 (mips_elf_create_dynamic_relocation): Likewise.
503 (_bfd_mips_elf_check_relocs): Likewise.
504 (allocate_dynrelocs): Likewise.
505 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
506 (mips_elf_lay_out_got): Likewise.
507 (mips_elf_set_plt_sym_value): Likewise.
508 (_bfd_mips_elf_size_dynamic_sections): Likewise.
509 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
510 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
511 (_bfd_mips_elf_final_link): Likewise.
512 (_bfd_mips_init_file_header): Likewise.
513 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
515 (allocate_dynrelocs): Likewise.
516 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
517 (_bfd_sparc_elf_relocate_section): Likewise.
518 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
519 (sparc_finish_dyn): Likewise.
520 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
521 * elfxx-target.h (ELF_TARGET_OS): New.
522 (elfNN_bed): Add ELF_TARGET_OS.
523 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
524 (_bfd_x86_elf_link_hash_table_create): Likewise.
525 (_bfd_x86_elf_size_dynamic_sections): Likewise.
526 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
527 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
528 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
529 * elfxx-x86.h (elf_x86_target_os): Removed.
530 (elf_x86_backend_data): Likewise.
531 (get_elf_x86_backend_data): Likewise.
532 (elf_x86_link_hash_table): Remove target_os.
534 2020-06-06 Alan Modra <amodra@gmail.com>
537 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
538 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
539 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
540 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
541 * elf64-ppc.c: Update throughout for reloc renaming.
542 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
543 * libbfd.h: Regenerate.
544 * bfd-in2.h: Regenerate.
546 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
549 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
552 2020-06-05 Nick Clifton <nickc@redhat.com>
554 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
557 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
559 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
560 priv_may_conflict, in_priv_zero and out_priv_zero to decide
561 whether the object can be linked according to it's priv
562 attributes. The object without any priv spec attributes can
563 be linked with others. If the first input object doesn't contain
564 any priv attributes, then we need to copy the setting from the
565 next input one. Also report more detailed error messages to user.
567 2020-06-04 Stephen Casner <casner@acm.org>
569 Extend pdp11-aout symbol table format to accommodate .stab
570 symbols and implement correct handling of them.
572 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
573 (N_STAB, is_stab): Needed new function is_stab to disambiguate
574 normal vs. .stab symbol table type values, replacing N_STAB mask.
575 (translate_from_native_sym_flags): Determine correct section for
576 different .stab types.
577 (translate_to_native_sym_flags): Leave .stab types intact.
578 (translate_symbol_table): Error if symbol indicates overlay;
579 store desc field from .stab symbols.
580 (write_syms): Output desc field with symbol.
581 (aout_link_check_ar_symbols): Skip .stab symbols.
582 (aout_link_add_symbols): Correctly distinguish .stab symbols.
583 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
584 (aout_link_write_symbols): Write 0 for desk and ovly fields;
585 correctly distinguish .stab symbols and select calculate their
586 section and value; and copy desc and ovly fields from input symbol
589 2020-06-04 Stephen Casner <casner@acm.org>
591 * aoutx.h (translate_symbol_table): Comment had external and
593 * pdp11.c (translate_symbol_table): Likewise.
595 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
597 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
598 (is_x86_elf): Check elf.hash_table_id instead of target_id.
599 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
601 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
604 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
605 in debug section against symbol defined in shared library to 0.
606 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
607 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
608 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
609 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
610 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
611 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
612 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
613 * elf32-sh.c (sh_elf_check_relocs): Likewise.
614 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
615 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
616 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
617 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
618 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
619 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
621 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
622 there is non-GOT reference.
623 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
624 non-alloced sections.
626 2020-06-03 Stephen Casner <casner@acm.org>
628 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
630 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
632 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
633 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
634 other size that doesn't qcover the header word.
635 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
636 string table, and zero it.
637 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
638 message and set bfd_error on finding an invalid name string offset.
639 (add_to_stringtab): INLINE -> inline
640 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
642 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
643 any relocs that could not be recognised.
644 92744f05809 PR 20929 - Check for relocs without an associated symbol.
645 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
646 name exists and is long enough, before attempting to see if it is
648 c3864421222 - Correct case for N_SO being the last symbol.
649 50455f1ab29 PR 20891 - Handle the case where the main file name
650 and the directory name are both empty.
651 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
652 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
653 range string table offsets.
654 531336e3a0b PR 20909 - Fix off-by-one error in check for an
655 illegal string offset.
656 (aout_link_includes_newfunc): Add comment.
657 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
658 on unexpected relocation type rather than ASSERT.
660 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
663 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
664 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
666 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
669 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
670 non-alloced sections.
672 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
674 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
675 dynamic relocations for non SEC_ALLOC sections.
677 2020-06-03 Gunther Nikl <gnikl@justmail.de>
679 * aout64.c (BMAGIC, QMAGIC): Do not define.
680 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
681 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
682 to check the file format.
683 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
684 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
685 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
687 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
689 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
690 relocations for non SEC_ALLOC sections.
692 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
694 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
695 * elf32-arm.c (maybe_set_textrel): Removed.
696 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
697 with _bfd_elf_maybe_set_textrel.
698 * elf32-csky.c (maybe_set_textrel): Removed.
699 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
700 with _bfd_elf_maybe_set_textrel.
701 * elf32-hppa.c (maybe_set_textrel): Removed.
702 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
703 with _bfd_elf_maybe_set_textrel.
704 * elf32-lm32.c (maybe_set_textrel): Removed.
705 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
706 with _bfd_elf_maybe_set_textrel.
707 * elf32-m32r.c (maybe_set_textrel): Removed.
708 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
709 with _bfd_elf_maybe_set_textrel.
710 * elf32-metag.c (maybe_set_textrel): Removed.
711 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
712 with _bfd_elf_maybe_set_textrel.
713 * elf32-nds32.c (maybe_set_textrel): Removed.
714 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
715 with _bfd_elf_maybe_set_textrel.
716 * elf32-or1k.c (maybe_set_textrel): Removed.
717 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
718 with _bfd_elf_maybe_set_textrel.
719 * elf32-ppc.c (maybe_set_textrel): Removed.
720 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
721 with _bfd_elf_maybe_set_textrel.
722 * elf32-s390.c (maybe_set_textrel): Removed.
723 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
724 with _bfd_elf_maybe_set_textrel.
725 * elf32-sh.c (maybe_set_textrel): Removed.
726 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
727 with _bfd_elf_maybe_set_textrel.
728 * elf32-tic6x.c (maybe_set_textrel): Removed.
729 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
730 with _bfd_elf_maybe_set_textrel.
731 * elf32-tilepro.c (maybe_set_textrel): Removed.
732 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
733 with _bfd_elf_maybe_set_textrel.
734 * elf64-ppc.c (maybe_set_textrel): Removed.
735 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
736 with _bfd_elf_maybe_set_textrel.
737 * elf64-s390.c (maybe_set_textrel): Removed.
738 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
739 with _bfd_elf_maybe_set_textrel.
740 * elfnn-aarch64.c (maybe_set_textrel): Removed.
741 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
742 with _bfd_elf_maybe_set_textrel.
743 * elfnn-riscv.c (maybe_set_textrel): Removed.
744 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
745 with _bfd_elf_maybe_set_textrel.
746 * elfxx-sparc.c (maybe_set_textrel): Removed.
747 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
748 with _bfd_elf_maybe_set_textrel.
749 * elfxx-tilegx.c (maybe_set_textrel): Removed.
750 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
751 with _bfd_elf_maybe_set_textrel.
752 * elfxx-x86.c (maybe_set_textrel): Removed.
753 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
754 with _bfd_elf_maybe_set_textrel.
755 * elflink.c (_bfd_elf_maybe_set_textrel): New.
757 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
760 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
762 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
763 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
764 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
765 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
767 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
768 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
769 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
770 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
771 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
772 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
773 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
774 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
775 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
776 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
777 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
778 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
779 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
780 (elf_backend_copy_indirect_symbol): Likewise.
781 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
782 (elf_backend_copy_indirect_symbol): Likewise.
783 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
785 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
788 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
789 * elf32-arm.c (readonly_dynrelocs): Removed.
790 (maybe_set_textrel): Replace readonly_dynrelocs with
791 _bfd_elf_readonly_dynrelocs.
792 * elf32-csky.c (readonly_dynrelocs): Removed.
793 (maybe_set_textrel): Replace readonly_dynrelocs with
794 _bfd_elf_readonly_dynrelocs.
795 * elf32-hppa.c(readonly_dynrelocs): Removed.
796 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
797 _bfd_elf_readonly_dynrelocs.
798 (maybe_set_textrel): Likewise.
799 * elf32-lm32.c (readonly_dynrelocs): Removed.
800 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
801 with _bfd_elf_readonly_dynrelocs.
802 (maybe_set_textrel): Likewise.
803 * elf32-m32r.c (readonly_dynrelocs): Removed.
804 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
805 with _bfd_elf_readonly_dynrelocs.
806 (maybe_set_textrel): Likewise.
807 * elf32-metag.c (readonly_dynrelocs): Removed.
808 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
809 with _bfd_elf_readonly_dynrelocs.
810 (maybe_set_textrel): Likewise.
811 * elf32-microblaze.c (readonly_dynrelocs): Removed.
812 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
813 with _bfd_elf_readonly_dynrelocs.
814 * elf32-nds32.c (readonly_dynrelocs): Removed.
815 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
816 with _bfd_elf_readonly_dynrelocs.
817 (maybe_set_textrel): Likewise.
818 * elf32-or1k.c (readonly_dynrelocs): Removed.
819 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
820 with _bfd_elf_readonly_dynrelocs.
821 * elf32-ppc.c (readonly_dynrelocs): Removed.
822 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
823 _bfd_elf_readonly_dynrelocs.
824 (ppc_elf_adjust_dynamic_symbol): Likewise.
825 (maybe_set_textrel): Likewise.
826 * elf32-s390.c (readonly_dynrelocs): Removed.
827 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
828 with _bfd_elf_readonly_dynrelocs.
829 (maybe_set_textrel): Likewise.
830 * elf32-sh.c (readonly_dynrelocs): Removed.
831 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
832 _bfd_elf_readonly_dynrelocs.
833 (maybe_set_textrel): Likewise.
834 * elf32-tic6x.c (readonly_dynrelocs): Removed.
835 (maybe_set_textrel): Replace readonly_dynrelocs with
836 _bfd_elf_readonly_dynrelocs.
837 * elf32-tilepro.c (readonly_dynrelocs): Removed.
838 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
839 with _bfd_elf_readonly_dynrelocs.
840 (maybe_set_textrel): Likewise.
841 * elf64-ppc.c (readonly_dynrelocs): Removed.
842 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
843 _bfd_elf_readonly_dynrelocs.
844 (ppc64_elf_adjust_dynamic_symbol): Likewise.
845 (maybe_set_textrel): Likewise.
846 * elf64-s390.c (readonly_dynrelocs): Removed.
847 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
848 with _bfd_elf_readonly_dynrelocs.
849 (maybe_set_textrel): Likewise.
850 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
851 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
852 (maybe_set_textrel): Replace readonly_dynrelocs with
853 _bfd_elf_readonly_dynrelocs.
854 * elfnn-riscv.c (readonly_dynrelocs): Removed.
855 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
856 with _bfd_elf_readonly_dynrelocs.
857 (maybe_set_textrel): Likewise.
858 * elfxx-sparc.c (readonly_dynrelocs): Removed.
859 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
860 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
861 (maybe_set_textrel): Likewise.
862 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
863 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
864 with _bfd_elf_readonly_dynrelocs.
865 (maybe_set_textrel): Likewise.
866 * elfxx-x86.c (readonly_dynrelocs): Removed.
867 (maybe_set_textrel): Replace readonly_dynrelocs with
868 _bfd_elf_readonly_dynrelocs.
869 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
871 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
873 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
874 -fsanitize=undefined.
876 2020-06-03 Alan Modra <amodra@gmail.com>
880 * peicode.h (pe_ILF_make_a_section): Align data for compilers
882 (pe_ILF_build_a_bfd): Likewise.
884 2020-06-03 Alan Modra <amodra@gmail.com>
887 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
888 core files as well as objects.
890 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
893 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
894 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
896 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
897 (elf_arc_link_hash_newfunc): Updated.
898 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
899 (elf32_arm_link_hash_newfunc): Updated.
900 (elf32_arm_copy_indirect_symbol): Likewise.
901 (elf32_arm_check_relocs): Likewise.
902 (readonly_dynrelocs): Likewise.
903 (allocate_dynrelocs_for_symbol): Likewise.
904 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
905 (csky_elf_link_hash_newfunc): Updated.
906 (csky_allocate_dynrelocs): Likewise.
907 (readonly_dynrelocs): Likewise.
908 (csky_elf_copy_indirect_symbol): Likewise.
909 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
910 (hppa_link_hash_newfunc): Updated.
911 (elf32_hppa_copy_indirect_symbol): Likewise.
912 (elf32_hppa_hide_symbol): Likewise.
913 (elf32_hppa_adjust_dynamic_symbol): Likewise.
914 (allocate_dynrelocs): Likewise.
915 (elf32_hppa_relocate_section): Likewise.
916 * elf32-i386.c (elf_i386_check_relocs): Likewise.
917 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
918 (lm32_elf_link_hash_newfunc): Likewise.
919 (lm32_elf_link_hash_table_create): Updated.
920 (readonly_dynrelocs): Likewise.
921 (allocate_dynrelocs): Likewise.
922 (lm32_elf_copy_indirect_symbol): Likewise.
923 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
924 (m32r_elf_link_hash_newfunc): Likewise.
925 (m32r_elf_link_hash_table_create): Updated.
926 (m32r_elf_copy_indirect_symbol): Likewise.
927 (allocate_dynrelocs): Likewise.
928 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
929 (metag_link_hash_newfunc): Updated.
930 (elf_metag_copy_indirect_symbol): Likewise.
931 (readonly_dynrelocs): Likewise.
932 (allocate_dynrelocs): Likewise.
933 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
935 (link_hash_newfunc): Updated.
936 (microblaze_elf_check_relocs): Likewise.
937 (microblaze_elf_copy_indirect_symbol): Likewise.
938 (readonly_dynrelocs): Likewise.
939 (allocate_dynrelocs): Likewise.
940 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
941 (nds32_elf_link_hash_newfunc): Updated.
942 (nds32_elf_copy_indirect_symbol): Likewise.
943 (readonly_dynrelocs): Likewise.
944 (allocate_dynrelocs): Likewise.
945 (nds32_elf_check_relocs): Likewise.
946 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
947 (link_hash_newfunc): Updated.
948 (nios2_elf32_copy_indirect_symbol): Likewise.
949 (nios2_elf32_check_relocs): Likewise.
950 (allocate_dynrelocs): Likewise.
951 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
952 (or1k_elf_link_hash_newfunc): Updated.
953 (readonly_dynrelocs): Likewise.
954 (allocate_dynrelocs): Likewise.
955 (or1k_elf_copy_indirect_symbol): Likewise.
956 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
957 (ppc_elf_link_hash_newfunc): Updated.
958 (ppc_elf_copy_indirect_symbol): Likewise.
959 (ppc_elf_check_relocs): Likewise.
960 (readonly_dynrelocs): Likewise.
961 (ppc_elf_adjust_dynamic_symbol): Likewise.
962 (allocate_dynrelocs): Likewise.
963 (ppc_elf_relocate_section): Likewise.
964 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
965 (link_hash_newfunc): Updated.
966 (elf_s390_copy_indirect_symbol): Likewise.
967 (readonly_dynrelocs): Likewise.
968 (elf_s390_adjust_dynamic_symbol): Likewise.
969 (allocate_dynrelocs): Likewise.
970 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
971 (sh_elf_link_hash_newfunc): Updated.
972 (readonly_dynrelocs): Likewise.
973 (allocate_dynrelocs): Likewise.
974 (sh_elf_copy_indirect_symbol): Likewise.
975 (sh_elf_check_relocs): Likewise.
976 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
977 (elf32_tic6x_link_hash_newfunc): Likewise.
978 (elf32_tic6x_link_hash_table_create): Updated.
979 (readonly_dynrelocs): Likewise.
980 (elf32_tic6x_check_relocs): Likewise.
981 (elf32_tic6x_allocate_dynrelocs): Likewise.
982 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
984 (link_hash_newfunc): Updated.
985 (tilepro_elf_copy_indirect_symbol): Likewise.
986 (tilepro_elf_check_relocs): Likewise.
987 (allocate_dynrelocs): Likewise.
988 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
989 (ppc64_elf_copy_indirect_symbol): Updated.
990 (ppc64_elf_check_relocs): Likewise.
991 (readonly_dynrelocs): Likewise.
992 (ppc64_elf_adjust_dynamic_symbol): Likewise.
993 (dec_dynrel_count): Likewise.
994 (allocate_dynrelocs): Likewise.
995 (ppc64_elf_relocate_section): Likewise.
996 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
997 (link_hash_newfunc): Updated.
998 (elf_s390_copy_indirect_symbol): Likewise.
999 (readonly_dynrelocs): Likewise.
1000 (allocate_dynrelocs): Likewise.
1001 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1002 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1004 (elfNN_aarch64_link_hash_newfunc): Updated.
1005 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1006 (readonly_dynrelocs): Likewise.
1007 (need_copy_relocation_p): Likewise.
1008 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1009 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1010 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1011 (link_hash_newfunc): Updated.
1012 (riscv_elf_copy_indirect_symbol): Likewise.
1013 (riscv_elf_check_relocs): Likewise.
1014 (readonly_dynrelocs): Likewise.
1015 (allocate_dynrelocs): Likewise.
1016 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1018 (link_hash_newfunc): Updated.
1019 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1020 (_bfd_sparc_elf_check_relocs): Likewise.
1021 (readonly_dynrelocs): Likewise.
1022 (allocate_dynrelocs): Likewise.
1023 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1024 (link_hash_newfunc): Updated.
1025 (tilegx_elf_copy_indirect_symbol): Likewise.
1026 (tilegx_elf_check_relocs): Likewise.
1027 (readonly_dynrelocs): Likewise.
1028 (allocate_dynrelocs): Likewise.
1029 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1030 (readonly_dynrelocs): Likewise.
1031 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1032 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1034 2020-06-01 Alan Modra <amodra@gmail.com>
1036 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1037 command against cmd_length, not the end of record. For
1038 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1039 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1042 2020-05-28 David Faust <david.faust@oracle.com>
1044 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1045 R_BPF_INSN_{32,64} relocations.
1047 2020-05-28 Stephen Casner <casner@acm.org>
1049 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1050 addreses in .long (used in testsuites) and .stab values.
1052 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1055 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1056 Check bfd_link_dll when issue a DT_TEXTREL warning.
1057 * elfxx-x86.c (maybe_set_textrel): Likewise.
1058 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1060 2020-05-26 Nick Clifton <nickc@redhat.com>
1062 * plugin.c (try_load_plugin): Extend error message when a plugin
1065 2020-05-23 Alan Modra <amodra@gmail.com>
1067 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1069 2020-05-22 Alan Modra <amodra@gmail.com>
1072 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1073 attributes from shared libraries, and do not return an error if
1076 2020-05-21 Alan Modra <amodra@gmail.com>
1079 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1081 (_bfd_delete_bfd): Free the copy.
1082 (_bfd_new_bfd): Free nbfd->memory on error.
1084 2020-05-21 Alan Modra <amodra@gmail.com>
1086 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1087 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1088 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1089 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1090 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1091 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1092 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1093 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1094 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1095 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1096 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1097 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1098 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1099 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1100 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1101 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1102 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1103 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1104 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1105 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1107 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1109 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1110 get_default_version. It is used to find the default version for
1111 the specific extension.
1112 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1113 default_major_version and default_minor_version. Add new bfd_boolean
1114 parameter *use_default_version. Set it to TRUE if we need to call
1115 the callback rps->get_default_version to find the default version.
1116 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1117 the default version in riscv_parsing_subset_version, and then call
1118 riscv_add_subset to add the subset into subset list.
1119 (riscv_parse_prefixed_ext): Likewise.
1120 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1121 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1122 strings rather than characters.
1123 riscv_merge_arch_attr_info): The callback function get_default_version
1124 is only needed for assembler, so set it to NULL int the linker.
1125 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1126 * elfxx-riscv.h: Updated.
1128 2020-05-20 Alan Modra <amodra@gmail.com>
1131 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1132 use bfd_set_filename.
1133 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1134 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1135 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1136 (bfd_create): Likewise.
1137 (_bfd_delete_bfd): Don't free filename.
1138 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1139 return pointer to the copy or NULL on alloc fail.
1140 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1141 result of bfd_set_filename.
1142 * bfd-in2.h: Regenerate.
1144 2020-05-20 Alan Modra <amodra@gmail.com>
1147 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1148 section size against file size.
1149 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1151 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1154 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1155 and memset when allocating memory for the sections_being_created
1158 2020-05-19 Stafford Horne <shorne@gmail.com>
1160 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1162 (or1k_elf_relocate_section): Access srelgot via
1163 htab->root.srelgot. Add assertions for srelgot->contents.
1164 Introduce local variable for srelgot to not reuse global
1166 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1167 (or1k_set_got_and_rela_sizes): New function.
1168 (or1k_initial_exec_offset): New function.
1169 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1170 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1172 (or1k_elf_check_relocs): Use OR to set TLS access.
1173 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1175 (or1k_elf_size_dynamic_sections): Use
1176 or1k_set_got_and_rela_sizes to set sizes.
1177 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1178 (TCB_SIZE): New macro.
1179 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1180 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1181 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1182 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1183 (tpoff): Add dynamic boolean argument.
1184 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1186 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
1188 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1189 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1190 cases with BFD_RELOC_AARCH64_JUMP26.
1191 (elfNN_aarch64_check_relocs): Likewise.
1193 2020-05-19 Alan Modra <amodra@gmail.com>
1195 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1196 bfd_get_filename rather than accessing bfd->filename directly.
1197 * aout-target.h (MY (object_p)): Likewise.
1198 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1199 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1200 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1201 (_bfd_archive_bsd44_construct_extended_name_table),
1202 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1203 (_bfd_bsd_write_armap): Likewise.
1204 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
1205 * cache.c (bfd_open_file): Likewise.
1206 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
1207 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
1208 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1209 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1210 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
1211 * elf32-nds32.c (nds32_elf_output_symbol_hook),
1212 (patch_tls_desc_to_ie): Likewise.
1213 * elf32-spu.c (sort_bfds, print_one_overlay_section),
1214 (spu_elf_auto_overlay): Likewise.
1215 * elf64-hppa.c (elf_hppa_final_link): Likewise.
1216 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
1217 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
1218 * elflink.c (bfd_elf_size_dynamic_sections),
1219 (elf_link_input_bfd): Likewise.
1220 * linker.c (_bfd_generic_link_output_symbols): Likewise.
1221 * mach-o.c (bfd_mach_o_follow_dsym),
1222 (bfd_mach_o_close_and_cleanup): Likewise.
1223 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
1224 (find_separate_debug_file, get_build_id_name): Likewise.
1225 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1226 * plugin.c (bfd_plugin_open_input): Likewise.
1227 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
1228 * som.c (som_write_armap): Likewise.
1229 * srec.c (srec_write_record, srec_write_symbols): Likewise.
1230 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1231 (_bfd_vms_lib_write_archive_contents): Likewise.
1232 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1234 2020-05-19 Alan Modra <amodra@gmail.com>
1237 * bfdio.c (_bfd_real_fopen): Typo fix.
1239 2020-05-18 Nick Clifton <nickc@redhat.com>
1242 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1243 for the sections_being_created array.
1245 2020-05-18 Alan Modra <amodra@gmail.com>
1247 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1248 they can be freed without also freeing internal_relocs.
1250 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1253 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1254 separators into DOS style when creating a WIN32 fullpath.
1256 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
1258 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1259 to initialize RISC-V tdata.
1261 2020-05-12 Gunther Nikl <gnikl@justmail.de>
1263 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1266 2020-05-11 Alan Modra <amodra@gmail.com>
1268 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1270 2020-05-11 Alan Modra <amodra@gmail.com>
1272 * elf64-ppc.c: Rename powerxx to power10 throughout.
1274 2020-05-11 Alan Modra <amodra@gmail.com>
1277 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1278 contains required number of auxents before processing any auxent.
1279 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1280 file name from auxents for PE.
1282 2020-05-04 Gunther Nikl <gnikl@justmail.de>
1284 * aout-cris.c (DEFAULT_ARCH): Delete define.
1285 (MY_set_arch_mach): Likewise.
1286 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1288 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1289 of r_type before the shift.
1291 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
1294 * elfnn-aarch64.c (group_sections): Copy implementation from
1297 2020-05-01 Alan Modra <amodra@gmail.com>
1300 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1301 accessing root.u.def of symbols. Also check root.u.def.section
1302 is non-NULL. Reverse tests so as to make the logic positive.
1304 2020-05-01 Alan Modra <amodra@gmail.com>
1307 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1308 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1310 2020-05-01 Alan Modra <amodra@gmail.com>
1313 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1314 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1315 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1316 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1317 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1318 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1319 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1320 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1321 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1322 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1324 2020-05-01 Alan Modra <amodra@gmail.com>
1327 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1328 from shared libraries.
1330 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1332 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1333 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1334 equals 0. Report overflow when the result has negative sign but
1335 all significant bits are zero.
1337 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1339 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1340 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1342 2020-04-28 Alan Modra <amodra@gmail.com>
1344 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1345 Emit warning message.
1347 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1349 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1350 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1351 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1352 to x86_64_pe_big_vec as it not a big-endian format.
1353 (vec i386_pe_big_vec): New.
1354 * configure.ac: Likewise.
1355 * targets.c: Likewise.
1356 * configure: Regenerate.
1357 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1358 COFF_WITH_PE_BIGOBJ): New.
1359 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1361 (x86_64_pe_be_vec): Moved.
1363 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1365 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1366 * elf.c (elfcore_grok_arc_v2): New function.
1367 (elfcore_grok_note): Call the new function to handle the corresponding
1369 (elfcore_write_arc_v2): New function.
1370 (elfcore_write_register_note): Call the new function to handle the
1371 corresponding pseudo-sections.
1373 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1376 * bfd-in2.h: Regenerated.
1377 * elf32-xtensa.c (elf_howto_table): New entries for
1378 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1379 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1380 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1381 R_XTENSA_NDIFF{8,16,32}.
1382 * libbfd.h (bfd_reloc_code_real_names): Add names for
1383 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1384 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1385 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1386 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1388 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1391 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1394 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1397 * elf-bfd.h (elf_backend_data): Add
1398 elf_backend_strip_zero_sized_dynamic_sections.
1399 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1400 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1402 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1404 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1406 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1408 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1410 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1412 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1414 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1416 2020-04-21 Nick Clifton <nickc@redhat.com>
1418 * po/sr.po: Updated Serbian translation.
1420 2020-04-21 Alan Modra <amodra@gmail.com>
1422 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1425 2020-04-20 Stephen Casner <casner@acm.org>
1427 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1428 causing globals from linker script to be treated as debug symbols.
1429 (translate_symbol_table): Don't sign-extend symbol values from 16
1430 to 64 bits in nm output.
1432 2020-04-20 Alan Modra <amodra@gmail.com>
1434 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1436 2020-04-18 Alan Modra <amodra@gmail.com>
1438 * section.c (bfd_is_const_section): Correct test for special
1440 * bfd-in2.h: Regenerate.
1442 2020-04-17 Alan Modra <amodra@gmail.com>
1445 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1448 2020-04-16 Nick Clifton <nickc@redhat.com>
1451 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1452 abort with a more helpful error message.
1454 2020-04-16 Alan Modra <amodra@gmail.com>
1457 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1460 2020-04-15 Fangrui Song <maskray@google.com>
1463 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1464 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1465 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1466 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1467 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1468 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1469 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1470 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1471 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1472 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1473 * elflink.c (elf_link_output_extsym): Likewise.
1474 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1476 2020-04-15 Alan Modra <amodra@gmail.com>
1479 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1480 pointer into strings that may be freed for section name, always
1481 allocate a new string.
1483 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1484 Jan W. Jagersma <jwjagersma@gmail.com>
1486 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1487 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1488 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1489 (_bfd_go32_mkobject): New functions.
1490 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1491 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1492 (go32exe_mkobject): Call _bfd_go32_mkobject.
1493 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1494 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1496 (coff_write_relocs): Enable extended reloc counter code if
1497 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1498 (coff_write_object_contents): Likewise. Pad section headers
1499 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1500 instead of coff_swap_scnhdr_out.
1501 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1502 enable extended reloc counter.
1503 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1504 Declare with ATTRIBUTE_UNUSED.
1505 * libcoff-in.h: (struct coff_tdata): New field go32.
1507 * libcoff.h: Regenerate.
1509 2020-04-14 Fangrui Song <maskray@google.com>
1512 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1515 2020-04-14 Stephen Casner <casner@acm.org>
1518 * pdp11.c: Add implementation of --imagic option.
1519 (adjust_o_magic): Fix objcopy --extract-symbol test.
1520 * libaout.h (enum aout_magic): Add i_magic.
1522 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1523 Nick Clifton <nickc@redhat.com>
1525 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1527 <default>: Error rather than abort.
1529 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1532 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1533 relocation section from section group.
1535 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1537 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1538 bfd->origin to file offset.
1539 * bfdwin.c (bfd_get_file_window): Likewise.
1540 * bfd.c: Clarify the use of the bfd->origin field.
1541 * bfd-in2.h: Regenerate.
1542 * coff-i386.c: Don't include go32exe.h. Allow overriding
1543 coff_write_object_contents via COFF_WRITE_CONTENTS.
1544 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1545 (go32exe_write_object_contents): New functions.
1546 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1547 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1548 (create_go32_stub): Remove check for 2k size limit. Read stub
1549 from go32exe_temp_stub if present.
1550 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1551 copy variable-length stub.
1552 (go32_check_format): Read stub to go32exe_temp_stub, set
1553 origin, return go32exe_cleanup.
1554 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1555 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1556 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1557 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1558 Remove functions and their associated #defines.
1559 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1560 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1561 Rename field go32stub to stub.
1562 * libcoff.h: Regenerate.
1563 * coff-stgo32.c (go32_check_format): Rename to...
1564 (go32exe_check_format): ...this.
1565 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1566 (go32exe_copy_private_bfd_data): ...this.
1567 (stub_bytes): Rename to...
1568 (go32exe_default_stub): ...this.
1569 (create_go32_stub): Rename to...
1570 (go32exe_create_stub): ...this.
1571 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1574 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1578 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1579 relocation to R_386_32 for relocation against non-preemptible
1581 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1582 allocate dynamic relocation for non-preemptible absolute symbol.
1583 (elf_i386_relocate_section): Pass sec to
1584 GENERATE_DYNAMIC_RELOCATION_P.
1585 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1586 (elf_x86_64_convert_load_reloc): Covert load relocation to
1587 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1588 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1589 for non-preemptible absolute symbol if they overflow.
1590 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1591 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1592 symbol. Don't allocate dynamic relocation for non-preemptible
1594 (elf_x86_64_relocate_section): Don't generate relative relocation
1595 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1596 to GENERATE_DYNAMIC_RELOCATION_P.
1597 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1598 against non-preemptible absolute symbol.
1599 (_bfd_elf_x86_valid_reloc_p): New function.
1600 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1602 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1603 argument. Don't generate dynamic relocation against
1604 non-preemptible absolute symbol.
1605 (ABS_SYMBOL_P): New.
1606 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1607 against non-preemptible absolute symbol.
1609 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1610 (_bfd_elf_x86_valid_reloc_p): New.
1612 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1615 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1616 address in the GOT if in thumb only mode.
1618 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1620 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1622 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1624 * mmo.c (mmo_scan): Create .text section only when needed, not
1627 2020-03-31 Alan Modra <amodra@gmail.com>
1629 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1632 2020-03-31 Alan Modra <amodra@gmail.com>
1634 * vms-alpha.c (image_write): Check bounds for sections without
1635 contents too. Error on non-zero write to section without
1637 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1639 2020-03-31 Alan Modra <amodra@gmail.com>
1641 * tekhex.c (pass_over): Check is_eof before reading buffer.
1643 2020-03-30 Nick Clifton <nickc@redhat.com>
1646 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1647 field to timestamp and make it an integer.
1648 * libcoff.h: Regenerate.
1649 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1650 field in the pe_data structure rather than the insert_timestamp
1653 2020-03-30 Alan Modra <amodra@gmail.com>
1656 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1659 2020-03-26 Nick Clifton <nickc@redhat.com>
1661 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1662 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1664 * libbfd.h: Regenerate.
1666 2020-03-26 Alan Modra <amodra@gmail.com>
1668 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1670 2020-03-26 Alan Modra <amodra@gmail.com>
1672 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1674 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1676 2020-03-25 Nick Clifton <nickc@redhat.com>
1678 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1680 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1681 * libbfd.h: Regenerate.
1683 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1685 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1686 correct field name in the output string.
1688 2020-03-25 Alan Modra <amodra@gmail.com>
1691 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1692 for SHT_NOBITS section if first in segment.
1694 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1697 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1698 (_bfd_elf_get_symbol_version_string): This.
1699 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1700 (_bfd_elf_get_symbol_version_string): This.
1701 (bfd_elf_print_symbol): Pass TRUE to
1702 _bfd_elf_get_symbol_version_string.
1703 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1704 bfd_boolean argument.
1705 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1706 * targets.c (_bfd_get_symbol_version_string): Likewise.
1707 (bfd_get_symbol_version_string): Likewise.
1708 * bfd-in2.h: Regenerated.
1710 2020-03-24 Nick Clifton <nickc@redhat.com>
1711 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1714 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1717 2020-03-24 Nick Clifton <nickc@redhat.com>
1720 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1721 segment to use for PT_GNU_RELRO, ignore empty sections in a
1722 segment's current list.
1724 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1727 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1729 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1732 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1733 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1734 on the previous _bfd_elf_get_symbol_version_string.
1735 (_bfd_elf_get_symbol_version_string): Use it.
1737 2020-03-24 Alan Modra <amodra@gmail.com>
1739 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1740 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1743 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1745 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1747 2020-03-23 Alan Modra <amodra@gmail.com>
1749 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1750 symbol count. Allocate an extra byte to ensure name strings
1751 are terminated. Sanity check name offsets. Release memory on
1754 2020-03-23 Alan Modra <amodra@gmail.com>
1756 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1757 field hasn't been read. Remove unnecessary casts.
1759 2020-03-22 Alan Modra <amodra@gmail.com>
1761 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1762 enough to read number of symbols.
1764 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1766 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1767 (EXECUTABLE_SUFFIX): Likewise.
1768 * config.in: Regenerated.
1769 * configure: Likewise.
1770 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1771 _bfd_generic_close_and_cleanup.
1772 (plugin_list_entry): Remove resolution_file, resolution_option,
1773 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1774 lto_wrapper, gcc_env and initialized,
1775 (need_lto_wrapper_p): Removed.
1776 (get_lto_wrapper): Likewise.
1777 (setup_lto_wrapper_env): Likewise.
1778 (register_all_symbols_read): Likewise.
1779 (egister_cleanup): Likewise.
1780 (get_symbols): Likewise.
1781 (add_input_file): Likewise.
1782 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1783 (add_symbols): Updated.
1784 (try_claim): Likewise.
1785 (try_load_plugin): Likewise.
1786 (bfd_plugin_canonicalize_symtab): Likewise.
1787 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1788 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1790 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1793 * plugin.c (plugin_list_entry): Add has_symbol_type.
1794 (add_symbols_v2): New function.
1795 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1796 provides symbol type.
1797 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1798 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1801 2020-03-20 Alan Modra <amodra@gmail.com>
1803 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1804 enough to read number of symbols.
1806 2020-03-20 Alan Modra <amodra@gmail.com>
1808 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1809 backend functions for NULL before calling.
1810 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1811 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1812 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1813 * elfnn-ia64.c (ignore_errors): New function.
1814 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1816 2020-03-19 Nick Clifton <nickc@redhat.com>
1819 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1820 location of the varinfo in the unit's debug info data. Change the
1821 type of the stack field to a boolean.
1822 (lookup_var_by_offset): New function. Returns the varinfo
1823 structure for the variable described at the given offset in the
1825 (scan_unit_for_symbols): Add support for variables which have the
1826 DW_AT_specification attribute.
1828 2020-03-19 Nick Clifton <nickc@redhat.com>
1831 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1834 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1836 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1838 2020-03-18 Nick Clifton <nickc@redhat.com>
1841 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1842 memory access when processing a corrupt secondary reloc section.
1844 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1846 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1847 instead of calling abort.
1848 * elf32-csky.c (csky_build_one_stub): Likewise.
1849 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1850 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1851 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1852 * elf32-metag.c (metag_build_one_stub): Likewise.
1853 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1854 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1855 (ppc_size_one_stub): Likewise.
1856 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1858 2020-03-17 Nick Clifton <nickc@redhat.com>
1861 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1862 with error messages.
1864 2020-03-17 Nick Clifton <nickc@redhat.com>
1867 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1868 free. Add free on another failure path.
1870 2020-03-16 Alan Modra <amodra@gmail.com>
1873 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1874 we have a non-zero section count. Do lma comparison in octets.
1876 2020-03-16 Alan Modra <amodra@gmail.com>
1878 * vms-alpha.c (dst_restore_location): Validate index into
1879 dst_ptr_offsets array before accessing. Return status.
1880 (dst_retrieve_location): Similarly, making "loc" parameter a
1881 pointer to return value.
1882 (_bfd_vms_slurp_etir): Update calls to above functions.
1884 2020-03-14 Kamil Rytarowski <n54@gmx.com>
1886 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1888 * configure: Regenerated.
1890 2020-03-14 Alan Modra <amodra@gmail.com>
1892 * section.c (BFD_FAKE_SECTIONS): Formatting.
1893 * bfd-in2.h: Regenerate.
1895 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1897 * elf.c (elfcore_grok_netbsd_note): Add support for
1898 NT_NETBSDCORE_LWPSTATUS notes.
1900 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1902 * bfd-in2.h: Regenerate.
1903 * section.c (asection): Add already_assigned field.
1904 (BFD_FAKE_SECTION): Add default initializer for it.
1905 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1906 * elf32-arm.c (arm_build_one_stub): Add support for
1907 non_contiguous_regions.
1908 * elf32-csky.c (csky_build_one_stub): Likewise.
1909 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1910 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1911 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1912 * elf32-metag.c (metag_build_one_stub): Likewise.
1913 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1914 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1915 (ppc_size_one_stub): Likewise.
1916 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1917 * elflink.c (elf_link_input_bfd): Likewise.
1919 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1922 * elf-linker-x86.h (elf_linker_x86_params): Add
1923 static_before_all_inputs and has_dynamic_linker.
1924 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1925 dynamic input objects if -static is passed at command-line
1926 before all input files without --dynamic-linker unless
1927 --no-dynamic-linker is used.
1929 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1931 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1933 2020-03-13 Christian Eggers <ceggers@gmx.de>
1935 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1936 "p_paddr" from "at".
1937 * elfcode.h (bfd_from_remote_memory): Add units to several
1938 parameters. New local "opb". Fix usage of p_align. Fix
1939 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1940 call of target_read_memory.
1941 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1942 calculation of "offset" and "output_offset".
1943 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1944 from "offset" and fix calculation of "end" from "vma+size". Fix
1945 comparison between "sh_addr" and "vma"/"output_offset".
1946 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1947 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1949 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1950 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1951 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1952 assignment of p_paddr from phdr_lma. Fix comparison between
1953 "lma+size" and "next->lma".
1954 (elf_sort_segments): Fix assignment from p_paddr to lma.
1955 (assign_file_positions_for_load_sections): Add unit (bytes) to
1956 local "align". Fix calculation of local "off_adjust". Fix
1957 calculation of local "filehdr_vaddr".
1958 (assign_file_positions_for_non_load_sections): New local "opb".
1959 Fix calculation of "end" from "p_size". Fix comparison between
1960 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1961 from "end" and "p_vaddr".
1962 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1963 vma. Fix assignment to p_paddr from lma. Fix comparison between
1964 p_paddr and lma. Fix assignment to p_paddr from lma.
1965 * merge.c (sec_merge_emit): New local "opb". Convert
1966 "alignment_power" to octets.
1967 (_bfd_add_merge_section): New locals "alignment_power" and
1968 "opb". Fix comparison between "alignment_power" and
1970 (_bfd_merge_sections): New local "opb". Divide size by opb
1971 before checking align mask.
1973 2020-03-13 Christian Eggers <ceggers@gmx.de>
1975 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1976 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1978 (_bfd_elf_make_section_from_phdr): Similarly.
1979 (elf_fake_sections): Fix calculation of
1980 Elf_Internal_shdr::sh_addr from section VMA.
1981 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1983 (assign_file_positions_for_load_sections): Fix calculations of
1984 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1985 comparison between program header address and section LMA.
1986 (assign_file_positions_for_non_load_sections): Likewise.
1987 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1988 (IS_CONTAINED_BY_VMA): Add parameter opb.
1989 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1990 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1991 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1992 Fix calculations of p_addr_valid and p_vaddr_offset.
1993 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1994 with octets per byte when comparing against p_vaddr.
1996 2020-03-11 Alan Modra <amodra@gmail.com>
1998 * som.c (setup_sections): Sanity check subspace.name.
2000 2020-03-11 Alan Modra <amodra@gmail.com>
2002 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2004 2020-03-10 Alan Modra <amodra@gmail.com>
2007 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2010 2020-03-09 Alan Modra <amodra@gmail.com>
2012 * wasm-module.c (wasm_scan): Sanity check file name length
2013 before allocating memory. Move common section setup code. Do
2014 without bfd_tell to calculate section size.
2016 2020-03-06 Nick Clifton <nickc@redhat.com>
2018 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2019 with error messages and failure return values.
2021 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
2023 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2024 relocation sections for any removed reference to a dynamic symbol.
2026 2020-03-05 Nick Clifton <nickc@redhat.com>
2028 * elf-bfd.h (struct elf_backend_data): Add new fields:
2029 init_secondary_reloc_section, slurp_secondary_reloc_section,
2030 write_secondary_reloc_section.
2031 (_bfd_elf_init_secondary_reloc_section): Prototype.
2032 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2033 (_bfd_elf_write_secondary_reloc_section): Prototype.
2034 * elf.c ( bfd_section_from_shdr): Invoke the new
2035 init_secondary_reloc_section backend function, if defined, when a
2036 second reloc section is encountered.
2037 (swap_out_syms): Invoke the new symbol_section_index function, if
2038 defined, when computing the section index of an OS/PROC specific
2040 (_bfd_elf_init_secondary_reloc_section): New function.
2041 (_bfd_elf_slurp_secondary_reloc_section): New function.
2042 (_bfd_elf_write_secondary_reloc_section): New function.
2043 (_bfd_elf_copy_special_section_fields): New function.
2044 * elfcode.h (elf_write_relocs): Invoke the new
2045 write_secondary_relocs function, if defined, in order to emit
2047 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2048 function, if defined, in order to read in secondary relocs.
2049 * elfxx-target.h (elf_backend_copy_special_section_fields):
2050 Provide a non-NULL default definition.
2051 (elf_backend_init_secondary_reloc_section): Likewise.
2052 (elf_backend_slurp_secondary_reloc_section): Likewise.
2053 (elf_backend_write_secondary_reloc_section): Likewise.
2054 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2056 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2057 * configure: Regenerate.
2059 2020-03-05 Alan Modra <amodra@gmail.com>
2061 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2062 against file size before allocating memory. Use bfd_alloc rather
2063 than bfd_zalloc for carsym/strings memory.
2065 2020-03-04 Alan Modra <amodra@gmail.com>
2067 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2068 sh_addr mod sh_addalign is zero.
2070 2020-03-04 Alan Modra <amodra@gmail.com>
2072 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2074 2020-03-03 Alan Modra <amodra@gmail.com>
2076 * format.c (struct bfd_preserve): Add cleanup field.
2077 (bfd_preserve_save): Add cleanup param and save.
2078 (bfd_preserve_restore): Return cleanup.
2079 (bfd_preserve_finish): Call the cleanup for the discarded match.
2080 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2081 and clear when preserving a match. Restore cleanup too when
2082 restoring that match.
2084 2020-03-02 Alan Modra <amodra@gmail.com>
2086 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2087 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2088 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2089 (core_sco5_vec): Correct initialisers.
2091 2020-03-02 Alan Modra <amodra@gmail.com>
2093 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2094 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2095 * cisco-core.c (cisco_core_file_validate): Likewise.
2096 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2097 * hpux-core.c (hpux_core_core_file_p): Likewise.
2098 * irix-core.c (irix_core_core_file_p): Likewise.
2099 * lynx-core.c (lynx_core_file_p): Likewise.
2100 * netbsd-core.c (netbsd_core_file_p): Likewise.
2101 * osf-core.c (osf_core_core_file_p): Likewise.
2102 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2103 * sco5-core.c (sco5_core_file_p): Likewise.
2105 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2107 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2109 2020-03-02 Alan Modra <amodra@gmail.com>
2111 * targets.c (bfd_cleanup): New typedef.
2112 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2113 * libbfd-in.h (_bfd_no_cleanup): Define.
2114 * format.c (bfd_reinit): Add cleanup parameter, call it.
2115 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2116 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2117 * aout-target.h (callback, object_p): Return bfd_cleanup.
2118 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2119 * archive.c (bfd_generic_archive_p): Likewise.
2120 * binary.c (binary_object_p): Likewise.
2121 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2122 * coff-ia64.c (ia64coff_object_p): Likewise.
2123 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2124 * coff-sh.c (coff_small_object_p): Likewise.
2125 * coff-stgo32.c (go32_check_format): Likewise.
2126 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2127 (xcoff64_core_p): Likewise.
2128 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2129 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2130 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2131 * elfcode.h (elf_object_p): Likewise.
2132 * elfcore.h (elf_core_file_p): Likewise.
2133 * i386msdos.c (msdos_object_p): Likewise.
2134 * ihex.c (ihex_object_p): Likewise.
2135 * libaout.h (some_aout_object_p): Likewise.
2136 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2137 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2138 * libbfd.c (_bfd_dummy_target): Likewise.
2139 * libcoff-in.h (coff_object_p): Likewise.
2140 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2141 (bfd_mach_o_arm64_core_p): Likewise.
2142 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2143 (bfd_mach_o_arm_core_p): Likewise.
2144 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2145 (bfd_mach_o_i386_core_p): Likewise.
2146 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2147 (bfd_mach_o_x86_64_core_p): Likewise.
2148 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2149 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2150 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2151 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2152 * mmo.c (mmo_object_p): Likewise.
2153 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2154 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2155 (pe_bfd_object_p): Likewise.
2156 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2157 * ppcboot.c (ppcboot_object_p): Likewise.
2158 * rs6000-core.c (rs6000coff_core_p): Likewise.
2159 * som.c (som_object_setup, som_object_p): Likewise.
2160 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2161 * tekhex.c (tekhex_object_p): Likewise.
2162 * vms-alpha.c (alpha_vms_object_p): Likewise.
2163 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2164 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2165 * wasm-module.c (wasm_object_p): Likewise.
2166 * xsym.c (bfd_sym_object_p): Likewise.
2167 * xsym.h (bfd_sym_object_p): Likewise.
2168 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2170 * pdp11.c (some_aout_object_p): Likewise.
2171 * plugin.c (register_ld_plugin_object_p): Update object_p
2173 * plugin.h (register_ld_plugin_object_p): Likewise.
2174 * bfd-in2.h: Regenerate.
2175 * libbfd.h: Regenerate.
2176 * libcoff.h: Regenerate.
2178 2020-03-02 Alan Modra <amodra@gmail.com>
2180 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2181 applicable section flags.
2182 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2183 (mips_ecoff_bele_vec): Likewise.
2184 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2186 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2187 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2189 2020-03-02 Alan Modra <amodra@gmail.com>
2191 * elf32-m32r.c (m32r_elf_section_flags): New function.
2192 (elf_backend_section_flags): Define.
2193 * elf32-nds32.c (nds32_elf_section_flags): New function.
2194 (elf_backend_section_flags): Define.
2195 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2196 .sbss and .sdata sections.
2197 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2198 for SHF_V850_GPREL sections.
2199 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2201 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2202 for SHF_PARISC_SHORT sections.
2203 * elf64-ppc.c (ppc64_elf_section_flags): New function.
2204 (elf_backend_section_flags): Define.
2205 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
2206 for SHF_MIPS_GPREL sections. Delete FIXME.
2208 2020-03-02 Alan Modra <amodra@gmail.com>
2210 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
2211 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
2212 calling elf_backend_section_flags with adjusted params. Use
2213 newsect->flags past that point.
2214 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
2216 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
2217 to have their type overridden, and all sh_flags but processor and
2219 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
2220 * elf32-mep.c (mep_elf_section_flags): Likewise.
2221 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
2222 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
2223 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
2224 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
2225 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
2226 stub BFD and non-aarch64 input files when scanning for stubs.
2228 2020-03-02 Alan Modra <amodra@gmail.com>
2230 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2231 limit to decompressed element size.
2233 2020-03-02 Alan Modra <amodra@gmail.com>
2235 * vms-lib.c (vms_traverse_index): Add recur_count param and
2236 update calls. Fail on excessive recursion.
2238 2020-03-02 Alan Modra <amodra@gmail.com>
2240 * vms-alpha.c (vms_get_remaining_object_record): Use
2241 bfd_realloc_or_free rather than bfd_realloc.
2242 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2243 (dst_define_location, parse_module): Likewise, and check realloc
2244 return status before using memory. Return status from function
2245 adjusting all callers.
2247 2020-02-28 Alan Modra <amodra@gmail.com>
2249 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2251 2020-02-28 Alan Modra <amodra@gmail.com>
2253 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2254 Remove duplicate undersize check.
2256 2020-02-27 Alan Modra <amodra@gmail.com>
2259 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2261 2020-02-27 Alan Modra <amodra@gmail.com>
2264 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2265 (coff_section_type): Adjust comment.
2266 (decode_section_type): Likewise. Call coff_section_type before
2267 decode_section_type.
2268 (bfd_decode_symclass): Use 'c' for common sections other than
2271 2020-02-27 Alan Modra <amodra@gmail.com>
2273 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2276 2020-02-27 Alan Modra <amodra@gmail.com>
2278 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2279 if file is an archive element.
2280 * bfd-in2.h: Regenerate.
2282 2020-02-26 Alan Modra <amodra@gmail.com>
2284 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2285 bfd_set_error on failing test. Don't bother changing bfd_error on
2286 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2287 Check sym name is within string buffer. Use size_t for some vars.
2288 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2289 int_buf. Don't change bfd_error on file read error. Use
2290 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2291 calculations to catch overflows before they occur. malloc and
2292 free raw armap rather than using bfd_alloc. Read raw armap before
2293 allocating carsym+strings buffer.
2294 (_bfd_slurp_extended_name_table): Localize variables. Check
2295 name size against file size.
2297 2020-02-26 Alan Modra <amodra@gmail.com>
2299 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2301 2020-02-26 Alan Modra <amodra@gmail.com>
2303 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2304 malloc. Check for NULL return from bfd_malloc.
2305 (rx_table_find, rx_table_map): Likewise.
2306 (rx_set_section_contents): Check bfd_alloc return.
2307 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2309 2020-02-26 Alan Modra <amodra@gmail.com>
2311 * aoutx.h: Indent labels correctly. Format error strings.
2312 * archive.c: Likewise.
2313 * archive64.c: Likewise.
2314 * coff-arm.c: Likewise.
2315 * coff-rs6000.c: Likewise.
2316 * coff-stgo32.c: Likewise.
2317 * cpu-arm.c: Likewise.
2318 * dwarf2.c: Likewise.
2319 * elf-ifunc.c: Likewise.
2320 * elf-properties.c: Likewise.
2321 * elf-s390-common.c: Likewise.
2322 * elf-strtab.c: Likewise.
2324 * elf32-arm.c: Likewise.
2325 * elf32-bfin.c: Likewise.
2326 * elf32-cr16.c: Likewise.
2327 * elf32-csky.c: Likewise.
2328 * elf32-i386.c: Likewise.
2329 * elf32-m68k.c: Likewise.
2330 * elf32-msp430.c: Likewise.
2331 * elf32-nds32.c: Likewise.
2332 * elf32-nios2.c: Likewise.
2333 * elf32-pru.c: Likewise.
2334 * elf32-xtensa.c: Likewise.
2335 * elf64-ia64-vms.c: Likewise.
2336 * elf64-x86-64.c: Likewise.
2337 * elfcode.h: Likewise.
2338 * elfcore.h: Likewise.
2339 * elflink.c: Likewise.
2340 * elfnn-aarch64.c: Likewise.
2341 * elfnn-ia64.c: Likewise.
2342 * elfnn-riscv.c: Likewise.
2343 * elfxx-mips.c: Likewise.
2344 * elfxx-sparc.c: Likewise.
2345 * elfxx-x86.c: Likewise.
2346 * i386lynx.c: Likewise.
2347 * merge.c: Likewise.
2348 * pdp11.c: Likewise.
2349 * plugin.c: Likewise.
2350 * reloc.c: Likewise.
2352 2020-02-26 Alan Modra <amodra@gmail.com>
2355 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2357 (bfd_elf_add_dt_needed_tag): Declare.
2358 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2359 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2360 from elf_add_dt_needed_tag. Remove soname and doit param.
2361 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2362 to see whether as-needed lib is already loaded, use dyn_loaded
2363 list instead. When saving and restoring around as-needed lib
2364 handle possibility that dynstr has not been initialised. Don't
2365 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2366 Mark libs loaded via DT_NEEDED entries of other libs with
2367 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2369 (elf_link_check_versioned_symbol): Remove now unneccesary
2370 DYNAMIC check when traversing dyn_loaded list.
2372 2020-02-26 Alan Modra <amodra@gmail.com>
2374 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2376 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2379 * plugin.c (need_lto_wrapper_p): New.
2380 (bfd_plugin_set_program_name): Add an int argument to set
2382 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2384 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2386 2020-02-24 Alan Modra <amodra@gmail.com>
2388 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2390 2020-02-24 Alan Modra <amodra@gmail.com>
2392 * vms-lib.c (struct carsym_mem): Add limit.
2393 (vms_add_index): Heed limit.
2394 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2395 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2396 Always return actual number read.
2397 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2398 assertion with error exit.
2400 2020-02-22 Alan Modra <amodra@gmail.com>
2403 * elf.c (assign_file_positions_for_load_sections): Continue linking
2404 on "PHDR segment not covered by LOAD segment" errors.
2406 2020-02-21 Alan Modra <amodra@gmail.com>
2408 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2410 (bfd_mach_o_canonicalize_reloc): Likewise.
2411 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2412 counts and offsets against file size.
2413 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2414 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2415 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2416 against file size. Delete symbol table error message.
2417 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2419 (bfd_mach_o_read_symtab): Likewise.
2420 (bfd_mach_o_read_command): Pass file size.
2421 (bfd_mach_o_scan): Sanity check command count against file size.
2423 2020-02-21 Alan Modra <amodra@gmail.com>
2426 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2427 "text", "data" and "bss" section pointer vars. Don't update
2428 section size, just exec header sizes.
2429 (adjust_sizes_and_vmas): Don't update text section size. Set
2430 initial exec header a_text. Print exec headers sizes.
2431 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2432 (adjust_sizes_and_vmas): Similarly. Formatting.
2433 (final_link): Correct final file extension.
2435 2020-02-20 Nick Clifton <nickc@redhat.com>
2437 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2439 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2441 (elfNN_bed): Initialise the symbol_section_index field.
2442 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2443 OS and PROC specific section indicies. Warn if converting other
2444 reserved incidies to SHN_ABS.
2446 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2449 * cpu-z80.c: Add machine type compatibility checking.
2451 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2454 * plugin.c (plugin_list_entry): Remove handle.
2455 (try_load_plugin): Call dlclose before return.
2457 2020-02-19 Alan Modra <amodra@gmail.com>
2459 * libbfd-in.h (_bfd_constant_p): Define.
2460 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2461 file size before allocating memory.
2462 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2463 * elf.c (bfd_elf_get_str_section): Likewise.
2464 (_bfd_elf_slurp_version_tables): Likewise.
2465 * libbfd.h: Regenerate.
2467 2020-02-19 Alan Modra <amodra@gmail.com>
2469 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2470 * aoutx.h (aout_get_external_symbols): Replace calls to
2471 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2472 (slurp_reloc_table): Likewise.
2473 * archive.c (do_slurp_bsd_armap): Likewise.
2474 (do_slurp_coff_armap): Likewise.
2475 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2476 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2477 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2478 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2479 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2480 (_bfd_coff_get_external_symbols): Likewise.
2481 * ecoff.c (ecoff_slurp_symbolic_header),
2482 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2483 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2484 (ecoff_indirect_link_order): Likewise.
2485 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2486 (_bfd_elf_slurp_version_tables): Likewise.
2487 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2488 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2489 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2490 * elf64-alpha.c (READ): Likewise.
2491 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2492 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2493 * elfcode.h (elf_slurp_symbol_table),
2494 (elf_slurp_reloc_table_from_section): Likewise.
2495 * elflink.c (elf_link_add_object_symbols),
2496 (elf_link_check_versioned_symbol): Likewise.
2497 * elfxx-mips.c (READ): Likewise.
2498 * i386lynx.c (slurp_reloc_table): Likewise.
2499 * lynx-core.c (lynx_core_file_p): Likewise.
2500 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2501 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2502 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2503 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2504 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2505 (bfd_pef_parse_symbols): Likewise.
2506 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2507 * som.c (setup_sections, som_slurp_string_table),
2508 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2509 (som_bfd_fill_in_ar_symbols): Likewise.
2510 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2511 (evax_bfd_print_image): Likewise.
2512 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2513 * wasm-module.c (wasm_scan): Likewise.
2514 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2515 * xsym.c (bfd_sym_read_name_table),
2516 (bfd_sym_print_type_information_table_entry): Likewise.
2517 * libbfd.h: Regenerate.
2519 2020-02-19 Alan Modra <amodra@gmail.com>
2521 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2522 reading external relocs.
2523 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2524 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2526 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2528 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2529 (m32c_elf_relax_section): Likewise.
2530 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2531 (rl78_elf_relax_section): Likewise.
2532 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2533 (elf32_rx_relax_section): Likewise.
2534 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2535 parameter types and use..
2536 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2537 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2538 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2539 being read from file, just the extra.
2540 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2541 after reading external syms. Free on failure.
2543 2020-02-19 Alan Modra <amodra@gmail.com>
2545 * coffcode.h (buy_and_read, coff_slurp_line_table),
2546 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2547 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2548 corresponding bfd_alloc call. Adjust variables to suit.
2549 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2550 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2551 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2552 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2553 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2554 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2555 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2556 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2557 * elf64-alpha.c (READ): Likewise.
2558 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2559 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2560 (bfd_from_remote_memory): Likewise.
2561 * elfcore.h (core_find_build_id): Likewise.
2562 * elfxx-mips.c (READ): Likewise.
2563 * mach-o.c (bfd_mach_o_mangle_sections),
2564 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2565 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2566 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2567 * som.c (setup_sections, som_prep_for_fixups)
2568 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2569 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2570 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2571 (som_bfd_ar_write_symbol_stuff): Likewise.
2572 * vms-alpha.c (vector_grow1): Likewise.
2573 * vms-lib.c (vms_add_index): Likewise.
2574 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2575 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2576 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2577 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2578 (bfd_alloc2, bfd_zalloc2): Delete.
2579 (_bfd_mul_overflow): Define.
2580 * libbfd.h: Regenerate.
2582 2020-02-19 Alan Modra <amodra@gmail.com>
2584 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2586 (assign_section_numbers): Likewise.
2587 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2588 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2589 bfd_malloc2, size_t amt, and unsigned tls_count.
2590 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2591 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2592 (elf_output_implib): Use bfd_alloc.
2594 2020-02-19 Alan Modra <amodra@gmail.com>
2596 * bfd.c (struct bfd): Move format and direction to other
2597 bitfields. Add "size".
2598 * bfdio.c (bfd_get_size): Cache size when not writing file.
2599 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2600 returning zero, ie. unknown.
2601 (bfd_get_alt_debug_link_info): Likewise.
2602 * bfd-in2.h: Regenerate.
2604 2020-02-19 Alan Modra <amodra@gmail.com>
2606 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2607 bfd_get_file_size twice.
2608 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2609 zero, ie. unknown, return.
2610 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2611 * elfcode.h (elf_swap_shdr_in): Likewise.
2612 (elf_object_p): Don't call bfd_get_file_size twice and correct
2615 2020-02-19 Alan Modra <amodra@gmail.com>
2617 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2618 FALSE if memory alloc fails. Adjust calls.
2619 * som.c (som_prep_for_fixups): Likewise.
2620 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2621 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2622 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2623 * som.c (som_build_and_write_symbol_table): Return via error_return
2625 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2626 (VEC_APPEND_EL): Delete.
2627 (vector_grow1): Return pointer to element. Catch overflow.
2628 Return NULL on memory allocation failure.
2629 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2630 (alpha_vms_add_fixup_ca): Likewise.
2631 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2633 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2635 2020-02-19 Alan Modra <amodra@gmail.com>
2637 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2638 * aout-target.h (object_p): Likewise.
2639 * aout-tic30.c (tic30_aout_object_p): Likewise.
2640 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2641 (emit_stringtab, write_syms, link_hash_table_create),
2642 (aout_link_write_other_symbol): Likewise.
2643 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2644 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2645 (_bfd_compute_and_write_armap): Likewise.
2646 * archures.c (bfd_arch_list): Likewise.
2647 * bfd.c (bfd_record_phdr): Likewise.
2648 * binary.c (binary_canonicalize_symtab): Likewise.
2649 * cisco-core.c (cisco_core_file_validate): Likewise.
2650 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2651 (find_arm_glue, record_arm_to_thumb_glue),
2652 (record_thumb_to_arm_glue): Likewise.
2653 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2654 (ppc_allocate_toc_section): Likewise.
2655 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2656 * coff-sh.c (sh_relax_section): Likewise.
2657 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2658 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2659 (coff_set_alignment_hook, coff_mkobject),
2660 (coff_compute_section_file_positions): Likewise.
2661 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2662 (coff_find_nearest_line_with_names),
2663 ( bfd_coff_set_symbol_class): Likewise.
2664 * cofflink.c (_bfd_coff_link_hash_table_create),
2665 (_bfd_coff_link_input_bfd): Likewise.
2666 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2667 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2668 (build_line_info_table, sort_line_sequences),
2669 (line_info_add_include_dir, line_info_add_file_name),
2670 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2671 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2672 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2673 (_bfd_ecoff_find_nearest_line),
2674 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2675 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2676 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2677 * elf-m10300.c (mn10300_elf_relax_section),
2678 (elf32_mn10300_link_hash_table_create): Likewise.
2679 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2680 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2681 * elf32-arm.c (elf32_arm_link_hash_table_create),
2682 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2683 (elf32_arm_new_section_hook): Likewise.
2684 * elf32-avr.c (elf_avr_new_section_hook),
2685 (elf32_avr_link_hash_table_create, get_local_syms),
2686 (elf32_avr_setup_section_lists): Likewise.
2687 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2688 (bfin_link_hash_table_create): Likewise.
2689 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2690 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2691 * elf32-csky.c (csky_elf_link_hash_table_create),
2692 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2693 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2694 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2695 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2696 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2697 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2698 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2699 (m32r_elf_check_relocs): Likewise.
2700 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2701 (elf32_m68hc11_setup_section_lists),
2702 (elf32_m68hc11_size_stubs): Likewise.
2703 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2704 * elf32-metag.c (elf_metag_link_hash_table_create),
2705 (elf_metag_setup_section_lists): Likewise.
2706 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2707 (microblaze_elf_check_relocs): Likewise.
2708 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2709 (nds32_elf_check_relocs): Likewise.
2710 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2711 (get_local_syms, nios2_elf32_check_relocs),
2712 (nios2_elf32_link_hash_table_create): Likewise.
2713 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2714 (or1k_elf_check_relocs): Likewise.
2715 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2716 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2717 * elf32-s390.c (elf_s390_link_hash_table_create),
2718 (elf_s390_check_relocs): Likewise.
2719 * elf32-score.c (score_elf_create_got_section),
2720 (s3_elf32_score_new_section_hook),
2721 (elf32_score_link_hash_table_create): Likewise.
2722 * elf32-score7.c (score_elf_create_got_section),
2723 (s7_elf32_score_new_section_hook): Likewise.
2724 * elf32-sh.c (sh_elf_link_hash_table_create),
2725 (sh_elf_check_relocs): Likewise.
2726 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2727 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2728 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2729 (tilepro_elf_check_relocs): Likewise.
2730 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2731 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2732 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2733 (elf_xtensa_new_section_hook): Likewise.
2734 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2735 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2736 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2737 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2738 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2739 * elf64-ppc.c (ppc64_elf_new_section_hook),
2740 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2741 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2742 * elf64-s390.c (elf_s390_link_hash_table_create),
2743 (elf_s390_check_relocs): Likewise.
2744 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2745 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2746 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2747 (elf_link_add_archive_symbols, compute_bucket_count),
2748 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2749 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2750 (bfd_elf_final_link): Likewise.
2751 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2752 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2753 (elfNN_aarch64_new_section_hook): Likewise.
2754 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2755 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2756 (riscv_elf_check_relocs): Likewise.
2757 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2758 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2759 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2760 (_bfd_mips_elf_link_hash_table_create): Likewise.
2761 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2762 (_bfd_sparc_elf_check_relocs),
2763 (_bfd_sparc_elf_new_section_hook): Likewise.
2764 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2765 (tilegx_elf_check_relocs): Likewise.
2766 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2767 * format.c (bfd_check_format_matches): Likewise.
2768 * hash.c (_bfd_stringtab_init): Likewise.
2769 * ihex.c (ihex_scan): Likewise.
2770 * irix-core.c (irix_core_core_file_p): Likewise.
2771 * linker.c (bfd_wrapped_link_hash_lookup),
2772 (_bfd_generic_link_hash_table_create),
2773 (_bfd_generic_reloc_link_order): Likewise.
2774 * lynx-core.c (lynx_core_file_p): Likewise.
2775 * netbsd-core.c (netbsd_core_file_p): Likewise.
2776 * osf-core.c (osf_core_core_file_p): Likewise.
2777 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2778 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2779 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2780 * peicode.h (pe_mkobject): Likewise.
2781 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2782 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2783 * sco5-core.c (read_uarea): Likewise.
2784 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2785 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2786 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2787 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2788 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2789 * srec.c (srec_scan): Likewise.
2790 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2791 * targets.c (bfd_target_list): Likewise.
2792 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2793 * trad-core.c (trad_unix_core_file_p): Likewise.
2794 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2795 (vms_new_section_hook): Likewise.
2796 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2797 * xcofflink.c (xcoff_get_section_contents),
2798 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2799 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2800 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2802 2020-02-19 Alan Modra <amodra@gmail.com>
2804 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2806 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2808 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2809 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2810 a build_list_p argument. Don't search plugin_list. Short circuit
2811 when building the plugin list.
2812 (has_plugin): Renamed to has_plugin_list.
2813 (bfd_plugin_set_plugin): Don't set has_plugin.
2814 (bfd_plugin_specified_p): Check plugin_list instead.
2815 (build_plugin_list): New function.
2816 (load_plugin): Call build_plugin_list and use plugin_list.
2818 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2821 * plugin.c (try_claim): Always clean up for LTO wrapper.
2822 (try_load_plugin): Treat each object as independent. Create a
2823 copy for plugin name.
2825 2020-02-11 Nick Clifton <nickc@redhat.com>
2827 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2828 for addresses in print statements.
2829 (msp430_elf_relax_delete_bytes): Likewise.
2830 (msp430_elf_relax_add_words): Likewise.
2831 (msp430_elf_relax_section): Likewise.
2833 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2835 * plugin.c (add_symbols): Clear plugin_data memory.
2837 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2840 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2841 (EXECUTABLE_SUFFIX): Likewise.
2842 * config.in: Regenerated.
2843 * configure: Likewise.
2844 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2845 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2846 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2847 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2848 (get_lto_wrapper): New.
2849 (setup_lto_wrapper_env): Likewise.
2850 (current_plugin): Likewise.
2851 (register_all_symbols_read): Likewise.
2852 (register_cleanup): Likewise.
2853 (get_symbols): Likewise.
2854 (add_input_file): Likewise.
2855 (bfd_plugin_close_and_cleanup): Likewise.
2856 (claim_file): Removed.
2857 (register_claim_file): Set current_plugin->claim_file.
2858 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2859 lto_syms in current_plugin.
2860 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2861 all_symbols_read handler. Copy real symbols to plugin_data.
2862 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2863 (try_load_plugin): Don't reuse the previous plugin for LTO
2864 wrapper. Set up GCC LTO wrapper if possible. Don't set
2865 plugin_list_iter->claim_file.
2866 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2868 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2871 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2873 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2874 check if previous instruction matches a conditional jump inserted
2875 earlier. Invert conditional jump and delete branch in this case.
2877 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2879 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2880 msp430_elf_relax_add_words. Support insertion of either one or two
2882 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2883 needs to be grown. Handle insertion of branch instruction to replace
2886 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2888 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2889 debugging relocations.
2890 (msp430_elf_relax_delete_bytes): Likewise.
2891 (msp430_elf_relax_add_two_words): Likewise.
2892 (msp430_elf_relax_section): Likewise.
2894 2020-02-10 Alan Modra <amodra@gmail.com>
2896 * archures.c: Wrap overlong z80 comments.
2897 * bfd-in2.h: Regenerate.
2899 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2902 * archures.c: Add GBZ80 and Z80N machine values.
2903 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2904 * coff-z80.c: Add support for new reloc.
2905 * coffcode.h: Add support for new machine values.
2906 * cpu-z80.c: Add support for new machine names.
2907 * elf32-z80.c: Add support for new reloc.
2908 * bfd-in2.h: Regenerate.
2909 * libbfd.h: Regenerate.
2911 2020-02-07 Nick Clifton <nickc@redhat.com>
2914 * elf.c (rewrite_elf_program_header): Do not complain if no
2915 sections are mapped to a segment.
2917 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2920 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2921 for garbage collection on __patchable_function_entries section
2922 without linked-to section.
2924 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2927 * bfd-in2.h: Regenerated.
2928 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2929 on section if gc_mark of any of its linked-to sections is set
2930 and don't set gc_mark again.
2931 * section.c (asection): Add linked_to_symbol_name to map_head
2934 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
2936 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2937 reporting an unrecognized instruction with R_V850_LONGJUMP.
2939 2020-02-05 Alan Modra <amodra@gmail.com>
2941 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2943 2020-02-04 Alan Modra <amodra@gmail.com>
2945 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2946 R_PPC_VLE_ADDR20, goto copy_reloc.
2948 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2950 * bfd-in2.h: Regenerated.
2951 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2953 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2956 * bfd-in2.h: Regenerated.
2957 * ecoff.c (bfd_debug_section): Add section_id.
2958 * section.c (bfd_section): Add section_id.
2959 (SEC_ASSEMBLER_SECTION_ID): New.
2960 (BFD_FAKE_SECTION): Add section_id.
2962 2020-02-01 Nick Clifton <nickc@redhat.com>
2964 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2967 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2969 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2970 encodings are relative to the GOT on nios2, too.
2972 2020-01-31 Alan Modra <amodra@gmail.com>
2974 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2975 file. Use $< and $@ in rules.
2976 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2977 (elf32-ia64.c, elf64-ia64.c): Likewise.
2978 (elf32-riscv.c, elf64-riscv.c): Likewise.
2979 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2980 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2981 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2982 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2983 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2984 * Makefile.in: Regenerate.
2986 2020-01-31 Alan Modra <amodra@gmail.com>
2989 * elf.c (setup_group): Don't clear entire section contents,
2990 just the padding after group flags. Release alloc'd memory
2991 after a seek or read failure.
2993 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2995 * peXXigen.c (pe_is_repro): New function.
2996 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2997 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2999 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3001 * peXXigen.c (debug_type_names): Add names for new debug data type
3004 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3006 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3007 inner loop. Fix a memory leak.
3009 2020-01-30 Alan Modra <amodra@gmail.com>
3011 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3012 or obj_coff_keep_strings here.
3013 (coff_get_normalized_symtab): Free external syms directly.
3014 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3017 2020-01-27 Jim Wilson <jimw@sifive.com>
3019 * cpu-riscv.c (riscv_scan): New.
3020 (N): Change bfd_default_scan to riscv_scan.
3022 2020-01-27 Andreas Schwab <schwab@suse.de>
3024 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3025 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3026 * Makefile.in: Regenerate.
3027 * cpu-plugin.c: Remove.
3028 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3029 (bfd_plugin_arch): Remove declaration.
3030 * bfd-in2.h: Regenerate.
3031 * po/SRC-POTFILES.in: Regenerate.
3033 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
3034 Alan Modra <amodra@gmail.com>
3037 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3039 2020-01-24 Jim Wilson <jimw@sifive.com>
3041 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3042 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3043 avoid over long line.
3045 2020-01-24 Nick Clifton <nickc@redhat.com>
3048 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3049 syms and keep strings flags as these may have been set in order to
3050 prevent a bogus call to free.
3052 2020-01-23 Nick Clifton <nickc@redhat.com>
3054 * po/fr.po: Updated French translation.
3056 2020-01-23 Alan Modra <amodra@gmail.com>
3059 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3060 by zero when p_align is zero.
3062 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3064 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3065 (riscv_prefix_cmp): Likewise.
3066 (riscv_non_std_ext_p): Deleted.
3067 (riscv_std_sv_ext_p): Likewise.
3068 (riscv_non_std_sv_ext_p): Likewise.
3069 (riscv_merge_non_std_and_sv_ext): Rename to...
3070 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3071 (riscv_merge_arch_attr_info): Replace 3 calls to
3072 riscv_merge_non_std_and_sv_ext with single call to
3073 riscv_merge_multi_letter_ext.
3074 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3075 encounter a 'z' prefix.
3076 (riscv_get_prefix_class): New function, return prefix class based
3077 on first few characters of input string.
3078 (riscv_parse_config): New structure to factor out minor differences
3079 in extension class parsing behaviour.
3080 (riscv_parse_sv_or_non_std_ext): Rename to...
3081 (riscv_parse_prefixed_ext): and parameterise with
3083 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3084 (riscv_multi_letter_ext_valid_p): New.
3085 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3086 (riscv_parse_subset): Delegate all non-single-letter parsing work
3087 to riscv_parse_prefixed_ext.
3088 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3089 (riscv_get_prefix_class): Declare.
3091 2020-01-22 Alan Modra <amodra@gmail.com>
3093 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3094 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3095 __tls_get_addr_desc.
3096 (ppc64_elf_size_stubs): Add section for linker generated
3097 __tls_get_addr_desc wrapper function. Loop at least once if
3098 generating this function.
3099 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3100 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3102 2020-01-22 Alan Modra <amodra@gmail.com>
3104 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3105 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3107 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3108 (STDU_R1_0R1, ADDI_R1_R1): Define.
3109 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3110 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3111 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3112 no_tls_get_addr_regsave.
3113 (branch_reloc_hash_match): Add hash3 and hash4.
3114 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3115 (ppc64_elf_size_dynamic_sections): Likewise.
3116 (ppc64_elf_relocate_section): Likewise.
3117 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3118 __tls_get_addr stub.
3119 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3121 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3122 eh_frame for regsave __tls_get_addr.
3124 2020-01-22 Alan Modra <amodra@gmail.com>
3126 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3127 which __tls_get_addr calls will be eliminated.
3129 2020-01-20 Nick Clifton <nickc@redhat.com>
3131 * po/pt.po: Updates Portuguese translation.
3132 * po/ru.po: Updated Russian translation.
3133 * po/uk.po: Updated Ukranian translation.
3135 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3138 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3139 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3141 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3142 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3143 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3144 "rex leal x@tlsdesc(%rip), %reg" to
3145 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3146 "call *(%eax)" to "nopl (%rax)".
3148 2020-01-20 Alan Modra <amodra@gmail.com>
3150 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3151 (MTLR_R11): Don't define.
3152 (LD_R0_0R3, CMPDI_R0_0): Define.
3153 (build_tls_get_addr_stub): Don't use r11 in stub.
3155 2020-01-20 Alan Modra <amodra@gmail.com>
3157 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3158 (defined_sym_val, is_tls_get_addr): Likewise.
3160 2020-01-18 Nick Clifton <nickc@redhat.com>
3162 * version.m4 (BFD_VERSION): Set to 2.34.50.
3163 * configure: Regenerate.
3164 * po/bfd.pot: Regenerate.
3166 2020-01-18 Nick Clifton <nickc@redhat.com>
3168 Binutils 2.34 branch created.
3170 2020-01-17 Christian Biesinger <cbiesinger@google.com>
3172 * coff-arm.c: Fix spelling error (seperate).
3173 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3175 * sysdep.h (strnlen): Fix spelling error (seperate).
3177 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
3180 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3182 2020-01-15 Alan Modra <amodra@gmail.com>
3185 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3186 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3187 of function symbols unless dot symbols are present. Do warn
3188 whenever one is created, regardles of whether a PLT entry is
3189 also emitted for the function symbol.
3191 2020-01-14 Alan Modra <amodra@gmail.com>
3193 * som.c (som_bfd_count_ar_symbols): Error when file position
3194 of symbols on chains is not strictly increasing.
3196 2020-01-14 Alan Modra <amodra@gmail.com>
3198 * vms.h (VMS_DEBUG): Define as 0.
3199 * vms-alpha.c (image_write): Move debug output after bounds check.
3201 (_bfd_vms_slurp_eihd): Warning fix.
3202 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
3204 2020-01-13 Alan Modra <amodra@gmail.com>
3206 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
3207 for "ignored" records.
3209 2020-01-13 Alan Modra <amodra@gmail.com>
3211 * wasm-module.c (wasm_scan_name_function_section): Formatting.
3212 Delete asect name check. Move asect NULL check to wasm_object_p.
3213 Correct bounds check of sizes against end. Replace uses of
3214 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
3215 just one bfd_release.
3216 (wasm_scan): Don't use malloc/strdup for section names,
3217 bfd_alloc instead. Simplify code prefixing section name.
3218 Formatting. Don't attempt to free memory here..
3219 (wasm_object_p): ..do so here.
3221 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
3224 * elf32-arm.c (elf32_arm_final_link_relocate): Use
3225 UNDEFWEAK_NO_DYNAMIC_RELOC.
3226 (allocate_dynrelocs_for_symbol): Likewise.
3228 2020-01-10 Tamar Christina <tamar.christina@arm.com>
3231 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3233 2020-01-10 Alan Modra <amodra@gmail.com>
3235 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3237 2020-01-09 Nick Clifton <nickc@redhat.com>
3240 * bfd.c (bfd_convert_section_contents): Check for a compress
3241 header size that is larger than the actual section size.
3243 2020-01-08 Alan Modra <amodra@gmail.com>
3246 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3247 after removing sections.
3249 2020-01-06 Jim Wilson <jimw@sifive.com>
3252 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3253 check for !bfd_link_pic (info).
3254 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3255 <R_RISCV_JAL>: Add comment.
3256 (_bfd_riscv_relax_section): For plt.offset check, add check for
3257 bfd_link_pic (info). Add comment.
3259 2020-01-06 Alan Modra <amodra@gmail.com>
3261 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3262 match failures. Don't init to bfd_error_wrong_format before
3263 calling _bfd_check_format.
3265 2020-01-06 Alan Modra <amodra@gmail.com>
3267 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3268 status rather than exiting on stack overflow or underflow.
3269 (_bfd_vms_slurp_etir): Adjust to suit.
3271 2020-01-06 Alan Modra <amodra@gmail.com>
3273 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3275 2020-01-06 Alan Modra <amodra@gmail.com>
3277 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3278 command. Check name offset is within command.
3279 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3280 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3281 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3282 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3283 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3284 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3285 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3286 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3287 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3288 (bfd_mach_o_read_segment): Similarly.
3289 (bfd_mach_o_read_thread): Properly bound check thread struct.
3290 Don't repeat checks on second loop.
3291 (bfd_mach_o_read_command): Fail on invalid command length.
3293 2020-01-04 Alan Modra <amodra@gmail.com>
3295 * format.c (bfd_check_format_matches): Add preserve_match.
3296 Save initial bfd state in "preserve", matched bfd state in
3297 "preserve_match". Save just the first match. Release
3298 bfd_alloc memory. Restore and finish preserved state as
3299 appropriate on all function exit paths.
3301 2020-01-04 Alan Modra <amodra@gmail.com>
3303 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3305 2020-01-04 Alan Modra <amodra@gmail.com>
3307 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3310 2020-01-03 Nick Clifton <nickc@redhat.com>
3313 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3314 there is enough data remaining in the code buffer before
3315 attempting to read a function stub.
3317 2020-01-03 Nick Clifton <nickc@redhat.com>
3320 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3321 return value from bfd_malloc.
3322 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3323 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3324 (elf32_arm_filter_cmse_symbols): Likewise.
3325 (elf32_arm_write_section): Likewise.
3326 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3327 (bfd_mach_o_follow_dsym): Likewise.
3328 * pef.c (bfd_pef_print_loader_section): Likewise.
3329 (bfd_pef_scan_start_address): Likewise.
3330 (bfd_pef_parse_function_stubs): Likewise.
3331 (bfd_pef_parse_symbols): Likewise.
3333 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3335 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3336 on binary inputs ld/PR25316.
3337 (is_ia64_elf): new helper to filter on ia64 objects.
3339 2020-01-03 Jan Beulich <jbeulich@suse.com>
3341 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3343 (bfd_mach_o_scan): Insert underscore in two variable names.
3345 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3347 * Makefile.am: Add z80-elf target support.
3348 * configure.ac: Likewise.
3349 * targets.c: Likewise.
3350 * Makefile.in: Regenerate.
3351 * configure: Regenerate.
3352 * config.bfd: Add z80-elf target support and new arches: ez80 and
3354 * elf32-z80.c: New file.
3355 * archures.c: Add new z80 architectures: eZ80 and Z180.
3356 * coffcode.h: Likewise.
3357 * cpu-z80.c: Likewise.
3358 * coff-z80.c: Add new relocations for Z80 target and local label
3360 * reloc.c: Add new relocs.
3361 * bfd-in2.h: Regenerate.
3362 * libbfd.h: Regenerate.
3364 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3368 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3370 2020-01-01 Alan Modra <amodra@gmail.com>
3372 Update year range in copyright notice of all files.
3374 For older changes see ChangeLog-2019
3376 Copyright (C) 2020 Free Software Foundation, Inc.
3378 Copying and distribution of this file, with or without modification,
3379 are permitted in any medium without royalty provided the copyright
3380 notice and this notice are preserved.
3386 version-control: never