1 2020-07-27 Alan Modra <amodra@gmail.com>
3 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
5 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
8 2020-07-24 Nick Clifton <nickc@redhat.com>
10 * config.bfd: Move xc16x target to the obsolete list.
12 2020-07-22 Kevin Buettner <kevinb@redhat.com>
14 * binary.c (binary_get_section_contents): Seek using offset
15 from section's file position.
17 2020-07-22 Kevin Buettner <kevinb@redhat.com>
19 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
21 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
24 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
25 type for the first function argument. Rename pointers to reflect
26 that they have distinct types.
28 2020-07-20 Alan Modra <amodra@gmail.com>
30 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
32 2020-07-19 Alan Modra <amodra@gmail.com>
34 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
35 (select_alt_stub): New function.
36 (ppc_get_stub_entry): Use it here.
37 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
39 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
40 merge notoc stubs with other varieties when power10_stubs is "auto".
41 Instead dup the stub hash table entry.
42 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
43 tests of power10_stubs.
45 2020-07-15 Alan Modra <amodra@gmail.com>
48 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
50 2020-07-15 Nick Clifton <nickc@redhat.com>
53 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
54 check for aux entries that overflow the buufer.
56 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
58 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
59 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
61 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
62 Alan Modra <amodra@gmail.com>
65 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
66 objects both before and after normal object files.
67 * elflink.c (_bfd_elf_section_already_linked): Likewise.
69 2020-07-10 Alan Modra <amodra@gmail.com>
71 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
72 * elf64-ppc.c (struct ppc_link_hash_table): Delete
74 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
75 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
76 uses of power10_stubs.
78 2020-07-09 Alan Modra <amodra@gmail.com>
83 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
84 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
86 (coff_write_object_contents): Remove PPC_PE code.
87 * config.bfd: Move powerpcle-pe to removed targets.
88 * configure.ac: Remove powerpc PE entries.
89 * libcoff-in.h (ppc_allocate_toc_section): Delete.
90 (ppc_process_before_allocation): Delete.
91 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
92 * targets.c: Remove powerpc PE vectors.
93 * po/SRC-POTFILES.in: Regenerate.
94 * libcoff.h: Regenerate.
95 * Makefile.in: Regenerate.
96 * configure: Regenerate.
98 2020-07-09 Nick Clifton <nickc@redhat.com>
100 * po/fr.po: Updated French translation.
102 2020-07-07 Alan Modra <amodra@gmail.com>
104 * xcofflink.c (xcoff_mark): Don't mark const sections.
105 (bfd_xcoff_record_link_assignment): Add FIXME.
106 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
107 sections being discarded by linker script.
109 2020-07-07 Alan Modra <amodra@gmail.com>
111 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
112 time, uid, gid and mode for deterministic archive.
113 (xcoff_write_archive_contents_big): Likewise.
115 2020-07-07 Alan Modra <amodra@gmail.com>
117 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
120 2020-07-06 Nick Clifton <nickc@redhat.com>
122 * po/pt.po: Updated Portuguese translation.
123 * po/uk.po: Updated Ukranian translation.
125 2020-07-04 Nick Clifton <nickc@redhat.com>
127 * version.m4: Set version to 2.35.50.
128 * configure: Regenerate.
129 * po/bbfd.pot: Regenerate.
131 2020-07-04 Nick Clifton <nickc@redhat.com>
133 Binutils 2.35 branch created.
135 2020-07-01 Alan Modra <amodra@gmail.com>
138 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
139 raw syment index before dereferencing.
141 2020-07-01 Alan Modra <amodra@gmail.com>
143 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
145 2020-07-01 Alan Modra <amodra@gmail.com>
147 * config.bfd: Obsolete xc16x.
149 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
151 * archures.c (bfd_mach_i386_nacl): Removed.
152 (bfd_mach_i386_i386_nacl): Likewise.
153 (bfd_mach_x86_64_nacl): Likewise.
154 (bfd_mach_x64_32_nacl): Likewise.
155 * config.bfd: Remove *-*-nacl* targets.
156 * configure.ac: Remove x86 NaCl target vectors.
157 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
158 (bfd_x64_32_nacl_arch): Likewise.
159 (bfd_x86_64_nacl_arch): Likewise.
160 (bfd_i386_nacl_arch): Likewise.
161 (bfd_x64_32_arch_intel_syntax): Updated.
162 * elf32-i386.c: Don't include "elf-nacl.h".
163 (elf_i386_nacl_plt): Removed.
164 (elf_i386_nacl_plt0_entry): Likewise.
165 (elf_i386_nacl_plt_entry): Likewise.
166 (elf_i386_nacl_pic_plt0_entry): Likewise.
167 (elf_i386_nacl_pic_plt_entry): Likewise.
168 (elf_i386_nacl_eh_frame_plt): Likewise.
169 (elf_i386_nacl_plt): Likewise.
170 (elf32_i386_nacl_elf_object_p): Likewise.
171 (elf_i386_get_synthetic_symtab): Updated.
172 (elf_i386_link_setup_gnu_properties): Likewise.
173 * elf64-x86-64.c: Don't include "elf-nacl.h".
174 (elf_x86_64_nacl_plt): Removed.
175 (elf64_x86_64_nacl_elf_object_p): Likewise.
176 (elf_x86_64_nacl_plt0_entry): Likewise.
177 (elf_x86_64_nacl_plt_entry): Likewise.
178 (elf_x86_64_nacl_eh_frame_plt): Likewise.
179 (elf_x86_64_nacl_plt): Likewise.
180 (elf32_x86_64_nacl_elf_object_p): Likewise.
181 (elf_x86_64_get_synthetic_symtab): Updated.
182 (elf_x86_64_link_setup_gnu_properties): Likewise.
183 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
184 * targets.c: Remove x86 NaCl target vectors.
185 * bfd-in2.h: Regenerated.
186 * configure: Likewise.
188 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
190 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
191 _bfd_elf_add_dynamic_tags.
193 2020-06-29 Alan Modra <amodra@gmail.com>
195 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
196 return value of bfd_bread. Don't read more than requested length.
197 Sanity check length. Properly terminate file name.
199 2020-06-29 Alan Modra <amodra@gmail.com>
201 * arc-got.h: Use C style comments.
202 * coff-z80.c: Likewise.
203 * elf32-csky.c: Likewise.
204 * peXXigen.c: Likewise.
205 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
208 2020-06-26 Pat Bernardi <bernardi@adacore.com>
210 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
211 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
213 2020-06-26 Alan Modra <amodra@gmail.com>
215 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
216 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
217 (riscv_get_priv_spec_name): Move to..
218 * cpu-riscv.c: ..here.
219 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
220 Use %u to print unsigned numbers.
222 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
224 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
225 default architecture.
227 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
230 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
231 _bfd_elf_add_dynamic_tags.
233 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
236 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
237 _bfd_elf_add_dynamic_tags.
239 2020-06-24 Alan Modra <amodra@gmail.com>
241 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
242 shifts without undefined behaviour.
244 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
246 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
248 (_bfd_elf_add_dynamic_tags): New.
249 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
250 _bfd_elf_add_dynamic_tags.
251 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
252 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
253 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
254 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
255 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
256 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
257 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
258 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
260 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
261 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
262 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
263 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
264 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
265 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
266 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
267 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
268 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
270 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
271 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
272 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
273 _bfd_elf_maybe_vxworks_add_dynamic_tags.
274 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
275 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
277 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
278 (_bfd_x86_elf_size_dynamic_sections): Likewise.
279 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
280 dt_reloc_sz and dt_reloc_ent.
281 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
282 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
284 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
285 etab.dt_pltgot_required.
286 (elf32_hppa_size_dynamic_sections): Call
287 _bfd_elf_add_dynamic_tags.
288 * elf32-metag.c (elf_metag_link_hash_table_create): Set
289 etab.dt_pltgot_required.
290 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
291 * elf32-sh.c (sh_elf_link_hash_table_create): Set
292 root.dt_pltgot_required for FDPIC output.
293 (sh_elf_size_dynamic_sections): Call
294 _bfd_elf_maybe_vxworks_add_dynamic_tags.
295 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
296 elf.dt_pltgot_required.
297 (elf_xtensa_size_dynamic_sections): Call
298 _bfd_elf_add_dynamic_tags.
299 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
300 root.dt_pltgot_required.
301 (elf64_hppa_size_dynamic_sections): Call
302 _bfd_elf_add_dynamic_tags.
303 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
304 root.dt_pltgot_required.
305 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
306 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
307 * elflink.c (_bfd_elf_add_dynamic_tags): New.
309 2020-06-22 Saagar Jha <saagar@saagarjha.com>
311 * mach-o.c: Support the new load commands by reading a linkedit
312 data command for them.
314 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
316 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
317 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
318 (riscv_get_priv_spec_class): Likewise.
319 (riscv_get_priv_spec_name): Likewise.
320 (riscv_get_priv_spec_class_from_numbers): New function, convert
321 the version numbers into string, then call riscv_get_priv_spec_class
322 to get the priv spec class.
323 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
324 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
325 (riscv_get_priv_spec_name): Likewise.
326 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
327 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
328 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
329 of input and output objects form their priv spec attributes by
330 riscv_get_priv_spec_class_from_numbers. Report warning rather than
331 errors when linking objects with differnet priv spec versions. We do
332 know v1.9.1 may have conflicts to other versions, so report the
333 warning, too. After that, update the output priv spec version to the
336 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
338 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
339 priv attributes, we will check the conflicts for all of them (major,
340 minor and revision), and then set the priv_attrs_merged to TRUE to
341 indicate that we have handled all of the priv attributes. Remove
342 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
344 2020-06-21 Alan Modra <amodra@gmail.com>
347 * configure.ac: Disable plugins by default for some targets.
348 * plugin.c: Comment typo fix.
349 * configure: Regenerate.
351 2020-06-19 Nick Clifton <nickc@redhat.com>
353 * plugin.c (try_load_plugin): Suppress the error message about
354 being unable to open a plugin if creating a list of viable
357 2020-06-16 Alan Modra <amodra@gmail.com>
359 * aout-tic30.c: Delete file.
360 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
361 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
362 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
363 (xc16x-*-elf): Sort properly.
364 * configure.ac: Remove tic30_aout_vec.
365 * targets.c: Likewise.
366 * Makefile.in: Regenerate.
367 * configure: Regenerate.
368 * po/SRC-POTFILES.in: Regenerate.
370 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
372 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
373 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
374 (elf32xtensa_abi): New global variable.
375 (xtensa_abi_choice): New function.
376 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
377 XSHAL_ABI to select PLT code.
379 2020-06-15 Roland McGrath <mcgrathr@google.com>
381 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
382 field of bfd_link_info.
384 2020-06-15 Alan Modra <amodra@gmail.com>
386 * config.bfd: Obsolete powerpcle-*-pe targets.
388 2020-06-15 Alan Modra <amodra@gmail.com>
391 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
392 symbols that were defined in discarded sections.
393 * cofflink.c (coff_link_check_archive_element): Likewise.
394 (coff_link_add_symbols): Set indx to -3 for symbols defined in
396 (_bfd_coff_write_global_sym): Don't emit such symbols.
397 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
398 libcoff.h: Regenerate.
400 2020-06-11 Alan Modra <amodra@gmail.com>
403 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
405 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
407 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
408 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
409 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
412 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
415 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
416 Clear verinfo.verdef.
418 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
421 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
422 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
423 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
425 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
426 Set ifunc_resolvers if there are FUNC resolvers.
427 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
428 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
429 with elf.ifunc_resolvers.
430 (write_plt_relocs_for_local_syms): Likewise.
431 (ppc64_elf_relocate_section): Likewise.
432 (ppc64_elf_finish_dynamic_sections): Likewise.
433 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
435 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
436 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
437 instead of readonly_dynrelocs_against_ifunc.
438 * elfxx-x86.h (elf_x86_link_hash_table): Remove
439 readonly_dynrelocs_against_ifunc.
441 2020-06-09 Alan Modra <amodra@gmail.com>
443 * elf64-ppc.c (struct ppc_link_hash_table): Delete
444 maybe_local_ifunc_resolver field.
445 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
446 cases where maybe_local_ifunc_resolver was set.
447 (ppc64_elf_relocate_section): Likewise.
448 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
451 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
453 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
455 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
457 (elf32_arm_size_dynamic_sections): Updated. Clear
458 root.tlsdesc_plt for DF_BIND_NOW.
459 (elf32_arm_finish_dynamic_sections): Updated.
460 (elf32_arm_output_arch_local_syms): Likewise.
461 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
462 Clear root.tlsdesc_plt for DF_BIND_NOW.
463 (nds32_elf_finish_dynamic_sections): Updated.
464 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
465 dt_tlsdesc_plt and dt_tlsdesc_got.
466 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
467 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
468 tlsdesc_plt and dt_tlsdesc_got.
469 (elfNN_aarch64_allocate_dynrelocs): Updated.
470 (elfNN_aarch64_finish_dynamic_sections): Likewise.
471 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
472 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
474 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
475 (_bfd_x86_elf_size_dynamic_sections): Likewise.
476 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
477 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
480 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
482 * elf32-tic6x.c (elf32_bed): Defined the default to
485 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
487 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
489 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
490 root.splt/root.srelplt.
491 (elf64_hppa_create_dynamic_sections): Likewise.
492 (elf64_hppa_size_dynamic_sections): Likewise.
493 (elf64_hppa_finish_dynamic_symbol): Likewise.
494 (elf_hppa_final_link): Likewise.
495 (elf_hppa_final_link_relocate): Likewise.
497 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
499 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
500 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
503 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
505 * elf-bfd.h (elf_target_os): New.
506 (elf_link_hash_table): Add target_os.
507 (elf_backend_data): Add target_os.
508 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
509 symbian_p and nacl_p.
510 (create_got_section): Updated.
511 (elf32_arm_create_dynamic_sections): Likewise.
512 (arm_type_of_stub): Likewise.
513 (elf32_arm_create_or_find_stub_sec): Likewise.
514 (elf32_arm_allocate_plt_entry): Likewise.
515 (elf32_arm_populate_plt_entry): Likewise.
516 (elf32_arm_final_link_relocate): Likewise.
517 (elf32_arm_check_relocs): Likewise.
518 (allocate_dynrelocs_for_symbol): Likewise.
519 (elf32_arm_finish_dynamic_symbol): Likewise.
520 (elf32_arm_finish_dynamic_sections): Likewise.
521 (elf32_arm_output_plt_map_1): Likewise.
522 (elf32_arm_output_arch_local_syms): Likewise.
523 (elf32_arm_add_symbol_hook): Likewise.
524 (elf32_arm_nacl_link_hash_table_create): Likewise.
525 (elf32_arm_vxworks_link_hash_table_create): Likewise.
526 (elf32_arm_symbian_link_hash_table_create): Likewise.
527 (ELF_TARGET_OS): New.
528 * elf32-i386.c (elf_i386_arch_bed): Removed.
529 (elf_backend_arch_data): Likewise.
530 (elf_i386_solaris_arch_bed): Likewise.
531 (elf_i386_nacl_arch_bed): Likewise.
532 (elf_i386_vxworks_arch_bed): Likewise.
533 (elf_i386_relocate_section): Updated.
534 (elf_i386_finish_dynamic_sections): Likewise.
535 (elf_i386_get_synthetic_symtab): Likewise.
536 (elf_i386_link_setup_gnu_properties): Likewise.
537 (ELF_TARGET_OS): New.
538 * elf32-mips.c (ELF_TARGET_OS): New.
539 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
540 (ppc_elf_create_got): Updated.
541 (ppc_elf_create_dynamic_sections): Likewise.
542 (ppc_elf_check_relocs): Likewise.
543 (ppc_elf_adjust_dynamic_symbol): Likewise.
544 (ppc_elf_size_dynamic_sections): Likewise.
545 (ppc_elf_relocate_section): Likewise.
546 (ppc_elf_finish_dynamic_sections): Likewise.
547 (ppc_elf_vxworks_link_hash_table_create): Likewise.
548 (ELF_TARGET_OS): New.
549 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
550 (sh_elf_link_hash_table_create): Updated.
551 (sh_elf_create_dynamic_sections): Likewise.
552 (allocate_dynrelocs): Likewise.
553 (sh_elf_size_dynamic_sections): Likewise.
554 (sh_elf_relocate_section): Likewise.
555 (sh_elf_finish_dynamic_symbol): Likewise.
556 (sh_elf_finish_dynamic_sections): Likewise.
557 (ELF_TARGET_OS): New.
558 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
560 (bfd_elf32_bfd_link_hash_table_create): Likewise.
561 (ELF_TARGET_OS): New.
562 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
563 (elf_x86_64_solaris_arch_bed): Likewise.
564 (elf_x86_64_nacl_arch_bed): Likewise.
565 (elf_x86_64_finish_dynamic_sections): Updated.
566 (elf_x86_64_get_synthetic_symtab): Likewise.
567 (elf_x86_64_link_setup_gnu_properties): Likewise.
568 (ELF_TARGET_OS): New.
569 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
571 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
572 (MIPS_ELF_REL_DYN_NAME): Updated.
573 (ELF_MIPS_GP_OFFSET): Likewise.
574 (mips_elf_create_local_got_entry): Likewise.
575 (mips_elf_allocate_dynamic_relocations): Likewise.
576 (mips_elf_count_got_symbols): Likewise.
577 (is_gott_symbol): Likewise.
578 (mips_elf_calculate_relocation): Likewise.
579 (mips_elf_create_dynamic_relocation): Likewise.
580 (_bfd_mips_elf_check_relocs): Likewise.
581 (allocate_dynrelocs): Likewise.
582 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
583 (mips_elf_lay_out_got): Likewise.
584 (mips_elf_set_plt_sym_value): Likewise.
585 (_bfd_mips_elf_size_dynamic_sections): Likewise.
586 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
587 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
588 (_bfd_mips_elf_final_link): Likewise.
589 (_bfd_mips_init_file_header): Likewise.
590 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
592 (allocate_dynrelocs): Likewise.
593 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
594 (_bfd_sparc_elf_relocate_section): Likewise.
595 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
596 (sparc_finish_dyn): Likewise.
597 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
598 * elfxx-target.h (ELF_TARGET_OS): New.
599 (elfNN_bed): Add ELF_TARGET_OS.
600 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
601 (_bfd_x86_elf_link_hash_table_create): Likewise.
602 (_bfd_x86_elf_size_dynamic_sections): Likewise.
603 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
604 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
605 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
606 * elfxx-x86.h (elf_x86_target_os): Removed.
607 (elf_x86_backend_data): Likewise.
608 (get_elf_x86_backend_data): Likewise.
609 (elf_x86_link_hash_table): Remove target_os.
611 2020-06-06 Alan Modra <amodra@gmail.com>
614 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
615 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
616 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
617 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
618 * elf64-ppc.c: Update throughout for reloc renaming.
619 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
620 * libbfd.h: Regenerate.
621 * bfd-in2.h: Regenerate.
623 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
626 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
629 2020-06-05 Nick Clifton <nickc@redhat.com>
631 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
634 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
636 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
637 priv_may_conflict, in_priv_zero and out_priv_zero to decide
638 whether the object can be linked according to it's priv
639 attributes. The object without any priv spec attributes can
640 be linked with others. If the first input object doesn't contain
641 any priv attributes, then we need to copy the setting from the
642 next input one. Also report more detailed error messages to user.
644 2020-06-04 Stephen Casner <casner@acm.org>
646 Extend pdp11-aout symbol table format to accommodate .stab
647 symbols and implement correct handling of them.
649 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
650 (N_STAB, is_stab): Needed new function is_stab to disambiguate
651 normal vs. .stab symbol table type values, replacing N_STAB mask.
652 (translate_from_native_sym_flags): Determine correct section for
653 different .stab types.
654 (translate_to_native_sym_flags): Leave .stab types intact.
655 (translate_symbol_table): Error if symbol indicates overlay;
656 store desc field from .stab symbols.
657 (write_syms): Output desc field with symbol.
658 (aout_link_check_ar_symbols): Skip .stab symbols.
659 (aout_link_add_symbols): Correctly distinguish .stab symbols.
660 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
661 (aout_link_write_symbols): Write 0 for desk and ovly fields;
662 correctly distinguish .stab symbols and select calculate their
663 section and value; and copy desc and ovly fields from input symbol
666 2020-06-04 Stephen Casner <casner@acm.org>
668 * aoutx.h (translate_symbol_table): Comment had external and
670 * pdp11.c (translate_symbol_table): Likewise.
672 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
674 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
675 (is_x86_elf): Check elf.hash_table_id instead of target_id.
676 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
678 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
681 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
682 in debug section against symbol defined in shared library to 0.
683 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
684 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
685 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
686 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
687 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
688 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
689 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
690 * elf32-sh.c (sh_elf_check_relocs): Likewise.
691 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
692 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
693 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
694 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
695 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
696 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
698 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
699 there is non-GOT reference.
700 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
701 non-alloced sections.
703 2020-06-03 Stephen Casner <casner@acm.org>
705 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
707 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
709 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
710 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
711 other size that doesn't qcover the header word.
712 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
713 string table, and zero it.
714 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
715 message and set bfd_error on finding an invalid name string offset.
716 (add_to_stringtab): INLINE -> inline
717 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
719 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
720 any relocs that could not be recognised.
721 92744f05809 PR 20929 - Check for relocs without an associated symbol.
722 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
723 name exists and is long enough, before attempting to see if it is
725 c3864421222 - Correct case for N_SO being the last symbol.
726 50455f1ab29 PR 20891 - Handle the case where the main file name
727 and the directory name are both empty.
728 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
729 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
730 range string table offsets.
731 531336e3a0b PR 20909 - Fix off-by-one error in check for an
732 illegal string offset.
733 (aout_link_includes_newfunc): Add comment.
734 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
735 on unexpected relocation type rather than ASSERT.
737 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
740 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
741 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
743 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
746 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
747 non-alloced sections.
749 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
751 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
752 dynamic relocations for non SEC_ALLOC sections.
754 2020-06-03 Gunther Nikl <gnikl@justmail.de>
756 * aout64.c (BMAGIC, QMAGIC): Do not define.
757 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
758 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
759 to check the file format.
760 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
761 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
762 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
764 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
766 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
767 relocations for non SEC_ALLOC sections.
769 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
771 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
772 * elf32-arm.c (maybe_set_textrel): Removed.
773 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
774 with _bfd_elf_maybe_set_textrel.
775 * elf32-csky.c (maybe_set_textrel): Removed.
776 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
777 with _bfd_elf_maybe_set_textrel.
778 * elf32-hppa.c (maybe_set_textrel): Removed.
779 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
780 with _bfd_elf_maybe_set_textrel.
781 * elf32-lm32.c (maybe_set_textrel): Removed.
782 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
783 with _bfd_elf_maybe_set_textrel.
784 * elf32-m32r.c (maybe_set_textrel): Removed.
785 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
786 with _bfd_elf_maybe_set_textrel.
787 * elf32-metag.c (maybe_set_textrel): Removed.
788 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
789 with _bfd_elf_maybe_set_textrel.
790 * elf32-nds32.c (maybe_set_textrel): Removed.
791 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
792 with _bfd_elf_maybe_set_textrel.
793 * elf32-or1k.c (maybe_set_textrel): Removed.
794 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
795 with _bfd_elf_maybe_set_textrel.
796 * elf32-ppc.c (maybe_set_textrel): Removed.
797 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
798 with _bfd_elf_maybe_set_textrel.
799 * elf32-s390.c (maybe_set_textrel): Removed.
800 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
801 with _bfd_elf_maybe_set_textrel.
802 * elf32-sh.c (maybe_set_textrel): Removed.
803 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
804 with _bfd_elf_maybe_set_textrel.
805 * elf32-tic6x.c (maybe_set_textrel): Removed.
806 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
807 with _bfd_elf_maybe_set_textrel.
808 * elf32-tilepro.c (maybe_set_textrel): Removed.
809 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
810 with _bfd_elf_maybe_set_textrel.
811 * elf64-ppc.c (maybe_set_textrel): Removed.
812 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
813 with _bfd_elf_maybe_set_textrel.
814 * elf64-s390.c (maybe_set_textrel): Removed.
815 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
816 with _bfd_elf_maybe_set_textrel.
817 * elfnn-aarch64.c (maybe_set_textrel): Removed.
818 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
819 with _bfd_elf_maybe_set_textrel.
820 * elfnn-riscv.c (maybe_set_textrel): Removed.
821 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
822 with _bfd_elf_maybe_set_textrel.
823 * elfxx-sparc.c (maybe_set_textrel): Removed.
824 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
825 with _bfd_elf_maybe_set_textrel.
826 * elfxx-tilegx.c (maybe_set_textrel): Removed.
827 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
828 with _bfd_elf_maybe_set_textrel.
829 * elfxx-x86.c (maybe_set_textrel): Removed.
830 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
831 with _bfd_elf_maybe_set_textrel.
832 * elflink.c (_bfd_elf_maybe_set_textrel): New.
834 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
837 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
839 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
840 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
841 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
842 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
844 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
845 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
846 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
847 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
848 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
849 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
850 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
851 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
852 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
853 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
854 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
855 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
856 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
857 (elf_backend_copy_indirect_symbol): Likewise.
858 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
859 (elf_backend_copy_indirect_symbol): Likewise.
860 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
862 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
865 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
866 * elf32-arm.c (readonly_dynrelocs): Removed.
867 (maybe_set_textrel): Replace readonly_dynrelocs with
868 _bfd_elf_readonly_dynrelocs.
869 * elf32-csky.c (readonly_dynrelocs): Removed.
870 (maybe_set_textrel): Replace readonly_dynrelocs with
871 _bfd_elf_readonly_dynrelocs.
872 * elf32-hppa.c(readonly_dynrelocs): Removed.
873 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
874 _bfd_elf_readonly_dynrelocs.
875 (maybe_set_textrel): Likewise.
876 * elf32-lm32.c (readonly_dynrelocs): Removed.
877 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
878 with _bfd_elf_readonly_dynrelocs.
879 (maybe_set_textrel): Likewise.
880 * elf32-m32r.c (readonly_dynrelocs): Removed.
881 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
882 with _bfd_elf_readonly_dynrelocs.
883 (maybe_set_textrel): Likewise.
884 * elf32-metag.c (readonly_dynrelocs): Removed.
885 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
886 with _bfd_elf_readonly_dynrelocs.
887 (maybe_set_textrel): Likewise.
888 * elf32-microblaze.c (readonly_dynrelocs): Removed.
889 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
890 with _bfd_elf_readonly_dynrelocs.
891 * elf32-nds32.c (readonly_dynrelocs): Removed.
892 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
893 with _bfd_elf_readonly_dynrelocs.
894 (maybe_set_textrel): Likewise.
895 * elf32-or1k.c (readonly_dynrelocs): Removed.
896 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
897 with _bfd_elf_readonly_dynrelocs.
898 * elf32-ppc.c (readonly_dynrelocs): Removed.
899 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
900 _bfd_elf_readonly_dynrelocs.
901 (ppc_elf_adjust_dynamic_symbol): Likewise.
902 (maybe_set_textrel): Likewise.
903 * elf32-s390.c (readonly_dynrelocs): Removed.
904 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
905 with _bfd_elf_readonly_dynrelocs.
906 (maybe_set_textrel): Likewise.
907 * elf32-sh.c (readonly_dynrelocs): Removed.
908 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
909 _bfd_elf_readonly_dynrelocs.
910 (maybe_set_textrel): Likewise.
911 * elf32-tic6x.c (readonly_dynrelocs): Removed.
912 (maybe_set_textrel): Replace readonly_dynrelocs with
913 _bfd_elf_readonly_dynrelocs.
914 * elf32-tilepro.c (readonly_dynrelocs): Removed.
915 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
916 with _bfd_elf_readonly_dynrelocs.
917 (maybe_set_textrel): Likewise.
918 * elf64-ppc.c (readonly_dynrelocs): Removed.
919 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
920 _bfd_elf_readonly_dynrelocs.
921 (ppc64_elf_adjust_dynamic_symbol): Likewise.
922 (maybe_set_textrel): Likewise.
923 * elf64-s390.c (readonly_dynrelocs): Removed.
924 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
925 with _bfd_elf_readonly_dynrelocs.
926 (maybe_set_textrel): Likewise.
927 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
928 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
929 (maybe_set_textrel): Replace readonly_dynrelocs with
930 _bfd_elf_readonly_dynrelocs.
931 * elfnn-riscv.c (readonly_dynrelocs): Removed.
932 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
933 with _bfd_elf_readonly_dynrelocs.
934 (maybe_set_textrel): Likewise.
935 * elfxx-sparc.c (readonly_dynrelocs): Removed.
936 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
937 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
938 (maybe_set_textrel): Likewise.
939 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
940 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
941 with _bfd_elf_readonly_dynrelocs.
942 (maybe_set_textrel): Likewise.
943 * elfxx-x86.c (readonly_dynrelocs): Removed.
944 (maybe_set_textrel): Replace readonly_dynrelocs with
945 _bfd_elf_readonly_dynrelocs.
946 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
948 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
950 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
951 -fsanitize=undefined.
953 2020-06-03 Alan Modra <amodra@gmail.com>
957 * peicode.h (pe_ILF_make_a_section): Align data for compilers
959 (pe_ILF_build_a_bfd): Likewise.
961 2020-06-03 Alan Modra <amodra@gmail.com>
964 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
965 core files as well as objects.
967 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
970 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
971 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
973 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
974 (elf_arc_link_hash_newfunc): Updated.
975 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
976 (elf32_arm_link_hash_newfunc): Updated.
977 (elf32_arm_copy_indirect_symbol): Likewise.
978 (elf32_arm_check_relocs): Likewise.
979 (readonly_dynrelocs): Likewise.
980 (allocate_dynrelocs_for_symbol): Likewise.
981 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
982 (csky_elf_link_hash_newfunc): Updated.
983 (csky_allocate_dynrelocs): Likewise.
984 (readonly_dynrelocs): Likewise.
985 (csky_elf_copy_indirect_symbol): Likewise.
986 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
987 (hppa_link_hash_newfunc): Updated.
988 (elf32_hppa_copy_indirect_symbol): Likewise.
989 (elf32_hppa_hide_symbol): Likewise.
990 (elf32_hppa_adjust_dynamic_symbol): Likewise.
991 (allocate_dynrelocs): Likewise.
992 (elf32_hppa_relocate_section): Likewise.
993 * elf32-i386.c (elf_i386_check_relocs): Likewise.
994 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
995 (lm32_elf_link_hash_newfunc): Likewise.
996 (lm32_elf_link_hash_table_create): Updated.
997 (readonly_dynrelocs): Likewise.
998 (allocate_dynrelocs): Likewise.
999 (lm32_elf_copy_indirect_symbol): Likewise.
1000 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
1001 (m32r_elf_link_hash_newfunc): Likewise.
1002 (m32r_elf_link_hash_table_create): Updated.
1003 (m32r_elf_copy_indirect_symbol): Likewise.
1004 (allocate_dynrelocs): Likewise.
1005 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
1006 (metag_link_hash_newfunc): Updated.
1007 (elf_metag_copy_indirect_symbol): Likewise.
1008 (readonly_dynrelocs): Likewise.
1009 (allocate_dynrelocs): Likewise.
1010 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
1012 (link_hash_newfunc): Updated.
1013 (microblaze_elf_check_relocs): Likewise.
1014 (microblaze_elf_copy_indirect_symbol): Likewise.
1015 (readonly_dynrelocs): Likewise.
1016 (allocate_dynrelocs): Likewise.
1017 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
1018 (nds32_elf_link_hash_newfunc): Updated.
1019 (nds32_elf_copy_indirect_symbol): Likewise.
1020 (readonly_dynrelocs): Likewise.
1021 (allocate_dynrelocs): Likewise.
1022 (nds32_elf_check_relocs): Likewise.
1023 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
1024 (link_hash_newfunc): Updated.
1025 (nios2_elf32_copy_indirect_symbol): Likewise.
1026 (nios2_elf32_check_relocs): Likewise.
1027 (allocate_dynrelocs): Likewise.
1028 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
1029 (or1k_elf_link_hash_newfunc): Updated.
1030 (readonly_dynrelocs): Likewise.
1031 (allocate_dynrelocs): Likewise.
1032 (or1k_elf_copy_indirect_symbol): Likewise.
1033 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
1034 (ppc_elf_link_hash_newfunc): Updated.
1035 (ppc_elf_copy_indirect_symbol): Likewise.
1036 (ppc_elf_check_relocs): Likewise.
1037 (readonly_dynrelocs): Likewise.
1038 (ppc_elf_adjust_dynamic_symbol): Likewise.
1039 (allocate_dynrelocs): Likewise.
1040 (ppc_elf_relocate_section): Likewise.
1041 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1042 (link_hash_newfunc): Updated.
1043 (elf_s390_copy_indirect_symbol): Likewise.
1044 (readonly_dynrelocs): Likewise.
1045 (elf_s390_adjust_dynamic_symbol): Likewise.
1046 (allocate_dynrelocs): Likewise.
1047 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
1048 (sh_elf_link_hash_newfunc): Updated.
1049 (readonly_dynrelocs): Likewise.
1050 (allocate_dynrelocs): Likewise.
1051 (sh_elf_copy_indirect_symbol): Likewise.
1052 (sh_elf_check_relocs): Likewise.
1053 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
1054 (elf32_tic6x_link_hash_newfunc): Likewise.
1055 (elf32_tic6x_link_hash_table_create): Updated.
1056 (readonly_dynrelocs): Likewise.
1057 (elf32_tic6x_check_relocs): Likewise.
1058 (elf32_tic6x_allocate_dynrelocs): Likewise.
1059 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
1061 (link_hash_newfunc): Updated.
1062 (tilepro_elf_copy_indirect_symbol): Likewise.
1063 (tilepro_elf_check_relocs): Likewise.
1064 (allocate_dynrelocs): Likewise.
1065 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
1066 (ppc64_elf_copy_indirect_symbol): Updated.
1067 (ppc64_elf_check_relocs): Likewise.
1068 (readonly_dynrelocs): Likewise.
1069 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1070 (dec_dynrel_count): Likewise.
1071 (allocate_dynrelocs): Likewise.
1072 (ppc64_elf_relocate_section): Likewise.
1073 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1074 (link_hash_newfunc): Updated.
1075 (elf_s390_copy_indirect_symbol): Likewise.
1076 (readonly_dynrelocs): Likewise.
1077 (allocate_dynrelocs): Likewise.
1078 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1079 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1081 (elfNN_aarch64_link_hash_newfunc): Updated.
1082 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1083 (readonly_dynrelocs): Likewise.
1084 (need_copy_relocation_p): Likewise.
1085 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1086 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1087 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1088 (link_hash_newfunc): Updated.
1089 (riscv_elf_copy_indirect_symbol): Likewise.
1090 (riscv_elf_check_relocs): Likewise.
1091 (readonly_dynrelocs): Likewise.
1092 (allocate_dynrelocs): Likewise.
1093 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1095 (link_hash_newfunc): Updated.
1096 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1097 (_bfd_sparc_elf_check_relocs): Likewise.
1098 (readonly_dynrelocs): Likewise.
1099 (allocate_dynrelocs): Likewise.
1100 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1101 (link_hash_newfunc): Updated.
1102 (tilegx_elf_copy_indirect_symbol): Likewise.
1103 (tilegx_elf_check_relocs): Likewise.
1104 (readonly_dynrelocs): Likewise.
1105 (allocate_dynrelocs): Likewise.
1106 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1107 (readonly_dynrelocs): Likewise.
1108 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1109 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1111 2020-06-01 Alan Modra <amodra@gmail.com>
1113 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1114 command against cmd_length, not the end of record. For
1115 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1116 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1119 2020-05-28 David Faust <david.faust@oracle.com>
1121 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1122 R_BPF_INSN_{32,64} relocations.
1124 2020-05-28 Stephen Casner <casner@acm.org>
1126 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1127 addreses in .long (used in testsuites) and .stab values.
1129 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1132 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1133 Check bfd_link_dll when issue a DT_TEXTREL warning.
1134 * elfxx-x86.c (maybe_set_textrel): Likewise.
1135 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1137 2020-05-26 Nick Clifton <nickc@redhat.com>
1139 * plugin.c (try_load_plugin): Extend error message when a plugin
1142 2020-05-23 Alan Modra <amodra@gmail.com>
1144 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1146 2020-05-22 Alan Modra <amodra@gmail.com>
1149 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1150 attributes from shared libraries, and do not return an error if
1153 2020-05-21 Alan Modra <amodra@gmail.com>
1156 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1158 (_bfd_delete_bfd): Free the copy.
1159 (_bfd_new_bfd): Free nbfd->memory on error.
1161 2020-05-21 Alan Modra <amodra@gmail.com>
1163 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1164 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1165 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1166 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1167 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1168 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1169 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1170 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1171 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1172 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1173 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1174 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1175 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1176 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1177 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1178 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1179 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1180 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1181 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1182 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1184 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1186 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1187 get_default_version. It is used to find the default version for
1188 the specific extension.
1189 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1190 default_major_version and default_minor_version. Add new bfd_boolean
1191 parameter *use_default_version. Set it to TRUE if we need to call
1192 the callback rps->get_default_version to find the default version.
1193 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1194 the default version in riscv_parsing_subset_version, and then call
1195 riscv_add_subset to add the subset into subset list.
1196 (riscv_parse_prefixed_ext): Likewise.
1197 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1198 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1199 strings rather than characters.
1200 riscv_merge_arch_attr_info): The callback function get_default_version
1201 is only needed for assembler, so set it to NULL int the linker.
1202 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1203 * elfxx-riscv.h: Updated.
1205 2020-05-20 Alan Modra <amodra@gmail.com>
1208 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1209 use bfd_set_filename.
1210 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1211 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1212 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1213 (bfd_create): Likewise.
1214 (_bfd_delete_bfd): Don't free filename.
1215 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1216 return pointer to the copy or NULL on alloc fail.
1217 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1218 result of bfd_set_filename.
1219 * bfd-in2.h: Regenerate.
1221 2020-05-20 Alan Modra <amodra@gmail.com>
1224 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1225 section size against file size.
1226 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1228 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1231 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1232 and memset when allocating memory for the sections_being_created
1235 2020-05-19 Stafford Horne <shorne@gmail.com>
1237 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1239 (or1k_elf_relocate_section): Access srelgot via
1240 htab->root.srelgot. Add assertions for srelgot->contents.
1241 Introduce local variable for srelgot to not reuse global
1243 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1244 (or1k_set_got_and_rela_sizes): New function.
1245 (or1k_initial_exec_offset): New function.
1246 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1247 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1249 (or1k_elf_check_relocs): Use OR to set TLS access.
1250 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1252 (or1k_elf_size_dynamic_sections): Use
1253 or1k_set_got_and_rela_sizes to set sizes.
1254 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1255 (TCB_SIZE): New macro.
1256 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1257 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1258 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1259 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1260 (tpoff): Add dynamic boolean argument.
1261 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1263 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
1265 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1266 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1267 cases with BFD_RELOC_AARCH64_JUMP26.
1268 (elfNN_aarch64_check_relocs): Likewise.
1270 2020-05-19 Alan Modra <amodra@gmail.com>
1272 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1273 bfd_get_filename rather than accessing bfd->filename directly.
1274 * aout-target.h (MY (object_p)): Likewise.
1275 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1276 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1277 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1278 (_bfd_archive_bsd44_construct_extended_name_table),
1279 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1280 (_bfd_bsd_write_armap): Likewise.
1281 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
1282 * cache.c (bfd_open_file): Likewise.
1283 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
1284 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
1285 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1286 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1287 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
1288 * elf32-nds32.c (nds32_elf_output_symbol_hook),
1289 (patch_tls_desc_to_ie): Likewise.
1290 * elf32-spu.c (sort_bfds, print_one_overlay_section),
1291 (spu_elf_auto_overlay): Likewise.
1292 * elf64-hppa.c (elf_hppa_final_link): Likewise.
1293 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
1294 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
1295 * elflink.c (bfd_elf_size_dynamic_sections),
1296 (elf_link_input_bfd): Likewise.
1297 * linker.c (_bfd_generic_link_output_symbols): Likewise.
1298 * mach-o.c (bfd_mach_o_follow_dsym),
1299 (bfd_mach_o_close_and_cleanup): Likewise.
1300 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
1301 (find_separate_debug_file, get_build_id_name): Likewise.
1302 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1303 * plugin.c (bfd_plugin_open_input): Likewise.
1304 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
1305 * som.c (som_write_armap): Likewise.
1306 * srec.c (srec_write_record, srec_write_symbols): Likewise.
1307 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1308 (_bfd_vms_lib_write_archive_contents): Likewise.
1309 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1311 2020-05-19 Alan Modra <amodra@gmail.com>
1314 * bfdio.c (_bfd_real_fopen): Typo fix.
1316 2020-05-18 Nick Clifton <nickc@redhat.com>
1319 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1320 for the sections_being_created array.
1322 2020-05-18 Alan Modra <amodra@gmail.com>
1324 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1325 they can be freed without also freeing internal_relocs.
1327 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1330 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1331 separators into DOS style when creating a WIN32 fullpath.
1333 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
1335 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1336 to initialize RISC-V tdata.
1338 2020-05-12 Gunther Nikl <gnikl@justmail.de>
1340 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1343 2020-05-11 Alan Modra <amodra@gmail.com>
1345 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1347 2020-05-11 Alan Modra <amodra@gmail.com>
1349 * elf64-ppc.c: Rename powerxx to power10 throughout.
1351 2020-05-11 Alan Modra <amodra@gmail.com>
1354 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1355 contains required number of auxents before processing any auxent.
1356 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1357 file name from auxents for PE.
1359 2020-05-04 Gunther Nikl <gnikl@justmail.de>
1361 * aout-cris.c (DEFAULT_ARCH): Delete define.
1362 (MY_set_arch_mach): Likewise.
1363 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1365 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1366 of r_type before the shift.
1368 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
1371 * elfnn-aarch64.c (group_sections): Copy implementation from
1374 2020-05-01 Alan Modra <amodra@gmail.com>
1377 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1378 accessing root.u.def of symbols. Also check root.u.def.section
1379 is non-NULL. Reverse tests so as to make the logic positive.
1381 2020-05-01 Alan Modra <amodra@gmail.com>
1384 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1385 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1387 2020-05-01 Alan Modra <amodra@gmail.com>
1390 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1391 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1392 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1393 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1394 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1395 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1396 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1397 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1398 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1399 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1401 2020-05-01 Alan Modra <amodra@gmail.com>
1404 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1405 from shared libraries.
1407 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1409 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1410 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1411 equals 0. Report overflow when the result has negative sign but
1412 all significant bits are zero.
1414 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1416 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1417 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1419 2020-04-28 Alan Modra <amodra@gmail.com>
1421 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1422 Emit warning message.
1424 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1426 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1427 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1428 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1429 to x86_64_pe_big_vec as it not a big-endian format.
1430 (vec i386_pe_big_vec): New.
1431 * configure.ac: Likewise.
1432 * targets.c: Likewise.
1433 * configure: Regenerate.
1434 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1435 COFF_WITH_PE_BIGOBJ): New.
1436 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1438 (x86_64_pe_be_vec): Moved.
1440 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1442 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1443 * elf.c (elfcore_grok_arc_v2): New function.
1444 (elfcore_grok_note): Call the new function to handle the corresponding
1446 (elfcore_write_arc_v2): New function.
1447 (elfcore_write_register_note): Call the new function to handle the
1448 corresponding pseudo-sections.
1450 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1453 * bfd-in2.h: Regenerated.
1454 * elf32-xtensa.c (elf_howto_table): New entries for
1455 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1456 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1457 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1458 R_XTENSA_NDIFF{8,16,32}.
1459 * libbfd.h (bfd_reloc_code_real_names): Add names for
1460 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1461 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1462 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1463 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1465 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1468 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1471 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1474 * elf-bfd.h (elf_backend_data): Add
1475 elf_backend_strip_zero_sized_dynamic_sections.
1476 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1477 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1479 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1481 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1483 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1485 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1487 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1489 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1491 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1493 2020-04-21 Nick Clifton <nickc@redhat.com>
1495 * po/sr.po: Updated Serbian translation.
1497 2020-04-21 Alan Modra <amodra@gmail.com>
1499 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1502 2020-04-20 Stephen Casner <casner@acm.org>
1504 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1505 causing globals from linker script to be treated as debug symbols.
1506 (translate_symbol_table): Don't sign-extend symbol values from 16
1507 to 64 bits in nm output.
1509 2020-04-20 Alan Modra <amodra@gmail.com>
1511 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1513 2020-04-18 Alan Modra <amodra@gmail.com>
1515 * section.c (bfd_is_const_section): Correct test for special
1517 * bfd-in2.h: Regenerate.
1519 2020-04-17 Alan Modra <amodra@gmail.com>
1522 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1525 2020-04-16 Nick Clifton <nickc@redhat.com>
1528 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1529 abort with a more helpful error message.
1531 2020-04-16 Alan Modra <amodra@gmail.com>
1534 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1537 2020-04-15 Fangrui Song <maskray@google.com>
1540 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1541 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1542 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1543 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1544 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1545 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1546 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1547 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1548 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1549 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1550 * elflink.c (elf_link_output_extsym): Likewise.
1551 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1553 2020-04-15 Alan Modra <amodra@gmail.com>
1556 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1557 pointer into strings that may be freed for section name, always
1558 allocate a new string.
1560 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1561 Jan W. Jagersma <jwjagersma@gmail.com>
1563 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1564 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1565 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1566 (_bfd_go32_mkobject): New functions.
1567 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1568 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1569 (go32exe_mkobject): Call _bfd_go32_mkobject.
1570 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1571 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1573 (coff_write_relocs): Enable extended reloc counter code if
1574 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1575 (coff_write_object_contents): Likewise. Pad section headers
1576 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1577 instead of coff_swap_scnhdr_out.
1578 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1579 enable extended reloc counter.
1580 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1581 Declare with ATTRIBUTE_UNUSED.
1582 * libcoff-in.h: (struct coff_tdata): New field go32.
1584 * libcoff.h: Regenerate.
1586 2020-04-14 Fangrui Song <maskray@google.com>
1589 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1592 2020-04-14 Stephen Casner <casner@acm.org>
1595 * pdp11.c: Add implementation of --imagic option.
1596 (adjust_o_magic): Fix objcopy --extract-symbol test.
1597 * libaout.h (enum aout_magic): Add i_magic.
1599 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1600 Nick Clifton <nickc@redhat.com>
1602 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1604 <default>: Error rather than abort.
1606 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1609 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1610 relocation section from section group.
1612 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1614 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1615 bfd->origin to file offset.
1616 * bfdwin.c (bfd_get_file_window): Likewise.
1617 * bfd.c: Clarify the use of the bfd->origin field.
1618 * bfd-in2.h: Regenerate.
1619 * coff-i386.c: Don't include go32exe.h. Allow overriding
1620 coff_write_object_contents via COFF_WRITE_CONTENTS.
1621 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1622 (go32exe_write_object_contents): New functions.
1623 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1624 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1625 (create_go32_stub): Remove check for 2k size limit. Read stub
1626 from go32exe_temp_stub if present.
1627 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1628 copy variable-length stub.
1629 (go32_check_format): Read stub to go32exe_temp_stub, set
1630 origin, return go32exe_cleanup.
1631 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1632 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1633 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1634 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1635 Remove functions and their associated #defines.
1636 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1637 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1638 Rename field go32stub to stub.
1639 * libcoff.h: Regenerate.
1640 * coff-stgo32.c (go32_check_format): Rename to...
1641 (go32exe_check_format): ...this.
1642 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1643 (go32exe_copy_private_bfd_data): ...this.
1644 (stub_bytes): Rename to...
1645 (go32exe_default_stub): ...this.
1646 (create_go32_stub): Rename to...
1647 (go32exe_create_stub): ...this.
1648 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1651 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1655 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1656 relocation to R_386_32 for relocation against non-preemptible
1658 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1659 allocate dynamic relocation for non-preemptible absolute symbol.
1660 (elf_i386_relocate_section): Pass sec to
1661 GENERATE_DYNAMIC_RELOCATION_P.
1662 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1663 (elf_x86_64_convert_load_reloc): Covert load relocation to
1664 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1665 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1666 for non-preemptible absolute symbol if they overflow.
1667 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1668 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1669 symbol. Don't allocate dynamic relocation for non-preemptible
1671 (elf_x86_64_relocate_section): Don't generate relative relocation
1672 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1673 to GENERATE_DYNAMIC_RELOCATION_P.
1674 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1675 against non-preemptible absolute symbol.
1676 (_bfd_elf_x86_valid_reloc_p): New function.
1677 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1679 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1680 argument. Don't generate dynamic relocation against
1681 non-preemptible absolute symbol.
1682 (ABS_SYMBOL_P): New.
1683 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1684 against non-preemptible absolute symbol.
1686 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1687 (_bfd_elf_x86_valid_reloc_p): New.
1689 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1692 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1693 address in the GOT if in thumb only mode.
1695 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1697 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1699 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1701 * mmo.c (mmo_scan): Create .text section only when needed, not
1704 2020-03-31 Alan Modra <amodra@gmail.com>
1706 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1709 2020-03-31 Alan Modra <amodra@gmail.com>
1711 * vms-alpha.c (image_write): Check bounds for sections without
1712 contents too. Error on non-zero write to section without
1714 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1716 2020-03-31 Alan Modra <amodra@gmail.com>
1718 * tekhex.c (pass_over): Check is_eof before reading buffer.
1720 2020-03-30 Nick Clifton <nickc@redhat.com>
1723 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1724 field to timestamp and make it an integer.
1725 * libcoff.h: Regenerate.
1726 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1727 field in the pe_data structure rather than the insert_timestamp
1730 2020-03-30 Alan Modra <amodra@gmail.com>
1733 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1736 2020-03-26 Nick Clifton <nickc@redhat.com>
1738 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1739 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1741 * libbfd.h: Regenerate.
1743 2020-03-26 Alan Modra <amodra@gmail.com>
1745 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1747 2020-03-26 Alan Modra <amodra@gmail.com>
1749 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1751 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1753 2020-03-25 Nick Clifton <nickc@redhat.com>
1755 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1757 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1758 * libbfd.h: Regenerate.
1760 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1762 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1763 correct field name in the output string.
1765 2020-03-25 Alan Modra <amodra@gmail.com>
1768 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1769 for SHT_NOBITS section if first in segment.
1771 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1774 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1775 (_bfd_elf_get_symbol_version_string): This.
1776 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1777 (_bfd_elf_get_symbol_version_string): This.
1778 (bfd_elf_print_symbol): Pass TRUE to
1779 _bfd_elf_get_symbol_version_string.
1780 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1781 bfd_boolean argument.
1782 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1783 * targets.c (_bfd_get_symbol_version_string): Likewise.
1784 (bfd_get_symbol_version_string): Likewise.
1785 * bfd-in2.h: Regenerated.
1787 2020-03-24 Nick Clifton <nickc@redhat.com>
1788 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1791 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1794 2020-03-24 Nick Clifton <nickc@redhat.com>
1797 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1798 segment to use for PT_GNU_RELRO, ignore empty sections in a
1799 segment's current list.
1801 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1804 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1806 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1809 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1810 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1811 on the previous _bfd_elf_get_symbol_version_string.
1812 (_bfd_elf_get_symbol_version_string): Use it.
1814 2020-03-24 Alan Modra <amodra@gmail.com>
1816 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1817 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1820 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1822 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1824 2020-03-23 Alan Modra <amodra@gmail.com>
1826 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1827 symbol count. Allocate an extra byte to ensure name strings
1828 are terminated. Sanity check name offsets. Release memory on
1831 2020-03-23 Alan Modra <amodra@gmail.com>
1833 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1834 field hasn't been read. Remove unnecessary casts.
1836 2020-03-22 Alan Modra <amodra@gmail.com>
1838 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1839 enough to read number of symbols.
1841 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1843 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1844 (EXECUTABLE_SUFFIX): Likewise.
1845 * config.in: Regenerated.
1846 * configure: Likewise.
1847 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1848 _bfd_generic_close_and_cleanup.
1849 (plugin_list_entry): Remove resolution_file, resolution_option,
1850 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1851 lto_wrapper, gcc_env and initialized,
1852 (need_lto_wrapper_p): Removed.
1853 (get_lto_wrapper): Likewise.
1854 (setup_lto_wrapper_env): Likewise.
1855 (register_all_symbols_read): Likewise.
1856 (egister_cleanup): Likewise.
1857 (get_symbols): Likewise.
1858 (add_input_file): Likewise.
1859 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1860 (add_symbols): Updated.
1861 (try_claim): Likewise.
1862 (try_load_plugin): Likewise.
1863 (bfd_plugin_canonicalize_symtab): Likewise.
1864 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1865 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1867 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1870 * plugin.c (plugin_list_entry): Add has_symbol_type.
1871 (add_symbols_v2): New function.
1872 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1873 provides symbol type.
1874 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1875 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1878 2020-03-20 Alan Modra <amodra@gmail.com>
1880 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1881 enough to read number of symbols.
1883 2020-03-20 Alan Modra <amodra@gmail.com>
1885 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1886 backend functions for NULL before calling.
1887 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1888 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1889 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1890 * elfnn-ia64.c (ignore_errors): New function.
1891 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1893 2020-03-19 Nick Clifton <nickc@redhat.com>
1896 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1897 location of the varinfo in the unit's debug info data. Change the
1898 type of the stack field to a boolean.
1899 (lookup_var_by_offset): New function. Returns the varinfo
1900 structure for the variable described at the given offset in the
1902 (scan_unit_for_symbols): Add support for variables which have the
1903 DW_AT_specification attribute.
1905 2020-03-19 Nick Clifton <nickc@redhat.com>
1908 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1911 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1913 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1915 2020-03-18 Nick Clifton <nickc@redhat.com>
1918 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1919 memory access when processing a corrupt secondary reloc section.
1921 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1923 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1924 instead of calling abort.
1925 * elf32-csky.c (csky_build_one_stub): Likewise.
1926 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1927 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1928 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1929 * elf32-metag.c (metag_build_one_stub): Likewise.
1930 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1931 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1932 (ppc_size_one_stub): Likewise.
1933 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1935 2020-03-17 Nick Clifton <nickc@redhat.com>
1938 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1939 with error messages.
1941 2020-03-17 Nick Clifton <nickc@redhat.com>
1944 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1945 free. Add free on another failure path.
1947 2020-03-16 Alan Modra <amodra@gmail.com>
1950 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1951 we have a non-zero section count. Do lma comparison in octets.
1953 2020-03-16 Alan Modra <amodra@gmail.com>
1955 * vms-alpha.c (dst_restore_location): Validate index into
1956 dst_ptr_offsets array before accessing. Return status.
1957 (dst_retrieve_location): Similarly, making "loc" parameter a
1958 pointer to return value.
1959 (_bfd_vms_slurp_etir): Update calls to above functions.
1961 2020-03-14 Kamil Rytarowski <n54@gmx.com>
1963 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1965 * configure: Regenerated.
1967 2020-03-14 Alan Modra <amodra@gmail.com>
1969 * section.c (BFD_FAKE_SECTIONS): Formatting.
1970 * bfd-in2.h: Regenerate.
1972 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1974 * elf.c (elfcore_grok_netbsd_note): Add support for
1975 NT_NETBSDCORE_LWPSTATUS notes.
1977 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1979 * bfd-in2.h: Regenerate.
1980 * section.c (asection): Add already_assigned field.
1981 (BFD_FAKE_SECTION): Add default initializer for it.
1982 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1983 * elf32-arm.c (arm_build_one_stub): Add support for
1984 non_contiguous_regions.
1985 * elf32-csky.c (csky_build_one_stub): Likewise.
1986 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1987 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1988 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1989 * elf32-metag.c (metag_build_one_stub): Likewise.
1990 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1991 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1992 (ppc_size_one_stub): Likewise.
1993 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1994 * elflink.c (elf_link_input_bfd): Likewise.
1996 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1999 * elf-linker-x86.h (elf_linker_x86_params): Add
2000 static_before_all_inputs and has_dynamic_linker.
2001 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2002 dynamic input objects if -static is passed at command-line
2003 before all input files without --dynamic-linker unless
2004 --no-dynamic-linker is used.
2006 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2008 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
2010 2020-03-13 Christian Eggers <ceggers@gmx.de>
2012 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
2013 "p_paddr" from "at".
2014 * elfcode.h (bfd_from_remote_memory): Add units to several
2015 parameters. New local "opb". Fix usage of p_align. Fix
2016 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
2017 call of target_read_memory.
2018 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
2019 calculation of "offset" and "output_offset".
2020 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
2021 from "offset" and fix calculation of "end" from "vma+size". Fix
2022 comparison between "sh_addr" and "vma"/"output_offset".
2023 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
2024 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
2026 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
2027 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
2028 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
2029 assignment of p_paddr from phdr_lma. Fix comparison between
2030 "lma+size" and "next->lma".
2031 (elf_sort_segments): Fix assignment from p_paddr to lma.
2032 (assign_file_positions_for_load_sections): Add unit (bytes) to
2033 local "align". Fix calculation of local "off_adjust". Fix
2034 calculation of local "filehdr_vaddr".
2035 (assign_file_positions_for_non_load_sections): New local "opb".
2036 Fix calculation of "end" from "p_size". Fix comparison between
2037 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
2038 from "end" and "p_vaddr".
2039 (rewrite_elf_program_header): Fix comparison between p_vaddr and
2040 vma. Fix assignment to p_paddr from lma. Fix comparison between
2041 p_paddr and lma. Fix assignment to p_paddr from lma.
2042 * merge.c (sec_merge_emit): New local "opb". Convert
2043 "alignment_power" to octets.
2044 (_bfd_add_merge_section): New locals "alignment_power" and
2045 "opb". Fix comparison between "alignment_power" and
2047 (_bfd_merge_sections): New local "opb". Divide size by opb
2048 before checking align mask.
2050 2020-03-13 Christian Eggers <ceggers@gmx.de>
2052 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
2053 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
2055 (_bfd_elf_make_section_from_phdr): Similarly.
2056 (elf_fake_sections): Fix calculation of
2057 Elf_Internal_shdr::sh_addr from section VMA.
2058 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
2060 (assign_file_positions_for_load_sections): Fix calculations of
2061 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
2062 comparison between program header address and section LMA.
2063 (assign_file_positions_for_non_load_sections): Likewise.
2064 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
2065 (IS_CONTAINED_BY_VMA): Add parameter opb.
2066 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
2067 INCLUDE_SECTION_IN_SEGMENT): Likewise.
2068 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
2069 Fix calculations of p_addr_valid and p_vaddr_offset.
2070 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
2071 with octets per byte when comparing against p_vaddr.
2073 2020-03-11 Alan Modra <amodra@gmail.com>
2075 * som.c (setup_sections): Sanity check subspace.name.
2077 2020-03-11 Alan Modra <amodra@gmail.com>
2079 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2081 2020-03-10 Alan Modra <amodra@gmail.com>
2084 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2087 2020-03-09 Alan Modra <amodra@gmail.com>
2089 * wasm-module.c (wasm_scan): Sanity check file name length
2090 before allocating memory. Move common section setup code. Do
2091 without bfd_tell to calculate section size.
2093 2020-03-06 Nick Clifton <nickc@redhat.com>
2095 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2096 with error messages and failure return values.
2098 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
2100 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2101 relocation sections for any removed reference to a dynamic symbol.
2103 2020-03-05 Nick Clifton <nickc@redhat.com>
2105 * elf-bfd.h (struct elf_backend_data): Add new fields:
2106 init_secondary_reloc_section, slurp_secondary_reloc_section,
2107 write_secondary_reloc_section.
2108 (_bfd_elf_init_secondary_reloc_section): Prototype.
2109 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2110 (_bfd_elf_write_secondary_reloc_section): Prototype.
2111 * elf.c ( bfd_section_from_shdr): Invoke the new
2112 init_secondary_reloc_section backend function, if defined, when a
2113 second reloc section is encountered.
2114 (swap_out_syms): Invoke the new symbol_section_index function, if
2115 defined, when computing the section index of an OS/PROC specific
2117 (_bfd_elf_init_secondary_reloc_section): New function.
2118 (_bfd_elf_slurp_secondary_reloc_section): New function.
2119 (_bfd_elf_write_secondary_reloc_section): New function.
2120 (_bfd_elf_copy_special_section_fields): New function.
2121 * elfcode.h (elf_write_relocs): Invoke the new
2122 write_secondary_relocs function, if defined, in order to emit
2124 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2125 function, if defined, in order to read in secondary relocs.
2126 * elfxx-target.h (elf_backend_copy_special_section_fields):
2127 Provide a non-NULL default definition.
2128 (elf_backend_init_secondary_reloc_section): Likewise.
2129 (elf_backend_slurp_secondary_reloc_section): Likewise.
2130 (elf_backend_write_secondary_reloc_section): Likewise.
2131 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2133 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2134 * configure: Regenerate.
2136 2020-03-05 Alan Modra <amodra@gmail.com>
2138 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2139 against file size before allocating memory. Use bfd_alloc rather
2140 than bfd_zalloc for carsym/strings memory.
2142 2020-03-04 Alan Modra <amodra@gmail.com>
2144 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2145 sh_addr mod sh_addalign is zero.
2147 2020-03-04 Alan Modra <amodra@gmail.com>
2149 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2151 2020-03-03 Alan Modra <amodra@gmail.com>
2153 * format.c (struct bfd_preserve): Add cleanup field.
2154 (bfd_preserve_save): Add cleanup param and save.
2155 (bfd_preserve_restore): Return cleanup.
2156 (bfd_preserve_finish): Call the cleanup for the discarded match.
2157 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2158 and clear when preserving a match. Restore cleanup too when
2159 restoring that match.
2161 2020-03-02 Alan Modra <amodra@gmail.com>
2163 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2164 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2165 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2166 (core_sco5_vec): Correct initialisers.
2168 2020-03-02 Alan Modra <amodra@gmail.com>
2170 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2171 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2172 * cisco-core.c (cisco_core_file_validate): Likewise.
2173 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2174 * hpux-core.c (hpux_core_core_file_p): Likewise.
2175 * irix-core.c (irix_core_core_file_p): Likewise.
2176 * lynx-core.c (lynx_core_file_p): Likewise.
2177 * netbsd-core.c (netbsd_core_file_p): Likewise.
2178 * osf-core.c (osf_core_core_file_p): Likewise.
2179 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2180 * sco5-core.c (sco5_core_file_p): Likewise.
2182 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2184 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2186 2020-03-02 Alan Modra <amodra@gmail.com>
2188 * targets.c (bfd_cleanup): New typedef.
2189 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2190 * libbfd-in.h (_bfd_no_cleanup): Define.
2191 * format.c (bfd_reinit): Add cleanup parameter, call it.
2192 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2193 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2194 * aout-target.h (callback, object_p): Return bfd_cleanup.
2195 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2196 * archive.c (bfd_generic_archive_p): Likewise.
2197 * binary.c (binary_object_p): Likewise.
2198 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2199 * coff-ia64.c (ia64coff_object_p): Likewise.
2200 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2201 * coff-sh.c (coff_small_object_p): Likewise.
2202 * coff-stgo32.c (go32_check_format): Likewise.
2203 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2204 (xcoff64_core_p): Likewise.
2205 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2206 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2207 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2208 * elfcode.h (elf_object_p): Likewise.
2209 * elfcore.h (elf_core_file_p): Likewise.
2210 * i386msdos.c (msdos_object_p): Likewise.
2211 * ihex.c (ihex_object_p): Likewise.
2212 * libaout.h (some_aout_object_p): Likewise.
2213 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2214 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2215 * libbfd.c (_bfd_dummy_target): Likewise.
2216 * libcoff-in.h (coff_object_p): Likewise.
2217 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2218 (bfd_mach_o_arm64_core_p): Likewise.
2219 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2220 (bfd_mach_o_arm_core_p): Likewise.
2221 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2222 (bfd_mach_o_i386_core_p): Likewise.
2223 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2224 (bfd_mach_o_x86_64_core_p): Likewise.
2225 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2226 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2227 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2228 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2229 * mmo.c (mmo_object_p): Likewise.
2230 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2231 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2232 (pe_bfd_object_p): Likewise.
2233 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2234 * ppcboot.c (ppcboot_object_p): Likewise.
2235 * rs6000-core.c (rs6000coff_core_p): Likewise.
2236 * som.c (som_object_setup, som_object_p): Likewise.
2237 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2238 * tekhex.c (tekhex_object_p): Likewise.
2239 * vms-alpha.c (alpha_vms_object_p): Likewise.
2240 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2241 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2242 * wasm-module.c (wasm_object_p): Likewise.
2243 * xsym.c (bfd_sym_object_p): Likewise.
2244 * xsym.h (bfd_sym_object_p): Likewise.
2245 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2247 * pdp11.c (some_aout_object_p): Likewise.
2248 * plugin.c (register_ld_plugin_object_p): Update object_p
2250 * plugin.h (register_ld_plugin_object_p): Likewise.
2251 * bfd-in2.h: Regenerate.
2252 * libbfd.h: Regenerate.
2253 * libcoff.h: Regenerate.
2255 2020-03-02 Alan Modra <amodra@gmail.com>
2257 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2258 applicable section flags.
2259 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2260 (mips_ecoff_bele_vec): Likewise.
2261 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2263 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2264 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2266 2020-03-02 Alan Modra <amodra@gmail.com>
2268 * elf32-m32r.c (m32r_elf_section_flags): New function.
2269 (elf_backend_section_flags): Define.
2270 * elf32-nds32.c (nds32_elf_section_flags): New function.
2271 (elf_backend_section_flags): Define.
2272 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2273 .sbss and .sdata sections.
2274 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2275 for SHF_V850_GPREL sections.
2276 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2278 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2279 for SHF_PARISC_SHORT sections.
2280 * elf64-ppc.c (ppc64_elf_section_flags): New function.
2281 (elf_backend_section_flags): Define.
2282 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
2283 for SHF_MIPS_GPREL sections. Delete FIXME.
2285 2020-03-02 Alan Modra <amodra@gmail.com>
2287 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
2288 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
2289 calling elf_backend_section_flags with adjusted params. Use
2290 newsect->flags past that point.
2291 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
2293 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
2294 to have their type overridden, and all sh_flags but processor and
2296 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
2297 * elf32-mep.c (mep_elf_section_flags): Likewise.
2298 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
2299 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
2300 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
2301 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
2302 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
2303 stub BFD and non-aarch64 input files when scanning for stubs.
2305 2020-03-02 Alan Modra <amodra@gmail.com>
2307 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2308 limit to decompressed element size.
2310 2020-03-02 Alan Modra <amodra@gmail.com>
2312 * vms-lib.c (vms_traverse_index): Add recur_count param and
2313 update calls. Fail on excessive recursion.
2315 2020-03-02 Alan Modra <amodra@gmail.com>
2317 * vms-alpha.c (vms_get_remaining_object_record): Use
2318 bfd_realloc_or_free rather than bfd_realloc.
2319 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2320 (dst_define_location, parse_module): Likewise, and check realloc
2321 return status before using memory. Return status from function
2322 adjusting all callers.
2324 2020-02-28 Alan Modra <amodra@gmail.com>
2326 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2328 2020-02-28 Alan Modra <amodra@gmail.com>
2330 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2331 Remove duplicate undersize check.
2333 2020-02-27 Alan Modra <amodra@gmail.com>
2336 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2338 2020-02-27 Alan Modra <amodra@gmail.com>
2341 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2342 (coff_section_type): Adjust comment.
2343 (decode_section_type): Likewise. Call coff_section_type before
2344 decode_section_type.
2345 (bfd_decode_symclass): Use 'c' for common sections other than
2348 2020-02-27 Alan Modra <amodra@gmail.com>
2350 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2353 2020-02-27 Alan Modra <amodra@gmail.com>
2355 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2356 if file is an archive element.
2357 * bfd-in2.h: Regenerate.
2359 2020-02-26 Alan Modra <amodra@gmail.com>
2361 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2362 bfd_set_error on failing test. Don't bother changing bfd_error on
2363 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2364 Check sym name is within string buffer. Use size_t for some vars.
2365 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2366 int_buf. Don't change bfd_error on file read error. Use
2367 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2368 calculations to catch overflows before they occur. malloc and
2369 free raw armap rather than using bfd_alloc. Read raw armap before
2370 allocating carsym+strings buffer.
2371 (_bfd_slurp_extended_name_table): Localize variables. Check
2372 name size against file size.
2374 2020-02-26 Alan Modra <amodra@gmail.com>
2376 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2378 2020-02-26 Alan Modra <amodra@gmail.com>
2380 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2381 malloc. Check for NULL return from bfd_malloc.
2382 (rx_table_find, rx_table_map): Likewise.
2383 (rx_set_section_contents): Check bfd_alloc return.
2384 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2386 2020-02-26 Alan Modra <amodra@gmail.com>
2388 * aoutx.h: Indent labels correctly. Format error strings.
2389 * archive.c: Likewise.
2390 * archive64.c: Likewise.
2391 * coff-arm.c: Likewise.
2392 * coff-rs6000.c: Likewise.
2393 * coff-stgo32.c: Likewise.
2394 * cpu-arm.c: Likewise.
2395 * dwarf2.c: Likewise.
2396 * elf-ifunc.c: Likewise.
2397 * elf-properties.c: Likewise.
2398 * elf-s390-common.c: Likewise.
2399 * elf-strtab.c: Likewise.
2401 * elf32-arm.c: Likewise.
2402 * elf32-bfin.c: Likewise.
2403 * elf32-cr16.c: Likewise.
2404 * elf32-csky.c: Likewise.
2405 * elf32-i386.c: Likewise.
2406 * elf32-m68k.c: Likewise.
2407 * elf32-msp430.c: Likewise.
2408 * elf32-nds32.c: Likewise.
2409 * elf32-nios2.c: Likewise.
2410 * elf32-pru.c: Likewise.
2411 * elf32-xtensa.c: Likewise.
2412 * elf64-ia64-vms.c: Likewise.
2413 * elf64-x86-64.c: Likewise.
2414 * elfcode.h: Likewise.
2415 * elfcore.h: Likewise.
2416 * elflink.c: Likewise.
2417 * elfnn-aarch64.c: Likewise.
2418 * elfnn-ia64.c: Likewise.
2419 * elfnn-riscv.c: Likewise.
2420 * elfxx-mips.c: Likewise.
2421 * elfxx-sparc.c: Likewise.
2422 * elfxx-x86.c: Likewise.
2423 * i386lynx.c: Likewise.
2424 * merge.c: Likewise.
2425 * pdp11.c: Likewise.
2426 * plugin.c: Likewise.
2427 * reloc.c: Likewise.
2429 2020-02-26 Alan Modra <amodra@gmail.com>
2432 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2434 (bfd_elf_add_dt_needed_tag): Declare.
2435 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2436 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2437 from elf_add_dt_needed_tag. Remove soname and doit param.
2438 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2439 to see whether as-needed lib is already loaded, use dyn_loaded
2440 list instead. When saving and restoring around as-needed lib
2441 handle possibility that dynstr has not been initialised. Don't
2442 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2443 Mark libs loaded via DT_NEEDED entries of other libs with
2444 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2446 (elf_link_check_versioned_symbol): Remove now unneccesary
2447 DYNAMIC check when traversing dyn_loaded list.
2449 2020-02-26 Alan Modra <amodra@gmail.com>
2451 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2453 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2456 * plugin.c (need_lto_wrapper_p): New.
2457 (bfd_plugin_set_program_name): Add an int argument to set
2459 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2461 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2463 2020-02-24 Alan Modra <amodra@gmail.com>
2465 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2467 2020-02-24 Alan Modra <amodra@gmail.com>
2469 * vms-lib.c (struct carsym_mem): Add limit.
2470 (vms_add_index): Heed limit.
2471 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2472 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2473 Always return actual number read.
2474 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2475 assertion with error exit.
2477 2020-02-22 Alan Modra <amodra@gmail.com>
2480 * elf.c (assign_file_positions_for_load_sections): Continue linking
2481 on "PHDR segment not covered by LOAD segment" errors.
2483 2020-02-21 Alan Modra <amodra@gmail.com>
2485 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2487 (bfd_mach_o_canonicalize_reloc): Likewise.
2488 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2489 counts and offsets against file size.
2490 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2491 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2492 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2493 against file size. Delete symbol table error message.
2494 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2496 (bfd_mach_o_read_symtab): Likewise.
2497 (bfd_mach_o_read_command): Pass file size.
2498 (bfd_mach_o_scan): Sanity check command count against file size.
2500 2020-02-21 Alan Modra <amodra@gmail.com>
2503 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2504 "text", "data" and "bss" section pointer vars. Don't update
2505 section size, just exec header sizes.
2506 (adjust_sizes_and_vmas): Don't update text section size. Set
2507 initial exec header a_text. Print exec headers sizes.
2508 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2509 (adjust_sizes_and_vmas): Similarly. Formatting.
2510 (final_link): Correct final file extension.
2512 2020-02-20 Nick Clifton <nickc@redhat.com>
2514 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2516 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2518 (elfNN_bed): Initialise the symbol_section_index field.
2519 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2520 OS and PROC specific section indicies. Warn if converting other
2521 reserved incidies to SHN_ABS.
2523 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2526 * cpu-z80.c: Add machine type compatibility checking.
2528 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2531 * plugin.c (plugin_list_entry): Remove handle.
2532 (try_load_plugin): Call dlclose before return.
2534 2020-02-19 Alan Modra <amodra@gmail.com>
2536 * libbfd-in.h (_bfd_constant_p): Define.
2537 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2538 file size before allocating memory.
2539 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2540 * elf.c (bfd_elf_get_str_section): Likewise.
2541 (_bfd_elf_slurp_version_tables): Likewise.
2542 * libbfd.h: Regenerate.
2544 2020-02-19 Alan Modra <amodra@gmail.com>
2546 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2547 * aoutx.h (aout_get_external_symbols): Replace calls to
2548 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2549 (slurp_reloc_table): Likewise.
2550 * archive.c (do_slurp_bsd_armap): Likewise.
2551 (do_slurp_coff_armap): Likewise.
2552 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2553 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2554 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2555 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2556 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2557 (_bfd_coff_get_external_symbols): Likewise.
2558 * ecoff.c (ecoff_slurp_symbolic_header),
2559 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2560 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2561 (ecoff_indirect_link_order): Likewise.
2562 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2563 (_bfd_elf_slurp_version_tables): Likewise.
2564 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2565 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2566 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2567 * elf64-alpha.c (READ): Likewise.
2568 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2569 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2570 * elfcode.h (elf_slurp_symbol_table),
2571 (elf_slurp_reloc_table_from_section): Likewise.
2572 * elflink.c (elf_link_add_object_symbols),
2573 (elf_link_check_versioned_symbol): Likewise.
2574 * elfxx-mips.c (READ): Likewise.
2575 * i386lynx.c (slurp_reloc_table): Likewise.
2576 * lynx-core.c (lynx_core_file_p): Likewise.
2577 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2578 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2579 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2580 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2581 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2582 (bfd_pef_parse_symbols): Likewise.
2583 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2584 * som.c (setup_sections, som_slurp_string_table),
2585 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2586 (som_bfd_fill_in_ar_symbols): Likewise.
2587 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2588 (evax_bfd_print_image): Likewise.
2589 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2590 * wasm-module.c (wasm_scan): Likewise.
2591 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2592 * xsym.c (bfd_sym_read_name_table),
2593 (bfd_sym_print_type_information_table_entry): Likewise.
2594 * libbfd.h: Regenerate.
2596 2020-02-19 Alan Modra <amodra@gmail.com>
2598 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2599 reading external relocs.
2600 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2601 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2603 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2605 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2606 (m32c_elf_relax_section): Likewise.
2607 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2608 (rl78_elf_relax_section): Likewise.
2609 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2610 (elf32_rx_relax_section): Likewise.
2611 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2612 parameter types and use..
2613 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2614 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2615 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2616 being read from file, just the extra.
2617 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2618 after reading external syms. Free on failure.
2620 2020-02-19 Alan Modra <amodra@gmail.com>
2622 * coffcode.h (buy_and_read, coff_slurp_line_table),
2623 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2624 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2625 corresponding bfd_alloc call. Adjust variables to suit.
2626 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2627 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2628 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2629 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2630 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2631 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2632 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2633 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2634 * elf64-alpha.c (READ): Likewise.
2635 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2636 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2637 (bfd_from_remote_memory): Likewise.
2638 * elfcore.h (core_find_build_id): Likewise.
2639 * elfxx-mips.c (READ): Likewise.
2640 * mach-o.c (bfd_mach_o_mangle_sections),
2641 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2642 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2643 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2644 * som.c (setup_sections, som_prep_for_fixups)
2645 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2646 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2647 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2648 (som_bfd_ar_write_symbol_stuff): Likewise.
2649 * vms-alpha.c (vector_grow1): Likewise.
2650 * vms-lib.c (vms_add_index): Likewise.
2651 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2652 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2653 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2654 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2655 (bfd_alloc2, bfd_zalloc2): Delete.
2656 (_bfd_mul_overflow): Define.
2657 * libbfd.h: Regenerate.
2659 2020-02-19 Alan Modra <amodra@gmail.com>
2661 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2663 (assign_section_numbers): Likewise.
2664 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2665 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2666 bfd_malloc2, size_t amt, and unsigned tls_count.
2667 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2668 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2669 (elf_output_implib): Use bfd_alloc.
2671 2020-02-19 Alan Modra <amodra@gmail.com>
2673 * bfd.c (struct bfd): Move format and direction to other
2674 bitfields. Add "size".
2675 * bfdio.c (bfd_get_size): Cache size when not writing file.
2676 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2677 returning zero, ie. unknown.
2678 (bfd_get_alt_debug_link_info): Likewise.
2679 * bfd-in2.h: Regenerate.
2681 2020-02-19 Alan Modra <amodra@gmail.com>
2683 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2684 bfd_get_file_size twice.
2685 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2686 zero, ie. unknown, return.
2687 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2688 * elfcode.h (elf_swap_shdr_in): Likewise.
2689 (elf_object_p): Don't call bfd_get_file_size twice and correct
2692 2020-02-19 Alan Modra <amodra@gmail.com>
2694 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2695 FALSE if memory alloc fails. Adjust calls.
2696 * som.c (som_prep_for_fixups): Likewise.
2697 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2698 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2699 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2700 * som.c (som_build_and_write_symbol_table): Return via error_return
2702 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2703 (VEC_APPEND_EL): Delete.
2704 (vector_grow1): Return pointer to element. Catch overflow.
2705 Return NULL on memory allocation failure.
2706 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2707 (alpha_vms_add_fixup_ca): Likewise.
2708 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2710 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2712 2020-02-19 Alan Modra <amodra@gmail.com>
2714 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2715 * aout-target.h (object_p): Likewise.
2716 * aout-tic30.c (tic30_aout_object_p): Likewise.
2717 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2718 (emit_stringtab, write_syms, link_hash_table_create),
2719 (aout_link_write_other_symbol): Likewise.
2720 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2721 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2722 (_bfd_compute_and_write_armap): Likewise.
2723 * archures.c (bfd_arch_list): Likewise.
2724 * bfd.c (bfd_record_phdr): Likewise.
2725 * binary.c (binary_canonicalize_symtab): Likewise.
2726 * cisco-core.c (cisco_core_file_validate): Likewise.
2727 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2728 (find_arm_glue, record_arm_to_thumb_glue),
2729 (record_thumb_to_arm_glue): Likewise.
2730 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2731 (ppc_allocate_toc_section): Likewise.
2732 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2733 * coff-sh.c (sh_relax_section): Likewise.
2734 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2735 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2736 (coff_set_alignment_hook, coff_mkobject),
2737 (coff_compute_section_file_positions): Likewise.
2738 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2739 (coff_find_nearest_line_with_names),
2740 ( bfd_coff_set_symbol_class): Likewise.
2741 * cofflink.c (_bfd_coff_link_hash_table_create),
2742 (_bfd_coff_link_input_bfd): Likewise.
2743 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2744 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2745 (build_line_info_table, sort_line_sequences),
2746 (line_info_add_include_dir, line_info_add_file_name),
2747 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2748 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2749 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2750 (_bfd_ecoff_find_nearest_line),
2751 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2752 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2753 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2754 * elf-m10300.c (mn10300_elf_relax_section),
2755 (elf32_mn10300_link_hash_table_create): Likewise.
2756 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2757 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2758 * elf32-arm.c (elf32_arm_link_hash_table_create),
2759 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2760 (elf32_arm_new_section_hook): Likewise.
2761 * elf32-avr.c (elf_avr_new_section_hook),
2762 (elf32_avr_link_hash_table_create, get_local_syms),
2763 (elf32_avr_setup_section_lists): Likewise.
2764 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2765 (bfin_link_hash_table_create): Likewise.
2766 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2767 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2768 * elf32-csky.c (csky_elf_link_hash_table_create),
2769 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2770 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2771 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2772 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2773 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2774 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2775 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2776 (m32r_elf_check_relocs): Likewise.
2777 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2778 (elf32_m68hc11_setup_section_lists),
2779 (elf32_m68hc11_size_stubs): Likewise.
2780 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2781 * elf32-metag.c (elf_metag_link_hash_table_create),
2782 (elf_metag_setup_section_lists): Likewise.
2783 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2784 (microblaze_elf_check_relocs): Likewise.
2785 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2786 (nds32_elf_check_relocs): Likewise.
2787 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2788 (get_local_syms, nios2_elf32_check_relocs),
2789 (nios2_elf32_link_hash_table_create): Likewise.
2790 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2791 (or1k_elf_check_relocs): Likewise.
2792 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2793 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2794 * elf32-s390.c (elf_s390_link_hash_table_create),
2795 (elf_s390_check_relocs): Likewise.
2796 * elf32-score.c (score_elf_create_got_section),
2797 (s3_elf32_score_new_section_hook),
2798 (elf32_score_link_hash_table_create): Likewise.
2799 * elf32-score7.c (score_elf_create_got_section),
2800 (s7_elf32_score_new_section_hook): Likewise.
2801 * elf32-sh.c (sh_elf_link_hash_table_create),
2802 (sh_elf_check_relocs): Likewise.
2803 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2804 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2805 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2806 (tilepro_elf_check_relocs): Likewise.
2807 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2808 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2809 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2810 (elf_xtensa_new_section_hook): Likewise.
2811 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2812 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2813 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2814 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2815 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2816 * elf64-ppc.c (ppc64_elf_new_section_hook),
2817 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2818 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2819 * elf64-s390.c (elf_s390_link_hash_table_create),
2820 (elf_s390_check_relocs): Likewise.
2821 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2822 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2823 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2824 (elf_link_add_archive_symbols, compute_bucket_count),
2825 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2826 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2827 (bfd_elf_final_link): Likewise.
2828 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2829 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2830 (elfNN_aarch64_new_section_hook): Likewise.
2831 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2832 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2833 (riscv_elf_check_relocs): Likewise.
2834 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2835 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2836 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2837 (_bfd_mips_elf_link_hash_table_create): Likewise.
2838 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2839 (_bfd_sparc_elf_check_relocs),
2840 (_bfd_sparc_elf_new_section_hook): Likewise.
2841 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2842 (tilegx_elf_check_relocs): Likewise.
2843 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2844 * format.c (bfd_check_format_matches): Likewise.
2845 * hash.c (_bfd_stringtab_init): Likewise.
2846 * ihex.c (ihex_scan): Likewise.
2847 * irix-core.c (irix_core_core_file_p): Likewise.
2848 * linker.c (bfd_wrapped_link_hash_lookup),
2849 (_bfd_generic_link_hash_table_create),
2850 (_bfd_generic_reloc_link_order): Likewise.
2851 * lynx-core.c (lynx_core_file_p): Likewise.
2852 * netbsd-core.c (netbsd_core_file_p): Likewise.
2853 * osf-core.c (osf_core_core_file_p): Likewise.
2854 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2855 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2856 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2857 * peicode.h (pe_mkobject): Likewise.
2858 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2859 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2860 * sco5-core.c (read_uarea): Likewise.
2861 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2862 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2863 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2864 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2865 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2866 * srec.c (srec_scan): Likewise.
2867 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2868 * targets.c (bfd_target_list): Likewise.
2869 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2870 * trad-core.c (trad_unix_core_file_p): Likewise.
2871 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2872 (vms_new_section_hook): Likewise.
2873 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2874 * xcofflink.c (xcoff_get_section_contents),
2875 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2876 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2877 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2879 2020-02-19 Alan Modra <amodra@gmail.com>
2881 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2883 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2885 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2886 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2887 a build_list_p argument. Don't search plugin_list. Short circuit
2888 when building the plugin list.
2889 (has_plugin): Renamed to has_plugin_list.
2890 (bfd_plugin_set_plugin): Don't set has_plugin.
2891 (bfd_plugin_specified_p): Check plugin_list instead.
2892 (build_plugin_list): New function.
2893 (load_plugin): Call build_plugin_list and use plugin_list.
2895 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2898 * plugin.c (try_claim): Always clean up for LTO wrapper.
2899 (try_load_plugin): Treat each object as independent. Create a
2900 copy for plugin name.
2902 2020-02-11 Nick Clifton <nickc@redhat.com>
2904 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2905 for addresses in print statements.
2906 (msp430_elf_relax_delete_bytes): Likewise.
2907 (msp430_elf_relax_add_words): Likewise.
2908 (msp430_elf_relax_section): Likewise.
2910 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2912 * plugin.c (add_symbols): Clear plugin_data memory.
2914 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2917 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2918 (EXECUTABLE_SUFFIX): Likewise.
2919 * config.in: Regenerated.
2920 * configure: Likewise.
2921 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2922 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2923 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2924 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2925 (get_lto_wrapper): New.
2926 (setup_lto_wrapper_env): Likewise.
2927 (current_plugin): Likewise.
2928 (register_all_symbols_read): Likewise.
2929 (register_cleanup): Likewise.
2930 (get_symbols): Likewise.
2931 (add_input_file): Likewise.
2932 (bfd_plugin_close_and_cleanup): Likewise.
2933 (claim_file): Removed.
2934 (register_claim_file): Set current_plugin->claim_file.
2935 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2936 lto_syms in current_plugin.
2937 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2938 all_symbols_read handler. Copy real symbols to plugin_data.
2939 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2940 (try_load_plugin): Don't reuse the previous plugin for LTO
2941 wrapper. Set up GCC LTO wrapper if possible. Don't set
2942 plugin_list_iter->claim_file.
2943 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2945 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2948 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2950 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2951 check if previous instruction matches a conditional jump inserted
2952 earlier. Invert conditional jump and delete branch in this case.
2954 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2956 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2957 msp430_elf_relax_add_words. Support insertion of either one or two
2959 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2960 needs to be grown. Handle insertion of branch instruction to replace
2963 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2965 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2966 debugging relocations.
2967 (msp430_elf_relax_delete_bytes): Likewise.
2968 (msp430_elf_relax_add_two_words): Likewise.
2969 (msp430_elf_relax_section): Likewise.
2971 2020-02-10 Alan Modra <amodra@gmail.com>
2973 * archures.c: Wrap overlong z80 comments.
2974 * bfd-in2.h: Regenerate.
2976 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2979 * archures.c: Add GBZ80 and Z80N machine values.
2980 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2981 * coff-z80.c: Add support for new reloc.
2982 * coffcode.h: Add support for new machine values.
2983 * cpu-z80.c: Add support for new machine names.
2984 * elf32-z80.c: Add support for new reloc.
2985 * bfd-in2.h: Regenerate.
2986 * libbfd.h: Regenerate.
2988 2020-02-07 Nick Clifton <nickc@redhat.com>
2991 * elf.c (rewrite_elf_program_header): Do not complain if no
2992 sections are mapped to a segment.
2994 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2997 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2998 for garbage collection on __patchable_function_entries section
2999 without linked-to section.
3001 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3004 * bfd-in2.h: Regenerated.
3005 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
3006 on section if gc_mark of any of its linked-to sections is set
3007 and don't set gc_mark again.
3008 * section.c (asection): Add linked_to_symbol_name to map_head
3011 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
3013 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
3014 reporting an unrecognized instruction with R_V850_LONGJUMP.
3016 2020-02-05 Alan Modra <amodra@gmail.com>
3018 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
3020 2020-02-04 Alan Modra <amodra@gmail.com>
3022 * elf32-ppc.c (ppc_elf_relocate_section): After applying
3023 R_PPC_VLE_ADDR20, goto copy_reloc.
3025 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3027 * bfd-in2.h: Regenerated.
3028 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
3030 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3033 * bfd-in2.h: Regenerated.
3034 * ecoff.c (bfd_debug_section): Add section_id.
3035 * section.c (bfd_section): Add section_id.
3036 (SEC_ASSEMBLER_SECTION_ID): New.
3037 (BFD_FAKE_SECTION): Add section_id.
3039 2020-02-01 Nick Clifton <nickc@redhat.com>
3041 * config.bfd: Move the c30-aout and tic30-aout targets onto the
3044 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
3046 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
3047 encodings are relative to the GOT on nios2, too.
3049 2020-01-31 Alan Modra <amodra@gmail.com>
3051 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
3052 file. Use $< and $@ in rules.
3053 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
3054 (elf32-ia64.c, elf64-ia64.c): Likewise.
3055 (elf32-riscv.c, elf64-riscv.c): Likewise.
3056 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3057 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
3058 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
3059 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
3060 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3061 * Makefile.in: Regenerate.
3063 2020-01-31 Alan Modra <amodra@gmail.com>
3066 * elf.c (setup_group): Don't clear entire section contents,
3067 just the padding after group flags. Release alloc'd memory
3068 after a seek or read failure.
3070 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3072 * peXXigen.c (pe_is_repro): New function.
3073 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
3074 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
3076 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3078 * peXXigen.c (debug_type_names): Add names for new debug data type
3081 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3083 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3084 inner loop. Fix a memory leak.
3086 2020-01-30 Alan Modra <amodra@gmail.com>
3088 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3089 or obj_coff_keep_strings here.
3090 (coff_get_normalized_symtab): Free external syms directly.
3091 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3094 2020-01-27 Jim Wilson <jimw@sifive.com>
3096 * cpu-riscv.c (riscv_scan): New.
3097 (N): Change bfd_default_scan to riscv_scan.
3099 2020-01-27 Andreas Schwab <schwab@suse.de>
3101 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3102 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3103 * Makefile.in: Regenerate.
3104 * cpu-plugin.c: Remove.
3105 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3106 (bfd_plugin_arch): Remove declaration.
3107 * bfd-in2.h: Regenerate.
3108 * po/SRC-POTFILES.in: Regenerate.
3110 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
3111 Alan Modra <amodra@gmail.com>
3114 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3116 2020-01-24 Jim Wilson <jimw@sifive.com>
3118 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3119 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3120 avoid over long line.
3122 2020-01-24 Nick Clifton <nickc@redhat.com>
3125 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3126 syms and keep strings flags as these may have been set in order to
3127 prevent a bogus call to free.
3129 2020-01-23 Nick Clifton <nickc@redhat.com>
3131 * po/fr.po: Updated French translation.
3133 2020-01-23 Alan Modra <amodra@gmail.com>
3136 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3137 by zero when p_align is zero.
3139 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3141 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3142 (riscv_prefix_cmp): Likewise.
3143 (riscv_non_std_ext_p): Deleted.
3144 (riscv_std_sv_ext_p): Likewise.
3145 (riscv_non_std_sv_ext_p): Likewise.
3146 (riscv_merge_non_std_and_sv_ext): Rename to...
3147 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3148 (riscv_merge_arch_attr_info): Replace 3 calls to
3149 riscv_merge_non_std_and_sv_ext with single call to
3150 riscv_merge_multi_letter_ext.
3151 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3152 encounter a 'z' prefix.
3153 (riscv_get_prefix_class): New function, return prefix class based
3154 on first few characters of input string.
3155 (riscv_parse_config): New structure to factor out minor differences
3156 in extension class parsing behaviour.
3157 (riscv_parse_sv_or_non_std_ext): Rename to...
3158 (riscv_parse_prefixed_ext): and parameterise with
3160 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3161 (riscv_multi_letter_ext_valid_p): New.
3162 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3163 (riscv_parse_subset): Delegate all non-single-letter parsing work
3164 to riscv_parse_prefixed_ext.
3165 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3166 (riscv_get_prefix_class): Declare.
3168 2020-01-22 Alan Modra <amodra@gmail.com>
3170 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3171 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3172 __tls_get_addr_desc.
3173 (ppc64_elf_size_stubs): Add section for linker generated
3174 __tls_get_addr_desc wrapper function. Loop at least once if
3175 generating this function.
3176 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3177 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3179 2020-01-22 Alan Modra <amodra@gmail.com>
3181 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3182 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3184 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3185 (STDU_R1_0R1, ADDI_R1_R1): Define.
3186 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3187 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3188 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3189 no_tls_get_addr_regsave.
3190 (branch_reloc_hash_match): Add hash3 and hash4.
3191 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3192 (ppc64_elf_size_dynamic_sections): Likewise.
3193 (ppc64_elf_relocate_section): Likewise.
3194 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3195 __tls_get_addr stub.
3196 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3198 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3199 eh_frame for regsave __tls_get_addr.
3201 2020-01-22 Alan Modra <amodra@gmail.com>
3203 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3204 which __tls_get_addr calls will be eliminated.
3206 2020-01-20 Nick Clifton <nickc@redhat.com>
3208 * po/pt.po: Updates Portuguese translation.
3209 * po/ru.po: Updated Russian translation.
3210 * po/uk.po: Updated Ukranian translation.
3212 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3215 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3216 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3218 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3219 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3220 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3221 "rex leal x@tlsdesc(%rip), %reg" to
3222 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3223 "call *(%eax)" to "nopl (%rax)".
3225 2020-01-20 Alan Modra <amodra@gmail.com>
3227 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3228 (MTLR_R11): Don't define.
3229 (LD_R0_0R3, CMPDI_R0_0): Define.
3230 (build_tls_get_addr_stub): Don't use r11 in stub.
3232 2020-01-20 Alan Modra <amodra@gmail.com>
3234 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3235 (defined_sym_val, is_tls_get_addr): Likewise.
3237 2020-01-18 Nick Clifton <nickc@redhat.com>
3239 * version.m4 (BFD_VERSION): Set to 2.34.50.
3240 * configure: Regenerate.
3241 * po/bfd.pot: Regenerate.
3243 2020-01-18 Nick Clifton <nickc@redhat.com>
3245 Binutils 2.34 branch created.
3247 2020-01-17 Christian Biesinger <cbiesinger@google.com>
3249 * coff-arm.c: Fix spelling error (seperate).
3250 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3252 * sysdep.h (strnlen): Fix spelling error (seperate).
3254 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
3257 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3259 2020-01-15 Alan Modra <amodra@gmail.com>
3262 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3263 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3264 of function symbols unless dot symbols are present. Do warn
3265 whenever one is created, regardles of whether a PLT entry is
3266 also emitted for the function symbol.
3268 2020-01-14 Alan Modra <amodra@gmail.com>
3270 * som.c (som_bfd_count_ar_symbols): Error when file position
3271 of symbols on chains is not strictly increasing.
3273 2020-01-14 Alan Modra <amodra@gmail.com>
3275 * vms.h (VMS_DEBUG): Define as 0.
3276 * vms-alpha.c (image_write): Move debug output after bounds check.
3278 (_bfd_vms_slurp_eihd): Warning fix.
3279 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
3281 2020-01-13 Alan Modra <amodra@gmail.com>
3283 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
3284 for "ignored" records.
3286 2020-01-13 Alan Modra <amodra@gmail.com>
3288 * wasm-module.c (wasm_scan_name_function_section): Formatting.
3289 Delete asect name check. Move asect NULL check to wasm_object_p.
3290 Correct bounds check of sizes against end. Replace uses of
3291 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
3292 just one bfd_release.
3293 (wasm_scan): Don't use malloc/strdup for section names,
3294 bfd_alloc instead. Simplify code prefixing section name.
3295 Formatting. Don't attempt to free memory here..
3296 (wasm_object_p): ..do so here.
3298 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
3301 * elf32-arm.c (elf32_arm_final_link_relocate): Use
3302 UNDEFWEAK_NO_DYNAMIC_RELOC.
3303 (allocate_dynrelocs_for_symbol): Likewise.
3305 2020-01-10 Tamar Christina <tamar.christina@arm.com>
3308 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3310 2020-01-10 Alan Modra <amodra@gmail.com>
3312 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3314 2020-01-09 Nick Clifton <nickc@redhat.com>
3317 * bfd.c (bfd_convert_section_contents): Check for a compress
3318 header size that is larger than the actual section size.
3320 2020-01-08 Alan Modra <amodra@gmail.com>
3323 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3324 after removing sections.
3326 2020-01-06 Jim Wilson <jimw@sifive.com>
3329 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3330 check for !bfd_link_pic (info).
3331 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3332 <R_RISCV_JAL>: Add comment.
3333 (_bfd_riscv_relax_section): For plt.offset check, add check for
3334 bfd_link_pic (info). Add comment.
3336 2020-01-06 Alan Modra <amodra@gmail.com>
3338 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3339 match failures. Don't init to bfd_error_wrong_format before
3340 calling _bfd_check_format.
3342 2020-01-06 Alan Modra <amodra@gmail.com>
3344 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3345 status rather than exiting on stack overflow or underflow.
3346 (_bfd_vms_slurp_etir): Adjust to suit.
3348 2020-01-06 Alan Modra <amodra@gmail.com>
3350 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3352 2020-01-06 Alan Modra <amodra@gmail.com>
3354 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3355 command. Check name offset is within command.
3356 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3357 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3358 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3359 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3360 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3361 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3362 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3363 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3364 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3365 (bfd_mach_o_read_segment): Similarly.
3366 (bfd_mach_o_read_thread): Properly bound check thread struct.
3367 Don't repeat checks on second loop.
3368 (bfd_mach_o_read_command): Fail on invalid command length.
3370 2020-01-04 Alan Modra <amodra@gmail.com>
3372 * format.c (bfd_check_format_matches): Add preserve_match.
3373 Save initial bfd state in "preserve", matched bfd state in
3374 "preserve_match". Save just the first match. Release
3375 bfd_alloc memory. Restore and finish preserved state as
3376 appropriate on all function exit paths.
3378 2020-01-04 Alan Modra <amodra@gmail.com>
3380 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3382 2020-01-04 Alan Modra <amodra@gmail.com>
3384 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3387 2020-01-03 Nick Clifton <nickc@redhat.com>
3390 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3391 there is enough data remaining in the code buffer before
3392 attempting to read a function stub.
3394 2020-01-03 Nick Clifton <nickc@redhat.com>
3397 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3398 return value from bfd_malloc.
3399 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3400 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3401 (elf32_arm_filter_cmse_symbols): Likewise.
3402 (elf32_arm_write_section): Likewise.
3403 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3404 (bfd_mach_o_follow_dsym): Likewise.
3405 * pef.c (bfd_pef_print_loader_section): Likewise.
3406 (bfd_pef_scan_start_address): Likewise.
3407 (bfd_pef_parse_function_stubs): Likewise.
3408 (bfd_pef_parse_symbols): Likewise.
3410 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3412 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3413 on binary inputs ld/PR25316.
3414 (is_ia64_elf): new helper to filter on ia64 objects.
3416 2020-01-03 Jan Beulich <jbeulich@suse.com>
3418 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3420 (bfd_mach_o_scan): Insert underscore in two variable names.
3422 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3424 * Makefile.am: Add z80-elf target support.
3425 * configure.ac: Likewise.
3426 * targets.c: Likewise.
3427 * Makefile.in: Regenerate.
3428 * configure: Regenerate.
3429 * config.bfd: Add z80-elf target support and new arches: ez80 and
3431 * elf32-z80.c: New file.
3432 * archures.c: Add new z80 architectures: eZ80 and Z180.
3433 * coffcode.h: Likewise.
3434 * cpu-z80.c: Likewise.
3435 * coff-z80.c: Add new relocations for Z80 target and local label
3437 * reloc.c: Add new relocs.
3438 * bfd-in2.h: Regenerate.
3439 * libbfd.h: Regenerate.
3441 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3445 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3447 2020-01-01 Alan Modra <amodra@gmail.com>
3449 Update year range in copyright notice of all files.
3451 For older changes see ChangeLog-2019
3453 Copyright (C) 2020 Free Software Foundation, Inc.
3455 Copying and distribution of this file, with or without modification,
3456 are permitted in any medium without royalty provided the copyright
3457 notice and this notice are preserved.
3463 version-control: never