1 2020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
3 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
4 win32pstatus note type to avoid signedness comparison warning.
6 2020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
8 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
9 win32pstatus notes, and return TRUE so we continue rather than
10 stopping as if it was an error.
12 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
14 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
16 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
18 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
19 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
20 appropriate size constraint for each win32pstatus note type.
22 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
24 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
25 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
28 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
30 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
31 (elfcore_grok_win32pstatus): Use.
33 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
35 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
36 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
37 offsets used to read NOTE_INFO_PROCESS.
39 2020-08-12 Nick Clifton <nickc@redhat.com>
41 * po/ru.po: Updated Russian translation.
42 * po/sr.po: Updated Serbian translation.
44 2020-08-07 David Faust <david.faust@oracle.com>
46 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
47 DISP16 and DISP32 relocations.
49 2020-08-05 David Faust <david.faust@oracle.com>
51 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
52 (bpf_elf_howto_table): Use it here.
53 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
54 instruction and data relocations.
56 2020-08-03 Alan Modra <amodra@gmail.com>
58 * vms-lib.c (vms_traverse_index): Sanity check size remaining
59 before accessing vms_idx or vms_elfidx.
61 2020-08-03 Alan Modra <amodra@gmail.com>
64 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
65 size against file size. Correct LONG_MAX limit check.
66 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
67 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
68 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
69 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
70 bfd_malloc_and_get_section.
72 2020-07-31 Alan Modra <amodra@gmail.com>
75 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
76 IR symbols to become dynamic.
77 (elf_link_add_object_symbols): Don't exclude IR symbols when
78 deciding whether an as-needed shared library is needed.
80 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
83 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
85 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
87 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
89 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
90 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
91 Don't define _STRUCTURED_PROC.
92 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
93 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
94 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
95 * configure, config.in: Regenerate.
96 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
97 * Makefile.in, doc/Makefile.in: Regenerate.
99 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
101 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
102 (elf_link_hash_table): Add sym_cache.
103 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
104 (elf32_arm_check_relocs): Updated.
105 (elf32_arm_size_dynamic_sections): Likewise.
106 * elf32-bfin.c (bfin_link_hash_table): Removed.
107 (bfin_link_hash_newfunc): Updated.
108 (bfin_hash_table): Removed.
109 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
110 (csky_elf_check_relocs): Updated.
111 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
112 (elf32_hppa_check_relocs): Updated.
113 * elf32-i386.c (elf_i386_tls_transition): Updated.
114 (elf_i386_convert_load_reloc): Likewise.
115 (elf_i386_check_relocs): Likewise.
116 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
117 (m32r_elf_hash_table): Updated.
118 (m32r_elf_link_hash_table_create): Likewise.
119 (m32r_elf_create_dynamic_sections): Likewise.
120 (m32r_elf_adjust_dynamic_symbol): Likewise.
121 (allocate_dynrelocs): Likewise.
122 (m32r_elf_size_dynamic_sections): Likewise.
123 (m32r_elf_relocate_section): Likewise.
124 (m32r_elf_finish_dynamic_symbol): Likewise.
125 (m32r_elf_check_relocs): Likewise.
126 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
128 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
129 (elf_m68k_check_relocs): Updated.
130 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
131 (elf_metag_check_relocs): Updated.
132 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
133 (microblaze_elf_check_relocs): Updated.
134 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
135 (nds32_elf_create_dynamic_sections): Likewise.
136 (nds32_elf_adjust_dynamic_symbol): Likewise.
137 (nds32_elf_check_relocs): Likewise.
138 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
139 srelbss and aym_cache.
140 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
141 (nios2_elf32_check_relocs): Updated.
142 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
143 (or1k_elf_check_relocs): Updated.
144 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
145 (ppc_elf_check_relocs): Updated.
146 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
147 (elf_s390_check_relocs): Updated.
148 (elf_s390_finish_dynamic_sections): Likewise.
149 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
151 (sh_elf_create_dynamic_sections): Updated.
152 (sh_elf_adjust_dynamic_symbol): Likewise.
153 (sh_elf_size_dynamic_sections): Likewise.
154 (sh_elf_check_relocs): Likewise.
155 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
156 (elf32_tic6x_check_relocs): Updated.
157 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
158 (tilepro_elf_hash_table): Updated.
159 (tilepro_elf_link_hash_table_create): Likewise.
160 (tilepro_elf_check_relocs): Likewise.
161 (tilepro_elf_adjust_dynamic_symbol): Likewise.
162 (allocate_dynrelocs): Likewise.
163 (tilepro_elf_size_dynamic_sections): Likewise.
164 (tilepro_elf_relocate_section): Likewise.
165 (tilepro_elf_finish_dynamic_symbol): Likewise.
166 (tilepro_finish_dyn): Likewise.
167 (tilepro_elf_finish_dynamic_sections): Likewise.
168 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
169 (ppc64_elf_before_check_relocs): Updated.
170 (ppc64_elf_check_relocs): Likewise.
171 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
172 (elf_s390_check_relocs): Updated.
173 (elf_s390_relocate_section): Likewise.
174 (elf_s390_finish_dynamic_sections): Likewise.
175 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
176 (elf_x86_64_check_relocs): Likewise.
177 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
179 (elfNN_aarch64_check_relocs): Updated.
180 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
181 (riscv_elf_check_relocs): Updated.
182 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
183 (mips_elf_resolve_got_page_ref): Updated.
184 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
185 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
187 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
188 (tilegx_elf_check_relocs): Updated.
189 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
191 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
193 * elflink.c (bfd_elf_final_link): Give local symbols a name if
195 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
196 return TRUE if making ET_REL output.
198 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
200 * elf-bfd.h (elf_backend_data): Add
201 `elf_backend_elfsym_local_is_section' member.
202 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
204 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
205 * elflink.c (bfd_elf_final_link): Use it to determine whether
206 set the `.symtab' section's `sh_info' value to the index of the
207 first non-local or non-section symbol.
208 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
210 (elf_backend_elfsym_local_is_section): New macro.
211 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
213 (elf_backend_elfsym_local_is_section): New macro.
215 2020-07-29 Alan Modra <amodra@gmail.com>
217 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
218 defined in excluded sections.
220 2020-07-28 Alan Modra <amodra@gmail.com>
222 * elf.c (assign_section_numbers): Comment. Don't segfault on
223 discarded sections when setting linked-to section for generic
225 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
227 2020-07-27 Alan Modra <amodra@gmail.com>
229 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
231 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
234 2020-07-24 Nick Clifton <nickc@redhat.com>
236 * config.bfd: Move xc16x target to the obsolete list.
238 2020-07-22 Kevin Buettner <kevinb@redhat.com>
240 * binary.c (binary_get_section_contents): Seek using offset
241 from section's file position.
243 2020-07-22 Kevin Buettner <kevinb@redhat.com>
245 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
247 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
250 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
251 type for the first function argument. Rename pointers to reflect
252 that they have distinct types.
254 2020-07-20 Alan Modra <amodra@gmail.com>
256 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
258 2020-07-19 Alan Modra <amodra@gmail.com>
260 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
261 (select_alt_stub): New function.
262 (ppc_get_stub_entry): Use it here.
263 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
265 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
266 merge notoc stubs with other varieties when power10_stubs is "auto".
267 Instead dup the stub hash table entry.
268 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
269 tests of power10_stubs.
271 2020-07-15 Alan Modra <amodra@gmail.com>
274 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
276 2020-07-15 Nick Clifton <nickc@redhat.com>
279 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
280 check for aux entries that overflow the buufer.
282 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
284 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
285 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
287 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
288 Alan Modra <amodra@gmail.com>
291 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
292 objects both before and after normal object files.
293 * elflink.c (_bfd_elf_section_already_linked): Likewise.
295 2020-07-10 Alan Modra <amodra@gmail.com>
297 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
298 * elf64-ppc.c (struct ppc_link_hash_table): Delete
300 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
301 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
302 uses of power10_stubs.
304 2020-07-09 Alan Modra <amodra@gmail.com>
306 * coff-ppc.c: Delete.
309 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
310 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
312 (coff_write_object_contents): Remove PPC_PE code.
313 * config.bfd: Move powerpcle-pe to removed targets.
314 * configure.ac: Remove powerpc PE entries.
315 * libcoff-in.h (ppc_allocate_toc_section): Delete.
316 (ppc_process_before_allocation): Delete.
317 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
318 * targets.c: Remove powerpc PE vectors.
319 * po/SRC-POTFILES.in: Regenerate.
320 * libcoff.h: Regenerate.
321 * Makefile.in: Regenerate.
322 * configure: Regenerate.
324 2020-07-09 Nick Clifton <nickc@redhat.com>
326 * po/fr.po: Updated French translation.
328 2020-07-07 Alan Modra <amodra@gmail.com>
330 * xcofflink.c (xcoff_mark): Don't mark const sections.
331 (bfd_xcoff_record_link_assignment): Add FIXME.
332 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
333 sections being discarded by linker script.
335 2020-07-07 Alan Modra <amodra@gmail.com>
337 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
338 time, uid, gid and mode for deterministic archive.
339 (xcoff_write_archive_contents_big): Likewise.
341 2020-07-07 Alan Modra <amodra@gmail.com>
343 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
346 2020-07-06 Nick Clifton <nickc@redhat.com>
348 * po/pt.po: Updated Portuguese translation.
349 * po/uk.po: Updated Ukranian translation.
351 2020-07-04 Nick Clifton <nickc@redhat.com>
353 * version.m4: Set version to 2.35.50.
354 * configure: Regenerate.
355 * po/bbfd.pot: Regenerate.
357 2020-07-04 Nick Clifton <nickc@redhat.com>
359 Binutils 2.35 branch created.
361 2020-07-01 Alan Modra <amodra@gmail.com>
364 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
365 raw syment index before dereferencing.
367 2020-07-01 Alan Modra <amodra@gmail.com>
369 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
371 2020-07-01 Alan Modra <amodra@gmail.com>
373 * config.bfd: Obsolete xc16x.
375 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
377 * archures.c (bfd_mach_i386_nacl): Removed.
378 (bfd_mach_i386_i386_nacl): Likewise.
379 (bfd_mach_x86_64_nacl): Likewise.
380 (bfd_mach_x64_32_nacl): Likewise.
381 * config.bfd: Remove *-*-nacl* targets.
382 * configure.ac: Remove x86 NaCl target vectors.
383 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
384 (bfd_x64_32_nacl_arch): Likewise.
385 (bfd_x86_64_nacl_arch): Likewise.
386 (bfd_i386_nacl_arch): Likewise.
387 (bfd_x64_32_arch_intel_syntax): Updated.
388 * elf32-i386.c: Don't include "elf-nacl.h".
389 (elf_i386_nacl_plt): Removed.
390 (elf_i386_nacl_plt0_entry): Likewise.
391 (elf_i386_nacl_plt_entry): Likewise.
392 (elf_i386_nacl_pic_plt0_entry): Likewise.
393 (elf_i386_nacl_pic_plt_entry): Likewise.
394 (elf_i386_nacl_eh_frame_plt): Likewise.
395 (elf_i386_nacl_plt): Likewise.
396 (elf32_i386_nacl_elf_object_p): Likewise.
397 (elf_i386_get_synthetic_symtab): Updated.
398 (elf_i386_link_setup_gnu_properties): Likewise.
399 * elf64-x86-64.c: Don't include "elf-nacl.h".
400 (elf_x86_64_nacl_plt): Removed.
401 (elf64_x86_64_nacl_elf_object_p): Likewise.
402 (elf_x86_64_nacl_plt0_entry): Likewise.
403 (elf_x86_64_nacl_plt_entry): Likewise.
404 (elf_x86_64_nacl_eh_frame_plt): Likewise.
405 (elf_x86_64_nacl_plt): Likewise.
406 (elf32_x86_64_nacl_elf_object_p): Likewise.
407 (elf_x86_64_get_synthetic_symtab): Updated.
408 (elf_x86_64_link_setup_gnu_properties): Likewise.
409 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
410 * targets.c: Remove x86 NaCl target vectors.
411 * bfd-in2.h: Regenerated.
412 * configure: Likewise.
414 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
416 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
417 _bfd_elf_add_dynamic_tags.
419 2020-06-29 Alan Modra <amodra@gmail.com>
421 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
422 return value of bfd_bread. Don't read more than requested length.
423 Sanity check length. Properly terminate file name.
425 2020-06-29 Alan Modra <amodra@gmail.com>
427 * arc-got.h: Use C style comments.
428 * coff-z80.c: Likewise.
429 * elf32-csky.c: Likewise.
430 * peXXigen.c: Likewise.
431 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
434 2020-06-26 Pat Bernardi <bernardi@adacore.com>
436 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
437 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
439 2020-06-26 Alan Modra <amodra@gmail.com>
441 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
442 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
443 (riscv_get_priv_spec_name): Move to..
444 * cpu-riscv.c: ..here.
445 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
446 Use %u to print unsigned numbers.
448 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
450 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
451 default architecture.
453 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
456 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
457 _bfd_elf_add_dynamic_tags.
459 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
462 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
463 _bfd_elf_add_dynamic_tags.
465 2020-06-24 Alan Modra <amodra@gmail.com>
467 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
468 shifts without undefined behaviour.
470 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
472 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
474 (_bfd_elf_add_dynamic_tags): New.
475 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
476 _bfd_elf_add_dynamic_tags.
477 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
478 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
479 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
480 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
481 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
482 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
483 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
484 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
486 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
487 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
488 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
489 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
490 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
491 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
492 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
493 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
494 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
496 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
497 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
498 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
499 _bfd_elf_maybe_vxworks_add_dynamic_tags.
500 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
501 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
503 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
504 (_bfd_x86_elf_size_dynamic_sections): Likewise.
505 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
506 dt_reloc_sz and dt_reloc_ent.
507 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
508 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
510 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
511 etab.dt_pltgot_required.
512 (elf32_hppa_size_dynamic_sections): Call
513 _bfd_elf_add_dynamic_tags.
514 * elf32-metag.c (elf_metag_link_hash_table_create): Set
515 etab.dt_pltgot_required.
516 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
517 * elf32-sh.c (sh_elf_link_hash_table_create): Set
518 root.dt_pltgot_required for FDPIC output.
519 (sh_elf_size_dynamic_sections): Call
520 _bfd_elf_maybe_vxworks_add_dynamic_tags.
521 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
522 elf.dt_pltgot_required.
523 (elf_xtensa_size_dynamic_sections): Call
524 _bfd_elf_add_dynamic_tags.
525 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
526 root.dt_pltgot_required.
527 (elf64_hppa_size_dynamic_sections): Call
528 _bfd_elf_add_dynamic_tags.
529 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
530 root.dt_pltgot_required.
531 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
532 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
533 * elflink.c (_bfd_elf_add_dynamic_tags): New.
535 2020-06-22 Saagar Jha <saagar@saagarjha.com>
537 * mach-o.c: Support the new load commands by reading a linkedit
538 data command for them.
540 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
542 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
543 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
544 (riscv_get_priv_spec_class): Likewise.
545 (riscv_get_priv_spec_name): Likewise.
546 (riscv_get_priv_spec_class_from_numbers): New function, convert
547 the version numbers into string, then call riscv_get_priv_spec_class
548 to get the priv spec class.
549 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
550 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
551 (riscv_get_priv_spec_name): Likewise.
552 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
553 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
554 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
555 of input and output objects form their priv spec attributes by
556 riscv_get_priv_spec_class_from_numbers. Report warning rather than
557 errors when linking objects with differnet priv spec versions. We do
558 know v1.9.1 may have conflicts to other versions, so report the
559 warning, too. After that, update the output priv spec version to the
562 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
564 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
565 priv attributes, we will check the conflicts for all of them (major,
566 minor and revision), and then set the priv_attrs_merged to TRUE to
567 indicate that we have handled all of the priv attributes. Remove
568 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
570 2020-06-21 Alan Modra <amodra@gmail.com>
573 * configure.ac: Disable plugins by default for some targets.
574 * plugin.c: Comment typo fix.
575 * configure: Regenerate.
577 2020-06-19 Nick Clifton <nickc@redhat.com>
579 * plugin.c (try_load_plugin): Suppress the error message about
580 being unable to open a plugin if creating a list of viable
583 2020-06-16 Alan Modra <amodra@gmail.com>
585 * aout-tic30.c: Delete file.
586 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
587 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
588 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
589 (xc16x-*-elf): Sort properly.
590 * configure.ac: Remove tic30_aout_vec.
591 * targets.c: Likewise.
592 * Makefile.in: Regenerate.
593 * configure: Regenerate.
594 * po/SRC-POTFILES.in: Regenerate.
596 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
598 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
599 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
600 (elf32xtensa_abi): New global variable.
601 (xtensa_abi_choice): New function.
602 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
603 XSHAL_ABI to select PLT code.
605 2020-06-15 Roland McGrath <mcgrathr@google.com>
607 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
608 field of bfd_link_info.
610 2020-06-15 Alan Modra <amodra@gmail.com>
612 * config.bfd: Obsolete powerpcle-*-pe targets.
614 2020-06-15 Alan Modra <amodra@gmail.com>
617 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
618 symbols that were defined in discarded sections.
619 * cofflink.c (coff_link_check_archive_element): Likewise.
620 (coff_link_add_symbols): Set indx to -3 for symbols defined in
622 (_bfd_coff_write_global_sym): Don't emit such symbols.
623 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
624 libcoff.h: Regenerate.
626 2020-06-11 Alan Modra <amodra@gmail.com>
629 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
631 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
633 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
634 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
635 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
638 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
641 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
642 Clear verinfo.verdef.
644 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
647 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
648 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
649 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
651 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
652 Set ifunc_resolvers if there are FUNC resolvers.
653 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
654 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
655 with elf.ifunc_resolvers.
656 (write_plt_relocs_for_local_syms): Likewise.
657 (ppc64_elf_relocate_section): Likewise.
658 (ppc64_elf_finish_dynamic_sections): Likewise.
659 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
661 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
662 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
663 instead of readonly_dynrelocs_against_ifunc.
664 * elfxx-x86.h (elf_x86_link_hash_table): Remove
665 readonly_dynrelocs_against_ifunc.
667 2020-06-09 Alan Modra <amodra@gmail.com>
669 * elf64-ppc.c (struct ppc_link_hash_table): Delete
670 maybe_local_ifunc_resolver field.
671 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
672 cases where maybe_local_ifunc_resolver was set.
673 (ppc64_elf_relocate_section): Likewise.
674 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
677 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
679 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
681 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
683 (elf32_arm_size_dynamic_sections): Updated. Clear
684 root.tlsdesc_plt for DF_BIND_NOW.
685 (elf32_arm_finish_dynamic_sections): Updated.
686 (elf32_arm_output_arch_local_syms): Likewise.
687 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
688 Clear root.tlsdesc_plt for DF_BIND_NOW.
689 (nds32_elf_finish_dynamic_sections): Updated.
690 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
691 dt_tlsdesc_plt and dt_tlsdesc_got.
692 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
693 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
694 tlsdesc_plt and dt_tlsdesc_got.
695 (elfNN_aarch64_allocate_dynrelocs): Updated.
696 (elfNN_aarch64_finish_dynamic_sections): Likewise.
697 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
698 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
700 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
701 (_bfd_x86_elf_size_dynamic_sections): Likewise.
702 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
703 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
706 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
708 * elf32-tic6x.c (elf32_bed): Defined the default to
711 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
713 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
715 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
716 root.splt/root.srelplt.
717 (elf64_hppa_create_dynamic_sections): Likewise.
718 (elf64_hppa_size_dynamic_sections): Likewise.
719 (elf64_hppa_finish_dynamic_symbol): Likewise.
720 (elf_hppa_final_link): Likewise.
721 (elf_hppa_final_link_relocate): Likewise.
723 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
725 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
726 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
729 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
731 * elf-bfd.h (elf_target_os): New.
732 (elf_link_hash_table): Add target_os.
733 (elf_backend_data): Add target_os.
734 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
735 symbian_p and nacl_p.
736 (create_got_section): Updated.
737 (elf32_arm_create_dynamic_sections): Likewise.
738 (arm_type_of_stub): Likewise.
739 (elf32_arm_create_or_find_stub_sec): Likewise.
740 (elf32_arm_allocate_plt_entry): Likewise.
741 (elf32_arm_populate_plt_entry): Likewise.
742 (elf32_arm_final_link_relocate): Likewise.
743 (elf32_arm_check_relocs): Likewise.
744 (allocate_dynrelocs_for_symbol): Likewise.
745 (elf32_arm_finish_dynamic_symbol): Likewise.
746 (elf32_arm_finish_dynamic_sections): Likewise.
747 (elf32_arm_output_plt_map_1): Likewise.
748 (elf32_arm_output_arch_local_syms): Likewise.
749 (elf32_arm_add_symbol_hook): Likewise.
750 (elf32_arm_nacl_link_hash_table_create): Likewise.
751 (elf32_arm_vxworks_link_hash_table_create): Likewise.
752 (elf32_arm_symbian_link_hash_table_create): Likewise.
753 (ELF_TARGET_OS): New.
754 * elf32-i386.c (elf_i386_arch_bed): Removed.
755 (elf_backend_arch_data): Likewise.
756 (elf_i386_solaris_arch_bed): Likewise.
757 (elf_i386_nacl_arch_bed): Likewise.
758 (elf_i386_vxworks_arch_bed): Likewise.
759 (elf_i386_relocate_section): Updated.
760 (elf_i386_finish_dynamic_sections): Likewise.
761 (elf_i386_get_synthetic_symtab): Likewise.
762 (elf_i386_link_setup_gnu_properties): Likewise.
763 (ELF_TARGET_OS): New.
764 * elf32-mips.c (ELF_TARGET_OS): New.
765 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
766 (ppc_elf_create_got): Updated.
767 (ppc_elf_create_dynamic_sections): Likewise.
768 (ppc_elf_check_relocs): Likewise.
769 (ppc_elf_adjust_dynamic_symbol): Likewise.
770 (ppc_elf_size_dynamic_sections): Likewise.
771 (ppc_elf_relocate_section): Likewise.
772 (ppc_elf_finish_dynamic_sections): Likewise.
773 (ppc_elf_vxworks_link_hash_table_create): Likewise.
774 (ELF_TARGET_OS): New.
775 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
776 (sh_elf_link_hash_table_create): Updated.
777 (sh_elf_create_dynamic_sections): Likewise.
778 (allocate_dynrelocs): Likewise.
779 (sh_elf_size_dynamic_sections): Likewise.
780 (sh_elf_relocate_section): Likewise.
781 (sh_elf_finish_dynamic_symbol): Likewise.
782 (sh_elf_finish_dynamic_sections): Likewise.
783 (ELF_TARGET_OS): New.
784 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
786 (bfd_elf32_bfd_link_hash_table_create): Likewise.
787 (ELF_TARGET_OS): New.
788 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
789 (elf_x86_64_solaris_arch_bed): Likewise.
790 (elf_x86_64_nacl_arch_bed): Likewise.
791 (elf_x86_64_finish_dynamic_sections): Updated.
792 (elf_x86_64_get_synthetic_symtab): Likewise.
793 (elf_x86_64_link_setup_gnu_properties): Likewise.
794 (ELF_TARGET_OS): New.
795 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
797 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
798 (MIPS_ELF_REL_DYN_NAME): Updated.
799 (ELF_MIPS_GP_OFFSET): Likewise.
800 (mips_elf_create_local_got_entry): Likewise.
801 (mips_elf_allocate_dynamic_relocations): Likewise.
802 (mips_elf_count_got_symbols): Likewise.
803 (is_gott_symbol): Likewise.
804 (mips_elf_calculate_relocation): Likewise.
805 (mips_elf_create_dynamic_relocation): Likewise.
806 (_bfd_mips_elf_check_relocs): Likewise.
807 (allocate_dynrelocs): Likewise.
808 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
809 (mips_elf_lay_out_got): Likewise.
810 (mips_elf_set_plt_sym_value): Likewise.
811 (_bfd_mips_elf_size_dynamic_sections): Likewise.
812 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
813 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
814 (_bfd_mips_elf_final_link): Likewise.
815 (_bfd_mips_init_file_header): Likewise.
816 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
818 (allocate_dynrelocs): Likewise.
819 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
820 (_bfd_sparc_elf_relocate_section): Likewise.
821 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
822 (sparc_finish_dyn): Likewise.
823 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
824 * elfxx-target.h (ELF_TARGET_OS): New.
825 (elfNN_bed): Add ELF_TARGET_OS.
826 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
827 (_bfd_x86_elf_link_hash_table_create): Likewise.
828 (_bfd_x86_elf_size_dynamic_sections): Likewise.
829 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
830 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
831 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
832 * elfxx-x86.h (elf_x86_target_os): Removed.
833 (elf_x86_backend_data): Likewise.
834 (get_elf_x86_backend_data): Likewise.
835 (elf_x86_link_hash_table): Remove target_os.
837 2020-06-06 Alan Modra <amodra@gmail.com>
840 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
841 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
842 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
843 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
844 * elf64-ppc.c: Update throughout for reloc renaming.
845 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
846 * libbfd.h: Regenerate.
847 * bfd-in2.h: Regenerate.
849 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
852 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
855 2020-06-05 Nick Clifton <nickc@redhat.com>
857 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
860 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
862 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
863 priv_may_conflict, in_priv_zero and out_priv_zero to decide
864 whether the object can be linked according to it's priv
865 attributes. The object without any priv spec attributes can
866 be linked with others. If the first input object doesn't contain
867 any priv attributes, then we need to copy the setting from the
868 next input one. Also report more detailed error messages to user.
870 2020-06-04 Stephen Casner <casner@acm.org>
872 Extend pdp11-aout symbol table format to accommodate .stab
873 symbols and implement correct handling of them.
875 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
876 (N_STAB, is_stab): Needed new function is_stab to disambiguate
877 normal vs. .stab symbol table type values, replacing N_STAB mask.
878 (translate_from_native_sym_flags): Determine correct section for
879 different .stab types.
880 (translate_to_native_sym_flags): Leave .stab types intact.
881 (translate_symbol_table): Error if symbol indicates overlay;
882 store desc field from .stab symbols.
883 (write_syms): Output desc field with symbol.
884 (aout_link_check_ar_symbols): Skip .stab symbols.
885 (aout_link_add_symbols): Correctly distinguish .stab symbols.
886 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
887 (aout_link_write_symbols): Write 0 for desk and ovly fields;
888 correctly distinguish .stab symbols and select calculate their
889 section and value; and copy desc and ovly fields from input symbol
892 2020-06-04 Stephen Casner <casner@acm.org>
894 * aoutx.h (translate_symbol_table): Comment had external and
896 * pdp11.c (translate_symbol_table): Likewise.
898 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
900 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
901 (is_x86_elf): Check elf.hash_table_id instead of target_id.
902 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
904 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
907 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
908 in debug section against symbol defined in shared library to 0.
909 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
910 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
911 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
912 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
913 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
914 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
915 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
916 * elf32-sh.c (sh_elf_check_relocs): Likewise.
917 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
918 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
919 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
920 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
921 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
922 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
924 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
925 there is non-GOT reference.
926 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
927 non-alloced sections.
929 2020-06-03 Stephen Casner <casner@acm.org>
931 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
933 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
935 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
936 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
937 other size that doesn't qcover the header word.
938 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
939 string table, and zero it.
940 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
941 message and set bfd_error on finding an invalid name string offset.
942 (add_to_stringtab): INLINE -> inline
943 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
945 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
946 any relocs that could not be recognised.
947 92744f05809 PR 20929 - Check for relocs without an associated symbol.
948 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
949 name exists and is long enough, before attempting to see if it is
951 c3864421222 - Correct case for N_SO being the last symbol.
952 50455f1ab29 PR 20891 - Handle the case where the main file name
953 and the directory name are both empty.
954 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
955 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
956 range string table offsets.
957 531336e3a0b PR 20909 - Fix off-by-one error in check for an
958 illegal string offset.
959 (aout_link_includes_newfunc): Add comment.
960 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
961 on unexpected relocation type rather than ASSERT.
963 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
966 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
967 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
969 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
972 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
973 non-alloced sections.
975 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
977 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
978 dynamic relocations for non SEC_ALLOC sections.
980 2020-06-03 Gunther Nikl <gnikl@justmail.de>
982 * aout64.c (BMAGIC, QMAGIC): Do not define.
983 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
984 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
985 to check the file format.
986 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
987 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
988 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
990 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
992 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
993 relocations for non SEC_ALLOC sections.
995 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
997 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
998 * elf32-arm.c (maybe_set_textrel): Removed.
999 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
1000 with _bfd_elf_maybe_set_textrel.
1001 * elf32-csky.c (maybe_set_textrel): Removed.
1002 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
1003 with _bfd_elf_maybe_set_textrel.
1004 * elf32-hppa.c (maybe_set_textrel): Removed.
1005 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
1006 with _bfd_elf_maybe_set_textrel.
1007 * elf32-lm32.c (maybe_set_textrel): Removed.
1008 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
1009 with _bfd_elf_maybe_set_textrel.
1010 * elf32-m32r.c (maybe_set_textrel): Removed.
1011 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
1012 with _bfd_elf_maybe_set_textrel.
1013 * elf32-metag.c (maybe_set_textrel): Removed.
1014 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
1015 with _bfd_elf_maybe_set_textrel.
1016 * elf32-nds32.c (maybe_set_textrel): Removed.
1017 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
1018 with _bfd_elf_maybe_set_textrel.
1019 * elf32-or1k.c (maybe_set_textrel): Removed.
1020 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
1021 with _bfd_elf_maybe_set_textrel.
1022 * elf32-ppc.c (maybe_set_textrel): Removed.
1023 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
1024 with _bfd_elf_maybe_set_textrel.
1025 * elf32-s390.c (maybe_set_textrel): Removed.
1026 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1027 with _bfd_elf_maybe_set_textrel.
1028 * elf32-sh.c (maybe_set_textrel): Removed.
1029 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
1030 with _bfd_elf_maybe_set_textrel.
1031 * elf32-tic6x.c (maybe_set_textrel): Removed.
1032 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
1033 with _bfd_elf_maybe_set_textrel.
1034 * elf32-tilepro.c (maybe_set_textrel): Removed.
1035 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
1036 with _bfd_elf_maybe_set_textrel.
1037 * elf64-ppc.c (maybe_set_textrel): Removed.
1038 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
1039 with _bfd_elf_maybe_set_textrel.
1040 * elf64-s390.c (maybe_set_textrel): Removed.
1041 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1042 with _bfd_elf_maybe_set_textrel.
1043 * elfnn-aarch64.c (maybe_set_textrel): Removed.
1044 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
1045 with _bfd_elf_maybe_set_textrel.
1046 * elfnn-riscv.c (maybe_set_textrel): Removed.
1047 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
1048 with _bfd_elf_maybe_set_textrel.
1049 * elfxx-sparc.c (maybe_set_textrel): Removed.
1050 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
1051 with _bfd_elf_maybe_set_textrel.
1052 * elfxx-tilegx.c (maybe_set_textrel): Removed.
1053 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
1054 with _bfd_elf_maybe_set_textrel.
1055 * elfxx-x86.c (maybe_set_textrel): Removed.
1056 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
1057 with _bfd_elf_maybe_set_textrel.
1058 * elflink.c (_bfd_elf_maybe_set_textrel): New.
1060 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1063 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
1065 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
1066 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
1067 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
1068 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
1070 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
1071 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
1072 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
1073 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1074 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
1075 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
1076 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1077 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
1078 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
1079 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1080 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
1081 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1082 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
1083 (elf_backend_copy_indirect_symbol): Likewise.
1084 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
1085 (elf_backend_copy_indirect_symbol): Likewise.
1086 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
1088 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1091 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
1092 * elf32-arm.c (readonly_dynrelocs): Removed.
1093 (maybe_set_textrel): Replace readonly_dynrelocs with
1094 _bfd_elf_readonly_dynrelocs.
1095 * elf32-csky.c (readonly_dynrelocs): Removed.
1096 (maybe_set_textrel): Replace readonly_dynrelocs with
1097 _bfd_elf_readonly_dynrelocs.
1098 * elf32-hppa.c(readonly_dynrelocs): Removed.
1099 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1100 _bfd_elf_readonly_dynrelocs.
1101 (maybe_set_textrel): Likewise.
1102 * elf32-lm32.c (readonly_dynrelocs): Removed.
1103 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1104 with _bfd_elf_readonly_dynrelocs.
1105 (maybe_set_textrel): Likewise.
1106 * elf32-m32r.c (readonly_dynrelocs): Removed.
1107 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1108 with _bfd_elf_readonly_dynrelocs.
1109 (maybe_set_textrel): Likewise.
1110 * elf32-metag.c (readonly_dynrelocs): Removed.
1111 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
1112 with _bfd_elf_readonly_dynrelocs.
1113 (maybe_set_textrel): Likewise.
1114 * elf32-microblaze.c (readonly_dynrelocs): Removed.
1115 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1116 with _bfd_elf_readonly_dynrelocs.
1117 * elf32-nds32.c (readonly_dynrelocs): Removed.
1118 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1119 with _bfd_elf_readonly_dynrelocs.
1120 (maybe_set_textrel): Likewise.
1121 * elf32-or1k.c (readonly_dynrelocs): Removed.
1122 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1123 with _bfd_elf_readonly_dynrelocs.
1124 * elf32-ppc.c (readonly_dynrelocs): Removed.
1125 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1126 _bfd_elf_readonly_dynrelocs.
1127 (ppc_elf_adjust_dynamic_symbol): Likewise.
1128 (maybe_set_textrel): Likewise.
1129 * elf32-s390.c (readonly_dynrelocs): Removed.
1130 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1131 with _bfd_elf_readonly_dynrelocs.
1132 (maybe_set_textrel): Likewise.
1133 * elf32-sh.c (readonly_dynrelocs): Removed.
1134 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
1135 _bfd_elf_readonly_dynrelocs.
1136 (maybe_set_textrel): Likewise.
1137 * elf32-tic6x.c (readonly_dynrelocs): Removed.
1138 (maybe_set_textrel): Replace readonly_dynrelocs with
1139 _bfd_elf_readonly_dynrelocs.
1140 * elf32-tilepro.c (readonly_dynrelocs): Removed.
1141 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1142 with _bfd_elf_readonly_dynrelocs.
1143 (maybe_set_textrel): Likewise.
1144 * elf64-ppc.c (readonly_dynrelocs): Removed.
1145 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1146 _bfd_elf_readonly_dynrelocs.
1147 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1148 (maybe_set_textrel): Likewise.
1149 * elf64-s390.c (readonly_dynrelocs): Removed.
1150 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1151 with _bfd_elf_readonly_dynrelocs.
1152 (maybe_set_textrel): Likewise.
1153 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
1154 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
1155 (maybe_set_textrel): Replace readonly_dynrelocs with
1156 _bfd_elf_readonly_dynrelocs.
1157 * elfnn-riscv.c (readonly_dynrelocs): Removed.
1158 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1159 with _bfd_elf_readonly_dynrelocs.
1160 (maybe_set_textrel): Likewise.
1161 * elfxx-sparc.c (readonly_dynrelocs): Removed.
1162 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
1163 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
1164 (maybe_set_textrel): Likewise.
1165 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
1166 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1167 with _bfd_elf_readonly_dynrelocs.
1168 (maybe_set_textrel): Likewise.
1169 * elfxx-x86.c (readonly_dynrelocs): Removed.
1170 (maybe_set_textrel): Replace readonly_dynrelocs with
1171 _bfd_elf_readonly_dynrelocs.
1172 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1174 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1176 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
1177 -fsanitize=undefined.
1179 2020-06-03 Alan Modra <amodra@gmail.com>
1183 * peicode.h (pe_ILF_make_a_section): Align data for compilers
1185 (pe_ILF_build_a_bfd): Likewise.
1187 2020-06-03 Alan Modra <amodra@gmail.com>
1190 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
1191 core files as well as objects.
1193 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
1196 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
1197 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
1199 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
1200 (elf_arc_link_hash_newfunc): Updated.
1201 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
1202 (elf32_arm_link_hash_newfunc): Updated.
1203 (elf32_arm_copy_indirect_symbol): Likewise.
1204 (elf32_arm_check_relocs): Likewise.
1205 (readonly_dynrelocs): Likewise.
1206 (allocate_dynrelocs_for_symbol): Likewise.
1207 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
1208 (csky_elf_link_hash_newfunc): Updated.
1209 (csky_allocate_dynrelocs): Likewise.
1210 (readonly_dynrelocs): Likewise.
1211 (csky_elf_copy_indirect_symbol): Likewise.
1212 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
1213 (hppa_link_hash_newfunc): Updated.
1214 (elf32_hppa_copy_indirect_symbol): Likewise.
1215 (elf32_hppa_hide_symbol): Likewise.
1216 (elf32_hppa_adjust_dynamic_symbol): Likewise.
1217 (allocate_dynrelocs): Likewise.
1218 (elf32_hppa_relocate_section): Likewise.
1219 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1220 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
1221 (lm32_elf_link_hash_newfunc): Likewise.
1222 (lm32_elf_link_hash_table_create): Updated.
1223 (readonly_dynrelocs): Likewise.
1224 (allocate_dynrelocs): Likewise.
1225 (lm32_elf_copy_indirect_symbol): Likewise.
1226 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
1227 (m32r_elf_link_hash_newfunc): Likewise.
1228 (m32r_elf_link_hash_table_create): Updated.
1229 (m32r_elf_copy_indirect_symbol): Likewise.
1230 (allocate_dynrelocs): Likewise.
1231 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
1232 (metag_link_hash_newfunc): Updated.
1233 (elf_metag_copy_indirect_symbol): Likewise.
1234 (readonly_dynrelocs): Likewise.
1235 (allocate_dynrelocs): Likewise.
1236 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
1238 (link_hash_newfunc): Updated.
1239 (microblaze_elf_check_relocs): Likewise.
1240 (microblaze_elf_copy_indirect_symbol): Likewise.
1241 (readonly_dynrelocs): Likewise.
1242 (allocate_dynrelocs): Likewise.
1243 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
1244 (nds32_elf_link_hash_newfunc): Updated.
1245 (nds32_elf_copy_indirect_symbol): Likewise.
1246 (readonly_dynrelocs): Likewise.
1247 (allocate_dynrelocs): Likewise.
1248 (nds32_elf_check_relocs): Likewise.
1249 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
1250 (link_hash_newfunc): Updated.
1251 (nios2_elf32_copy_indirect_symbol): Likewise.
1252 (nios2_elf32_check_relocs): Likewise.
1253 (allocate_dynrelocs): Likewise.
1254 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
1255 (or1k_elf_link_hash_newfunc): Updated.
1256 (readonly_dynrelocs): Likewise.
1257 (allocate_dynrelocs): Likewise.
1258 (or1k_elf_copy_indirect_symbol): Likewise.
1259 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
1260 (ppc_elf_link_hash_newfunc): Updated.
1261 (ppc_elf_copy_indirect_symbol): Likewise.
1262 (ppc_elf_check_relocs): Likewise.
1263 (readonly_dynrelocs): Likewise.
1264 (ppc_elf_adjust_dynamic_symbol): Likewise.
1265 (allocate_dynrelocs): Likewise.
1266 (ppc_elf_relocate_section): Likewise.
1267 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1268 (link_hash_newfunc): Updated.
1269 (elf_s390_copy_indirect_symbol): Likewise.
1270 (readonly_dynrelocs): Likewise.
1271 (elf_s390_adjust_dynamic_symbol): Likewise.
1272 (allocate_dynrelocs): Likewise.
1273 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
1274 (sh_elf_link_hash_newfunc): Updated.
1275 (readonly_dynrelocs): Likewise.
1276 (allocate_dynrelocs): Likewise.
1277 (sh_elf_copy_indirect_symbol): Likewise.
1278 (sh_elf_check_relocs): Likewise.
1279 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
1280 (elf32_tic6x_link_hash_newfunc): Likewise.
1281 (elf32_tic6x_link_hash_table_create): Updated.
1282 (readonly_dynrelocs): Likewise.
1283 (elf32_tic6x_check_relocs): Likewise.
1284 (elf32_tic6x_allocate_dynrelocs): Likewise.
1285 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
1287 (link_hash_newfunc): Updated.
1288 (tilepro_elf_copy_indirect_symbol): Likewise.
1289 (tilepro_elf_check_relocs): Likewise.
1290 (allocate_dynrelocs): Likewise.
1291 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
1292 (ppc64_elf_copy_indirect_symbol): Updated.
1293 (ppc64_elf_check_relocs): Likewise.
1294 (readonly_dynrelocs): Likewise.
1295 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1296 (dec_dynrel_count): Likewise.
1297 (allocate_dynrelocs): Likewise.
1298 (ppc64_elf_relocate_section): Likewise.
1299 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1300 (link_hash_newfunc): Updated.
1301 (elf_s390_copy_indirect_symbol): Likewise.
1302 (readonly_dynrelocs): Likewise.
1303 (allocate_dynrelocs): Likewise.
1304 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1305 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1307 (elfNN_aarch64_link_hash_newfunc): Updated.
1308 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1309 (readonly_dynrelocs): Likewise.
1310 (need_copy_relocation_p): Likewise.
1311 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1312 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1313 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1314 (link_hash_newfunc): Updated.
1315 (riscv_elf_copy_indirect_symbol): Likewise.
1316 (riscv_elf_check_relocs): Likewise.
1317 (readonly_dynrelocs): Likewise.
1318 (allocate_dynrelocs): Likewise.
1319 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1321 (link_hash_newfunc): Updated.
1322 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1323 (_bfd_sparc_elf_check_relocs): Likewise.
1324 (readonly_dynrelocs): Likewise.
1325 (allocate_dynrelocs): Likewise.
1326 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1327 (link_hash_newfunc): Updated.
1328 (tilegx_elf_copy_indirect_symbol): Likewise.
1329 (tilegx_elf_check_relocs): Likewise.
1330 (readonly_dynrelocs): Likewise.
1331 (allocate_dynrelocs): Likewise.
1332 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1333 (readonly_dynrelocs): Likewise.
1334 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1335 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1337 2020-06-01 Alan Modra <amodra@gmail.com>
1339 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1340 command against cmd_length, not the end of record. For
1341 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1342 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1345 2020-05-28 David Faust <david.faust@oracle.com>
1347 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1348 R_BPF_INSN_{32,64} relocations.
1350 2020-05-28 Stephen Casner <casner@acm.org>
1352 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1353 addreses in .long (used in testsuites) and .stab values.
1355 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1358 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1359 Check bfd_link_dll when issue a DT_TEXTREL warning.
1360 * elfxx-x86.c (maybe_set_textrel): Likewise.
1361 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1363 2020-05-26 Nick Clifton <nickc@redhat.com>
1365 * plugin.c (try_load_plugin): Extend error message when a plugin
1368 2020-05-23 Alan Modra <amodra@gmail.com>
1370 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1372 2020-05-22 Alan Modra <amodra@gmail.com>
1375 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1376 attributes from shared libraries, and do not return an error if
1379 2020-05-21 Alan Modra <amodra@gmail.com>
1382 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1384 (_bfd_delete_bfd): Free the copy.
1385 (_bfd_new_bfd): Free nbfd->memory on error.
1387 2020-05-21 Alan Modra <amodra@gmail.com>
1389 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1390 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1391 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1392 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1393 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1394 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1395 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1396 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1397 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1398 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1399 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1400 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1401 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1402 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1403 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1404 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1405 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1406 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1407 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1408 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1410 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1412 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1413 get_default_version. It is used to find the default version for
1414 the specific extension.
1415 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1416 default_major_version and default_minor_version. Add new bfd_boolean
1417 parameter *use_default_version. Set it to TRUE if we need to call
1418 the callback rps->get_default_version to find the default version.
1419 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1420 the default version in riscv_parsing_subset_version, and then call
1421 riscv_add_subset to add the subset into subset list.
1422 (riscv_parse_prefixed_ext): Likewise.
1423 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1424 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1425 strings rather than characters.
1426 riscv_merge_arch_attr_info): The callback function get_default_version
1427 is only needed for assembler, so set it to NULL int the linker.
1428 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1429 * elfxx-riscv.h: Updated.
1431 2020-05-20 Alan Modra <amodra@gmail.com>
1434 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1435 use bfd_set_filename.
1436 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1437 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1438 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1439 (bfd_create): Likewise.
1440 (_bfd_delete_bfd): Don't free filename.
1441 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1442 return pointer to the copy or NULL on alloc fail.
1443 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1444 result of bfd_set_filename.
1445 * bfd-in2.h: Regenerate.
1447 2020-05-20 Alan Modra <amodra@gmail.com>
1450 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1451 section size against file size.
1452 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1454 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1457 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1458 and memset when allocating memory for the sections_being_created
1461 2020-05-19 Stafford Horne <shorne@gmail.com>
1463 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1465 (or1k_elf_relocate_section): Access srelgot via
1466 htab->root.srelgot. Add assertions for srelgot->contents.
1467 Introduce local variable for srelgot to not reuse global
1469 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1470 (or1k_set_got_and_rela_sizes): New function.
1471 (or1k_initial_exec_offset): New function.
1472 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1473 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1475 (or1k_elf_check_relocs): Use OR to set TLS access.
1476 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1478 (or1k_elf_size_dynamic_sections): Use
1479 or1k_set_got_and_rela_sizes to set sizes.
1480 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1481 (TCB_SIZE): New macro.
1482 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1483 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1484 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1485 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1486 (tpoff): Add dynamic boolean argument.
1487 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1489 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
1491 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1492 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1493 cases with BFD_RELOC_AARCH64_JUMP26.
1494 (elfNN_aarch64_check_relocs): Likewise.
1496 2020-05-19 Alan Modra <amodra@gmail.com>
1498 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1499 bfd_get_filename rather than accessing bfd->filename directly.
1500 * aout-target.h (MY (object_p)): Likewise.
1501 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1502 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1503 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1504 (_bfd_archive_bsd44_construct_extended_name_table),
1505 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1506 (_bfd_bsd_write_armap): Likewise.
1507 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
1508 * cache.c (bfd_open_file): Likewise.
1509 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
1510 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
1511 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1512 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1513 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
1514 * elf32-nds32.c (nds32_elf_output_symbol_hook),
1515 (patch_tls_desc_to_ie): Likewise.
1516 * elf32-spu.c (sort_bfds, print_one_overlay_section),
1517 (spu_elf_auto_overlay): Likewise.
1518 * elf64-hppa.c (elf_hppa_final_link): Likewise.
1519 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
1520 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
1521 * elflink.c (bfd_elf_size_dynamic_sections),
1522 (elf_link_input_bfd): Likewise.
1523 * linker.c (_bfd_generic_link_output_symbols): Likewise.
1524 * mach-o.c (bfd_mach_o_follow_dsym),
1525 (bfd_mach_o_close_and_cleanup): Likewise.
1526 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
1527 (find_separate_debug_file, get_build_id_name): Likewise.
1528 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1529 * plugin.c (bfd_plugin_open_input): Likewise.
1530 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
1531 * som.c (som_write_armap): Likewise.
1532 * srec.c (srec_write_record, srec_write_symbols): Likewise.
1533 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1534 (_bfd_vms_lib_write_archive_contents): Likewise.
1535 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1537 2020-05-19 Alan Modra <amodra@gmail.com>
1540 * bfdio.c (_bfd_real_fopen): Typo fix.
1542 2020-05-18 Nick Clifton <nickc@redhat.com>
1545 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1546 for the sections_being_created array.
1548 2020-05-18 Alan Modra <amodra@gmail.com>
1550 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1551 they can be freed without also freeing internal_relocs.
1553 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1556 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1557 separators into DOS style when creating a WIN32 fullpath.
1559 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
1561 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1562 to initialize RISC-V tdata.
1564 2020-05-12 Gunther Nikl <gnikl@justmail.de>
1566 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1569 2020-05-11 Alan Modra <amodra@gmail.com>
1571 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1573 2020-05-11 Alan Modra <amodra@gmail.com>
1575 * elf64-ppc.c: Rename powerxx to power10 throughout.
1577 2020-05-11 Alan Modra <amodra@gmail.com>
1580 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1581 contains required number of auxents before processing any auxent.
1582 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1583 file name from auxents for PE.
1585 2020-05-04 Gunther Nikl <gnikl@justmail.de>
1587 * aout-cris.c (DEFAULT_ARCH): Delete define.
1588 (MY_set_arch_mach): Likewise.
1589 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1591 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1592 of r_type before the shift.
1594 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
1597 * elfnn-aarch64.c (group_sections): Copy implementation from
1600 2020-05-01 Alan Modra <amodra@gmail.com>
1603 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1604 accessing root.u.def of symbols. Also check root.u.def.section
1605 is non-NULL. Reverse tests so as to make the logic positive.
1607 2020-05-01 Alan Modra <amodra@gmail.com>
1610 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1611 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1613 2020-05-01 Alan Modra <amodra@gmail.com>
1616 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1617 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1618 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1619 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1620 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1621 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1622 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1623 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1624 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1625 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1627 2020-05-01 Alan Modra <amodra@gmail.com>
1630 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1631 from shared libraries.
1633 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1635 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1636 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1637 equals 0. Report overflow when the result has negative sign but
1638 all significant bits are zero.
1640 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1642 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1643 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1645 2020-04-28 Alan Modra <amodra@gmail.com>
1647 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1648 Emit warning message.
1650 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1652 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1653 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1654 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1655 to x86_64_pe_big_vec as it not a big-endian format.
1656 (vec i386_pe_big_vec): New.
1657 * configure.ac: Likewise.
1658 * targets.c: Likewise.
1659 * configure: Regenerate.
1660 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1661 COFF_WITH_PE_BIGOBJ): New.
1662 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1664 (x86_64_pe_be_vec): Moved.
1666 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1668 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1669 * elf.c (elfcore_grok_arc_v2): New function.
1670 (elfcore_grok_note): Call the new function to handle the corresponding
1672 (elfcore_write_arc_v2): New function.
1673 (elfcore_write_register_note): Call the new function to handle the
1674 corresponding pseudo-sections.
1676 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1679 * bfd-in2.h: Regenerated.
1680 * elf32-xtensa.c (elf_howto_table): New entries for
1681 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1682 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1683 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1684 R_XTENSA_NDIFF{8,16,32}.
1685 * libbfd.h (bfd_reloc_code_real_names): Add names for
1686 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1687 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1688 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1689 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1691 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1694 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1697 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1700 * elf-bfd.h (elf_backend_data): Add
1701 elf_backend_strip_zero_sized_dynamic_sections.
1702 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1703 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1705 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1707 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1709 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1711 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1713 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1715 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1717 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1719 2020-04-21 Nick Clifton <nickc@redhat.com>
1721 * po/sr.po: Updated Serbian translation.
1723 2020-04-21 Alan Modra <amodra@gmail.com>
1725 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1728 2020-04-20 Stephen Casner <casner@acm.org>
1730 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1731 causing globals from linker script to be treated as debug symbols.
1732 (translate_symbol_table): Don't sign-extend symbol values from 16
1733 to 64 bits in nm output.
1735 2020-04-20 Alan Modra <amodra@gmail.com>
1737 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1739 2020-04-18 Alan Modra <amodra@gmail.com>
1741 * section.c (bfd_is_const_section): Correct test for special
1743 * bfd-in2.h: Regenerate.
1745 2020-04-17 Alan Modra <amodra@gmail.com>
1748 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1751 2020-04-16 Nick Clifton <nickc@redhat.com>
1754 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1755 abort with a more helpful error message.
1757 2020-04-16 Alan Modra <amodra@gmail.com>
1760 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1763 2020-04-15 Fangrui Song <maskray@google.com>
1766 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1767 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1768 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1769 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1770 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1771 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1772 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1773 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1774 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1775 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1776 * elflink.c (elf_link_output_extsym): Likewise.
1777 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1779 2020-04-15 Alan Modra <amodra@gmail.com>
1782 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1783 pointer into strings that may be freed for section name, always
1784 allocate a new string.
1786 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1787 Jan W. Jagersma <jwjagersma@gmail.com>
1789 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1790 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1791 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1792 (_bfd_go32_mkobject): New functions.
1793 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1794 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1795 (go32exe_mkobject): Call _bfd_go32_mkobject.
1796 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1797 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1799 (coff_write_relocs): Enable extended reloc counter code if
1800 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1801 (coff_write_object_contents): Likewise. Pad section headers
1802 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1803 instead of coff_swap_scnhdr_out.
1804 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1805 enable extended reloc counter.
1806 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1807 Declare with ATTRIBUTE_UNUSED.
1808 * libcoff-in.h: (struct coff_tdata): New field go32.
1810 * libcoff.h: Regenerate.
1812 2020-04-14 Fangrui Song <maskray@google.com>
1815 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1818 2020-04-14 Stephen Casner <casner@acm.org>
1821 * pdp11.c: Add implementation of --imagic option.
1822 (adjust_o_magic): Fix objcopy --extract-symbol test.
1823 * libaout.h (enum aout_magic): Add i_magic.
1825 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1826 Nick Clifton <nickc@redhat.com>
1828 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1830 <default>: Error rather than abort.
1832 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1835 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1836 relocation section from section group.
1838 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1840 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1841 bfd->origin to file offset.
1842 * bfdwin.c (bfd_get_file_window): Likewise.
1843 * bfd.c: Clarify the use of the bfd->origin field.
1844 * bfd-in2.h: Regenerate.
1845 * coff-i386.c: Don't include go32exe.h. Allow overriding
1846 coff_write_object_contents via COFF_WRITE_CONTENTS.
1847 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1848 (go32exe_write_object_contents): New functions.
1849 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1850 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1851 (create_go32_stub): Remove check for 2k size limit. Read stub
1852 from go32exe_temp_stub if present.
1853 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1854 copy variable-length stub.
1855 (go32_check_format): Read stub to go32exe_temp_stub, set
1856 origin, return go32exe_cleanup.
1857 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1858 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1859 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1860 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1861 Remove functions and their associated #defines.
1862 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1863 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1864 Rename field go32stub to stub.
1865 * libcoff.h: Regenerate.
1866 * coff-stgo32.c (go32_check_format): Rename to...
1867 (go32exe_check_format): ...this.
1868 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1869 (go32exe_copy_private_bfd_data): ...this.
1870 (stub_bytes): Rename to...
1871 (go32exe_default_stub): ...this.
1872 (create_go32_stub): Rename to...
1873 (go32exe_create_stub): ...this.
1874 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1877 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1881 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1882 relocation to R_386_32 for relocation against non-preemptible
1884 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1885 allocate dynamic relocation for non-preemptible absolute symbol.
1886 (elf_i386_relocate_section): Pass sec to
1887 GENERATE_DYNAMIC_RELOCATION_P.
1888 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1889 (elf_x86_64_convert_load_reloc): Covert load relocation to
1890 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1891 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1892 for non-preemptible absolute symbol if they overflow.
1893 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1894 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1895 symbol. Don't allocate dynamic relocation for non-preemptible
1897 (elf_x86_64_relocate_section): Don't generate relative relocation
1898 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1899 to GENERATE_DYNAMIC_RELOCATION_P.
1900 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1901 against non-preemptible absolute symbol.
1902 (_bfd_elf_x86_valid_reloc_p): New function.
1903 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1905 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1906 argument. Don't generate dynamic relocation against
1907 non-preemptible absolute symbol.
1908 (ABS_SYMBOL_P): New.
1909 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1910 against non-preemptible absolute symbol.
1912 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1913 (_bfd_elf_x86_valid_reloc_p): New.
1915 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1918 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1919 address in the GOT if in thumb only mode.
1921 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1923 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1925 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1927 * mmo.c (mmo_scan): Create .text section only when needed, not
1930 2020-03-31 Alan Modra <amodra@gmail.com>
1932 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1935 2020-03-31 Alan Modra <amodra@gmail.com>
1937 * vms-alpha.c (image_write): Check bounds for sections without
1938 contents too. Error on non-zero write to section without
1940 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1942 2020-03-31 Alan Modra <amodra@gmail.com>
1944 * tekhex.c (pass_over): Check is_eof before reading buffer.
1946 2020-03-30 Nick Clifton <nickc@redhat.com>
1949 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1950 field to timestamp and make it an integer.
1951 * libcoff.h: Regenerate.
1952 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1953 field in the pe_data structure rather than the insert_timestamp
1956 2020-03-30 Alan Modra <amodra@gmail.com>
1959 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1962 2020-03-26 Nick Clifton <nickc@redhat.com>
1964 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1965 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1967 * libbfd.h: Regenerate.
1969 2020-03-26 Alan Modra <amodra@gmail.com>
1971 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1973 2020-03-26 Alan Modra <amodra@gmail.com>
1975 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1977 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1979 2020-03-25 Nick Clifton <nickc@redhat.com>
1981 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1983 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1984 * libbfd.h: Regenerate.
1986 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1988 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1989 correct field name in the output string.
1991 2020-03-25 Alan Modra <amodra@gmail.com>
1994 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1995 for SHT_NOBITS section if first in segment.
1997 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2000 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
2001 (_bfd_elf_get_symbol_version_string): This.
2002 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
2003 (_bfd_elf_get_symbol_version_string): This.
2004 (bfd_elf_print_symbol): Pass TRUE to
2005 _bfd_elf_get_symbol_version_string.
2006 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
2007 bfd_boolean argument.
2008 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
2009 * targets.c (_bfd_get_symbol_version_string): Likewise.
2010 (bfd_get_symbol_version_string): Likewise.
2011 * bfd-in2.h: Regenerated.
2013 2020-03-24 Nick Clifton <nickc@redhat.com>
2014 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2017 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
2020 2020-03-24 Nick Clifton <nickc@redhat.com>
2023 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
2024 segment to use for PT_GNU_RELRO, ignore empty sections in a
2025 segment's current list.
2027 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2030 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2032 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2035 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
2036 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
2037 on the previous _bfd_elf_get_symbol_version_string.
2038 (_bfd_elf_get_symbol_version_string): Use it.
2040 2020-03-24 Alan Modra <amodra@gmail.com>
2042 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
2043 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
2046 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
2048 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
2050 2020-03-23 Alan Modra <amodra@gmail.com>
2052 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
2053 symbol count. Allocate an extra byte to ensure name strings
2054 are terminated. Sanity check name offsets. Release memory on
2057 2020-03-23 Alan Modra <amodra@gmail.com>
2059 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
2060 field hasn't been read. Remove unnecessary casts.
2062 2020-03-22 Alan Modra <amodra@gmail.com>
2064 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
2065 enough to read number of symbols.
2067 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
2069 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
2070 (EXECUTABLE_SUFFIX): Likewise.
2071 * config.in: Regenerated.
2072 * configure: Likewise.
2073 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
2074 _bfd_generic_close_and_cleanup.
2075 (plugin_list_entry): Remove resolution_file, resolution_option,
2076 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
2077 lto_wrapper, gcc_env and initialized,
2078 (need_lto_wrapper_p): Removed.
2079 (get_lto_wrapper): Likewise.
2080 (setup_lto_wrapper_env): Likewise.
2081 (register_all_symbols_read): Likewise.
2082 (egister_cleanup): Likewise.
2083 (get_symbols): Likewise.
2084 (add_input_file): Likewise.
2085 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
2086 (add_symbols): Updated.
2087 (try_claim): Likewise.
2088 (try_load_plugin): Likewise.
2089 (bfd_plugin_canonicalize_symtab): Likewise.
2090 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
2091 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
2093 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
2096 * plugin.c (plugin_list_entry): Add has_symbol_type.
2097 (add_symbols_v2): New function.
2098 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
2099 provides symbol type.
2100 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
2101 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
2104 2020-03-20 Alan Modra <amodra@gmail.com>
2106 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
2107 enough to read number of symbols.
2109 2020-03-20 Alan Modra <amodra@gmail.com>
2111 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
2112 backend functions for NULL before calling.
2113 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
2114 (bfd_section_from_shdr, assign_section_numbers): Likewise.
2115 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
2116 * elfnn-ia64.c (ignore_errors): New function.
2117 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
2119 2020-03-19 Nick Clifton <nickc@redhat.com>
2122 * dwarf2.c (struct varinfo): Add unit_offset field to record the
2123 location of the varinfo in the unit's debug info data. Change the
2124 type of the stack field to a boolean.
2125 (lookup_var_by_offset): New function. Returns the varinfo
2126 structure for the variable described at the given offset in the
2128 (scan_unit_for_symbols): Add support for variables which have the
2129 DW_AT_specification attribute.
2131 2020-03-19 Nick Clifton <nickc@redhat.com>
2134 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
2137 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
2139 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
2141 2020-03-18 Nick Clifton <nickc@redhat.com>
2144 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
2145 memory access when processing a corrupt secondary reloc section.
2147 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
2149 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
2150 instead of calling abort.
2151 * elf32-csky.c (csky_build_one_stub): Likewise.
2152 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2153 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2154 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2155 * elf32-metag.c (metag_build_one_stub): Likewise.
2156 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2157 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2158 (ppc_size_one_stub): Likewise.
2159 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2161 2020-03-17 Nick Clifton <nickc@redhat.com>
2164 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
2165 with error messages.
2167 2020-03-17 Nick Clifton <nickc@redhat.com>
2170 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
2171 free. Add free on another failure path.
2173 2020-03-16 Alan Modra <amodra@gmail.com>
2176 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
2177 we have a non-zero section count. Do lma comparison in octets.
2179 2020-03-16 Alan Modra <amodra@gmail.com>
2181 * vms-alpha.c (dst_restore_location): Validate index into
2182 dst_ptr_offsets array before accessing. Return status.
2183 (dst_retrieve_location): Similarly, making "loc" parameter a
2184 pointer to return value.
2185 (_bfd_vms_slurp_etir): Update calls to above functions.
2187 2020-03-14 Kamil Rytarowski <n54@gmx.com>
2189 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
2191 * configure: Regenerated.
2193 2020-03-14 Alan Modra <amodra@gmail.com>
2195 * section.c (BFD_FAKE_SECTIONS): Formatting.
2196 * bfd-in2.h: Regenerate.
2198 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2200 * elf.c (elfcore_grok_netbsd_note): Add support for
2201 NT_NETBSDCORE_LWPSTATUS notes.
2203 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
2205 * bfd-in2.h: Regenerate.
2206 * section.c (asection): Add already_assigned field.
2207 (BFD_FAKE_SECTION): Add default initializer for it.
2208 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
2209 * elf32-arm.c (arm_build_one_stub): Add support for
2210 non_contiguous_regions.
2211 * elf32-csky.c (csky_build_one_stub): Likewise.
2212 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2213 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2214 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2215 * elf32-metag.c (metag_build_one_stub): Likewise.
2216 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2217 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2218 (ppc_size_one_stub): Likewise.
2219 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2220 * elflink.c (elf_link_input_bfd): Likewise.
2222 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
2225 * elf-linker-x86.h (elf_linker_x86_params): Add
2226 static_before_all_inputs and has_dynamic_linker.
2227 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2228 dynamic input objects if -static is passed at command-line
2229 before all input files without --dynamic-linker unless
2230 --no-dynamic-linker is used.
2232 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2234 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
2236 2020-03-13 Christian Eggers <ceggers@gmx.de>
2238 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
2239 "p_paddr" from "at".
2240 * elfcode.h (bfd_from_remote_memory): Add units to several
2241 parameters. New local "opb". Fix usage of p_align. Fix
2242 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
2243 call of target_read_memory.
2244 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
2245 calculation of "offset" and "output_offset".
2246 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
2247 from "offset" and fix calculation of "end" from "vma+size". Fix
2248 comparison between "sh_addr" and "vma"/"output_offset".
2249 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
2250 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
2252 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
2253 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
2254 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
2255 assignment of p_paddr from phdr_lma. Fix comparison between
2256 "lma+size" and "next->lma".
2257 (elf_sort_segments): Fix assignment from p_paddr to lma.
2258 (assign_file_positions_for_load_sections): Add unit (bytes) to
2259 local "align". Fix calculation of local "off_adjust". Fix
2260 calculation of local "filehdr_vaddr".
2261 (assign_file_positions_for_non_load_sections): New local "opb".
2262 Fix calculation of "end" from "p_size". Fix comparison between
2263 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
2264 from "end" and "p_vaddr".
2265 (rewrite_elf_program_header): Fix comparison between p_vaddr and
2266 vma. Fix assignment to p_paddr from lma. Fix comparison between
2267 p_paddr and lma. Fix assignment to p_paddr from lma.
2268 * merge.c (sec_merge_emit): New local "opb". Convert
2269 "alignment_power" to octets.
2270 (_bfd_add_merge_section): New locals "alignment_power" and
2271 "opb". Fix comparison between "alignment_power" and
2273 (_bfd_merge_sections): New local "opb". Divide size by opb
2274 before checking align mask.
2276 2020-03-13 Christian Eggers <ceggers@gmx.de>
2278 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
2279 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
2281 (_bfd_elf_make_section_from_phdr): Similarly.
2282 (elf_fake_sections): Fix calculation of
2283 Elf_Internal_shdr::sh_addr from section VMA.
2284 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
2286 (assign_file_positions_for_load_sections): Fix calculations of
2287 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
2288 comparison between program header address and section LMA.
2289 (assign_file_positions_for_non_load_sections): Likewise.
2290 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
2291 (IS_CONTAINED_BY_VMA): Add parameter opb.
2292 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
2293 INCLUDE_SECTION_IN_SEGMENT): Likewise.
2294 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
2295 Fix calculations of p_addr_valid and p_vaddr_offset.
2296 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
2297 with octets per byte when comparing against p_vaddr.
2299 2020-03-11 Alan Modra <amodra@gmail.com>
2301 * som.c (setup_sections): Sanity check subspace.name.
2303 2020-03-11 Alan Modra <amodra@gmail.com>
2305 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2307 2020-03-10 Alan Modra <amodra@gmail.com>
2310 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2313 2020-03-09 Alan Modra <amodra@gmail.com>
2315 * wasm-module.c (wasm_scan): Sanity check file name length
2316 before allocating memory. Move common section setup code. Do
2317 without bfd_tell to calculate section size.
2319 2020-03-06 Nick Clifton <nickc@redhat.com>
2321 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2322 with error messages and failure return values.
2324 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
2326 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2327 relocation sections for any removed reference to a dynamic symbol.
2329 2020-03-05 Nick Clifton <nickc@redhat.com>
2331 * elf-bfd.h (struct elf_backend_data): Add new fields:
2332 init_secondary_reloc_section, slurp_secondary_reloc_section,
2333 write_secondary_reloc_section.
2334 (_bfd_elf_init_secondary_reloc_section): Prototype.
2335 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2336 (_bfd_elf_write_secondary_reloc_section): Prototype.
2337 * elf.c ( bfd_section_from_shdr): Invoke the new
2338 init_secondary_reloc_section backend function, if defined, when a
2339 second reloc section is encountered.
2340 (swap_out_syms): Invoke the new symbol_section_index function, if
2341 defined, when computing the section index of an OS/PROC specific
2343 (_bfd_elf_init_secondary_reloc_section): New function.
2344 (_bfd_elf_slurp_secondary_reloc_section): New function.
2345 (_bfd_elf_write_secondary_reloc_section): New function.
2346 (_bfd_elf_copy_special_section_fields): New function.
2347 * elfcode.h (elf_write_relocs): Invoke the new
2348 write_secondary_relocs function, if defined, in order to emit
2350 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2351 function, if defined, in order to read in secondary relocs.
2352 * elfxx-target.h (elf_backend_copy_special_section_fields):
2353 Provide a non-NULL default definition.
2354 (elf_backend_init_secondary_reloc_section): Likewise.
2355 (elf_backend_slurp_secondary_reloc_section): Likewise.
2356 (elf_backend_write_secondary_reloc_section): Likewise.
2357 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2359 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2360 * configure: Regenerate.
2362 2020-03-05 Alan Modra <amodra@gmail.com>
2364 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2365 against file size before allocating memory. Use bfd_alloc rather
2366 than bfd_zalloc for carsym/strings memory.
2368 2020-03-04 Alan Modra <amodra@gmail.com>
2370 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2371 sh_addr mod sh_addalign is zero.
2373 2020-03-04 Alan Modra <amodra@gmail.com>
2375 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2377 2020-03-03 Alan Modra <amodra@gmail.com>
2379 * format.c (struct bfd_preserve): Add cleanup field.
2380 (bfd_preserve_save): Add cleanup param and save.
2381 (bfd_preserve_restore): Return cleanup.
2382 (bfd_preserve_finish): Call the cleanup for the discarded match.
2383 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2384 and clear when preserving a match. Restore cleanup too when
2385 restoring that match.
2387 2020-03-02 Alan Modra <amodra@gmail.com>
2389 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2390 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2391 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2392 (core_sco5_vec): Correct initialisers.
2394 2020-03-02 Alan Modra <amodra@gmail.com>
2396 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2397 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2398 * cisco-core.c (cisco_core_file_validate): Likewise.
2399 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2400 * hpux-core.c (hpux_core_core_file_p): Likewise.
2401 * irix-core.c (irix_core_core_file_p): Likewise.
2402 * lynx-core.c (lynx_core_file_p): Likewise.
2403 * netbsd-core.c (netbsd_core_file_p): Likewise.
2404 * osf-core.c (osf_core_core_file_p): Likewise.
2405 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2406 * sco5-core.c (sco5_core_file_p): Likewise.
2408 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2410 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2412 2020-03-02 Alan Modra <amodra@gmail.com>
2414 * targets.c (bfd_cleanup): New typedef.
2415 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2416 * libbfd-in.h (_bfd_no_cleanup): Define.
2417 * format.c (bfd_reinit): Add cleanup parameter, call it.
2418 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2419 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2420 * aout-target.h (callback, object_p): Return bfd_cleanup.
2421 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2422 * archive.c (bfd_generic_archive_p): Likewise.
2423 * binary.c (binary_object_p): Likewise.
2424 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2425 * coff-ia64.c (ia64coff_object_p): Likewise.
2426 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2427 * coff-sh.c (coff_small_object_p): Likewise.
2428 * coff-stgo32.c (go32_check_format): Likewise.
2429 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2430 (xcoff64_core_p): Likewise.
2431 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2432 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2433 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2434 * elfcode.h (elf_object_p): Likewise.
2435 * elfcore.h (elf_core_file_p): Likewise.
2436 * i386msdos.c (msdos_object_p): Likewise.
2437 * ihex.c (ihex_object_p): Likewise.
2438 * libaout.h (some_aout_object_p): Likewise.
2439 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2440 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2441 * libbfd.c (_bfd_dummy_target): Likewise.
2442 * libcoff-in.h (coff_object_p): Likewise.
2443 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2444 (bfd_mach_o_arm64_core_p): Likewise.
2445 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2446 (bfd_mach_o_arm_core_p): Likewise.
2447 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2448 (bfd_mach_o_i386_core_p): Likewise.
2449 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2450 (bfd_mach_o_x86_64_core_p): Likewise.
2451 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2452 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2453 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2454 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2455 * mmo.c (mmo_object_p): Likewise.
2456 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2457 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2458 (pe_bfd_object_p): Likewise.
2459 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2460 * ppcboot.c (ppcboot_object_p): Likewise.
2461 * rs6000-core.c (rs6000coff_core_p): Likewise.
2462 * som.c (som_object_setup, som_object_p): Likewise.
2463 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2464 * tekhex.c (tekhex_object_p): Likewise.
2465 * vms-alpha.c (alpha_vms_object_p): Likewise.
2466 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2467 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2468 * wasm-module.c (wasm_object_p): Likewise.
2469 * xsym.c (bfd_sym_object_p): Likewise.
2470 * xsym.h (bfd_sym_object_p): Likewise.
2471 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2473 * pdp11.c (some_aout_object_p): Likewise.
2474 * plugin.c (register_ld_plugin_object_p): Update object_p
2476 * plugin.h (register_ld_plugin_object_p): Likewise.
2477 * bfd-in2.h: Regenerate.
2478 * libbfd.h: Regenerate.
2479 * libcoff.h: Regenerate.
2481 2020-03-02 Alan Modra <amodra@gmail.com>
2483 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2484 applicable section flags.
2485 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2486 (mips_ecoff_bele_vec): Likewise.
2487 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2489 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2490 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2492 2020-03-02 Alan Modra <amodra@gmail.com>
2494 * elf32-m32r.c (m32r_elf_section_flags): New function.
2495 (elf_backend_section_flags): Define.
2496 * elf32-nds32.c (nds32_elf_section_flags): New function.
2497 (elf_backend_section_flags): Define.
2498 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2499 .sbss and .sdata sections.
2500 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2501 for SHF_V850_GPREL sections.
2502 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2504 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2505 for SHF_PARISC_SHORT sections.
2506 * elf64-ppc.c (ppc64_elf_section_flags): New function.
2507 (elf_backend_section_flags): Define.
2508 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
2509 for SHF_MIPS_GPREL sections. Delete FIXME.
2511 2020-03-02 Alan Modra <amodra@gmail.com>
2513 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
2514 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
2515 calling elf_backend_section_flags with adjusted params. Use
2516 newsect->flags past that point.
2517 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
2519 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
2520 to have their type overridden, and all sh_flags but processor and
2522 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
2523 * elf32-mep.c (mep_elf_section_flags): Likewise.
2524 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
2525 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
2526 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
2527 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
2528 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
2529 stub BFD and non-aarch64 input files when scanning for stubs.
2531 2020-03-02 Alan Modra <amodra@gmail.com>
2533 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2534 limit to decompressed element size.
2536 2020-03-02 Alan Modra <amodra@gmail.com>
2538 * vms-lib.c (vms_traverse_index): Add recur_count param and
2539 update calls. Fail on excessive recursion.
2541 2020-03-02 Alan Modra <amodra@gmail.com>
2543 * vms-alpha.c (vms_get_remaining_object_record): Use
2544 bfd_realloc_or_free rather than bfd_realloc.
2545 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2546 (dst_define_location, parse_module): Likewise, and check realloc
2547 return status before using memory. Return status from function
2548 adjusting all callers.
2550 2020-02-28 Alan Modra <amodra@gmail.com>
2552 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2554 2020-02-28 Alan Modra <amodra@gmail.com>
2556 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2557 Remove duplicate undersize check.
2559 2020-02-27 Alan Modra <amodra@gmail.com>
2562 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2564 2020-02-27 Alan Modra <amodra@gmail.com>
2567 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2568 (coff_section_type): Adjust comment.
2569 (decode_section_type): Likewise. Call coff_section_type before
2570 decode_section_type.
2571 (bfd_decode_symclass): Use 'c' for common sections other than
2574 2020-02-27 Alan Modra <amodra@gmail.com>
2576 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2579 2020-02-27 Alan Modra <amodra@gmail.com>
2581 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2582 if file is an archive element.
2583 * bfd-in2.h: Regenerate.
2585 2020-02-26 Alan Modra <amodra@gmail.com>
2587 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2588 bfd_set_error on failing test. Don't bother changing bfd_error on
2589 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2590 Check sym name is within string buffer. Use size_t for some vars.
2591 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2592 int_buf. Don't change bfd_error on file read error. Use
2593 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2594 calculations to catch overflows before they occur. malloc and
2595 free raw armap rather than using bfd_alloc. Read raw armap before
2596 allocating carsym+strings buffer.
2597 (_bfd_slurp_extended_name_table): Localize variables. Check
2598 name size against file size.
2600 2020-02-26 Alan Modra <amodra@gmail.com>
2602 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2604 2020-02-26 Alan Modra <amodra@gmail.com>
2606 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2607 malloc. Check for NULL return from bfd_malloc.
2608 (rx_table_find, rx_table_map): Likewise.
2609 (rx_set_section_contents): Check bfd_alloc return.
2610 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2612 2020-02-26 Alan Modra <amodra@gmail.com>
2614 * aoutx.h: Indent labels correctly. Format error strings.
2615 * archive.c: Likewise.
2616 * archive64.c: Likewise.
2617 * coff-arm.c: Likewise.
2618 * coff-rs6000.c: Likewise.
2619 * coff-stgo32.c: Likewise.
2620 * cpu-arm.c: Likewise.
2621 * dwarf2.c: Likewise.
2622 * elf-ifunc.c: Likewise.
2623 * elf-properties.c: Likewise.
2624 * elf-s390-common.c: Likewise.
2625 * elf-strtab.c: Likewise.
2627 * elf32-arm.c: Likewise.
2628 * elf32-bfin.c: Likewise.
2629 * elf32-cr16.c: Likewise.
2630 * elf32-csky.c: Likewise.
2631 * elf32-i386.c: Likewise.
2632 * elf32-m68k.c: Likewise.
2633 * elf32-msp430.c: Likewise.
2634 * elf32-nds32.c: Likewise.
2635 * elf32-nios2.c: Likewise.
2636 * elf32-pru.c: Likewise.
2637 * elf32-xtensa.c: Likewise.
2638 * elf64-ia64-vms.c: Likewise.
2639 * elf64-x86-64.c: Likewise.
2640 * elfcode.h: Likewise.
2641 * elfcore.h: Likewise.
2642 * elflink.c: Likewise.
2643 * elfnn-aarch64.c: Likewise.
2644 * elfnn-ia64.c: Likewise.
2645 * elfnn-riscv.c: Likewise.
2646 * elfxx-mips.c: Likewise.
2647 * elfxx-sparc.c: Likewise.
2648 * elfxx-x86.c: Likewise.
2649 * i386lynx.c: Likewise.
2650 * merge.c: Likewise.
2651 * pdp11.c: Likewise.
2652 * plugin.c: Likewise.
2653 * reloc.c: Likewise.
2655 2020-02-26 Alan Modra <amodra@gmail.com>
2658 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2660 (bfd_elf_add_dt_needed_tag): Declare.
2661 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2662 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2663 from elf_add_dt_needed_tag. Remove soname and doit param.
2664 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2665 to see whether as-needed lib is already loaded, use dyn_loaded
2666 list instead. When saving and restoring around as-needed lib
2667 handle possibility that dynstr has not been initialised. Don't
2668 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2669 Mark libs loaded via DT_NEEDED entries of other libs with
2670 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2672 (elf_link_check_versioned_symbol): Remove now unneccesary
2673 DYNAMIC check when traversing dyn_loaded list.
2675 2020-02-26 Alan Modra <amodra@gmail.com>
2677 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2679 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2682 * plugin.c (need_lto_wrapper_p): New.
2683 (bfd_plugin_set_program_name): Add an int argument to set
2685 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2687 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2689 2020-02-24 Alan Modra <amodra@gmail.com>
2691 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2693 2020-02-24 Alan Modra <amodra@gmail.com>
2695 * vms-lib.c (struct carsym_mem): Add limit.
2696 (vms_add_index): Heed limit.
2697 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2698 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2699 Always return actual number read.
2700 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2701 assertion with error exit.
2703 2020-02-22 Alan Modra <amodra@gmail.com>
2706 * elf.c (assign_file_positions_for_load_sections): Continue linking
2707 on "PHDR segment not covered by LOAD segment" errors.
2709 2020-02-21 Alan Modra <amodra@gmail.com>
2711 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2713 (bfd_mach_o_canonicalize_reloc): Likewise.
2714 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2715 counts and offsets against file size.
2716 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2717 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2718 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2719 against file size. Delete symbol table error message.
2720 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2722 (bfd_mach_o_read_symtab): Likewise.
2723 (bfd_mach_o_read_command): Pass file size.
2724 (bfd_mach_o_scan): Sanity check command count against file size.
2726 2020-02-21 Alan Modra <amodra@gmail.com>
2729 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2730 "text", "data" and "bss" section pointer vars. Don't update
2731 section size, just exec header sizes.
2732 (adjust_sizes_and_vmas): Don't update text section size. Set
2733 initial exec header a_text. Print exec headers sizes.
2734 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2735 (adjust_sizes_and_vmas): Similarly. Formatting.
2736 (final_link): Correct final file extension.
2738 2020-02-20 Nick Clifton <nickc@redhat.com>
2740 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2742 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2744 (elfNN_bed): Initialise the symbol_section_index field.
2745 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2746 OS and PROC specific section indicies. Warn if converting other
2747 reserved incidies to SHN_ABS.
2749 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2752 * cpu-z80.c: Add machine type compatibility checking.
2754 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2757 * plugin.c (plugin_list_entry): Remove handle.
2758 (try_load_plugin): Call dlclose before return.
2760 2020-02-19 Alan Modra <amodra@gmail.com>
2762 * libbfd-in.h (_bfd_constant_p): Define.
2763 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2764 file size before allocating memory.
2765 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2766 * elf.c (bfd_elf_get_str_section): Likewise.
2767 (_bfd_elf_slurp_version_tables): Likewise.
2768 * libbfd.h: Regenerate.
2770 2020-02-19 Alan Modra <amodra@gmail.com>
2772 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2773 * aoutx.h (aout_get_external_symbols): Replace calls to
2774 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2775 (slurp_reloc_table): Likewise.
2776 * archive.c (do_slurp_bsd_armap): Likewise.
2777 (do_slurp_coff_armap): Likewise.
2778 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2779 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2780 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2781 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2782 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2783 (_bfd_coff_get_external_symbols): Likewise.
2784 * ecoff.c (ecoff_slurp_symbolic_header),
2785 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2786 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2787 (ecoff_indirect_link_order): Likewise.
2788 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2789 (_bfd_elf_slurp_version_tables): Likewise.
2790 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2791 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2792 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2793 * elf64-alpha.c (READ): Likewise.
2794 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2795 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2796 * elfcode.h (elf_slurp_symbol_table),
2797 (elf_slurp_reloc_table_from_section): Likewise.
2798 * elflink.c (elf_link_add_object_symbols),
2799 (elf_link_check_versioned_symbol): Likewise.
2800 * elfxx-mips.c (READ): Likewise.
2801 * i386lynx.c (slurp_reloc_table): Likewise.
2802 * lynx-core.c (lynx_core_file_p): Likewise.
2803 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2804 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2805 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2806 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2807 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2808 (bfd_pef_parse_symbols): Likewise.
2809 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2810 * som.c (setup_sections, som_slurp_string_table),
2811 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2812 (som_bfd_fill_in_ar_symbols): Likewise.
2813 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2814 (evax_bfd_print_image): Likewise.
2815 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2816 * wasm-module.c (wasm_scan): Likewise.
2817 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2818 * xsym.c (bfd_sym_read_name_table),
2819 (bfd_sym_print_type_information_table_entry): Likewise.
2820 * libbfd.h: Regenerate.
2822 2020-02-19 Alan Modra <amodra@gmail.com>
2824 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2825 reading external relocs.
2826 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2827 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2829 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2831 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2832 (m32c_elf_relax_section): Likewise.
2833 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2834 (rl78_elf_relax_section): Likewise.
2835 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2836 (elf32_rx_relax_section): Likewise.
2837 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2838 parameter types and use..
2839 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2840 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2841 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2842 being read from file, just the extra.
2843 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2844 after reading external syms. Free on failure.
2846 2020-02-19 Alan Modra <amodra@gmail.com>
2848 * coffcode.h (buy_and_read, coff_slurp_line_table),
2849 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2850 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2851 corresponding bfd_alloc call. Adjust variables to suit.
2852 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2853 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2854 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2855 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2856 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2857 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2858 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2859 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2860 * elf64-alpha.c (READ): Likewise.
2861 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2862 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2863 (bfd_from_remote_memory): Likewise.
2864 * elfcore.h (core_find_build_id): Likewise.
2865 * elfxx-mips.c (READ): Likewise.
2866 * mach-o.c (bfd_mach_o_mangle_sections),
2867 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2868 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2869 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2870 * som.c (setup_sections, som_prep_for_fixups)
2871 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2872 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2873 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2874 (som_bfd_ar_write_symbol_stuff): Likewise.
2875 * vms-alpha.c (vector_grow1): Likewise.
2876 * vms-lib.c (vms_add_index): Likewise.
2877 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2878 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2879 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2880 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2881 (bfd_alloc2, bfd_zalloc2): Delete.
2882 (_bfd_mul_overflow): Define.
2883 * libbfd.h: Regenerate.
2885 2020-02-19 Alan Modra <amodra@gmail.com>
2887 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2889 (assign_section_numbers): Likewise.
2890 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2891 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2892 bfd_malloc2, size_t amt, and unsigned tls_count.
2893 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2894 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2895 (elf_output_implib): Use bfd_alloc.
2897 2020-02-19 Alan Modra <amodra@gmail.com>
2899 * bfd.c (struct bfd): Move format and direction to other
2900 bitfields. Add "size".
2901 * bfdio.c (bfd_get_size): Cache size when not writing file.
2902 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2903 returning zero, ie. unknown.
2904 (bfd_get_alt_debug_link_info): Likewise.
2905 * bfd-in2.h: Regenerate.
2907 2020-02-19 Alan Modra <amodra@gmail.com>
2909 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2910 bfd_get_file_size twice.
2911 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2912 zero, ie. unknown, return.
2913 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2914 * elfcode.h (elf_swap_shdr_in): Likewise.
2915 (elf_object_p): Don't call bfd_get_file_size twice and correct
2918 2020-02-19 Alan Modra <amodra@gmail.com>
2920 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2921 FALSE if memory alloc fails. Adjust calls.
2922 * som.c (som_prep_for_fixups): Likewise.
2923 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2924 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2925 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2926 * som.c (som_build_and_write_symbol_table): Return via error_return
2928 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2929 (VEC_APPEND_EL): Delete.
2930 (vector_grow1): Return pointer to element. Catch overflow.
2931 Return NULL on memory allocation failure.
2932 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2933 (alpha_vms_add_fixup_ca): Likewise.
2934 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2936 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2938 2020-02-19 Alan Modra <amodra@gmail.com>
2940 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2941 * aout-target.h (object_p): Likewise.
2942 * aout-tic30.c (tic30_aout_object_p): Likewise.
2943 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2944 (emit_stringtab, write_syms, link_hash_table_create),
2945 (aout_link_write_other_symbol): Likewise.
2946 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2947 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2948 (_bfd_compute_and_write_armap): Likewise.
2949 * archures.c (bfd_arch_list): Likewise.
2950 * bfd.c (bfd_record_phdr): Likewise.
2951 * binary.c (binary_canonicalize_symtab): Likewise.
2952 * cisco-core.c (cisco_core_file_validate): Likewise.
2953 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2954 (find_arm_glue, record_arm_to_thumb_glue),
2955 (record_thumb_to_arm_glue): Likewise.
2956 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2957 (ppc_allocate_toc_section): Likewise.
2958 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2959 * coff-sh.c (sh_relax_section): Likewise.
2960 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2961 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2962 (coff_set_alignment_hook, coff_mkobject),
2963 (coff_compute_section_file_positions): Likewise.
2964 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2965 (coff_find_nearest_line_with_names),
2966 ( bfd_coff_set_symbol_class): Likewise.
2967 * cofflink.c (_bfd_coff_link_hash_table_create),
2968 (_bfd_coff_link_input_bfd): Likewise.
2969 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2970 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2971 (build_line_info_table, sort_line_sequences),
2972 (line_info_add_include_dir, line_info_add_file_name),
2973 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2974 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2975 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2976 (_bfd_ecoff_find_nearest_line),
2977 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2978 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2979 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2980 * elf-m10300.c (mn10300_elf_relax_section),
2981 (elf32_mn10300_link_hash_table_create): Likewise.
2982 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2983 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2984 * elf32-arm.c (elf32_arm_link_hash_table_create),
2985 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2986 (elf32_arm_new_section_hook): Likewise.
2987 * elf32-avr.c (elf_avr_new_section_hook),
2988 (elf32_avr_link_hash_table_create, get_local_syms),
2989 (elf32_avr_setup_section_lists): Likewise.
2990 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2991 (bfin_link_hash_table_create): Likewise.
2992 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2993 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2994 * elf32-csky.c (csky_elf_link_hash_table_create),
2995 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2996 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2997 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2998 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2999 * elf32-i386.c (elf_i386_check_relocs): Likewise.
3000 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
3001 * elf32-m32r.c (m32r_elf_link_hash_table_create),
3002 (m32r_elf_check_relocs): Likewise.
3003 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
3004 (elf32_m68hc11_setup_section_lists),
3005 (elf32_m68hc11_size_stubs): Likewise.
3006 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
3007 * elf32-metag.c (elf_metag_link_hash_table_create),
3008 (elf_metag_setup_section_lists): Likewise.
3009 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
3010 (microblaze_elf_check_relocs): Likewise.
3011 * elf32-nds32.c (nds32_elf_link_hash_table_create),
3012 (nds32_elf_check_relocs): Likewise.
3013 * elf32-nios2.c (nios2_elf32_setup_section_lists),
3014 (get_local_syms, nios2_elf32_check_relocs),
3015 (nios2_elf32_link_hash_table_create): Likewise.
3016 * elf32-or1k.c (or1k_elf_link_hash_table_create),
3017 (or1k_elf_check_relocs): Likewise.
3018 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
3019 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
3020 * elf32-s390.c (elf_s390_link_hash_table_create),
3021 (elf_s390_check_relocs): Likewise.
3022 * elf32-score.c (score_elf_create_got_section),
3023 (s3_elf32_score_new_section_hook),
3024 (elf32_score_link_hash_table_create): Likewise.
3025 * elf32-score7.c (score_elf_create_got_section),
3026 (s7_elf32_score_new_section_hook): Likewise.
3027 * elf32-sh.c (sh_elf_link_hash_table_create),
3028 (sh_elf_check_relocs): Likewise.
3029 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
3030 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
3031 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
3032 (tilepro_elf_check_relocs): Likewise.
3033 * elf32-v850.c (remember_hi16s_reloc): Likewise.
3034 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
3035 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
3036 (elf_xtensa_new_section_hook): Likewise.
3037 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
3038 (get_got_entry, elf64_alpha_check_relocs): Likewise.
3039 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
3040 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
3041 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
3042 * elf64-ppc.c (ppc64_elf_new_section_hook),
3043 (ppc64_elf_link_hash_table_create, update_local_sym_info),
3044 (update_plt_info, ppc64_elf_check_relocs): Likewise.
3045 * elf64-s390.c (elf_s390_link_hash_table_create),
3046 (elf_s390_check_relocs): Likewise.
3047 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
3048 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
3049 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
3050 (elf_link_add_archive_symbols, compute_bucket_count),
3051 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
3052 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
3053 (bfd_elf_final_link): Likewise.
3054 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
3055 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
3056 (elfNN_aarch64_new_section_hook): Likewise.
3057 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
3058 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
3059 (riscv_elf_check_relocs): Likewise.
3060 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
3061 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
3062 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
3063 (_bfd_mips_elf_link_hash_table_create): Likewise.
3064 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
3065 (_bfd_sparc_elf_check_relocs),
3066 (_bfd_sparc_elf_new_section_hook): Likewise.
3067 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
3068 (tilegx_elf_check_relocs): Likewise.
3069 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
3070 * format.c (bfd_check_format_matches): Likewise.
3071 * hash.c (_bfd_stringtab_init): Likewise.
3072 * ihex.c (ihex_scan): Likewise.
3073 * irix-core.c (irix_core_core_file_p): Likewise.
3074 * linker.c (bfd_wrapped_link_hash_lookup),
3075 (_bfd_generic_link_hash_table_create),
3076 (_bfd_generic_reloc_link_order): Likewise.
3077 * lynx-core.c (lynx_core_file_p): Likewise.
3078 * netbsd-core.c (netbsd_core_file_p): Likewise.
3079 * osf-core.c (osf_core_core_file_p): Likewise.
3080 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
3081 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
3082 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
3083 * peicode.h (pe_mkobject): Likewise.
3084 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
3085 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3086 * sco5-core.c (read_uarea): Likewise.
3087 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
3088 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
3089 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
3090 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
3091 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
3092 * srec.c (srec_scan): Likewise.
3093 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
3094 * targets.c (bfd_target_list): Likewise.
3095 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
3096 * trad-core.c (trad_unix_core_file_p): Likewise.
3097 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
3098 (vms_new_section_hook): Likewise.
3099 * wasm-module.c (wasm_make_empty_symbol): Likewise.
3100 * xcofflink.c (xcoff_get_section_contents),
3101 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
3102 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
3103 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
3105 2020-02-19 Alan Modra <amodra@gmail.com>
3107 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
3109 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
3111 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
3112 and use it if it isn't NULL. Remove has_plugin_p argument. Add
3113 a build_list_p argument. Don't search plugin_list. Short circuit
3114 when building the plugin list.
3115 (has_plugin): Renamed to has_plugin_list.
3116 (bfd_plugin_set_plugin): Don't set has_plugin.
3117 (bfd_plugin_specified_p): Check plugin_list instead.
3118 (build_plugin_list): New function.
3119 (load_plugin): Call build_plugin_list and use plugin_list.
3121 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3124 * plugin.c (try_claim): Always clean up for LTO wrapper.
3125 (try_load_plugin): Treat each object as independent. Create a
3126 copy for plugin name.
3128 2020-02-11 Nick Clifton <nickc@redhat.com>
3130 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
3131 for addresses in print statements.
3132 (msp430_elf_relax_delete_bytes): Likewise.
3133 (msp430_elf_relax_add_words): Likewise.
3134 (msp430_elf_relax_section): Likewise.
3136 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3138 * plugin.c (add_symbols): Clear plugin_data memory.
3140 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
3143 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
3144 (EXECUTABLE_SUFFIX): Likewise.
3145 * config.in: Regenerated.
3146 * configure: Likewise.
3147 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
3148 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
3149 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
3150 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
3151 (get_lto_wrapper): New.
3152 (setup_lto_wrapper_env): Likewise.
3153 (current_plugin): Likewise.
3154 (register_all_symbols_read): Likewise.
3155 (register_cleanup): Likewise.
3156 (get_symbols): Likewise.
3157 (add_input_file): Likewise.
3158 (bfd_plugin_close_and_cleanup): Likewise.
3159 (claim_file): Removed.
3160 (register_claim_file): Set current_plugin->claim_file.
3161 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
3162 lto_syms in current_plugin.
3163 (try_claim): Use current_plugin->claim_file. Call LTO plugin
3164 all_symbols_read handler. Copy real symbols to plugin_data.
3165 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
3166 (try_load_plugin): Don't reuse the previous plugin for LTO
3167 wrapper. Set up GCC LTO wrapper if possible. Don't set
3168 plugin_list_iter->claim_file.
3169 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
3171 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
3174 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3176 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
3177 check if previous instruction matches a conditional jump inserted
3178 earlier. Invert conditional jump and delete branch in this case.
3180 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3182 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
3183 msp430_elf_relax_add_words. Support insertion of either one or two
3185 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
3186 needs to be grown. Handle insertion of branch instruction to replace
3189 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3191 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
3192 debugging relocations.
3193 (msp430_elf_relax_delete_bytes): Likewise.
3194 (msp430_elf_relax_add_two_words): Likewise.
3195 (msp430_elf_relax_section): Likewise.
3197 2020-02-10 Alan Modra <amodra@gmail.com>
3199 * archures.c: Wrap overlong z80 comments.
3200 * bfd-in2.h: Regenerate.
3202 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
3205 * archures.c: Add GBZ80 and Z80N machine values.
3206 * reloc.c: Add BFD_RELOC_Z80_16_BE.
3207 * coff-z80.c: Add support for new reloc.
3208 * coffcode.h: Add support for new machine values.
3209 * cpu-z80.c: Add support for new machine names.
3210 * elf32-z80.c: Add support for new reloc.
3211 * bfd-in2.h: Regenerate.
3212 * libbfd.h: Regenerate.
3214 2020-02-07 Nick Clifton <nickc@redhat.com>
3217 * elf.c (rewrite_elf_program_header): Do not complain if no
3218 sections are mapped to a segment.
3220 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3223 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
3224 for garbage collection on __patchable_function_entries section
3225 without linked-to section.
3227 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3230 * bfd-in2.h: Regenerated.
3231 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
3232 on section if gc_mark of any of its linked-to sections is set
3233 and don't set gc_mark again.
3234 * section.c (asection): Add linked_to_symbol_name to map_head
3237 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
3239 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
3240 reporting an unrecognized instruction with R_V850_LONGJUMP.
3242 2020-02-05 Alan Modra <amodra@gmail.com>
3244 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
3246 2020-02-04 Alan Modra <amodra@gmail.com>
3248 * elf32-ppc.c (ppc_elf_relocate_section): After applying
3249 R_PPC_VLE_ADDR20, goto copy_reloc.
3251 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3253 * bfd-in2.h: Regenerated.
3254 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
3256 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3259 * bfd-in2.h: Regenerated.
3260 * ecoff.c (bfd_debug_section): Add section_id.
3261 * section.c (bfd_section): Add section_id.
3262 (SEC_ASSEMBLER_SECTION_ID): New.
3263 (BFD_FAKE_SECTION): Add section_id.
3265 2020-02-01 Nick Clifton <nickc@redhat.com>
3267 * config.bfd: Move the c30-aout and tic30-aout targets onto the
3270 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
3272 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
3273 encodings are relative to the GOT on nios2, too.
3275 2020-01-31 Alan Modra <amodra@gmail.com>
3277 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
3278 file. Use $< and $@ in rules.
3279 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
3280 (elf32-ia64.c, elf64-ia64.c): Likewise.
3281 (elf32-riscv.c, elf64-riscv.c): Likewise.
3282 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3283 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
3284 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
3285 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
3286 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3287 * Makefile.in: Regenerate.
3289 2020-01-31 Alan Modra <amodra@gmail.com>
3292 * elf.c (setup_group): Don't clear entire section contents,
3293 just the padding after group flags. Release alloc'd memory
3294 after a seek or read failure.
3296 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3298 * peXXigen.c (pe_is_repro): New function.
3299 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
3300 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
3302 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3304 * peXXigen.c (debug_type_names): Add names for new debug data type
3307 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3309 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3310 inner loop. Fix a memory leak.
3312 2020-01-30 Alan Modra <amodra@gmail.com>
3314 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3315 or obj_coff_keep_strings here.
3316 (coff_get_normalized_symtab): Free external syms directly.
3317 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3320 2020-01-27 Jim Wilson <jimw@sifive.com>
3322 * cpu-riscv.c (riscv_scan): New.
3323 (N): Change bfd_default_scan to riscv_scan.
3325 2020-01-27 Andreas Schwab <schwab@suse.de>
3327 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3328 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3329 * Makefile.in: Regenerate.
3330 * cpu-plugin.c: Remove.
3331 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3332 (bfd_plugin_arch): Remove declaration.
3333 * bfd-in2.h: Regenerate.
3334 * po/SRC-POTFILES.in: Regenerate.
3336 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
3337 Alan Modra <amodra@gmail.com>
3340 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3342 2020-01-24 Jim Wilson <jimw@sifive.com>
3344 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3345 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3346 avoid over long line.
3348 2020-01-24 Nick Clifton <nickc@redhat.com>
3351 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3352 syms and keep strings flags as these may have been set in order to
3353 prevent a bogus call to free.
3355 2020-01-23 Nick Clifton <nickc@redhat.com>
3357 * po/fr.po: Updated French translation.
3359 2020-01-23 Alan Modra <amodra@gmail.com>
3362 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3363 by zero when p_align is zero.
3365 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3367 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3368 (riscv_prefix_cmp): Likewise.
3369 (riscv_non_std_ext_p): Deleted.
3370 (riscv_std_sv_ext_p): Likewise.
3371 (riscv_non_std_sv_ext_p): Likewise.
3372 (riscv_merge_non_std_and_sv_ext): Rename to...
3373 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3374 (riscv_merge_arch_attr_info): Replace 3 calls to
3375 riscv_merge_non_std_and_sv_ext with single call to
3376 riscv_merge_multi_letter_ext.
3377 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3378 encounter a 'z' prefix.
3379 (riscv_get_prefix_class): New function, return prefix class based
3380 on first few characters of input string.
3381 (riscv_parse_config): New structure to factor out minor differences
3382 in extension class parsing behaviour.
3383 (riscv_parse_sv_or_non_std_ext): Rename to...
3384 (riscv_parse_prefixed_ext): and parameterise with
3386 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3387 (riscv_multi_letter_ext_valid_p): New.
3388 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3389 (riscv_parse_subset): Delegate all non-single-letter parsing work
3390 to riscv_parse_prefixed_ext.
3391 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3392 (riscv_get_prefix_class): Declare.
3394 2020-01-22 Alan Modra <amodra@gmail.com>
3396 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3397 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3398 __tls_get_addr_desc.
3399 (ppc64_elf_size_stubs): Add section for linker generated
3400 __tls_get_addr_desc wrapper function. Loop at least once if
3401 generating this function.
3402 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3403 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3405 2020-01-22 Alan Modra <amodra@gmail.com>
3407 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3408 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3410 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3411 (STDU_R1_0R1, ADDI_R1_R1): Define.
3412 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3413 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3414 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3415 no_tls_get_addr_regsave.
3416 (branch_reloc_hash_match): Add hash3 and hash4.
3417 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3418 (ppc64_elf_size_dynamic_sections): Likewise.
3419 (ppc64_elf_relocate_section): Likewise.
3420 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3421 __tls_get_addr stub.
3422 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3424 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3425 eh_frame for regsave __tls_get_addr.
3427 2020-01-22 Alan Modra <amodra@gmail.com>
3429 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3430 which __tls_get_addr calls will be eliminated.
3432 2020-01-20 Nick Clifton <nickc@redhat.com>
3434 * po/pt.po: Updates Portuguese translation.
3435 * po/ru.po: Updated Russian translation.
3436 * po/uk.po: Updated Ukranian translation.
3438 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3441 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3442 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3444 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3445 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3446 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3447 "rex leal x@tlsdesc(%rip), %reg" to
3448 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3449 "call *(%eax)" to "nopl (%rax)".
3451 2020-01-20 Alan Modra <amodra@gmail.com>
3453 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3454 (MTLR_R11): Don't define.
3455 (LD_R0_0R3, CMPDI_R0_0): Define.
3456 (build_tls_get_addr_stub): Don't use r11 in stub.
3458 2020-01-20 Alan Modra <amodra@gmail.com>
3460 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3461 (defined_sym_val, is_tls_get_addr): Likewise.
3463 2020-01-18 Nick Clifton <nickc@redhat.com>
3465 * version.m4 (BFD_VERSION): Set to 2.34.50.
3466 * configure: Regenerate.
3467 * po/bfd.pot: Regenerate.
3469 2020-01-18 Nick Clifton <nickc@redhat.com>
3471 Binutils 2.34 branch created.
3473 2020-01-17 Christian Biesinger <cbiesinger@google.com>
3475 * coff-arm.c: Fix spelling error (seperate).
3476 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3478 * sysdep.h (strnlen): Fix spelling error (seperate).
3480 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
3483 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3485 2020-01-15 Alan Modra <amodra@gmail.com>
3488 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3489 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3490 of function symbols unless dot symbols are present. Do warn
3491 whenever one is created, regardles of whether a PLT entry is
3492 also emitted for the function symbol.
3494 2020-01-14 Alan Modra <amodra@gmail.com>
3496 * som.c (som_bfd_count_ar_symbols): Error when file position
3497 of symbols on chains is not strictly increasing.
3499 2020-01-14 Alan Modra <amodra@gmail.com>
3501 * vms.h (VMS_DEBUG): Define as 0.
3502 * vms-alpha.c (image_write): Move debug output after bounds check.
3504 (_bfd_vms_slurp_eihd): Warning fix.
3505 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
3507 2020-01-13 Alan Modra <amodra@gmail.com>
3509 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
3510 for "ignored" records.
3512 2020-01-13 Alan Modra <amodra@gmail.com>
3514 * wasm-module.c (wasm_scan_name_function_section): Formatting.
3515 Delete asect name check. Move asect NULL check to wasm_object_p.
3516 Correct bounds check of sizes against end. Replace uses of
3517 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
3518 just one bfd_release.
3519 (wasm_scan): Don't use malloc/strdup for section names,
3520 bfd_alloc instead. Simplify code prefixing section name.
3521 Formatting. Don't attempt to free memory here..
3522 (wasm_object_p): ..do so here.
3524 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
3527 * elf32-arm.c (elf32_arm_final_link_relocate): Use
3528 UNDEFWEAK_NO_DYNAMIC_RELOC.
3529 (allocate_dynrelocs_for_symbol): Likewise.
3531 2020-01-10 Tamar Christina <tamar.christina@arm.com>
3534 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3536 2020-01-10 Alan Modra <amodra@gmail.com>
3538 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3540 2020-01-09 Nick Clifton <nickc@redhat.com>
3543 * bfd.c (bfd_convert_section_contents): Check for a compress
3544 header size that is larger than the actual section size.
3546 2020-01-08 Alan Modra <amodra@gmail.com>
3549 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3550 after removing sections.
3552 2020-01-06 Jim Wilson <jimw@sifive.com>
3555 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3556 check for !bfd_link_pic (info).
3557 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3558 <R_RISCV_JAL>: Add comment.
3559 (_bfd_riscv_relax_section): For plt.offset check, add check for
3560 bfd_link_pic (info). Add comment.
3562 2020-01-06 Alan Modra <amodra@gmail.com>
3564 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3565 match failures. Don't init to bfd_error_wrong_format before
3566 calling _bfd_check_format.
3568 2020-01-06 Alan Modra <amodra@gmail.com>
3570 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3571 status rather than exiting on stack overflow or underflow.
3572 (_bfd_vms_slurp_etir): Adjust to suit.
3574 2020-01-06 Alan Modra <amodra@gmail.com>
3576 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3578 2020-01-06 Alan Modra <amodra@gmail.com>
3580 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3581 command. Check name offset is within command.
3582 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3583 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3584 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3585 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3586 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3587 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3588 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3589 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3590 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3591 (bfd_mach_o_read_segment): Similarly.
3592 (bfd_mach_o_read_thread): Properly bound check thread struct.
3593 Don't repeat checks on second loop.
3594 (bfd_mach_o_read_command): Fail on invalid command length.
3596 2020-01-04 Alan Modra <amodra@gmail.com>
3598 * format.c (bfd_check_format_matches): Add preserve_match.
3599 Save initial bfd state in "preserve", matched bfd state in
3600 "preserve_match". Save just the first match. Release
3601 bfd_alloc memory. Restore and finish preserved state as
3602 appropriate on all function exit paths.
3604 2020-01-04 Alan Modra <amodra@gmail.com>
3606 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3608 2020-01-04 Alan Modra <amodra@gmail.com>
3610 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3613 2020-01-03 Nick Clifton <nickc@redhat.com>
3616 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3617 there is enough data remaining in the code buffer before
3618 attempting to read a function stub.
3620 2020-01-03 Nick Clifton <nickc@redhat.com>
3623 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3624 return value from bfd_malloc.
3625 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3626 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3627 (elf32_arm_filter_cmse_symbols): Likewise.
3628 (elf32_arm_write_section): Likewise.
3629 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3630 (bfd_mach_o_follow_dsym): Likewise.
3631 * pef.c (bfd_pef_print_loader_section): Likewise.
3632 (bfd_pef_scan_start_address): Likewise.
3633 (bfd_pef_parse_function_stubs): Likewise.
3634 (bfd_pef_parse_symbols): Likewise.
3636 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3638 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3639 on binary inputs ld/PR25316.
3640 (is_ia64_elf): new helper to filter on ia64 objects.
3642 2020-01-03 Jan Beulich <jbeulich@suse.com>
3644 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3646 (bfd_mach_o_scan): Insert underscore in two variable names.
3648 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3650 * Makefile.am: Add z80-elf target support.
3651 * configure.ac: Likewise.
3652 * targets.c: Likewise.
3653 * Makefile.in: Regenerate.
3654 * configure: Regenerate.
3655 * config.bfd: Add z80-elf target support and new arches: ez80 and
3657 * elf32-z80.c: New file.
3658 * archures.c: Add new z80 architectures: eZ80 and Z180.
3659 * coffcode.h: Likewise.
3660 * cpu-z80.c: Likewise.
3661 * coff-z80.c: Add new relocations for Z80 target and local label
3663 * reloc.c: Add new relocs.
3664 * bfd-in2.h: Regenerate.
3665 * libbfd.h: Regenerate.
3667 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3671 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3673 2020-01-01 Alan Modra <amodra@gmail.com>
3675 Update year range in copyright notice of all files.
3677 For older changes see ChangeLog-2019
3679 Copyright (C) 2020 Free Software Foundation, Inc.
3681 Copying and distribution of this file, with or without modification,
3682 are permitted in any medium without royalty provided the copyright
3683 notice and this notice are preserved.
3689 version-control: never