1 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
3 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
4 (elfcore_grok_win32pstatus): Use.
6 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
8 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
9 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
10 offsets used to read NOTE_INFO_PROCESS.
12 2020-08-12 Nick Clifton <nickc@redhat.com>
14 * po/ru.po: Updated Russian translation.
15 * po/sr.po: Updated Serbian translation.
17 2020-08-07 David Faust <david.faust@oracle.com>
19 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
20 DISP16 and DISP32 relocations.
22 2020-08-05 David Faust <david.faust@oracle.com>
24 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
25 (bpf_elf_howto_table): Use it here.
26 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
27 instruction and data relocations.
29 2020-08-03 Alan Modra <amodra@gmail.com>
31 * vms-lib.c (vms_traverse_index): Sanity check size remaining
32 before accessing vms_idx or vms_elfidx.
34 2020-08-03 Alan Modra <amodra@gmail.com>
37 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
38 size against file size. Correct LONG_MAX limit check.
39 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
40 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
41 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
42 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
43 bfd_malloc_and_get_section.
45 2020-07-31 Alan Modra <amodra@gmail.com>
48 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
49 IR symbols to become dynamic.
50 (elf_link_add_object_symbols): Don't exclude IR symbols when
51 deciding whether an as-needed shared library is needed.
53 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
56 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
58 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
60 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
62 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
63 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
64 Don't define _STRUCTURED_PROC.
65 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
66 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
67 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
68 * configure, config.in: Regenerate.
69 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
70 * Makefile.in, doc/Makefile.in: Regenerate.
72 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
74 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
75 (elf_link_hash_table): Add sym_cache.
76 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
77 (elf32_arm_check_relocs): Updated.
78 (elf32_arm_size_dynamic_sections): Likewise.
79 * elf32-bfin.c (bfin_link_hash_table): Removed.
80 (bfin_link_hash_newfunc): Updated.
81 (bfin_hash_table): Removed.
82 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
83 (csky_elf_check_relocs): Updated.
84 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
85 (elf32_hppa_check_relocs): Updated.
86 * elf32-i386.c (elf_i386_tls_transition): Updated.
87 (elf_i386_convert_load_reloc): Likewise.
88 (elf_i386_check_relocs): Likewise.
89 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
90 (m32r_elf_hash_table): Updated.
91 (m32r_elf_link_hash_table_create): Likewise.
92 (m32r_elf_create_dynamic_sections): Likewise.
93 (m32r_elf_adjust_dynamic_symbol): Likewise.
94 (allocate_dynrelocs): Likewise.
95 (m32r_elf_size_dynamic_sections): Likewise.
96 (m32r_elf_relocate_section): Likewise.
97 (m32r_elf_finish_dynamic_symbol): Likewise.
98 (m32r_elf_check_relocs): Likewise.
99 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
101 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
102 (elf_m68k_check_relocs): Updated.
103 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
104 (elf_metag_check_relocs): Updated.
105 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
106 (microblaze_elf_check_relocs): Updated.
107 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
108 (nds32_elf_create_dynamic_sections): Likewise.
109 (nds32_elf_adjust_dynamic_symbol): Likewise.
110 (nds32_elf_check_relocs): Likewise.
111 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
112 srelbss and aym_cache.
113 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
114 (nios2_elf32_check_relocs): Updated.
115 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
116 (or1k_elf_check_relocs): Updated.
117 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
118 (ppc_elf_check_relocs): Updated.
119 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
120 (elf_s390_check_relocs): Updated.
121 (elf_s390_finish_dynamic_sections): Likewise.
122 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
124 (sh_elf_create_dynamic_sections): Updated.
125 (sh_elf_adjust_dynamic_symbol): Likewise.
126 (sh_elf_size_dynamic_sections): Likewise.
127 (sh_elf_check_relocs): Likewise.
128 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
129 (elf32_tic6x_check_relocs): Updated.
130 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
131 (tilepro_elf_hash_table): Updated.
132 (tilepro_elf_link_hash_table_create): Likewise.
133 (tilepro_elf_check_relocs): Likewise.
134 (tilepro_elf_adjust_dynamic_symbol): Likewise.
135 (allocate_dynrelocs): Likewise.
136 (tilepro_elf_size_dynamic_sections): Likewise.
137 (tilepro_elf_relocate_section): Likewise.
138 (tilepro_elf_finish_dynamic_symbol): Likewise.
139 (tilepro_finish_dyn): Likewise.
140 (tilepro_elf_finish_dynamic_sections): Likewise.
141 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
142 (ppc64_elf_before_check_relocs): Updated.
143 (ppc64_elf_check_relocs): Likewise.
144 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
145 (elf_s390_check_relocs): Updated.
146 (elf_s390_relocate_section): Likewise.
147 (elf_s390_finish_dynamic_sections): Likewise.
148 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
149 (elf_x86_64_check_relocs): Likewise.
150 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
152 (elfNN_aarch64_check_relocs): Updated.
153 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
154 (riscv_elf_check_relocs): Updated.
155 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
156 (mips_elf_resolve_got_page_ref): Updated.
157 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
158 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
160 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
161 (tilegx_elf_check_relocs): Updated.
162 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
164 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
166 * elflink.c (bfd_elf_final_link): Give local symbols a name if
168 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
169 return TRUE if making ET_REL output.
171 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
173 * elf-bfd.h (elf_backend_data): Add
174 `elf_backend_elfsym_local_is_section' member.
175 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
177 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
178 * elflink.c (bfd_elf_final_link): Use it to determine whether
179 set the `.symtab' section's `sh_info' value to the index of the
180 first non-local or non-section symbol.
181 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
183 (elf_backend_elfsym_local_is_section): New macro.
184 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
186 (elf_backend_elfsym_local_is_section): New macro.
188 2020-07-29 Alan Modra <amodra@gmail.com>
190 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
191 defined in excluded sections.
193 2020-07-28 Alan Modra <amodra@gmail.com>
195 * elf.c (assign_section_numbers): Comment. Don't segfault on
196 discarded sections when setting linked-to section for generic
198 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
200 2020-07-27 Alan Modra <amodra@gmail.com>
202 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
204 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
207 2020-07-24 Nick Clifton <nickc@redhat.com>
209 * config.bfd: Move xc16x target to the obsolete list.
211 2020-07-22 Kevin Buettner <kevinb@redhat.com>
213 * binary.c (binary_get_section_contents): Seek using offset
214 from section's file position.
216 2020-07-22 Kevin Buettner <kevinb@redhat.com>
218 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
220 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
223 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
224 type for the first function argument. Rename pointers to reflect
225 that they have distinct types.
227 2020-07-20 Alan Modra <amodra@gmail.com>
229 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
231 2020-07-19 Alan Modra <amodra@gmail.com>
233 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
234 (select_alt_stub): New function.
235 (ppc_get_stub_entry): Use it here.
236 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
238 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
239 merge notoc stubs with other varieties when power10_stubs is "auto".
240 Instead dup the stub hash table entry.
241 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
242 tests of power10_stubs.
244 2020-07-15 Alan Modra <amodra@gmail.com>
247 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
249 2020-07-15 Nick Clifton <nickc@redhat.com>
252 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
253 check for aux entries that overflow the buufer.
255 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
257 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
258 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
260 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
261 Alan Modra <amodra@gmail.com>
264 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
265 objects both before and after normal object files.
266 * elflink.c (_bfd_elf_section_already_linked): Likewise.
268 2020-07-10 Alan Modra <amodra@gmail.com>
270 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
271 * elf64-ppc.c (struct ppc_link_hash_table): Delete
273 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
274 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
275 uses of power10_stubs.
277 2020-07-09 Alan Modra <amodra@gmail.com>
279 * coff-ppc.c: Delete.
282 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
283 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
285 (coff_write_object_contents): Remove PPC_PE code.
286 * config.bfd: Move powerpcle-pe to removed targets.
287 * configure.ac: Remove powerpc PE entries.
288 * libcoff-in.h (ppc_allocate_toc_section): Delete.
289 (ppc_process_before_allocation): Delete.
290 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
291 * targets.c: Remove powerpc PE vectors.
292 * po/SRC-POTFILES.in: Regenerate.
293 * libcoff.h: Regenerate.
294 * Makefile.in: Regenerate.
295 * configure: Regenerate.
297 2020-07-09 Nick Clifton <nickc@redhat.com>
299 * po/fr.po: Updated French translation.
301 2020-07-07 Alan Modra <amodra@gmail.com>
303 * xcofflink.c (xcoff_mark): Don't mark const sections.
304 (bfd_xcoff_record_link_assignment): Add FIXME.
305 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
306 sections being discarded by linker script.
308 2020-07-07 Alan Modra <amodra@gmail.com>
310 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
311 time, uid, gid and mode for deterministic archive.
312 (xcoff_write_archive_contents_big): Likewise.
314 2020-07-07 Alan Modra <amodra@gmail.com>
316 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
319 2020-07-06 Nick Clifton <nickc@redhat.com>
321 * po/pt.po: Updated Portuguese translation.
322 * po/uk.po: Updated Ukranian translation.
324 2020-07-04 Nick Clifton <nickc@redhat.com>
326 * version.m4: Set version to 2.35.50.
327 * configure: Regenerate.
328 * po/bbfd.pot: Regenerate.
330 2020-07-04 Nick Clifton <nickc@redhat.com>
332 Binutils 2.35 branch created.
334 2020-07-01 Alan Modra <amodra@gmail.com>
337 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
338 raw syment index before dereferencing.
340 2020-07-01 Alan Modra <amodra@gmail.com>
342 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
344 2020-07-01 Alan Modra <amodra@gmail.com>
346 * config.bfd: Obsolete xc16x.
348 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
350 * archures.c (bfd_mach_i386_nacl): Removed.
351 (bfd_mach_i386_i386_nacl): Likewise.
352 (bfd_mach_x86_64_nacl): Likewise.
353 (bfd_mach_x64_32_nacl): Likewise.
354 * config.bfd: Remove *-*-nacl* targets.
355 * configure.ac: Remove x86 NaCl target vectors.
356 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
357 (bfd_x64_32_nacl_arch): Likewise.
358 (bfd_x86_64_nacl_arch): Likewise.
359 (bfd_i386_nacl_arch): Likewise.
360 (bfd_x64_32_arch_intel_syntax): Updated.
361 * elf32-i386.c: Don't include "elf-nacl.h".
362 (elf_i386_nacl_plt): Removed.
363 (elf_i386_nacl_plt0_entry): Likewise.
364 (elf_i386_nacl_plt_entry): Likewise.
365 (elf_i386_nacl_pic_plt0_entry): Likewise.
366 (elf_i386_nacl_pic_plt_entry): Likewise.
367 (elf_i386_nacl_eh_frame_plt): Likewise.
368 (elf_i386_nacl_plt): Likewise.
369 (elf32_i386_nacl_elf_object_p): Likewise.
370 (elf_i386_get_synthetic_symtab): Updated.
371 (elf_i386_link_setup_gnu_properties): Likewise.
372 * elf64-x86-64.c: Don't include "elf-nacl.h".
373 (elf_x86_64_nacl_plt): Removed.
374 (elf64_x86_64_nacl_elf_object_p): Likewise.
375 (elf_x86_64_nacl_plt0_entry): Likewise.
376 (elf_x86_64_nacl_plt_entry): Likewise.
377 (elf_x86_64_nacl_eh_frame_plt): Likewise.
378 (elf_x86_64_nacl_plt): Likewise.
379 (elf32_x86_64_nacl_elf_object_p): Likewise.
380 (elf_x86_64_get_synthetic_symtab): Updated.
381 (elf_x86_64_link_setup_gnu_properties): Likewise.
382 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
383 * targets.c: Remove x86 NaCl target vectors.
384 * bfd-in2.h: Regenerated.
385 * configure: Likewise.
387 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
389 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
390 _bfd_elf_add_dynamic_tags.
392 2020-06-29 Alan Modra <amodra@gmail.com>
394 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
395 return value of bfd_bread. Don't read more than requested length.
396 Sanity check length. Properly terminate file name.
398 2020-06-29 Alan Modra <amodra@gmail.com>
400 * arc-got.h: Use C style comments.
401 * coff-z80.c: Likewise.
402 * elf32-csky.c: Likewise.
403 * peXXigen.c: Likewise.
404 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
407 2020-06-26 Pat Bernardi <bernardi@adacore.com>
409 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
410 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
412 2020-06-26 Alan Modra <amodra@gmail.com>
414 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
415 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
416 (riscv_get_priv_spec_name): Move to..
417 * cpu-riscv.c: ..here.
418 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
419 Use %u to print unsigned numbers.
421 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
423 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
424 default architecture.
426 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
429 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
430 _bfd_elf_add_dynamic_tags.
432 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
435 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
436 _bfd_elf_add_dynamic_tags.
438 2020-06-24 Alan Modra <amodra@gmail.com>
440 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
441 shifts without undefined behaviour.
443 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
445 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
447 (_bfd_elf_add_dynamic_tags): New.
448 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
449 _bfd_elf_add_dynamic_tags.
450 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
451 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
452 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
453 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
454 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
455 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
456 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
457 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
459 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
460 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
461 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
462 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
463 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
464 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
465 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
466 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
467 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
469 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
470 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
471 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
472 _bfd_elf_maybe_vxworks_add_dynamic_tags.
473 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
474 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
476 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
477 (_bfd_x86_elf_size_dynamic_sections): Likewise.
478 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
479 dt_reloc_sz and dt_reloc_ent.
480 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
481 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
483 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
484 etab.dt_pltgot_required.
485 (elf32_hppa_size_dynamic_sections): Call
486 _bfd_elf_add_dynamic_tags.
487 * elf32-metag.c (elf_metag_link_hash_table_create): Set
488 etab.dt_pltgot_required.
489 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
490 * elf32-sh.c (sh_elf_link_hash_table_create): Set
491 root.dt_pltgot_required for FDPIC output.
492 (sh_elf_size_dynamic_sections): Call
493 _bfd_elf_maybe_vxworks_add_dynamic_tags.
494 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
495 elf.dt_pltgot_required.
496 (elf_xtensa_size_dynamic_sections): Call
497 _bfd_elf_add_dynamic_tags.
498 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
499 root.dt_pltgot_required.
500 (elf64_hppa_size_dynamic_sections): Call
501 _bfd_elf_add_dynamic_tags.
502 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
503 root.dt_pltgot_required.
504 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
505 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
506 * elflink.c (_bfd_elf_add_dynamic_tags): New.
508 2020-06-22 Saagar Jha <saagar@saagarjha.com>
510 * mach-o.c: Support the new load commands by reading a linkedit
511 data command for them.
513 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
515 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
516 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
517 (riscv_get_priv_spec_class): Likewise.
518 (riscv_get_priv_spec_name): Likewise.
519 (riscv_get_priv_spec_class_from_numbers): New function, convert
520 the version numbers into string, then call riscv_get_priv_spec_class
521 to get the priv spec class.
522 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
523 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
524 (riscv_get_priv_spec_name): Likewise.
525 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
526 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
527 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
528 of input and output objects form their priv spec attributes by
529 riscv_get_priv_spec_class_from_numbers. Report warning rather than
530 errors when linking objects with differnet priv spec versions. We do
531 know v1.9.1 may have conflicts to other versions, so report the
532 warning, too. After that, update the output priv spec version to the
535 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
537 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
538 priv attributes, we will check the conflicts for all of them (major,
539 minor and revision), and then set the priv_attrs_merged to TRUE to
540 indicate that we have handled all of the priv attributes. Remove
541 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
543 2020-06-21 Alan Modra <amodra@gmail.com>
546 * configure.ac: Disable plugins by default for some targets.
547 * plugin.c: Comment typo fix.
548 * configure: Regenerate.
550 2020-06-19 Nick Clifton <nickc@redhat.com>
552 * plugin.c (try_load_plugin): Suppress the error message about
553 being unable to open a plugin if creating a list of viable
556 2020-06-16 Alan Modra <amodra@gmail.com>
558 * aout-tic30.c: Delete file.
559 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
560 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
561 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
562 (xc16x-*-elf): Sort properly.
563 * configure.ac: Remove tic30_aout_vec.
564 * targets.c: Likewise.
565 * Makefile.in: Regenerate.
566 * configure: Regenerate.
567 * po/SRC-POTFILES.in: Regenerate.
569 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
571 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
572 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
573 (elf32xtensa_abi): New global variable.
574 (xtensa_abi_choice): New function.
575 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
576 XSHAL_ABI to select PLT code.
578 2020-06-15 Roland McGrath <mcgrathr@google.com>
580 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
581 field of bfd_link_info.
583 2020-06-15 Alan Modra <amodra@gmail.com>
585 * config.bfd: Obsolete powerpcle-*-pe targets.
587 2020-06-15 Alan Modra <amodra@gmail.com>
590 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
591 symbols that were defined in discarded sections.
592 * cofflink.c (coff_link_check_archive_element): Likewise.
593 (coff_link_add_symbols): Set indx to -3 for symbols defined in
595 (_bfd_coff_write_global_sym): Don't emit such symbols.
596 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
597 libcoff.h: Regenerate.
599 2020-06-11 Alan Modra <amodra@gmail.com>
602 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
604 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
606 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
607 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
608 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
611 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
614 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
615 Clear verinfo.verdef.
617 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
620 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
621 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
622 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
624 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
625 Set ifunc_resolvers if there are FUNC resolvers.
626 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
627 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
628 with elf.ifunc_resolvers.
629 (write_plt_relocs_for_local_syms): Likewise.
630 (ppc64_elf_relocate_section): Likewise.
631 (ppc64_elf_finish_dynamic_sections): Likewise.
632 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
634 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
635 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
636 instead of readonly_dynrelocs_against_ifunc.
637 * elfxx-x86.h (elf_x86_link_hash_table): Remove
638 readonly_dynrelocs_against_ifunc.
640 2020-06-09 Alan Modra <amodra@gmail.com>
642 * elf64-ppc.c (struct ppc_link_hash_table): Delete
643 maybe_local_ifunc_resolver field.
644 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
645 cases where maybe_local_ifunc_resolver was set.
646 (ppc64_elf_relocate_section): Likewise.
647 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
650 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
652 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
654 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
656 (elf32_arm_size_dynamic_sections): Updated. Clear
657 root.tlsdesc_plt for DF_BIND_NOW.
658 (elf32_arm_finish_dynamic_sections): Updated.
659 (elf32_arm_output_arch_local_syms): Likewise.
660 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
661 Clear root.tlsdesc_plt for DF_BIND_NOW.
662 (nds32_elf_finish_dynamic_sections): Updated.
663 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
664 dt_tlsdesc_plt and dt_tlsdesc_got.
665 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
666 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
667 tlsdesc_plt and dt_tlsdesc_got.
668 (elfNN_aarch64_allocate_dynrelocs): Updated.
669 (elfNN_aarch64_finish_dynamic_sections): Likewise.
670 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
671 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
673 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
674 (_bfd_x86_elf_size_dynamic_sections): Likewise.
675 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
676 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
679 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
681 * elf32-tic6x.c (elf32_bed): Defined the default to
684 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
686 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
688 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
689 root.splt/root.srelplt.
690 (elf64_hppa_create_dynamic_sections): Likewise.
691 (elf64_hppa_size_dynamic_sections): Likewise.
692 (elf64_hppa_finish_dynamic_symbol): Likewise.
693 (elf_hppa_final_link): Likewise.
694 (elf_hppa_final_link_relocate): Likewise.
696 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
698 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
699 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
702 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
704 * elf-bfd.h (elf_target_os): New.
705 (elf_link_hash_table): Add target_os.
706 (elf_backend_data): Add target_os.
707 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
708 symbian_p and nacl_p.
709 (create_got_section): Updated.
710 (elf32_arm_create_dynamic_sections): Likewise.
711 (arm_type_of_stub): Likewise.
712 (elf32_arm_create_or_find_stub_sec): Likewise.
713 (elf32_arm_allocate_plt_entry): Likewise.
714 (elf32_arm_populate_plt_entry): Likewise.
715 (elf32_arm_final_link_relocate): Likewise.
716 (elf32_arm_check_relocs): Likewise.
717 (allocate_dynrelocs_for_symbol): Likewise.
718 (elf32_arm_finish_dynamic_symbol): Likewise.
719 (elf32_arm_finish_dynamic_sections): Likewise.
720 (elf32_arm_output_plt_map_1): Likewise.
721 (elf32_arm_output_arch_local_syms): Likewise.
722 (elf32_arm_add_symbol_hook): Likewise.
723 (elf32_arm_nacl_link_hash_table_create): Likewise.
724 (elf32_arm_vxworks_link_hash_table_create): Likewise.
725 (elf32_arm_symbian_link_hash_table_create): Likewise.
726 (ELF_TARGET_OS): New.
727 * elf32-i386.c (elf_i386_arch_bed): Removed.
728 (elf_backend_arch_data): Likewise.
729 (elf_i386_solaris_arch_bed): Likewise.
730 (elf_i386_nacl_arch_bed): Likewise.
731 (elf_i386_vxworks_arch_bed): Likewise.
732 (elf_i386_relocate_section): Updated.
733 (elf_i386_finish_dynamic_sections): Likewise.
734 (elf_i386_get_synthetic_symtab): Likewise.
735 (elf_i386_link_setup_gnu_properties): Likewise.
736 (ELF_TARGET_OS): New.
737 * elf32-mips.c (ELF_TARGET_OS): New.
738 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
739 (ppc_elf_create_got): Updated.
740 (ppc_elf_create_dynamic_sections): Likewise.
741 (ppc_elf_check_relocs): Likewise.
742 (ppc_elf_adjust_dynamic_symbol): Likewise.
743 (ppc_elf_size_dynamic_sections): Likewise.
744 (ppc_elf_relocate_section): Likewise.
745 (ppc_elf_finish_dynamic_sections): Likewise.
746 (ppc_elf_vxworks_link_hash_table_create): Likewise.
747 (ELF_TARGET_OS): New.
748 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
749 (sh_elf_link_hash_table_create): Updated.
750 (sh_elf_create_dynamic_sections): Likewise.
751 (allocate_dynrelocs): Likewise.
752 (sh_elf_size_dynamic_sections): Likewise.
753 (sh_elf_relocate_section): Likewise.
754 (sh_elf_finish_dynamic_symbol): Likewise.
755 (sh_elf_finish_dynamic_sections): Likewise.
756 (ELF_TARGET_OS): New.
757 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
759 (bfd_elf32_bfd_link_hash_table_create): Likewise.
760 (ELF_TARGET_OS): New.
761 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
762 (elf_x86_64_solaris_arch_bed): Likewise.
763 (elf_x86_64_nacl_arch_bed): Likewise.
764 (elf_x86_64_finish_dynamic_sections): Updated.
765 (elf_x86_64_get_synthetic_symtab): Likewise.
766 (elf_x86_64_link_setup_gnu_properties): Likewise.
767 (ELF_TARGET_OS): New.
768 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
770 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
771 (MIPS_ELF_REL_DYN_NAME): Updated.
772 (ELF_MIPS_GP_OFFSET): Likewise.
773 (mips_elf_create_local_got_entry): Likewise.
774 (mips_elf_allocate_dynamic_relocations): Likewise.
775 (mips_elf_count_got_symbols): Likewise.
776 (is_gott_symbol): Likewise.
777 (mips_elf_calculate_relocation): Likewise.
778 (mips_elf_create_dynamic_relocation): Likewise.
779 (_bfd_mips_elf_check_relocs): Likewise.
780 (allocate_dynrelocs): Likewise.
781 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
782 (mips_elf_lay_out_got): Likewise.
783 (mips_elf_set_plt_sym_value): Likewise.
784 (_bfd_mips_elf_size_dynamic_sections): Likewise.
785 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
786 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
787 (_bfd_mips_elf_final_link): Likewise.
788 (_bfd_mips_init_file_header): Likewise.
789 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
791 (allocate_dynrelocs): Likewise.
792 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
793 (_bfd_sparc_elf_relocate_section): Likewise.
794 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
795 (sparc_finish_dyn): Likewise.
796 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
797 * elfxx-target.h (ELF_TARGET_OS): New.
798 (elfNN_bed): Add ELF_TARGET_OS.
799 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
800 (_bfd_x86_elf_link_hash_table_create): Likewise.
801 (_bfd_x86_elf_size_dynamic_sections): Likewise.
802 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
803 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
804 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
805 * elfxx-x86.h (elf_x86_target_os): Removed.
806 (elf_x86_backend_data): Likewise.
807 (get_elf_x86_backend_data): Likewise.
808 (elf_x86_link_hash_table): Remove target_os.
810 2020-06-06 Alan Modra <amodra@gmail.com>
813 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
814 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
815 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
816 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
817 * elf64-ppc.c: Update throughout for reloc renaming.
818 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
819 * libbfd.h: Regenerate.
820 * bfd-in2.h: Regenerate.
822 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
825 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
828 2020-06-05 Nick Clifton <nickc@redhat.com>
830 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
833 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
835 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
836 priv_may_conflict, in_priv_zero and out_priv_zero to decide
837 whether the object can be linked according to it's priv
838 attributes. The object without any priv spec attributes can
839 be linked with others. If the first input object doesn't contain
840 any priv attributes, then we need to copy the setting from the
841 next input one. Also report more detailed error messages to user.
843 2020-06-04 Stephen Casner <casner@acm.org>
845 Extend pdp11-aout symbol table format to accommodate .stab
846 symbols and implement correct handling of them.
848 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
849 (N_STAB, is_stab): Needed new function is_stab to disambiguate
850 normal vs. .stab symbol table type values, replacing N_STAB mask.
851 (translate_from_native_sym_flags): Determine correct section for
852 different .stab types.
853 (translate_to_native_sym_flags): Leave .stab types intact.
854 (translate_symbol_table): Error if symbol indicates overlay;
855 store desc field from .stab symbols.
856 (write_syms): Output desc field with symbol.
857 (aout_link_check_ar_symbols): Skip .stab symbols.
858 (aout_link_add_symbols): Correctly distinguish .stab symbols.
859 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
860 (aout_link_write_symbols): Write 0 for desk and ovly fields;
861 correctly distinguish .stab symbols and select calculate their
862 section and value; and copy desc and ovly fields from input symbol
865 2020-06-04 Stephen Casner <casner@acm.org>
867 * aoutx.h (translate_symbol_table): Comment had external and
869 * pdp11.c (translate_symbol_table): Likewise.
871 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
873 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
874 (is_x86_elf): Check elf.hash_table_id instead of target_id.
875 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
877 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
880 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
881 in debug section against symbol defined in shared library to 0.
882 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
883 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
884 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
885 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
886 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
887 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
888 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
889 * elf32-sh.c (sh_elf_check_relocs): Likewise.
890 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
891 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
892 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
893 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
894 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
895 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
897 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
898 there is non-GOT reference.
899 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
900 non-alloced sections.
902 2020-06-03 Stephen Casner <casner@acm.org>
904 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
906 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
908 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
909 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
910 other size that doesn't qcover the header word.
911 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
912 string table, and zero it.
913 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
914 message and set bfd_error on finding an invalid name string offset.
915 (add_to_stringtab): INLINE -> inline
916 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
918 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
919 any relocs that could not be recognised.
920 92744f05809 PR 20929 - Check for relocs without an associated symbol.
921 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
922 name exists and is long enough, before attempting to see if it is
924 c3864421222 - Correct case for N_SO being the last symbol.
925 50455f1ab29 PR 20891 - Handle the case where the main file name
926 and the directory name are both empty.
927 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
928 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
929 range string table offsets.
930 531336e3a0b PR 20909 - Fix off-by-one error in check for an
931 illegal string offset.
932 (aout_link_includes_newfunc): Add comment.
933 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
934 on unexpected relocation type rather than ASSERT.
936 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
939 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
940 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
942 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
945 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
946 non-alloced sections.
948 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
950 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
951 dynamic relocations for non SEC_ALLOC sections.
953 2020-06-03 Gunther Nikl <gnikl@justmail.de>
955 * aout64.c (BMAGIC, QMAGIC): Do not define.
956 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
957 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
958 to check the file format.
959 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
960 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
961 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
963 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
965 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
966 relocations for non SEC_ALLOC sections.
968 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
970 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
971 * elf32-arm.c (maybe_set_textrel): Removed.
972 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
973 with _bfd_elf_maybe_set_textrel.
974 * elf32-csky.c (maybe_set_textrel): Removed.
975 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
976 with _bfd_elf_maybe_set_textrel.
977 * elf32-hppa.c (maybe_set_textrel): Removed.
978 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
979 with _bfd_elf_maybe_set_textrel.
980 * elf32-lm32.c (maybe_set_textrel): Removed.
981 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
982 with _bfd_elf_maybe_set_textrel.
983 * elf32-m32r.c (maybe_set_textrel): Removed.
984 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
985 with _bfd_elf_maybe_set_textrel.
986 * elf32-metag.c (maybe_set_textrel): Removed.
987 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
988 with _bfd_elf_maybe_set_textrel.
989 * elf32-nds32.c (maybe_set_textrel): Removed.
990 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
991 with _bfd_elf_maybe_set_textrel.
992 * elf32-or1k.c (maybe_set_textrel): Removed.
993 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
994 with _bfd_elf_maybe_set_textrel.
995 * elf32-ppc.c (maybe_set_textrel): Removed.
996 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
997 with _bfd_elf_maybe_set_textrel.
998 * elf32-s390.c (maybe_set_textrel): Removed.
999 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1000 with _bfd_elf_maybe_set_textrel.
1001 * elf32-sh.c (maybe_set_textrel): Removed.
1002 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
1003 with _bfd_elf_maybe_set_textrel.
1004 * elf32-tic6x.c (maybe_set_textrel): Removed.
1005 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
1006 with _bfd_elf_maybe_set_textrel.
1007 * elf32-tilepro.c (maybe_set_textrel): Removed.
1008 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
1009 with _bfd_elf_maybe_set_textrel.
1010 * elf64-ppc.c (maybe_set_textrel): Removed.
1011 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
1012 with _bfd_elf_maybe_set_textrel.
1013 * elf64-s390.c (maybe_set_textrel): Removed.
1014 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1015 with _bfd_elf_maybe_set_textrel.
1016 * elfnn-aarch64.c (maybe_set_textrel): Removed.
1017 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
1018 with _bfd_elf_maybe_set_textrel.
1019 * elfnn-riscv.c (maybe_set_textrel): Removed.
1020 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
1021 with _bfd_elf_maybe_set_textrel.
1022 * elfxx-sparc.c (maybe_set_textrel): Removed.
1023 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
1024 with _bfd_elf_maybe_set_textrel.
1025 * elfxx-tilegx.c (maybe_set_textrel): Removed.
1026 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
1027 with _bfd_elf_maybe_set_textrel.
1028 * elfxx-x86.c (maybe_set_textrel): Removed.
1029 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
1030 with _bfd_elf_maybe_set_textrel.
1031 * elflink.c (_bfd_elf_maybe_set_textrel): New.
1033 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1036 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
1038 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
1039 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
1040 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
1041 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
1043 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
1044 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
1045 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
1046 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1047 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
1048 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
1049 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1050 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
1051 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
1052 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1053 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
1054 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1055 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
1056 (elf_backend_copy_indirect_symbol): Likewise.
1057 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
1058 (elf_backend_copy_indirect_symbol): Likewise.
1059 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
1061 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1064 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
1065 * elf32-arm.c (readonly_dynrelocs): Removed.
1066 (maybe_set_textrel): Replace readonly_dynrelocs with
1067 _bfd_elf_readonly_dynrelocs.
1068 * elf32-csky.c (readonly_dynrelocs): Removed.
1069 (maybe_set_textrel): Replace readonly_dynrelocs with
1070 _bfd_elf_readonly_dynrelocs.
1071 * elf32-hppa.c(readonly_dynrelocs): Removed.
1072 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1073 _bfd_elf_readonly_dynrelocs.
1074 (maybe_set_textrel): Likewise.
1075 * elf32-lm32.c (readonly_dynrelocs): Removed.
1076 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1077 with _bfd_elf_readonly_dynrelocs.
1078 (maybe_set_textrel): Likewise.
1079 * elf32-m32r.c (readonly_dynrelocs): Removed.
1080 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1081 with _bfd_elf_readonly_dynrelocs.
1082 (maybe_set_textrel): Likewise.
1083 * elf32-metag.c (readonly_dynrelocs): Removed.
1084 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
1085 with _bfd_elf_readonly_dynrelocs.
1086 (maybe_set_textrel): Likewise.
1087 * elf32-microblaze.c (readonly_dynrelocs): Removed.
1088 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1089 with _bfd_elf_readonly_dynrelocs.
1090 * elf32-nds32.c (readonly_dynrelocs): Removed.
1091 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1092 with _bfd_elf_readonly_dynrelocs.
1093 (maybe_set_textrel): Likewise.
1094 * elf32-or1k.c (readonly_dynrelocs): Removed.
1095 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1096 with _bfd_elf_readonly_dynrelocs.
1097 * elf32-ppc.c (readonly_dynrelocs): Removed.
1098 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1099 _bfd_elf_readonly_dynrelocs.
1100 (ppc_elf_adjust_dynamic_symbol): Likewise.
1101 (maybe_set_textrel): Likewise.
1102 * elf32-s390.c (readonly_dynrelocs): Removed.
1103 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1104 with _bfd_elf_readonly_dynrelocs.
1105 (maybe_set_textrel): Likewise.
1106 * elf32-sh.c (readonly_dynrelocs): Removed.
1107 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
1108 _bfd_elf_readonly_dynrelocs.
1109 (maybe_set_textrel): Likewise.
1110 * elf32-tic6x.c (readonly_dynrelocs): Removed.
1111 (maybe_set_textrel): Replace readonly_dynrelocs with
1112 _bfd_elf_readonly_dynrelocs.
1113 * elf32-tilepro.c (readonly_dynrelocs): Removed.
1114 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1115 with _bfd_elf_readonly_dynrelocs.
1116 (maybe_set_textrel): Likewise.
1117 * elf64-ppc.c (readonly_dynrelocs): Removed.
1118 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1119 _bfd_elf_readonly_dynrelocs.
1120 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1121 (maybe_set_textrel): Likewise.
1122 * elf64-s390.c (readonly_dynrelocs): Removed.
1123 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1124 with _bfd_elf_readonly_dynrelocs.
1125 (maybe_set_textrel): Likewise.
1126 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
1127 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
1128 (maybe_set_textrel): Replace readonly_dynrelocs with
1129 _bfd_elf_readonly_dynrelocs.
1130 * elfnn-riscv.c (readonly_dynrelocs): Removed.
1131 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1132 with _bfd_elf_readonly_dynrelocs.
1133 (maybe_set_textrel): Likewise.
1134 * elfxx-sparc.c (readonly_dynrelocs): Removed.
1135 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
1136 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
1137 (maybe_set_textrel): Likewise.
1138 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
1139 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1140 with _bfd_elf_readonly_dynrelocs.
1141 (maybe_set_textrel): Likewise.
1142 * elfxx-x86.c (readonly_dynrelocs): Removed.
1143 (maybe_set_textrel): Replace readonly_dynrelocs with
1144 _bfd_elf_readonly_dynrelocs.
1145 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1147 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1149 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
1150 -fsanitize=undefined.
1152 2020-06-03 Alan Modra <amodra@gmail.com>
1156 * peicode.h (pe_ILF_make_a_section): Align data for compilers
1158 (pe_ILF_build_a_bfd): Likewise.
1160 2020-06-03 Alan Modra <amodra@gmail.com>
1163 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
1164 core files as well as objects.
1166 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
1169 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
1170 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
1172 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
1173 (elf_arc_link_hash_newfunc): Updated.
1174 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
1175 (elf32_arm_link_hash_newfunc): Updated.
1176 (elf32_arm_copy_indirect_symbol): Likewise.
1177 (elf32_arm_check_relocs): Likewise.
1178 (readonly_dynrelocs): Likewise.
1179 (allocate_dynrelocs_for_symbol): Likewise.
1180 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
1181 (csky_elf_link_hash_newfunc): Updated.
1182 (csky_allocate_dynrelocs): Likewise.
1183 (readonly_dynrelocs): Likewise.
1184 (csky_elf_copy_indirect_symbol): Likewise.
1185 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
1186 (hppa_link_hash_newfunc): Updated.
1187 (elf32_hppa_copy_indirect_symbol): Likewise.
1188 (elf32_hppa_hide_symbol): Likewise.
1189 (elf32_hppa_adjust_dynamic_symbol): Likewise.
1190 (allocate_dynrelocs): Likewise.
1191 (elf32_hppa_relocate_section): Likewise.
1192 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1193 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
1194 (lm32_elf_link_hash_newfunc): Likewise.
1195 (lm32_elf_link_hash_table_create): Updated.
1196 (readonly_dynrelocs): Likewise.
1197 (allocate_dynrelocs): Likewise.
1198 (lm32_elf_copy_indirect_symbol): Likewise.
1199 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
1200 (m32r_elf_link_hash_newfunc): Likewise.
1201 (m32r_elf_link_hash_table_create): Updated.
1202 (m32r_elf_copy_indirect_symbol): Likewise.
1203 (allocate_dynrelocs): Likewise.
1204 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
1205 (metag_link_hash_newfunc): Updated.
1206 (elf_metag_copy_indirect_symbol): Likewise.
1207 (readonly_dynrelocs): Likewise.
1208 (allocate_dynrelocs): Likewise.
1209 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
1211 (link_hash_newfunc): Updated.
1212 (microblaze_elf_check_relocs): Likewise.
1213 (microblaze_elf_copy_indirect_symbol): Likewise.
1214 (readonly_dynrelocs): Likewise.
1215 (allocate_dynrelocs): Likewise.
1216 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
1217 (nds32_elf_link_hash_newfunc): Updated.
1218 (nds32_elf_copy_indirect_symbol): Likewise.
1219 (readonly_dynrelocs): Likewise.
1220 (allocate_dynrelocs): Likewise.
1221 (nds32_elf_check_relocs): Likewise.
1222 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
1223 (link_hash_newfunc): Updated.
1224 (nios2_elf32_copy_indirect_symbol): Likewise.
1225 (nios2_elf32_check_relocs): Likewise.
1226 (allocate_dynrelocs): Likewise.
1227 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
1228 (or1k_elf_link_hash_newfunc): Updated.
1229 (readonly_dynrelocs): Likewise.
1230 (allocate_dynrelocs): Likewise.
1231 (or1k_elf_copy_indirect_symbol): Likewise.
1232 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
1233 (ppc_elf_link_hash_newfunc): Updated.
1234 (ppc_elf_copy_indirect_symbol): Likewise.
1235 (ppc_elf_check_relocs): Likewise.
1236 (readonly_dynrelocs): Likewise.
1237 (ppc_elf_adjust_dynamic_symbol): Likewise.
1238 (allocate_dynrelocs): Likewise.
1239 (ppc_elf_relocate_section): Likewise.
1240 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1241 (link_hash_newfunc): Updated.
1242 (elf_s390_copy_indirect_symbol): Likewise.
1243 (readonly_dynrelocs): Likewise.
1244 (elf_s390_adjust_dynamic_symbol): Likewise.
1245 (allocate_dynrelocs): Likewise.
1246 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
1247 (sh_elf_link_hash_newfunc): Updated.
1248 (readonly_dynrelocs): Likewise.
1249 (allocate_dynrelocs): Likewise.
1250 (sh_elf_copy_indirect_symbol): Likewise.
1251 (sh_elf_check_relocs): Likewise.
1252 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
1253 (elf32_tic6x_link_hash_newfunc): Likewise.
1254 (elf32_tic6x_link_hash_table_create): Updated.
1255 (readonly_dynrelocs): Likewise.
1256 (elf32_tic6x_check_relocs): Likewise.
1257 (elf32_tic6x_allocate_dynrelocs): Likewise.
1258 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
1260 (link_hash_newfunc): Updated.
1261 (tilepro_elf_copy_indirect_symbol): Likewise.
1262 (tilepro_elf_check_relocs): Likewise.
1263 (allocate_dynrelocs): Likewise.
1264 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
1265 (ppc64_elf_copy_indirect_symbol): Updated.
1266 (ppc64_elf_check_relocs): Likewise.
1267 (readonly_dynrelocs): Likewise.
1268 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1269 (dec_dynrel_count): Likewise.
1270 (allocate_dynrelocs): Likewise.
1271 (ppc64_elf_relocate_section): Likewise.
1272 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1273 (link_hash_newfunc): Updated.
1274 (elf_s390_copy_indirect_symbol): Likewise.
1275 (readonly_dynrelocs): Likewise.
1276 (allocate_dynrelocs): Likewise.
1277 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1278 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1280 (elfNN_aarch64_link_hash_newfunc): Updated.
1281 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1282 (readonly_dynrelocs): Likewise.
1283 (need_copy_relocation_p): Likewise.
1284 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1285 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1286 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1287 (link_hash_newfunc): Updated.
1288 (riscv_elf_copy_indirect_symbol): Likewise.
1289 (riscv_elf_check_relocs): Likewise.
1290 (readonly_dynrelocs): Likewise.
1291 (allocate_dynrelocs): Likewise.
1292 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1294 (link_hash_newfunc): Updated.
1295 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1296 (_bfd_sparc_elf_check_relocs): Likewise.
1297 (readonly_dynrelocs): Likewise.
1298 (allocate_dynrelocs): Likewise.
1299 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1300 (link_hash_newfunc): Updated.
1301 (tilegx_elf_copy_indirect_symbol): Likewise.
1302 (tilegx_elf_check_relocs): Likewise.
1303 (readonly_dynrelocs): Likewise.
1304 (allocate_dynrelocs): Likewise.
1305 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1306 (readonly_dynrelocs): Likewise.
1307 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1308 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1310 2020-06-01 Alan Modra <amodra@gmail.com>
1312 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1313 command against cmd_length, not the end of record. For
1314 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1315 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1318 2020-05-28 David Faust <david.faust@oracle.com>
1320 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1321 R_BPF_INSN_{32,64} relocations.
1323 2020-05-28 Stephen Casner <casner@acm.org>
1325 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1326 addreses in .long (used in testsuites) and .stab values.
1328 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1331 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1332 Check bfd_link_dll when issue a DT_TEXTREL warning.
1333 * elfxx-x86.c (maybe_set_textrel): Likewise.
1334 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1336 2020-05-26 Nick Clifton <nickc@redhat.com>
1338 * plugin.c (try_load_plugin): Extend error message when a plugin
1341 2020-05-23 Alan Modra <amodra@gmail.com>
1343 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1345 2020-05-22 Alan Modra <amodra@gmail.com>
1348 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1349 attributes from shared libraries, and do not return an error if
1352 2020-05-21 Alan Modra <amodra@gmail.com>
1355 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1357 (_bfd_delete_bfd): Free the copy.
1358 (_bfd_new_bfd): Free nbfd->memory on error.
1360 2020-05-21 Alan Modra <amodra@gmail.com>
1362 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1363 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1364 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1365 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1366 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1367 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1368 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1369 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1370 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1371 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1372 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1373 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1374 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1375 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1376 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1377 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1378 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1379 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1380 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1381 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1383 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1385 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1386 get_default_version. It is used to find the default version for
1387 the specific extension.
1388 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1389 default_major_version and default_minor_version. Add new bfd_boolean
1390 parameter *use_default_version. Set it to TRUE if we need to call
1391 the callback rps->get_default_version to find the default version.
1392 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1393 the default version in riscv_parsing_subset_version, and then call
1394 riscv_add_subset to add the subset into subset list.
1395 (riscv_parse_prefixed_ext): Likewise.
1396 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1397 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1398 strings rather than characters.
1399 riscv_merge_arch_attr_info): The callback function get_default_version
1400 is only needed for assembler, so set it to NULL int the linker.
1401 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1402 * elfxx-riscv.h: Updated.
1404 2020-05-20 Alan Modra <amodra@gmail.com>
1407 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1408 use bfd_set_filename.
1409 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1410 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1411 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1412 (bfd_create): Likewise.
1413 (_bfd_delete_bfd): Don't free filename.
1414 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1415 return pointer to the copy or NULL on alloc fail.
1416 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1417 result of bfd_set_filename.
1418 * bfd-in2.h: Regenerate.
1420 2020-05-20 Alan Modra <amodra@gmail.com>
1423 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1424 section size against file size.
1425 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1427 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1430 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1431 and memset when allocating memory for the sections_being_created
1434 2020-05-19 Stafford Horne <shorne@gmail.com>
1436 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1438 (or1k_elf_relocate_section): Access srelgot via
1439 htab->root.srelgot. Add assertions for srelgot->contents.
1440 Introduce local variable for srelgot to not reuse global
1442 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1443 (or1k_set_got_and_rela_sizes): New function.
1444 (or1k_initial_exec_offset): New function.
1445 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1446 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1448 (or1k_elf_check_relocs): Use OR to set TLS access.
1449 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1451 (or1k_elf_size_dynamic_sections): Use
1452 or1k_set_got_and_rela_sizes to set sizes.
1453 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1454 (TCB_SIZE): New macro.
1455 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1456 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1457 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1458 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1459 (tpoff): Add dynamic boolean argument.
1460 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1462 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
1464 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1465 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1466 cases with BFD_RELOC_AARCH64_JUMP26.
1467 (elfNN_aarch64_check_relocs): Likewise.
1469 2020-05-19 Alan Modra <amodra@gmail.com>
1471 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1472 bfd_get_filename rather than accessing bfd->filename directly.
1473 * aout-target.h (MY (object_p)): Likewise.
1474 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1475 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1476 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1477 (_bfd_archive_bsd44_construct_extended_name_table),
1478 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1479 (_bfd_bsd_write_armap): Likewise.
1480 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
1481 * cache.c (bfd_open_file): Likewise.
1482 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
1483 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
1484 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1485 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1486 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
1487 * elf32-nds32.c (nds32_elf_output_symbol_hook),
1488 (patch_tls_desc_to_ie): Likewise.
1489 * elf32-spu.c (sort_bfds, print_one_overlay_section),
1490 (spu_elf_auto_overlay): Likewise.
1491 * elf64-hppa.c (elf_hppa_final_link): Likewise.
1492 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
1493 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
1494 * elflink.c (bfd_elf_size_dynamic_sections),
1495 (elf_link_input_bfd): Likewise.
1496 * linker.c (_bfd_generic_link_output_symbols): Likewise.
1497 * mach-o.c (bfd_mach_o_follow_dsym),
1498 (bfd_mach_o_close_and_cleanup): Likewise.
1499 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
1500 (find_separate_debug_file, get_build_id_name): Likewise.
1501 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1502 * plugin.c (bfd_plugin_open_input): Likewise.
1503 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
1504 * som.c (som_write_armap): Likewise.
1505 * srec.c (srec_write_record, srec_write_symbols): Likewise.
1506 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1507 (_bfd_vms_lib_write_archive_contents): Likewise.
1508 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1510 2020-05-19 Alan Modra <amodra@gmail.com>
1513 * bfdio.c (_bfd_real_fopen): Typo fix.
1515 2020-05-18 Nick Clifton <nickc@redhat.com>
1518 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1519 for the sections_being_created array.
1521 2020-05-18 Alan Modra <amodra@gmail.com>
1523 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1524 they can be freed without also freeing internal_relocs.
1526 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1529 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1530 separators into DOS style when creating a WIN32 fullpath.
1532 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
1534 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1535 to initialize RISC-V tdata.
1537 2020-05-12 Gunther Nikl <gnikl@justmail.de>
1539 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1542 2020-05-11 Alan Modra <amodra@gmail.com>
1544 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1546 2020-05-11 Alan Modra <amodra@gmail.com>
1548 * elf64-ppc.c: Rename powerxx to power10 throughout.
1550 2020-05-11 Alan Modra <amodra@gmail.com>
1553 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1554 contains required number of auxents before processing any auxent.
1555 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1556 file name from auxents for PE.
1558 2020-05-04 Gunther Nikl <gnikl@justmail.de>
1560 * aout-cris.c (DEFAULT_ARCH): Delete define.
1561 (MY_set_arch_mach): Likewise.
1562 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1564 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1565 of r_type before the shift.
1567 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
1570 * elfnn-aarch64.c (group_sections): Copy implementation from
1573 2020-05-01 Alan Modra <amodra@gmail.com>
1576 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1577 accessing root.u.def of symbols. Also check root.u.def.section
1578 is non-NULL. Reverse tests so as to make the logic positive.
1580 2020-05-01 Alan Modra <amodra@gmail.com>
1583 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1584 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1586 2020-05-01 Alan Modra <amodra@gmail.com>
1589 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1590 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1591 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1592 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1593 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1594 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1595 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1596 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1597 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1598 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1600 2020-05-01 Alan Modra <amodra@gmail.com>
1603 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1604 from shared libraries.
1606 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1608 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1609 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1610 equals 0. Report overflow when the result has negative sign but
1611 all significant bits are zero.
1613 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1615 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1616 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1618 2020-04-28 Alan Modra <amodra@gmail.com>
1620 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1621 Emit warning message.
1623 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1625 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1626 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1627 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1628 to x86_64_pe_big_vec as it not a big-endian format.
1629 (vec i386_pe_big_vec): New.
1630 * configure.ac: Likewise.
1631 * targets.c: Likewise.
1632 * configure: Regenerate.
1633 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1634 COFF_WITH_PE_BIGOBJ): New.
1635 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1637 (x86_64_pe_be_vec): Moved.
1639 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1641 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1642 * elf.c (elfcore_grok_arc_v2): New function.
1643 (elfcore_grok_note): Call the new function to handle the corresponding
1645 (elfcore_write_arc_v2): New function.
1646 (elfcore_write_register_note): Call the new function to handle the
1647 corresponding pseudo-sections.
1649 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1652 * bfd-in2.h: Regenerated.
1653 * elf32-xtensa.c (elf_howto_table): New entries for
1654 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1655 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1656 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1657 R_XTENSA_NDIFF{8,16,32}.
1658 * libbfd.h (bfd_reloc_code_real_names): Add names for
1659 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1660 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1661 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1662 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1664 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1667 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1670 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1673 * elf-bfd.h (elf_backend_data): Add
1674 elf_backend_strip_zero_sized_dynamic_sections.
1675 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1676 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1678 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1680 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1682 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1684 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1686 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1688 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1690 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1692 2020-04-21 Nick Clifton <nickc@redhat.com>
1694 * po/sr.po: Updated Serbian translation.
1696 2020-04-21 Alan Modra <amodra@gmail.com>
1698 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1701 2020-04-20 Stephen Casner <casner@acm.org>
1703 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1704 causing globals from linker script to be treated as debug symbols.
1705 (translate_symbol_table): Don't sign-extend symbol values from 16
1706 to 64 bits in nm output.
1708 2020-04-20 Alan Modra <amodra@gmail.com>
1710 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1712 2020-04-18 Alan Modra <amodra@gmail.com>
1714 * section.c (bfd_is_const_section): Correct test for special
1716 * bfd-in2.h: Regenerate.
1718 2020-04-17 Alan Modra <amodra@gmail.com>
1721 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1724 2020-04-16 Nick Clifton <nickc@redhat.com>
1727 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1728 abort with a more helpful error message.
1730 2020-04-16 Alan Modra <amodra@gmail.com>
1733 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1736 2020-04-15 Fangrui Song <maskray@google.com>
1739 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1740 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1741 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1742 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1743 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1744 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1745 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1746 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1747 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1748 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1749 * elflink.c (elf_link_output_extsym): Likewise.
1750 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1752 2020-04-15 Alan Modra <amodra@gmail.com>
1755 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1756 pointer into strings that may be freed for section name, always
1757 allocate a new string.
1759 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1760 Jan W. Jagersma <jwjagersma@gmail.com>
1762 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1763 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1764 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1765 (_bfd_go32_mkobject): New functions.
1766 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1767 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1768 (go32exe_mkobject): Call _bfd_go32_mkobject.
1769 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1770 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1772 (coff_write_relocs): Enable extended reloc counter code if
1773 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1774 (coff_write_object_contents): Likewise. Pad section headers
1775 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1776 instead of coff_swap_scnhdr_out.
1777 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1778 enable extended reloc counter.
1779 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1780 Declare with ATTRIBUTE_UNUSED.
1781 * libcoff-in.h: (struct coff_tdata): New field go32.
1783 * libcoff.h: Regenerate.
1785 2020-04-14 Fangrui Song <maskray@google.com>
1788 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1791 2020-04-14 Stephen Casner <casner@acm.org>
1794 * pdp11.c: Add implementation of --imagic option.
1795 (adjust_o_magic): Fix objcopy --extract-symbol test.
1796 * libaout.h (enum aout_magic): Add i_magic.
1798 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1799 Nick Clifton <nickc@redhat.com>
1801 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1803 <default>: Error rather than abort.
1805 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1808 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1809 relocation section from section group.
1811 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1813 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1814 bfd->origin to file offset.
1815 * bfdwin.c (bfd_get_file_window): Likewise.
1816 * bfd.c: Clarify the use of the bfd->origin field.
1817 * bfd-in2.h: Regenerate.
1818 * coff-i386.c: Don't include go32exe.h. Allow overriding
1819 coff_write_object_contents via COFF_WRITE_CONTENTS.
1820 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1821 (go32exe_write_object_contents): New functions.
1822 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1823 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1824 (create_go32_stub): Remove check for 2k size limit. Read stub
1825 from go32exe_temp_stub if present.
1826 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1827 copy variable-length stub.
1828 (go32_check_format): Read stub to go32exe_temp_stub, set
1829 origin, return go32exe_cleanup.
1830 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1831 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1832 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1833 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1834 Remove functions and their associated #defines.
1835 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1836 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1837 Rename field go32stub to stub.
1838 * libcoff.h: Regenerate.
1839 * coff-stgo32.c (go32_check_format): Rename to...
1840 (go32exe_check_format): ...this.
1841 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1842 (go32exe_copy_private_bfd_data): ...this.
1843 (stub_bytes): Rename to...
1844 (go32exe_default_stub): ...this.
1845 (create_go32_stub): Rename to...
1846 (go32exe_create_stub): ...this.
1847 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1850 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1854 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1855 relocation to R_386_32 for relocation against non-preemptible
1857 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1858 allocate dynamic relocation for non-preemptible absolute symbol.
1859 (elf_i386_relocate_section): Pass sec to
1860 GENERATE_DYNAMIC_RELOCATION_P.
1861 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1862 (elf_x86_64_convert_load_reloc): Covert load relocation to
1863 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1864 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1865 for non-preemptible absolute symbol if they overflow.
1866 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1867 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1868 symbol. Don't allocate dynamic relocation for non-preemptible
1870 (elf_x86_64_relocate_section): Don't generate relative relocation
1871 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1872 to GENERATE_DYNAMIC_RELOCATION_P.
1873 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1874 against non-preemptible absolute symbol.
1875 (_bfd_elf_x86_valid_reloc_p): New function.
1876 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1878 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1879 argument. Don't generate dynamic relocation against
1880 non-preemptible absolute symbol.
1881 (ABS_SYMBOL_P): New.
1882 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1883 against non-preemptible absolute symbol.
1885 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1886 (_bfd_elf_x86_valid_reloc_p): New.
1888 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1891 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1892 address in the GOT if in thumb only mode.
1894 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1896 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1898 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1900 * mmo.c (mmo_scan): Create .text section only when needed, not
1903 2020-03-31 Alan Modra <amodra@gmail.com>
1905 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1908 2020-03-31 Alan Modra <amodra@gmail.com>
1910 * vms-alpha.c (image_write): Check bounds for sections without
1911 contents too. Error on non-zero write to section without
1913 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1915 2020-03-31 Alan Modra <amodra@gmail.com>
1917 * tekhex.c (pass_over): Check is_eof before reading buffer.
1919 2020-03-30 Nick Clifton <nickc@redhat.com>
1922 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1923 field to timestamp and make it an integer.
1924 * libcoff.h: Regenerate.
1925 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1926 field in the pe_data structure rather than the insert_timestamp
1929 2020-03-30 Alan Modra <amodra@gmail.com>
1932 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1935 2020-03-26 Nick Clifton <nickc@redhat.com>
1937 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1938 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1940 * libbfd.h: Regenerate.
1942 2020-03-26 Alan Modra <amodra@gmail.com>
1944 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1946 2020-03-26 Alan Modra <amodra@gmail.com>
1948 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1950 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1952 2020-03-25 Nick Clifton <nickc@redhat.com>
1954 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1956 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1957 * libbfd.h: Regenerate.
1959 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1961 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1962 correct field name in the output string.
1964 2020-03-25 Alan Modra <amodra@gmail.com>
1967 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1968 for SHT_NOBITS section if first in segment.
1970 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1973 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1974 (_bfd_elf_get_symbol_version_string): This.
1975 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1976 (_bfd_elf_get_symbol_version_string): This.
1977 (bfd_elf_print_symbol): Pass TRUE to
1978 _bfd_elf_get_symbol_version_string.
1979 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1980 bfd_boolean argument.
1981 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1982 * targets.c (_bfd_get_symbol_version_string): Likewise.
1983 (bfd_get_symbol_version_string): Likewise.
1984 * bfd-in2.h: Regenerated.
1986 2020-03-24 Nick Clifton <nickc@redhat.com>
1987 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1990 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1993 2020-03-24 Nick Clifton <nickc@redhat.com>
1996 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1997 segment to use for PT_GNU_RELRO, ignore empty sections in a
1998 segment's current list.
2000 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2003 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2005 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2008 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
2009 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
2010 on the previous _bfd_elf_get_symbol_version_string.
2011 (_bfd_elf_get_symbol_version_string): Use it.
2013 2020-03-24 Alan Modra <amodra@gmail.com>
2015 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
2016 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
2019 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
2021 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
2023 2020-03-23 Alan Modra <amodra@gmail.com>
2025 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
2026 symbol count. Allocate an extra byte to ensure name strings
2027 are terminated. Sanity check name offsets. Release memory on
2030 2020-03-23 Alan Modra <amodra@gmail.com>
2032 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
2033 field hasn't been read. Remove unnecessary casts.
2035 2020-03-22 Alan Modra <amodra@gmail.com>
2037 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
2038 enough to read number of symbols.
2040 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
2042 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
2043 (EXECUTABLE_SUFFIX): Likewise.
2044 * config.in: Regenerated.
2045 * configure: Likewise.
2046 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
2047 _bfd_generic_close_and_cleanup.
2048 (plugin_list_entry): Remove resolution_file, resolution_option,
2049 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
2050 lto_wrapper, gcc_env and initialized,
2051 (need_lto_wrapper_p): Removed.
2052 (get_lto_wrapper): Likewise.
2053 (setup_lto_wrapper_env): Likewise.
2054 (register_all_symbols_read): Likewise.
2055 (egister_cleanup): Likewise.
2056 (get_symbols): Likewise.
2057 (add_input_file): Likewise.
2058 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
2059 (add_symbols): Updated.
2060 (try_claim): Likewise.
2061 (try_load_plugin): Likewise.
2062 (bfd_plugin_canonicalize_symtab): Likewise.
2063 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
2064 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
2066 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
2069 * plugin.c (plugin_list_entry): Add has_symbol_type.
2070 (add_symbols_v2): New function.
2071 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
2072 provides symbol type.
2073 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
2074 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
2077 2020-03-20 Alan Modra <amodra@gmail.com>
2079 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
2080 enough to read number of symbols.
2082 2020-03-20 Alan Modra <amodra@gmail.com>
2084 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
2085 backend functions for NULL before calling.
2086 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
2087 (bfd_section_from_shdr, assign_section_numbers): Likewise.
2088 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
2089 * elfnn-ia64.c (ignore_errors): New function.
2090 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
2092 2020-03-19 Nick Clifton <nickc@redhat.com>
2095 * dwarf2.c (struct varinfo): Add unit_offset field to record the
2096 location of the varinfo in the unit's debug info data. Change the
2097 type of the stack field to a boolean.
2098 (lookup_var_by_offset): New function. Returns the varinfo
2099 structure for the variable described at the given offset in the
2101 (scan_unit_for_symbols): Add support for variables which have the
2102 DW_AT_specification attribute.
2104 2020-03-19 Nick Clifton <nickc@redhat.com>
2107 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
2110 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
2112 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
2114 2020-03-18 Nick Clifton <nickc@redhat.com>
2117 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
2118 memory access when processing a corrupt secondary reloc section.
2120 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
2122 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
2123 instead of calling abort.
2124 * elf32-csky.c (csky_build_one_stub): Likewise.
2125 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2126 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2127 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2128 * elf32-metag.c (metag_build_one_stub): Likewise.
2129 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2130 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2131 (ppc_size_one_stub): Likewise.
2132 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2134 2020-03-17 Nick Clifton <nickc@redhat.com>
2137 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
2138 with error messages.
2140 2020-03-17 Nick Clifton <nickc@redhat.com>
2143 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
2144 free. Add free on another failure path.
2146 2020-03-16 Alan Modra <amodra@gmail.com>
2149 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
2150 we have a non-zero section count. Do lma comparison in octets.
2152 2020-03-16 Alan Modra <amodra@gmail.com>
2154 * vms-alpha.c (dst_restore_location): Validate index into
2155 dst_ptr_offsets array before accessing. Return status.
2156 (dst_retrieve_location): Similarly, making "loc" parameter a
2157 pointer to return value.
2158 (_bfd_vms_slurp_etir): Update calls to above functions.
2160 2020-03-14 Kamil Rytarowski <n54@gmx.com>
2162 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
2164 * configure: Regenerated.
2166 2020-03-14 Alan Modra <amodra@gmail.com>
2168 * section.c (BFD_FAKE_SECTIONS): Formatting.
2169 * bfd-in2.h: Regenerate.
2171 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2173 * elf.c (elfcore_grok_netbsd_note): Add support for
2174 NT_NETBSDCORE_LWPSTATUS notes.
2176 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
2178 * bfd-in2.h: Regenerate.
2179 * section.c (asection): Add already_assigned field.
2180 (BFD_FAKE_SECTION): Add default initializer for it.
2181 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
2182 * elf32-arm.c (arm_build_one_stub): Add support for
2183 non_contiguous_regions.
2184 * elf32-csky.c (csky_build_one_stub): Likewise.
2185 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2186 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2187 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2188 * elf32-metag.c (metag_build_one_stub): Likewise.
2189 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2190 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2191 (ppc_size_one_stub): Likewise.
2192 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2193 * elflink.c (elf_link_input_bfd): Likewise.
2195 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
2198 * elf-linker-x86.h (elf_linker_x86_params): Add
2199 static_before_all_inputs and has_dynamic_linker.
2200 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2201 dynamic input objects if -static is passed at command-line
2202 before all input files without --dynamic-linker unless
2203 --no-dynamic-linker is used.
2205 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2207 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
2209 2020-03-13 Christian Eggers <ceggers@gmx.de>
2211 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
2212 "p_paddr" from "at".
2213 * elfcode.h (bfd_from_remote_memory): Add units to several
2214 parameters. New local "opb". Fix usage of p_align. Fix
2215 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
2216 call of target_read_memory.
2217 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
2218 calculation of "offset" and "output_offset".
2219 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
2220 from "offset" and fix calculation of "end" from "vma+size". Fix
2221 comparison between "sh_addr" and "vma"/"output_offset".
2222 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
2223 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
2225 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
2226 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
2227 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
2228 assignment of p_paddr from phdr_lma. Fix comparison between
2229 "lma+size" and "next->lma".
2230 (elf_sort_segments): Fix assignment from p_paddr to lma.
2231 (assign_file_positions_for_load_sections): Add unit (bytes) to
2232 local "align". Fix calculation of local "off_adjust". Fix
2233 calculation of local "filehdr_vaddr".
2234 (assign_file_positions_for_non_load_sections): New local "opb".
2235 Fix calculation of "end" from "p_size". Fix comparison between
2236 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
2237 from "end" and "p_vaddr".
2238 (rewrite_elf_program_header): Fix comparison between p_vaddr and
2239 vma. Fix assignment to p_paddr from lma. Fix comparison between
2240 p_paddr and lma. Fix assignment to p_paddr from lma.
2241 * merge.c (sec_merge_emit): New local "opb". Convert
2242 "alignment_power" to octets.
2243 (_bfd_add_merge_section): New locals "alignment_power" and
2244 "opb". Fix comparison between "alignment_power" and
2246 (_bfd_merge_sections): New local "opb". Divide size by opb
2247 before checking align mask.
2249 2020-03-13 Christian Eggers <ceggers@gmx.de>
2251 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
2252 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
2254 (_bfd_elf_make_section_from_phdr): Similarly.
2255 (elf_fake_sections): Fix calculation of
2256 Elf_Internal_shdr::sh_addr from section VMA.
2257 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
2259 (assign_file_positions_for_load_sections): Fix calculations of
2260 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
2261 comparison between program header address and section LMA.
2262 (assign_file_positions_for_non_load_sections): Likewise.
2263 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
2264 (IS_CONTAINED_BY_VMA): Add parameter opb.
2265 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
2266 INCLUDE_SECTION_IN_SEGMENT): Likewise.
2267 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
2268 Fix calculations of p_addr_valid and p_vaddr_offset.
2269 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
2270 with octets per byte when comparing against p_vaddr.
2272 2020-03-11 Alan Modra <amodra@gmail.com>
2274 * som.c (setup_sections): Sanity check subspace.name.
2276 2020-03-11 Alan Modra <amodra@gmail.com>
2278 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2280 2020-03-10 Alan Modra <amodra@gmail.com>
2283 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2286 2020-03-09 Alan Modra <amodra@gmail.com>
2288 * wasm-module.c (wasm_scan): Sanity check file name length
2289 before allocating memory. Move common section setup code. Do
2290 without bfd_tell to calculate section size.
2292 2020-03-06 Nick Clifton <nickc@redhat.com>
2294 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2295 with error messages and failure return values.
2297 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
2299 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2300 relocation sections for any removed reference to a dynamic symbol.
2302 2020-03-05 Nick Clifton <nickc@redhat.com>
2304 * elf-bfd.h (struct elf_backend_data): Add new fields:
2305 init_secondary_reloc_section, slurp_secondary_reloc_section,
2306 write_secondary_reloc_section.
2307 (_bfd_elf_init_secondary_reloc_section): Prototype.
2308 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2309 (_bfd_elf_write_secondary_reloc_section): Prototype.
2310 * elf.c ( bfd_section_from_shdr): Invoke the new
2311 init_secondary_reloc_section backend function, if defined, when a
2312 second reloc section is encountered.
2313 (swap_out_syms): Invoke the new symbol_section_index function, if
2314 defined, when computing the section index of an OS/PROC specific
2316 (_bfd_elf_init_secondary_reloc_section): New function.
2317 (_bfd_elf_slurp_secondary_reloc_section): New function.
2318 (_bfd_elf_write_secondary_reloc_section): New function.
2319 (_bfd_elf_copy_special_section_fields): New function.
2320 * elfcode.h (elf_write_relocs): Invoke the new
2321 write_secondary_relocs function, if defined, in order to emit
2323 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2324 function, if defined, in order to read in secondary relocs.
2325 * elfxx-target.h (elf_backend_copy_special_section_fields):
2326 Provide a non-NULL default definition.
2327 (elf_backend_init_secondary_reloc_section): Likewise.
2328 (elf_backend_slurp_secondary_reloc_section): Likewise.
2329 (elf_backend_write_secondary_reloc_section): Likewise.
2330 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2332 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2333 * configure: Regenerate.
2335 2020-03-05 Alan Modra <amodra@gmail.com>
2337 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2338 against file size before allocating memory. Use bfd_alloc rather
2339 than bfd_zalloc for carsym/strings memory.
2341 2020-03-04 Alan Modra <amodra@gmail.com>
2343 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2344 sh_addr mod sh_addalign is zero.
2346 2020-03-04 Alan Modra <amodra@gmail.com>
2348 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2350 2020-03-03 Alan Modra <amodra@gmail.com>
2352 * format.c (struct bfd_preserve): Add cleanup field.
2353 (bfd_preserve_save): Add cleanup param and save.
2354 (bfd_preserve_restore): Return cleanup.
2355 (bfd_preserve_finish): Call the cleanup for the discarded match.
2356 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2357 and clear when preserving a match. Restore cleanup too when
2358 restoring that match.
2360 2020-03-02 Alan Modra <amodra@gmail.com>
2362 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2363 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2364 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2365 (core_sco5_vec): Correct initialisers.
2367 2020-03-02 Alan Modra <amodra@gmail.com>
2369 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2370 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2371 * cisco-core.c (cisco_core_file_validate): Likewise.
2372 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2373 * hpux-core.c (hpux_core_core_file_p): Likewise.
2374 * irix-core.c (irix_core_core_file_p): Likewise.
2375 * lynx-core.c (lynx_core_file_p): Likewise.
2376 * netbsd-core.c (netbsd_core_file_p): Likewise.
2377 * osf-core.c (osf_core_core_file_p): Likewise.
2378 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2379 * sco5-core.c (sco5_core_file_p): Likewise.
2381 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2383 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2385 2020-03-02 Alan Modra <amodra@gmail.com>
2387 * targets.c (bfd_cleanup): New typedef.
2388 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2389 * libbfd-in.h (_bfd_no_cleanup): Define.
2390 * format.c (bfd_reinit): Add cleanup parameter, call it.
2391 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2392 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2393 * aout-target.h (callback, object_p): Return bfd_cleanup.
2394 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2395 * archive.c (bfd_generic_archive_p): Likewise.
2396 * binary.c (binary_object_p): Likewise.
2397 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2398 * coff-ia64.c (ia64coff_object_p): Likewise.
2399 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2400 * coff-sh.c (coff_small_object_p): Likewise.
2401 * coff-stgo32.c (go32_check_format): Likewise.
2402 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2403 (xcoff64_core_p): Likewise.
2404 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2405 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2406 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2407 * elfcode.h (elf_object_p): Likewise.
2408 * elfcore.h (elf_core_file_p): Likewise.
2409 * i386msdos.c (msdos_object_p): Likewise.
2410 * ihex.c (ihex_object_p): Likewise.
2411 * libaout.h (some_aout_object_p): Likewise.
2412 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2413 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2414 * libbfd.c (_bfd_dummy_target): Likewise.
2415 * libcoff-in.h (coff_object_p): Likewise.
2416 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2417 (bfd_mach_o_arm64_core_p): Likewise.
2418 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2419 (bfd_mach_o_arm_core_p): Likewise.
2420 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2421 (bfd_mach_o_i386_core_p): Likewise.
2422 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2423 (bfd_mach_o_x86_64_core_p): Likewise.
2424 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2425 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2426 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2427 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2428 * mmo.c (mmo_object_p): Likewise.
2429 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2430 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2431 (pe_bfd_object_p): Likewise.
2432 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2433 * ppcboot.c (ppcboot_object_p): Likewise.
2434 * rs6000-core.c (rs6000coff_core_p): Likewise.
2435 * som.c (som_object_setup, som_object_p): Likewise.
2436 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2437 * tekhex.c (tekhex_object_p): Likewise.
2438 * vms-alpha.c (alpha_vms_object_p): Likewise.
2439 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2440 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2441 * wasm-module.c (wasm_object_p): Likewise.
2442 * xsym.c (bfd_sym_object_p): Likewise.
2443 * xsym.h (bfd_sym_object_p): Likewise.
2444 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2446 * pdp11.c (some_aout_object_p): Likewise.
2447 * plugin.c (register_ld_plugin_object_p): Update object_p
2449 * plugin.h (register_ld_plugin_object_p): Likewise.
2450 * bfd-in2.h: Regenerate.
2451 * libbfd.h: Regenerate.
2452 * libcoff.h: Regenerate.
2454 2020-03-02 Alan Modra <amodra@gmail.com>
2456 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2457 applicable section flags.
2458 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2459 (mips_ecoff_bele_vec): Likewise.
2460 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2462 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2463 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2465 2020-03-02 Alan Modra <amodra@gmail.com>
2467 * elf32-m32r.c (m32r_elf_section_flags): New function.
2468 (elf_backend_section_flags): Define.
2469 * elf32-nds32.c (nds32_elf_section_flags): New function.
2470 (elf_backend_section_flags): Define.
2471 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2472 .sbss and .sdata sections.
2473 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2474 for SHF_V850_GPREL sections.
2475 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2477 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2478 for SHF_PARISC_SHORT sections.
2479 * elf64-ppc.c (ppc64_elf_section_flags): New function.
2480 (elf_backend_section_flags): Define.
2481 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
2482 for SHF_MIPS_GPREL sections. Delete FIXME.
2484 2020-03-02 Alan Modra <amodra@gmail.com>
2486 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
2487 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
2488 calling elf_backend_section_flags with adjusted params. Use
2489 newsect->flags past that point.
2490 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
2492 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
2493 to have their type overridden, and all sh_flags but processor and
2495 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
2496 * elf32-mep.c (mep_elf_section_flags): Likewise.
2497 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
2498 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
2499 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
2500 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
2501 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
2502 stub BFD and non-aarch64 input files when scanning for stubs.
2504 2020-03-02 Alan Modra <amodra@gmail.com>
2506 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2507 limit to decompressed element size.
2509 2020-03-02 Alan Modra <amodra@gmail.com>
2511 * vms-lib.c (vms_traverse_index): Add recur_count param and
2512 update calls. Fail on excessive recursion.
2514 2020-03-02 Alan Modra <amodra@gmail.com>
2516 * vms-alpha.c (vms_get_remaining_object_record): Use
2517 bfd_realloc_or_free rather than bfd_realloc.
2518 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2519 (dst_define_location, parse_module): Likewise, and check realloc
2520 return status before using memory. Return status from function
2521 adjusting all callers.
2523 2020-02-28 Alan Modra <amodra@gmail.com>
2525 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2527 2020-02-28 Alan Modra <amodra@gmail.com>
2529 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2530 Remove duplicate undersize check.
2532 2020-02-27 Alan Modra <amodra@gmail.com>
2535 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2537 2020-02-27 Alan Modra <amodra@gmail.com>
2540 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2541 (coff_section_type): Adjust comment.
2542 (decode_section_type): Likewise. Call coff_section_type before
2543 decode_section_type.
2544 (bfd_decode_symclass): Use 'c' for common sections other than
2547 2020-02-27 Alan Modra <amodra@gmail.com>
2549 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2552 2020-02-27 Alan Modra <amodra@gmail.com>
2554 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2555 if file is an archive element.
2556 * bfd-in2.h: Regenerate.
2558 2020-02-26 Alan Modra <amodra@gmail.com>
2560 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2561 bfd_set_error on failing test. Don't bother changing bfd_error on
2562 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2563 Check sym name is within string buffer. Use size_t for some vars.
2564 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2565 int_buf. Don't change bfd_error on file read error. Use
2566 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2567 calculations to catch overflows before they occur. malloc and
2568 free raw armap rather than using bfd_alloc. Read raw armap before
2569 allocating carsym+strings buffer.
2570 (_bfd_slurp_extended_name_table): Localize variables. Check
2571 name size against file size.
2573 2020-02-26 Alan Modra <amodra@gmail.com>
2575 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2577 2020-02-26 Alan Modra <amodra@gmail.com>
2579 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2580 malloc. Check for NULL return from bfd_malloc.
2581 (rx_table_find, rx_table_map): Likewise.
2582 (rx_set_section_contents): Check bfd_alloc return.
2583 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2585 2020-02-26 Alan Modra <amodra@gmail.com>
2587 * aoutx.h: Indent labels correctly. Format error strings.
2588 * archive.c: Likewise.
2589 * archive64.c: Likewise.
2590 * coff-arm.c: Likewise.
2591 * coff-rs6000.c: Likewise.
2592 * coff-stgo32.c: Likewise.
2593 * cpu-arm.c: Likewise.
2594 * dwarf2.c: Likewise.
2595 * elf-ifunc.c: Likewise.
2596 * elf-properties.c: Likewise.
2597 * elf-s390-common.c: Likewise.
2598 * elf-strtab.c: Likewise.
2600 * elf32-arm.c: Likewise.
2601 * elf32-bfin.c: Likewise.
2602 * elf32-cr16.c: Likewise.
2603 * elf32-csky.c: Likewise.
2604 * elf32-i386.c: Likewise.
2605 * elf32-m68k.c: Likewise.
2606 * elf32-msp430.c: Likewise.
2607 * elf32-nds32.c: Likewise.
2608 * elf32-nios2.c: Likewise.
2609 * elf32-pru.c: Likewise.
2610 * elf32-xtensa.c: Likewise.
2611 * elf64-ia64-vms.c: Likewise.
2612 * elf64-x86-64.c: Likewise.
2613 * elfcode.h: Likewise.
2614 * elfcore.h: Likewise.
2615 * elflink.c: Likewise.
2616 * elfnn-aarch64.c: Likewise.
2617 * elfnn-ia64.c: Likewise.
2618 * elfnn-riscv.c: Likewise.
2619 * elfxx-mips.c: Likewise.
2620 * elfxx-sparc.c: Likewise.
2621 * elfxx-x86.c: Likewise.
2622 * i386lynx.c: Likewise.
2623 * merge.c: Likewise.
2624 * pdp11.c: Likewise.
2625 * plugin.c: Likewise.
2626 * reloc.c: Likewise.
2628 2020-02-26 Alan Modra <amodra@gmail.com>
2631 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2633 (bfd_elf_add_dt_needed_tag): Declare.
2634 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2635 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2636 from elf_add_dt_needed_tag. Remove soname and doit param.
2637 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2638 to see whether as-needed lib is already loaded, use dyn_loaded
2639 list instead. When saving and restoring around as-needed lib
2640 handle possibility that dynstr has not been initialised. Don't
2641 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2642 Mark libs loaded via DT_NEEDED entries of other libs with
2643 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2645 (elf_link_check_versioned_symbol): Remove now unneccesary
2646 DYNAMIC check when traversing dyn_loaded list.
2648 2020-02-26 Alan Modra <amodra@gmail.com>
2650 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2652 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2655 * plugin.c (need_lto_wrapper_p): New.
2656 (bfd_plugin_set_program_name): Add an int argument to set
2658 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2660 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2662 2020-02-24 Alan Modra <amodra@gmail.com>
2664 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2666 2020-02-24 Alan Modra <amodra@gmail.com>
2668 * vms-lib.c (struct carsym_mem): Add limit.
2669 (vms_add_index): Heed limit.
2670 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2671 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2672 Always return actual number read.
2673 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2674 assertion with error exit.
2676 2020-02-22 Alan Modra <amodra@gmail.com>
2679 * elf.c (assign_file_positions_for_load_sections): Continue linking
2680 on "PHDR segment not covered by LOAD segment" errors.
2682 2020-02-21 Alan Modra <amodra@gmail.com>
2684 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2686 (bfd_mach_o_canonicalize_reloc): Likewise.
2687 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2688 counts and offsets against file size.
2689 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2690 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2691 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2692 against file size. Delete symbol table error message.
2693 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2695 (bfd_mach_o_read_symtab): Likewise.
2696 (bfd_mach_o_read_command): Pass file size.
2697 (bfd_mach_o_scan): Sanity check command count against file size.
2699 2020-02-21 Alan Modra <amodra@gmail.com>
2702 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2703 "text", "data" and "bss" section pointer vars. Don't update
2704 section size, just exec header sizes.
2705 (adjust_sizes_and_vmas): Don't update text section size. Set
2706 initial exec header a_text. Print exec headers sizes.
2707 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2708 (adjust_sizes_and_vmas): Similarly. Formatting.
2709 (final_link): Correct final file extension.
2711 2020-02-20 Nick Clifton <nickc@redhat.com>
2713 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2715 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2717 (elfNN_bed): Initialise the symbol_section_index field.
2718 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2719 OS and PROC specific section indicies. Warn if converting other
2720 reserved incidies to SHN_ABS.
2722 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2725 * cpu-z80.c: Add machine type compatibility checking.
2727 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2730 * plugin.c (plugin_list_entry): Remove handle.
2731 (try_load_plugin): Call dlclose before return.
2733 2020-02-19 Alan Modra <amodra@gmail.com>
2735 * libbfd-in.h (_bfd_constant_p): Define.
2736 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2737 file size before allocating memory.
2738 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2739 * elf.c (bfd_elf_get_str_section): Likewise.
2740 (_bfd_elf_slurp_version_tables): Likewise.
2741 * libbfd.h: Regenerate.
2743 2020-02-19 Alan Modra <amodra@gmail.com>
2745 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2746 * aoutx.h (aout_get_external_symbols): Replace calls to
2747 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2748 (slurp_reloc_table): Likewise.
2749 * archive.c (do_slurp_bsd_armap): Likewise.
2750 (do_slurp_coff_armap): Likewise.
2751 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2752 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2753 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2754 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2755 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2756 (_bfd_coff_get_external_symbols): Likewise.
2757 * ecoff.c (ecoff_slurp_symbolic_header),
2758 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2759 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2760 (ecoff_indirect_link_order): Likewise.
2761 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2762 (_bfd_elf_slurp_version_tables): Likewise.
2763 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2764 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2765 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2766 * elf64-alpha.c (READ): Likewise.
2767 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2768 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2769 * elfcode.h (elf_slurp_symbol_table),
2770 (elf_slurp_reloc_table_from_section): Likewise.
2771 * elflink.c (elf_link_add_object_symbols),
2772 (elf_link_check_versioned_symbol): Likewise.
2773 * elfxx-mips.c (READ): Likewise.
2774 * i386lynx.c (slurp_reloc_table): Likewise.
2775 * lynx-core.c (lynx_core_file_p): Likewise.
2776 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2777 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2778 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2779 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2780 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2781 (bfd_pef_parse_symbols): Likewise.
2782 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2783 * som.c (setup_sections, som_slurp_string_table),
2784 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2785 (som_bfd_fill_in_ar_symbols): Likewise.
2786 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2787 (evax_bfd_print_image): Likewise.
2788 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2789 * wasm-module.c (wasm_scan): Likewise.
2790 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2791 * xsym.c (bfd_sym_read_name_table),
2792 (bfd_sym_print_type_information_table_entry): Likewise.
2793 * libbfd.h: Regenerate.
2795 2020-02-19 Alan Modra <amodra@gmail.com>
2797 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2798 reading external relocs.
2799 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2800 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2802 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2804 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2805 (m32c_elf_relax_section): Likewise.
2806 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2807 (rl78_elf_relax_section): Likewise.
2808 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2809 (elf32_rx_relax_section): Likewise.
2810 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2811 parameter types and use..
2812 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2813 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2814 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2815 being read from file, just the extra.
2816 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2817 after reading external syms. Free on failure.
2819 2020-02-19 Alan Modra <amodra@gmail.com>
2821 * coffcode.h (buy_and_read, coff_slurp_line_table),
2822 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2823 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2824 corresponding bfd_alloc call. Adjust variables to suit.
2825 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2826 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2827 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2828 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2829 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2830 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2831 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2832 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2833 * elf64-alpha.c (READ): Likewise.
2834 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2835 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2836 (bfd_from_remote_memory): Likewise.
2837 * elfcore.h (core_find_build_id): Likewise.
2838 * elfxx-mips.c (READ): Likewise.
2839 * mach-o.c (bfd_mach_o_mangle_sections),
2840 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2841 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2842 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2843 * som.c (setup_sections, som_prep_for_fixups)
2844 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2845 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2846 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2847 (som_bfd_ar_write_symbol_stuff): Likewise.
2848 * vms-alpha.c (vector_grow1): Likewise.
2849 * vms-lib.c (vms_add_index): Likewise.
2850 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2851 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2852 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2853 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2854 (bfd_alloc2, bfd_zalloc2): Delete.
2855 (_bfd_mul_overflow): Define.
2856 * libbfd.h: Regenerate.
2858 2020-02-19 Alan Modra <amodra@gmail.com>
2860 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2862 (assign_section_numbers): Likewise.
2863 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2864 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2865 bfd_malloc2, size_t amt, and unsigned tls_count.
2866 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2867 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2868 (elf_output_implib): Use bfd_alloc.
2870 2020-02-19 Alan Modra <amodra@gmail.com>
2872 * bfd.c (struct bfd): Move format and direction to other
2873 bitfields. Add "size".
2874 * bfdio.c (bfd_get_size): Cache size when not writing file.
2875 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2876 returning zero, ie. unknown.
2877 (bfd_get_alt_debug_link_info): Likewise.
2878 * bfd-in2.h: Regenerate.
2880 2020-02-19 Alan Modra <amodra@gmail.com>
2882 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2883 bfd_get_file_size twice.
2884 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2885 zero, ie. unknown, return.
2886 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2887 * elfcode.h (elf_swap_shdr_in): Likewise.
2888 (elf_object_p): Don't call bfd_get_file_size twice and correct
2891 2020-02-19 Alan Modra <amodra@gmail.com>
2893 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2894 FALSE if memory alloc fails. Adjust calls.
2895 * som.c (som_prep_for_fixups): Likewise.
2896 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2897 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2898 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2899 * som.c (som_build_and_write_symbol_table): Return via error_return
2901 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2902 (VEC_APPEND_EL): Delete.
2903 (vector_grow1): Return pointer to element. Catch overflow.
2904 Return NULL on memory allocation failure.
2905 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2906 (alpha_vms_add_fixup_ca): Likewise.
2907 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2909 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2911 2020-02-19 Alan Modra <amodra@gmail.com>
2913 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2914 * aout-target.h (object_p): Likewise.
2915 * aout-tic30.c (tic30_aout_object_p): Likewise.
2916 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2917 (emit_stringtab, write_syms, link_hash_table_create),
2918 (aout_link_write_other_symbol): Likewise.
2919 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2920 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2921 (_bfd_compute_and_write_armap): Likewise.
2922 * archures.c (bfd_arch_list): Likewise.
2923 * bfd.c (bfd_record_phdr): Likewise.
2924 * binary.c (binary_canonicalize_symtab): Likewise.
2925 * cisco-core.c (cisco_core_file_validate): Likewise.
2926 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2927 (find_arm_glue, record_arm_to_thumb_glue),
2928 (record_thumb_to_arm_glue): Likewise.
2929 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2930 (ppc_allocate_toc_section): Likewise.
2931 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2932 * coff-sh.c (sh_relax_section): Likewise.
2933 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2934 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2935 (coff_set_alignment_hook, coff_mkobject),
2936 (coff_compute_section_file_positions): Likewise.
2937 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2938 (coff_find_nearest_line_with_names),
2939 ( bfd_coff_set_symbol_class): Likewise.
2940 * cofflink.c (_bfd_coff_link_hash_table_create),
2941 (_bfd_coff_link_input_bfd): Likewise.
2942 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2943 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2944 (build_line_info_table, sort_line_sequences),
2945 (line_info_add_include_dir, line_info_add_file_name),
2946 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2947 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2948 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2949 (_bfd_ecoff_find_nearest_line),
2950 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2951 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2952 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2953 * elf-m10300.c (mn10300_elf_relax_section),
2954 (elf32_mn10300_link_hash_table_create): Likewise.
2955 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2956 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2957 * elf32-arm.c (elf32_arm_link_hash_table_create),
2958 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2959 (elf32_arm_new_section_hook): Likewise.
2960 * elf32-avr.c (elf_avr_new_section_hook),
2961 (elf32_avr_link_hash_table_create, get_local_syms),
2962 (elf32_avr_setup_section_lists): Likewise.
2963 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2964 (bfin_link_hash_table_create): Likewise.
2965 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2966 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2967 * elf32-csky.c (csky_elf_link_hash_table_create),
2968 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2969 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2970 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2971 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2972 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2973 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2974 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2975 (m32r_elf_check_relocs): Likewise.
2976 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2977 (elf32_m68hc11_setup_section_lists),
2978 (elf32_m68hc11_size_stubs): Likewise.
2979 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2980 * elf32-metag.c (elf_metag_link_hash_table_create),
2981 (elf_metag_setup_section_lists): Likewise.
2982 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2983 (microblaze_elf_check_relocs): Likewise.
2984 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2985 (nds32_elf_check_relocs): Likewise.
2986 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2987 (get_local_syms, nios2_elf32_check_relocs),
2988 (nios2_elf32_link_hash_table_create): Likewise.
2989 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2990 (or1k_elf_check_relocs): Likewise.
2991 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2992 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2993 * elf32-s390.c (elf_s390_link_hash_table_create),
2994 (elf_s390_check_relocs): Likewise.
2995 * elf32-score.c (score_elf_create_got_section),
2996 (s3_elf32_score_new_section_hook),
2997 (elf32_score_link_hash_table_create): Likewise.
2998 * elf32-score7.c (score_elf_create_got_section),
2999 (s7_elf32_score_new_section_hook): Likewise.
3000 * elf32-sh.c (sh_elf_link_hash_table_create),
3001 (sh_elf_check_relocs): Likewise.
3002 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
3003 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
3004 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
3005 (tilepro_elf_check_relocs): Likewise.
3006 * elf32-v850.c (remember_hi16s_reloc): Likewise.
3007 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
3008 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
3009 (elf_xtensa_new_section_hook): Likewise.
3010 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
3011 (get_got_entry, elf64_alpha_check_relocs): Likewise.
3012 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
3013 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
3014 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
3015 * elf64-ppc.c (ppc64_elf_new_section_hook),
3016 (ppc64_elf_link_hash_table_create, update_local_sym_info),
3017 (update_plt_info, ppc64_elf_check_relocs): Likewise.
3018 * elf64-s390.c (elf_s390_link_hash_table_create),
3019 (elf_s390_check_relocs): Likewise.
3020 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
3021 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
3022 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
3023 (elf_link_add_archive_symbols, compute_bucket_count),
3024 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
3025 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
3026 (bfd_elf_final_link): Likewise.
3027 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
3028 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
3029 (elfNN_aarch64_new_section_hook): Likewise.
3030 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
3031 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
3032 (riscv_elf_check_relocs): Likewise.
3033 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
3034 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
3035 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
3036 (_bfd_mips_elf_link_hash_table_create): Likewise.
3037 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
3038 (_bfd_sparc_elf_check_relocs),
3039 (_bfd_sparc_elf_new_section_hook): Likewise.
3040 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
3041 (tilegx_elf_check_relocs): Likewise.
3042 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
3043 * format.c (bfd_check_format_matches): Likewise.
3044 * hash.c (_bfd_stringtab_init): Likewise.
3045 * ihex.c (ihex_scan): Likewise.
3046 * irix-core.c (irix_core_core_file_p): Likewise.
3047 * linker.c (bfd_wrapped_link_hash_lookup),
3048 (_bfd_generic_link_hash_table_create),
3049 (_bfd_generic_reloc_link_order): Likewise.
3050 * lynx-core.c (lynx_core_file_p): Likewise.
3051 * netbsd-core.c (netbsd_core_file_p): Likewise.
3052 * osf-core.c (osf_core_core_file_p): Likewise.
3053 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
3054 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
3055 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
3056 * peicode.h (pe_mkobject): Likewise.
3057 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
3058 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3059 * sco5-core.c (read_uarea): Likewise.
3060 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
3061 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
3062 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
3063 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
3064 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
3065 * srec.c (srec_scan): Likewise.
3066 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
3067 * targets.c (bfd_target_list): Likewise.
3068 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
3069 * trad-core.c (trad_unix_core_file_p): Likewise.
3070 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
3071 (vms_new_section_hook): Likewise.
3072 * wasm-module.c (wasm_make_empty_symbol): Likewise.
3073 * xcofflink.c (xcoff_get_section_contents),
3074 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
3075 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
3076 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
3078 2020-02-19 Alan Modra <amodra@gmail.com>
3080 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
3082 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
3084 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
3085 and use it if it isn't NULL. Remove has_plugin_p argument. Add
3086 a build_list_p argument. Don't search plugin_list. Short circuit
3087 when building the plugin list.
3088 (has_plugin): Renamed to has_plugin_list.
3089 (bfd_plugin_set_plugin): Don't set has_plugin.
3090 (bfd_plugin_specified_p): Check plugin_list instead.
3091 (build_plugin_list): New function.
3092 (load_plugin): Call build_plugin_list and use plugin_list.
3094 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3097 * plugin.c (try_claim): Always clean up for LTO wrapper.
3098 (try_load_plugin): Treat each object as independent. Create a
3099 copy for plugin name.
3101 2020-02-11 Nick Clifton <nickc@redhat.com>
3103 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
3104 for addresses in print statements.
3105 (msp430_elf_relax_delete_bytes): Likewise.
3106 (msp430_elf_relax_add_words): Likewise.
3107 (msp430_elf_relax_section): Likewise.
3109 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3111 * plugin.c (add_symbols): Clear plugin_data memory.
3113 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
3116 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
3117 (EXECUTABLE_SUFFIX): Likewise.
3118 * config.in: Regenerated.
3119 * configure: Likewise.
3120 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
3121 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
3122 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
3123 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
3124 (get_lto_wrapper): New.
3125 (setup_lto_wrapper_env): Likewise.
3126 (current_plugin): Likewise.
3127 (register_all_symbols_read): Likewise.
3128 (register_cleanup): Likewise.
3129 (get_symbols): Likewise.
3130 (add_input_file): Likewise.
3131 (bfd_plugin_close_and_cleanup): Likewise.
3132 (claim_file): Removed.
3133 (register_claim_file): Set current_plugin->claim_file.
3134 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
3135 lto_syms in current_plugin.
3136 (try_claim): Use current_plugin->claim_file. Call LTO plugin
3137 all_symbols_read handler. Copy real symbols to plugin_data.
3138 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
3139 (try_load_plugin): Don't reuse the previous plugin for LTO
3140 wrapper. Set up GCC LTO wrapper if possible. Don't set
3141 plugin_list_iter->claim_file.
3142 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
3144 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
3147 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3149 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
3150 check if previous instruction matches a conditional jump inserted
3151 earlier. Invert conditional jump and delete branch in this case.
3153 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3155 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
3156 msp430_elf_relax_add_words. Support insertion of either one or two
3158 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
3159 needs to be grown. Handle insertion of branch instruction to replace
3162 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3164 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
3165 debugging relocations.
3166 (msp430_elf_relax_delete_bytes): Likewise.
3167 (msp430_elf_relax_add_two_words): Likewise.
3168 (msp430_elf_relax_section): Likewise.
3170 2020-02-10 Alan Modra <amodra@gmail.com>
3172 * archures.c: Wrap overlong z80 comments.
3173 * bfd-in2.h: Regenerate.
3175 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
3178 * archures.c: Add GBZ80 and Z80N machine values.
3179 * reloc.c: Add BFD_RELOC_Z80_16_BE.
3180 * coff-z80.c: Add support for new reloc.
3181 * coffcode.h: Add support for new machine values.
3182 * cpu-z80.c: Add support for new machine names.
3183 * elf32-z80.c: Add support for new reloc.
3184 * bfd-in2.h: Regenerate.
3185 * libbfd.h: Regenerate.
3187 2020-02-07 Nick Clifton <nickc@redhat.com>
3190 * elf.c (rewrite_elf_program_header): Do not complain if no
3191 sections are mapped to a segment.
3193 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3196 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
3197 for garbage collection on __patchable_function_entries section
3198 without linked-to section.
3200 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3203 * bfd-in2.h: Regenerated.
3204 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
3205 on section if gc_mark of any of its linked-to sections is set
3206 and don't set gc_mark again.
3207 * section.c (asection): Add linked_to_symbol_name to map_head
3210 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
3212 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
3213 reporting an unrecognized instruction with R_V850_LONGJUMP.
3215 2020-02-05 Alan Modra <amodra@gmail.com>
3217 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
3219 2020-02-04 Alan Modra <amodra@gmail.com>
3221 * elf32-ppc.c (ppc_elf_relocate_section): After applying
3222 R_PPC_VLE_ADDR20, goto copy_reloc.
3224 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3226 * bfd-in2.h: Regenerated.
3227 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
3229 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3232 * bfd-in2.h: Regenerated.
3233 * ecoff.c (bfd_debug_section): Add section_id.
3234 * section.c (bfd_section): Add section_id.
3235 (SEC_ASSEMBLER_SECTION_ID): New.
3236 (BFD_FAKE_SECTION): Add section_id.
3238 2020-02-01 Nick Clifton <nickc@redhat.com>
3240 * config.bfd: Move the c30-aout and tic30-aout targets onto the
3243 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
3245 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
3246 encodings are relative to the GOT on nios2, too.
3248 2020-01-31 Alan Modra <amodra@gmail.com>
3250 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
3251 file. Use $< and $@ in rules.
3252 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
3253 (elf32-ia64.c, elf64-ia64.c): Likewise.
3254 (elf32-riscv.c, elf64-riscv.c): Likewise.
3255 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3256 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
3257 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
3258 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
3259 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3260 * Makefile.in: Regenerate.
3262 2020-01-31 Alan Modra <amodra@gmail.com>
3265 * elf.c (setup_group): Don't clear entire section contents,
3266 just the padding after group flags. Release alloc'd memory
3267 after a seek or read failure.
3269 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3271 * peXXigen.c (pe_is_repro): New function.
3272 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
3273 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
3275 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3277 * peXXigen.c (debug_type_names): Add names for new debug data type
3280 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3282 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3283 inner loop. Fix a memory leak.
3285 2020-01-30 Alan Modra <amodra@gmail.com>
3287 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3288 or obj_coff_keep_strings here.
3289 (coff_get_normalized_symtab): Free external syms directly.
3290 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3293 2020-01-27 Jim Wilson <jimw@sifive.com>
3295 * cpu-riscv.c (riscv_scan): New.
3296 (N): Change bfd_default_scan to riscv_scan.
3298 2020-01-27 Andreas Schwab <schwab@suse.de>
3300 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3301 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3302 * Makefile.in: Regenerate.
3303 * cpu-plugin.c: Remove.
3304 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3305 (bfd_plugin_arch): Remove declaration.
3306 * bfd-in2.h: Regenerate.
3307 * po/SRC-POTFILES.in: Regenerate.
3309 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
3310 Alan Modra <amodra@gmail.com>
3313 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3315 2020-01-24 Jim Wilson <jimw@sifive.com>
3317 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3318 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3319 avoid over long line.
3321 2020-01-24 Nick Clifton <nickc@redhat.com>
3324 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3325 syms and keep strings flags as these may have been set in order to
3326 prevent a bogus call to free.
3328 2020-01-23 Nick Clifton <nickc@redhat.com>
3330 * po/fr.po: Updated French translation.
3332 2020-01-23 Alan Modra <amodra@gmail.com>
3335 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3336 by zero when p_align is zero.
3338 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3340 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3341 (riscv_prefix_cmp): Likewise.
3342 (riscv_non_std_ext_p): Deleted.
3343 (riscv_std_sv_ext_p): Likewise.
3344 (riscv_non_std_sv_ext_p): Likewise.
3345 (riscv_merge_non_std_and_sv_ext): Rename to...
3346 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3347 (riscv_merge_arch_attr_info): Replace 3 calls to
3348 riscv_merge_non_std_and_sv_ext with single call to
3349 riscv_merge_multi_letter_ext.
3350 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3351 encounter a 'z' prefix.
3352 (riscv_get_prefix_class): New function, return prefix class based
3353 on first few characters of input string.
3354 (riscv_parse_config): New structure to factor out minor differences
3355 in extension class parsing behaviour.
3356 (riscv_parse_sv_or_non_std_ext): Rename to...
3357 (riscv_parse_prefixed_ext): and parameterise with
3359 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3360 (riscv_multi_letter_ext_valid_p): New.
3361 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3362 (riscv_parse_subset): Delegate all non-single-letter parsing work
3363 to riscv_parse_prefixed_ext.
3364 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3365 (riscv_get_prefix_class): Declare.
3367 2020-01-22 Alan Modra <amodra@gmail.com>
3369 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3370 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3371 __tls_get_addr_desc.
3372 (ppc64_elf_size_stubs): Add section for linker generated
3373 __tls_get_addr_desc wrapper function. Loop at least once if
3374 generating this function.
3375 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3376 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3378 2020-01-22 Alan Modra <amodra@gmail.com>
3380 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3381 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3383 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3384 (STDU_R1_0R1, ADDI_R1_R1): Define.
3385 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3386 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3387 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3388 no_tls_get_addr_regsave.
3389 (branch_reloc_hash_match): Add hash3 and hash4.
3390 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3391 (ppc64_elf_size_dynamic_sections): Likewise.
3392 (ppc64_elf_relocate_section): Likewise.
3393 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3394 __tls_get_addr stub.
3395 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3397 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3398 eh_frame for regsave __tls_get_addr.
3400 2020-01-22 Alan Modra <amodra@gmail.com>
3402 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3403 which __tls_get_addr calls will be eliminated.
3405 2020-01-20 Nick Clifton <nickc@redhat.com>
3407 * po/pt.po: Updates Portuguese translation.
3408 * po/ru.po: Updated Russian translation.
3409 * po/uk.po: Updated Ukranian translation.
3411 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3414 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3415 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3417 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3418 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3419 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3420 "rex leal x@tlsdesc(%rip), %reg" to
3421 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3422 "call *(%eax)" to "nopl (%rax)".
3424 2020-01-20 Alan Modra <amodra@gmail.com>
3426 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3427 (MTLR_R11): Don't define.
3428 (LD_R0_0R3, CMPDI_R0_0): Define.
3429 (build_tls_get_addr_stub): Don't use r11 in stub.
3431 2020-01-20 Alan Modra <amodra@gmail.com>
3433 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3434 (defined_sym_val, is_tls_get_addr): Likewise.
3436 2020-01-18 Nick Clifton <nickc@redhat.com>
3438 * version.m4 (BFD_VERSION): Set to 2.34.50.
3439 * configure: Regenerate.
3440 * po/bfd.pot: Regenerate.
3442 2020-01-18 Nick Clifton <nickc@redhat.com>
3444 Binutils 2.34 branch created.
3446 2020-01-17 Christian Biesinger <cbiesinger@google.com>
3448 * coff-arm.c: Fix spelling error (seperate).
3449 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3451 * sysdep.h (strnlen): Fix spelling error (seperate).
3453 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
3456 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3458 2020-01-15 Alan Modra <amodra@gmail.com>
3461 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3462 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3463 of function symbols unless dot symbols are present. Do warn
3464 whenever one is created, regardles of whether a PLT entry is
3465 also emitted for the function symbol.
3467 2020-01-14 Alan Modra <amodra@gmail.com>
3469 * som.c (som_bfd_count_ar_symbols): Error when file position
3470 of symbols on chains is not strictly increasing.
3472 2020-01-14 Alan Modra <amodra@gmail.com>
3474 * vms.h (VMS_DEBUG): Define as 0.
3475 * vms-alpha.c (image_write): Move debug output after bounds check.
3477 (_bfd_vms_slurp_eihd): Warning fix.
3478 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
3480 2020-01-13 Alan Modra <amodra@gmail.com>
3482 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
3483 for "ignored" records.
3485 2020-01-13 Alan Modra <amodra@gmail.com>
3487 * wasm-module.c (wasm_scan_name_function_section): Formatting.
3488 Delete asect name check. Move asect NULL check to wasm_object_p.
3489 Correct bounds check of sizes against end. Replace uses of
3490 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
3491 just one bfd_release.
3492 (wasm_scan): Don't use malloc/strdup for section names,
3493 bfd_alloc instead. Simplify code prefixing section name.
3494 Formatting. Don't attempt to free memory here..
3495 (wasm_object_p): ..do so here.
3497 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
3500 * elf32-arm.c (elf32_arm_final_link_relocate): Use
3501 UNDEFWEAK_NO_DYNAMIC_RELOC.
3502 (allocate_dynrelocs_for_symbol): Likewise.
3504 2020-01-10 Tamar Christina <tamar.christina@arm.com>
3507 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3509 2020-01-10 Alan Modra <amodra@gmail.com>
3511 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3513 2020-01-09 Nick Clifton <nickc@redhat.com>
3516 * bfd.c (bfd_convert_section_contents): Check for a compress
3517 header size that is larger than the actual section size.
3519 2020-01-08 Alan Modra <amodra@gmail.com>
3522 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3523 after removing sections.
3525 2020-01-06 Jim Wilson <jimw@sifive.com>
3528 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3529 check for !bfd_link_pic (info).
3530 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3531 <R_RISCV_JAL>: Add comment.
3532 (_bfd_riscv_relax_section): For plt.offset check, add check for
3533 bfd_link_pic (info). Add comment.
3535 2020-01-06 Alan Modra <amodra@gmail.com>
3537 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3538 match failures. Don't init to bfd_error_wrong_format before
3539 calling _bfd_check_format.
3541 2020-01-06 Alan Modra <amodra@gmail.com>
3543 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3544 status rather than exiting on stack overflow or underflow.
3545 (_bfd_vms_slurp_etir): Adjust to suit.
3547 2020-01-06 Alan Modra <amodra@gmail.com>
3549 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3551 2020-01-06 Alan Modra <amodra@gmail.com>
3553 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3554 command. Check name offset is within command.
3555 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3556 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3557 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3558 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3559 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3560 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3561 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3562 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3563 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3564 (bfd_mach_o_read_segment): Similarly.
3565 (bfd_mach_o_read_thread): Properly bound check thread struct.
3566 Don't repeat checks on second loop.
3567 (bfd_mach_o_read_command): Fail on invalid command length.
3569 2020-01-04 Alan Modra <amodra@gmail.com>
3571 * format.c (bfd_check_format_matches): Add preserve_match.
3572 Save initial bfd state in "preserve", matched bfd state in
3573 "preserve_match". Save just the first match. Release
3574 bfd_alloc memory. Restore and finish preserved state as
3575 appropriate on all function exit paths.
3577 2020-01-04 Alan Modra <amodra@gmail.com>
3579 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3581 2020-01-04 Alan Modra <amodra@gmail.com>
3583 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3586 2020-01-03 Nick Clifton <nickc@redhat.com>
3589 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3590 there is enough data remaining in the code buffer before
3591 attempting to read a function stub.
3593 2020-01-03 Nick Clifton <nickc@redhat.com>
3596 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3597 return value from bfd_malloc.
3598 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3599 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3600 (elf32_arm_filter_cmse_symbols): Likewise.
3601 (elf32_arm_write_section): Likewise.
3602 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3603 (bfd_mach_o_follow_dsym): Likewise.
3604 * pef.c (bfd_pef_print_loader_section): Likewise.
3605 (bfd_pef_scan_start_address): Likewise.
3606 (bfd_pef_parse_function_stubs): Likewise.
3607 (bfd_pef_parse_symbols): Likewise.
3609 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3611 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3612 on binary inputs ld/PR25316.
3613 (is_ia64_elf): new helper to filter on ia64 objects.
3615 2020-01-03 Jan Beulich <jbeulich@suse.com>
3617 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3619 (bfd_mach_o_scan): Insert underscore in two variable names.
3621 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3623 * Makefile.am: Add z80-elf target support.
3624 * configure.ac: Likewise.
3625 * targets.c: Likewise.
3626 * Makefile.in: Regenerate.
3627 * configure: Regenerate.
3628 * config.bfd: Add z80-elf target support and new arches: ez80 and
3630 * elf32-z80.c: New file.
3631 * archures.c: Add new z80 architectures: eZ80 and Z180.
3632 * coffcode.h: Likewise.
3633 * cpu-z80.c: Likewise.
3634 * coff-z80.c: Add new relocations for Z80 target and local label
3636 * reloc.c: Add new relocs.
3637 * bfd-in2.h: Regenerate.
3638 * libbfd.h: Regenerate.
3640 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3644 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3646 2020-01-01 Alan Modra <amodra@gmail.com>
3648 Update year range in copyright notice of all files.
3650 For older changes see ChangeLog-2019
3652 Copyright (C) 2020 Free Software Foundation, Inc.
3654 Copying and distribution of this file, with or without modification,
3655 are permitted in any medium without royalty provided the copyright
3656 notice and this notice are preserved.
3662 version-control: never