1 2020-08-22 H.J. Lu <hongjiu.lu@intel.com>
4 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
5 versioned symbols, which are defined in shared objects, in
8 2020-08-21 Nick Clifton <nickc@redhat.com>
10 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
11 the data map if there are entries in it.
12 (_bfd_aarch64_erratum_843419_scan): Likewise.
14 2020-08-21 Jan Beulich <jbeulich@suse.com>
16 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
17 last byte of debug dir, not first.
19 2020-08-20 Nick Clifton <nickc@redhat.com>
22 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
23 field in the ELF header of the compressed sections.
25 2020-08-20 Nick Clifton <nickc@redhat.com>
28 * elf-bfd.h (struct bfd_elf_section_data): Add
29 has_secondary_relocs field.
30 * elf.c (_bfd_elf_copy_special_section_fields): Set the
31 has_secondary_relocs field for sections which have associated
33 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
34 on sections which have associated secondary relocs.
36 2020-08-15 Alan Modra <amodra@gmail.com>
38 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
40 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
41 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
42 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
43 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
44 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
45 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
46 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
47 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
48 * elf32-v850.c (v850_elf_check_relocs): Likewise.
49 (v850_elf_add_symbol_hook): Likewise.
50 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
51 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
52 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
53 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
55 2020-08-15 Alan Modra <amodra@gmail.com>
58 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
60 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
61 on small common section.
62 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
63 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
64 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
65 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
66 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
67 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
69 2020-08-14 Alan Modra <amodra@gmail.com>
71 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
72 rather than another copy of primes. Increase maximum default
75 2020-08-13 Alan Modra <amodra@gmail.com>
77 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
79 2020-08-13 Alan Modra <amodra@gmail.com>
81 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
82 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
83 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
84 optimization when --no-pcrel-optimize.
86 2020-08-13 Alan Modra <amodra@gmail.com>
89 * bfd.c (struct bfd): Add read_only.
90 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
91 Set read_only on warning.
92 (elf_object_p): Sanity check program header alignment. Set
94 * bfd-in2.h: Regenerate.
96 2020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
98 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
99 win32pstatus note type to avoid signedness comparison warning.
101 2020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
103 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
104 win32pstatus notes, and return TRUE so we continue rather than
105 stopping as if it was an error.
107 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
109 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
111 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
113 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
114 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
115 appropriate size constraint for each win32pstatus note type.
117 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
119 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
120 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
123 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
125 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
126 (elfcore_grok_win32pstatus): Use.
128 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
130 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
131 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
132 offsets used to read NOTE_INFO_PROCESS.
134 2020-08-12 Nick Clifton <nickc@redhat.com>
136 * po/ru.po: Updated Russian translation.
137 * po/sr.po: Updated Serbian translation.
139 2020-08-07 David Faust <david.faust@oracle.com>
141 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
142 DISP16 and DISP32 relocations.
144 2020-08-05 David Faust <david.faust@oracle.com>
146 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
147 (bpf_elf_howto_table): Use it here.
148 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
149 instruction and data relocations.
151 2020-08-03 Alan Modra <amodra@gmail.com>
153 * vms-lib.c (vms_traverse_index): Sanity check size remaining
154 before accessing vms_idx or vms_elfidx.
156 2020-08-03 Alan Modra <amodra@gmail.com>
159 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
160 size against file size. Correct LONG_MAX limit check.
161 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
162 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
163 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
164 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
165 bfd_malloc_and_get_section.
167 2020-07-31 Alan Modra <amodra@gmail.com>
170 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
171 IR symbols to become dynamic.
172 (elf_link_add_object_symbols): Don't exclude IR symbols when
173 deciding whether an as-needed shared library is needed.
175 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
178 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
180 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
182 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
184 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
185 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
186 Don't define _STRUCTURED_PROC.
187 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
188 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
189 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
190 * configure, config.in: Regenerate.
191 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
192 * Makefile.in, doc/Makefile.in: Regenerate.
194 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
196 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
197 (elf_link_hash_table): Add sym_cache.
198 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
199 (elf32_arm_check_relocs): Updated.
200 (elf32_arm_size_dynamic_sections): Likewise.
201 * elf32-bfin.c (bfin_link_hash_table): Removed.
202 (bfin_link_hash_newfunc): Updated.
203 (bfin_hash_table): Removed.
204 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
205 (csky_elf_check_relocs): Updated.
206 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
207 (elf32_hppa_check_relocs): Updated.
208 * elf32-i386.c (elf_i386_tls_transition): Updated.
209 (elf_i386_convert_load_reloc): Likewise.
210 (elf_i386_check_relocs): Likewise.
211 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
212 (m32r_elf_hash_table): Updated.
213 (m32r_elf_link_hash_table_create): Likewise.
214 (m32r_elf_create_dynamic_sections): Likewise.
215 (m32r_elf_adjust_dynamic_symbol): Likewise.
216 (allocate_dynrelocs): Likewise.
217 (m32r_elf_size_dynamic_sections): Likewise.
218 (m32r_elf_relocate_section): Likewise.
219 (m32r_elf_finish_dynamic_symbol): Likewise.
220 (m32r_elf_check_relocs): Likewise.
221 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
223 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
224 (elf_m68k_check_relocs): Updated.
225 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
226 (elf_metag_check_relocs): Updated.
227 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
228 (microblaze_elf_check_relocs): Updated.
229 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
230 (nds32_elf_create_dynamic_sections): Likewise.
231 (nds32_elf_adjust_dynamic_symbol): Likewise.
232 (nds32_elf_check_relocs): Likewise.
233 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
234 srelbss and aym_cache.
235 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
236 (nios2_elf32_check_relocs): Updated.
237 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
238 (or1k_elf_check_relocs): Updated.
239 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
240 (ppc_elf_check_relocs): Updated.
241 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
242 (elf_s390_check_relocs): Updated.
243 (elf_s390_finish_dynamic_sections): Likewise.
244 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
246 (sh_elf_create_dynamic_sections): Updated.
247 (sh_elf_adjust_dynamic_symbol): Likewise.
248 (sh_elf_size_dynamic_sections): Likewise.
249 (sh_elf_check_relocs): Likewise.
250 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
251 (elf32_tic6x_check_relocs): Updated.
252 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
253 (tilepro_elf_hash_table): Updated.
254 (tilepro_elf_link_hash_table_create): Likewise.
255 (tilepro_elf_check_relocs): Likewise.
256 (tilepro_elf_adjust_dynamic_symbol): Likewise.
257 (allocate_dynrelocs): Likewise.
258 (tilepro_elf_size_dynamic_sections): Likewise.
259 (tilepro_elf_relocate_section): Likewise.
260 (tilepro_elf_finish_dynamic_symbol): Likewise.
261 (tilepro_finish_dyn): Likewise.
262 (tilepro_elf_finish_dynamic_sections): Likewise.
263 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
264 (ppc64_elf_before_check_relocs): Updated.
265 (ppc64_elf_check_relocs): Likewise.
266 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
267 (elf_s390_check_relocs): Updated.
268 (elf_s390_relocate_section): Likewise.
269 (elf_s390_finish_dynamic_sections): Likewise.
270 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
271 (elf_x86_64_check_relocs): Likewise.
272 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
274 (elfNN_aarch64_check_relocs): Updated.
275 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
276 (riscv_elf_check_relocs): Updated.
277 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
278 (mips_elf_resolve_got_page_ref): Updated.
279 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
280 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
282 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
283 (tilegx_elf_check_relocs): Updated.
284 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
286 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
288 * elflink.c (bfd_elf_final_link): Give local symbols a name if
290 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
291 return TRUE if making ET_REL output.
293 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
295 * elf-bfd.h (elf_backend_data): Add
296 `elf_backend_elfsym_local_is_section' member.
297 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
299 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
300 * elflink.c (bfd_elf_final_link): Use it to determine whether
301 set the `.symtab' section's `sh_info' value to the index of the
302 first non-local or non-section symbol.
303 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
305 (elf_backend_elfsym_local_is_section): New macro.
306 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
308 (elf_backend_elfsym_local_is_section): New macro.
310 2020-07-29 Alan Modra <amodra@gmail.com>
312 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
313 defined in excluded sections.
315 2020-07-28 Alan Modra <amodra@gmail.com>
317 * elf.c (assign_section_numbers): Comment. Don't segfault on
318 discarded sections when setting linked-to section for generic
320 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
322 2020-07-27 Alan Modra <amodra@gmail.com>
324 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
326 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
329 2020-07-24 Nick Clifton <nickc@redhat.com>
331 * config.bfd: Move xc16x target to the obsolete list.
333 2020-07-22 Kevin Buettner <kevinb@redhat.com>
335 * binary.c (binary_get_section_contents): Seek using offset
336 from section's file position.
338 2020-07-22 Kevin Buettner <kevinb@redhat.com>
340 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
342 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
345 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
346 type for the first function argument. Rename pointers to reflect
347 that they have distinct types.
349 2020-07-20 Alan Modra <amodra@gmail.com>
351 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
353 2020-07-19 Alan Modra <amodra@gmail.com>
355 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
356 (select_alt_stub): New function.
357 (ppc_get_stub_entry): Use it here.
358 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
360 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
361 merge notoc stubs with other varieties when power10_stubs is "auto".
362 Instead dup the stub hash table entry.
363 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
364 tests of power10_stubs.
366 2020-07-15 Alan Modra <amodra@gmail.com>
369 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
371 2020-07-15 Nick Clifton <nickc@redhat.com>
374 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
375 check for aux entries that overflow the buufer.
377 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
379 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
380 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
382 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
383 Alan Modra <amodra@gmail.com>
386 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
387 objects both before and after normal object files.
388 * elflink.c (_bfd_elf_section_already_linked): Likewise.
390 2020-07-10 Alan Modra <amodra@gmail.com>
392 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
393 * elf64-ppc.c (struct ppc_link_hash_table): Delete
395 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
396 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
397 uses of power10_stubs.
399 2020-07-09 Alan Modra <amodra@gmail.com>
401 * coff-ppc.c: Delete.
404 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
405 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
407 (coff_write_object_contents): Remove PPC_PE code.
408 * config.bfd: Move powerpcle-pe to removed targets.
409 * configure.ac: Remove powerpc PE entries.
410 * libcoff-in.h (ppc_allocate_toc_section): Delete.
411 (ppc_process_before_allocation): Delete.
412 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
413 * targets.c: Remove powerpc PE vectors.
414 * po/SRC-POTFILES.in: Regenerate.
415 * libcoff.h: Regenerate.
416 * Makefile.in: Regenerate.
417 * configure: Regenerate.
419 2020-07-09 Nick Clifton <nickc@redhat.com>
421 * po/fr.po: Updated French translation.
423 2020-07-07 Alan Modra <amodra@gmail.com>
425 * xcofflink.c (xcoff_mark): Don't mark const sections.
426 (bfd_xcoff_record_link_assignment): Add FIXME.
427 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
428 sections being discarded by linker script.
430 2020-07-07 Alan Modra <amodra@gmail.com>
432 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
433 time, uid, gid and mode for deterministic archive.
434 (xcoff_write_archive_contents_big): Likewise.
436 2020-07-07 Alan Modra <amodra@gmail.com>
438 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
441 2020-07-06 Nick Clifton <nickc@redhat.com>
443 * po/pt.po: Updated Portuguese translation.
444 * po/uk.po: Updated Ukranian translation.
446 2020-07-04 Nick Clifton <nickc@redhat.com>
448 * version.m4: Set version to 2.35.50.
449 * configure: Regenerate.
450 * po/bbfd.pot: Regenerate.
452 2020-07-04 Nick Clifton <nickc@redhat.com>
454 Binutils 2.35 branch created.
456 2020-07-01 Alan Modra <amodra@gmail.com>
459 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
460 raw syment index before dereferencing.
462 2020-07-01 Alan Modra <amodra@gmail.com>
464 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
466 2020-07-01 Alan Modra <amodra@gmail.com>
468 * config.bfd: Obsolete xc16x.
470 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
472 * archures.c (bfd_mach_i386_nacl): Removed.
473 (bfd_mach_i386_i386_nacl): Likewise.
474 (bfd_mach_x86_64_nacl): Likewise.
475 (bfd_mach_x64_32_nacl): Likewise.
476 * config.bfd: Remove *-*-nacl* targets.
477 * configure.ac: Remove x86 NaCl target vectors.
478 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
479 (bfd_x64_32_nacl_arch): Likewise.
480 (bfd_x86_64_nacl_arch): Likewise.
481 (bfd_i386_nacl_arch): Likewise.
482 (bfd_x64_32_arch_intel_syntax): Updated.
483 * elf32-i386.c: Don't include "elf-nacl.h".
484 (elf_i386_nacl_plt): Removed.
485 (elf_i386_nacl_plt0_entry): Likewise.
486 (elf_i386_nacl_plt_entry): Likewise.
487 (elf_i386_nacl_pic_plt0_entry): Likewise.
488 (elf_i386_nacl_pic_plt_entry): Likewise.
489 (elf_i386_nacl_eh_frame_plt): Likewise.
490 (elf_i386_nacl_plt): Likewise.
491 (elf32_i386_nacl_elf_object_p): Likewise.
492 (elf_i386_get_synthetic_symtab): Updated.
493 (elf_i386_link_setup_gnu_properties): Likewise.
494 * elf64-x86-64.c: Don't include "elf-nacl.h".
495 (elf_x86_64_nacl_plt): Removed.
496 (elf64_x86_64_nacl_elf_object_p): Likewise.
497 (elf_x86_64_nacl_plt0_entry): Likewise.
498 (elf_x86_64_nacl_plt_entry): Likewise.
499 (elf_x86_64_nacl_eh_frame_plt): Likewise.
500 (elf_x86_64_nacl_plt): Likewise.
501 (elf32_x86_64_nacl_elf_object_p): Likewise.
502 (elf_x86_64_get_synthetic_symtab): Updated.
503 (elf_x86_64_link_setup_gnu_properties): Likewise.
504 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
505 * targets.c: Remove x86 NaCl target vectors.
506 * bfd-in2.h: Regenerated.
507 * configure: Likewise.
509 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
511 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
512 _bfd_elf_add_dynamic_tags.
514 2020-06-29 Alan Modra <amodra@gmail.com>
516 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
517 return value of bfd_bread. Don't read more than requested length.
518 Sanity check length. Properly terminate file name.
520 2020-06-29 Alan Modra <amodra@gmail.com>
522 * arc-got.h: Use C style comments.
523 * coff-z80.c: Likewise.
524 * elf32-csky.c: Likewise.
525 * peXXigen.c: Likewise.
526 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
529 2020-06-26 Pat Bernardi <bernardi@adacore.com>
531 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
532 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
534 2020-06-26 Alan Modra <amodra@gmail.com>
536 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
537 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
538 (riscv_get_priv_spec_name): Move to..
539 * cpu-riscv.c: ..here.
540 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
541 Use %u to print unsigned numbers.
543 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
545 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
546 default architecture.
548 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
551 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
552 _bfd_elf_add_dynamic_tags.
554 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
557 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
558 _bfd_elf_add_dynamic_tags.
560 2020-06-24 Alan Modra <amodra@gmail.com>
562 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
563 shifts without undefined behaviour.
565 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
567 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
569 (_bfd_elf_add_dynamic_tags): New.
570 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
571 _bfd_elf_add_dynamic_tags.
572 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
573 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
574 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
575 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
576 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
577 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
578 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
579 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
581 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
582 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
583 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
584 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
585 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
586 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
587 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
588 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
589 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
591 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
592 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
593 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
594 _bfd_elf_maybe_vxworks_add_dynamic_tags.
595 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
596 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
598 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
599 (_bfd_x86_elf_size_dynamic_sections): Likewise.
600 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
601 dt_reloc_sz and dt_reloc_ent.
602 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
603 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
605 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
606 etab.dt_pltgot_required.
607 (elf32_hppa_size_dynamic_sections): Call
608 _bfd_elf_add_dynamic_tags.
609 * elf32-metag.c (elf_metag_link_hash_table_create): Set
610 etab.dt_pltgot_required.
611 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
612 * elf32-sh.c (sh_elf_link_hash_table_create): Set
613 root.dt_pltgot_required for FDPIC output.
614 (sh_elf_size_dynamic_sections): Call
615 _bfd_elf_maybe_vxworks_add_dynamic_tags.
616 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
617 elf.dt_pltgot_required.
618 (elf_xtensa_size_dynamic_sections): Call
619 _bfd_elf_add_dynamic_tags.
620 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
621 root.dt_pltgot_required.
622 (elf64_hppa_size_dynamic_sections): Call
623 _bfd_elf_add_dynamic_tags.
624 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
625 root.dt_pltgot_required.
626 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
627 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
628 * elflink.c (_bfd_elf_add_dynamic_tags): New.
630 2020-06-22 Saagar Jha <saagar@saagarjha.com>
632 * mach-o.c: Support the new load commands by reading a linkedit
633 data command for them.
635 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
637 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
638 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
639 (riscv_get_priv_spec_class): Likewise.
640 (riscv_get_priv_spec_name): Likewise.
641 (riscv_get_priv_spec_class_from_numbers): New function, convert
642 the version numbers into string, then call riscv_get_priv_spec_class
643 to get the priv spec class.
644 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
645 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
646 (riscv_get_priv_spec_name): Likewise.
647 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
648 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
649 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
650 of input and output objects form their priv spec attributes by
651 riscv_get_priv_spec_class_from_numbers. Report warning rather than
652 errors when linking objects with differnet priv spec versions. We do
653 know v1.9.1 may have conflicts to other versions, so report the
654 warning, too. After that, update the output priv spec version to the
657 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
659 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
660 priv attributes, we will check the conflicts for all of them (major,
661 minor and revision), and then set the priv_attrs_merged to TRUE to
662 indicate that we have handled all of the priv attributes. Remove
663 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
665 2020-06-21 Alan Modra <amodra@gmail.com>
668 * configure.ac: Disable plugins by default for some targets.
669 * plugin.c: Comment typo fix.
670 * configure: Regenerate.
672 2020-06-19 Nick Clifton <nickc@redhat.com>
674 * plugin.c (try_load_plugin): Suppress the error message about
675 being unable to open a plugin if creating a list of viable
678 2020-06-16 Alan Modra <amodra@gmail.com>
680 * aout-tic30.c: Delete file.
681 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
682 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
683 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
684 (xc16x-*-elf): Sort properly.
685 * configure.ac: Remove tic30_aout_vec.
686 * targets.c: Likewise.
687 * Makefile.in: Regenerate.
688 * configure: Regenerate.
689 * po/SRC-POTFILES.in: Regenerate.
691 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
693 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
694 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
695 (elf32xtensa_abi): New global variable.
696 (xtensa_abi_choice): New function.
697 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
698 XSHAL_ABI to select PLT code.
700 2020-06-15 Roland McGrath <mcgrathr@google.com>
702 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
703 field of bfd_link_info.
705 2020-06-15 Alan Modra <amodra@gmail.com>
707 * config.bfd: Obsolete powerpcle-*-pe targets.
709 2020-06-15 Alan Modra <amodra@gmail.com>
712 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
713 symbols that were defined in discarded sections.
714 * cofflink.c (coff_link_check_archive_element): Likewise.
715 (coff_link_add_symbols): Set indx to -3 for symbols defined in
717 (_bfd_coff_write_global_sym): Don't emit such symbols.
718 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
719 libcoff.h: Regenerate.
721 2020-06-11 Alan Modra <amodra@gmail.com>
724 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
726 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
728 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
729 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
730 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
733 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
736 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
737 Clear verinfo.verdef.
739 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
742 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
743 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
744 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
746 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
747 Set ifunc_resolvers if there are FUNC resolvers.
748 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
749 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
750 with elf.ifunc_resolvers.
751 (write_plt_relocs_for_local_syms): Likewise.
752 (ppc64_elf_relocate_section): Likewise.
753 (ppc64_elf_finish_dynamic_sections): Likewise.
754 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
756 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
757 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
758 instead of readonly_dynrelocs_against_ifunc.
759 * elfxx-x86.h (elf_x86_link_hash_table): Remove
760 readonly_dynrelocs_against_ifunc.
762 2020-06-09 Alan Modra <amodra@gmail.com>
764 * elf64-ppc.c (struct ppc_link_hash_table): Delete
765 maybe_local_ifunc_resolver field.
766 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
767 cases where maybe_local_ifunc_resolver was set.
768 (ppc64_elf_relocate_section): Likewise.
769 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
772 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
774 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
776 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
778 (elf32_arm_size_dynamic_sections): Updated. Clear
779 root.tlsdesc_plt for DF_BIND_NOW.
780 (elf32_arm_finish_dynamic_sections): Updated.
781 (elf32_arm_output_arch_local_syms): Likewise.
782 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
783 Clear root.tlsdesc_plt for DF_BIND_NOW.
784 (nds32_elf_finish_dynamic_sections): Updated.
785 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
786 dt_tlsdesc_plt and dt_tlsdesc_got.
787 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
788 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
789 tlsdesc_plt and dt_tlsdesc_got.
790 (elfNN_aarch64_allocate_dynrelocs): Updated.
791 (elfNN_aarch64_finish_dynamic_sections): Likewise.
792 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
793 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
795 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
796 (_bfd_x86_elf_size_dynamic_sections): Likewise.
797 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
798 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
801 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
803 * elf32-tic6x.c (elf32_bed): Defined the default to
806 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
808 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
810 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
811 root.splt/root.srelplt.
812 (elf64_hppa_create_dynamic_sections): Likewise.
813 (elf64_hppa_size_dynamic_sections): Likewise.
814 (elf64_hppa_finish_dynamic_symbol): Likewise.
815 (elf_hppa_final_link): Likewise.
816 (elf_hppa_final_link_relocate): Likewise.
818 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
820 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
821 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
824 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
826 * elf-bfd.h (elf_target_os): New.
827 (elf_link_hash_table): Add target_os.
828 (elf_backend_data): Add target_os.
829 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
830 symbian_p and nacl_p.
831 (create_got_section): Updated.
832 (elf32_arm_create_dynamic_sections): Likewise.
833 (arm_type_of_stub): Likewise.
834 (elf32_arm_create_or_find_stub_sec): Likewise.
835 (elf32_arm_allocate_plt_entry): Likewise.
836 (elf32_arm_populate_plt_entry): Likewise.
837 (elf32_arm_final_link_relocate): Likewise.
838 (elf32_arm_check_relocs): Likewise.
839 (allocate_dynrelocs_for_symbol): Likewise.
840 (elf32_arm_finish_dynamic_symbol): Likewise.
841 (elf32_arm_finish_dynamic_sections): Likewise.
842 (elf32_arm_output_plt_map_1): Likewise.
843 (elf32_arm_output_arch_local_syms): Likewise.
844 (elf32_arm_add_symbol_hook): Likewise.
845 (elf32_arm_nacl_link_hash_table_create): Likewise.
846 (elf32_arm_vxworks_link_hash_table_create): Likewise.
847 (elf32_arm_symbian_link_hash_table_create): Likewise.
848 (ELF_TARGET_OS): New.
849 * elf32-i386.c (elf_i386_arch_bed): Removed.
850 (elf_backend_arch_data): Likewise.
851 (elf_i386_solaris_arch_bed): Likewise.
852 (elf_i386_nacl_arch_bed): Likewise.
853 (elf_i386_vxworks_arch_bed): Likewise.
854 (elf_i386_relocate_section): Updated.
855 (elf_i386_finish_dynamic_sections): Likewise.
856 (elf_i386_get_synthetic_symtab): Likewise.
857 (elf_i386_link_setup_gnu_properties): Likewise.
858 (ELF_TARGET_OS): New.
859 * elf32-mips.c (ELF_TARGET_OS): New.
860 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
861 (ppc_elf_create_got): Updated.
862 (ppc_elf_create_dynamic_sections): Likewise.
863 (ppc_elf_check_relocs): Likewise.
864 (ppc_elf_adjust_dynamic_symbol): Likewise.
865 (ppc_elf_size_dynamic_sections): Likewise.
866 (ppc_elf_relocate_section): Likewise.
867 (ppc_elf_finish_dynamic_sections): Likewise.
868 (ppc_elf_vxworks_link_hash_table_create): Likewise.
869 (ELF_TARGET_OS): New.
870 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
871 (sh_elf_link_hash_table_create): Updated.
872 (sh_elf_create_dynamic_sections): Likewise.
873 (allocate_dynrelocs): Likewise.
874 (sh_elf_size_dynamic_sections): Likewise.
875 (sh_elf_relocate_section): Likewise.
876 (sh_elf_finish_dynamic_symbol): Likewise.
877 (sh_elf_finish_dynamic_sections): Likewise.
878 (ELF_TARGET_OS): New.
879 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
881 (bfd_elf32_bfd_link_hash_table_create): Likewise.
882 (ELF_TARGET_OS): New.
883 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
884 (elf_x86_64_solaris_arch_bed): Likewise.
885 (elf_x86_64_nacl_arch_bed): Likewise.
886 (elf_x86_64_finish_dynamic_sections): Updated.
887 (elf_x86_64_get_synthetic_symtab): Likewise.
888 (elf_x86_64_link_setup_gnu_properties): Likewise.
889 (ELF_TARGET_OS): New.
890 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
892 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
893 (MIPS_ELF_REL_DYN_NAME): Updated.
894 (ELF_MIPS_GP_OFFSET): Likewise.
895 (mips_elf_create_local_got_entry): Likewise.
896 (mips_elf_allocate_dynamic_relocations): Likewise.
897 (mips_elf_count_got_symbols): Likewise.
898 (is_gott_symbol): Likewise.
899 (mips_elf_calculate_relocation): Likewise.
900 (mips_elf_create_dynamic_relocation): Likewise.
901 (_bfd_mips_elf_check_relocs): Likewise.
902 (allocate_dynrelocs): Likewise.
903 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
904 (mips_elf_lay_out_got): Likewise.
905 (mips_elf_set_plt_sym_value): Likewise.
906 (_bfd_mips_elf_size_dynamic_sections): Likewise.
907 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
908 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
909 (_bfd_mips_elf_final_link): Likewise.
910 (_bfd_mips_init_file_header): Likewise.
911 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
913 (allocate_dynrelocs): Likewise.
914 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
915 (_bfd_sparc_elf_relocate_section): Likewise.
916 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
917 (sparc_finish_dyn): Likewise.
918 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
919 * elfxx-target.h (ELF_TARGET_OS): New.
920 (elfNN_bed): Add ELF_TARGET_OS.
921 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
922 (_bfd_x86_elf_link_hash_table_create): Likewise.
923 (_bfd_x86_elf_size_dynamic_sections): Likewise.
924 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
925 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
926 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
927 * elfxx-x86.h (elf_x86_target_os): Removed.
928 (elf_x86_backend_data): Likewise.
929 (get_elf_x86_backend_data): Likewise.
930 (elf_x86_link_hash_table): Remove target_os.
932 2020-06-06 Alan Modra <amodra@gmail.com>
935 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
936 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
937 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
938 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
939 * elf64-ppc.c: Update throughout for reloc renaming.
940 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
941 * libbfd.h: Regenerate.
942 * bfd-in2.h: Regenerate.
944 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
947 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
950 2020-06-05 Nick Clifton <nickc@redhat.com>
952 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
955 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
957 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
958 priv_may_conflict, in_priv_zero and out_priv_zero to decide
959 whether the object can be linked according to it's priv
960 attributes. The object without any priv spec attributes can
961 be linked with others. If the first input object doesn't contain
962 any priv attributes, then we need to copy the setting from the
963 next input one. Also report more detailed error messages to user.
965 2020-06-04 Stephen Casner <casner@acm.org>
967 Extend pdp11-aout symbol table format to accommodate .stab
968 symbols and implement correct handling of them.
970 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
971 (N_STAB, is_stab): Needed new function is_stab to disambiguate
972 normal vs. .stab symbol table type values, replacing N_STAB mask.
973 (translate_from_native_sym_flags): Determine correct section for
974 different .stab types.
975 (translate_to_native_sym_flags): Leave .stab types intact.
976 (translate_symbol_table): Error if symbol indicates overlay;
977 store desc field from .stab symbols.
978 (write_syms): Output desc field with symbol.
979 (aout_link_check_ar_symbols): Skip .stab symbols.
980 (aout_link_add_symbols): Correctly distinguish .stab symbols.
981 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
982 (aout_link_write_symbols): Write 0 for desk and ovly fields;
983 correctly distinguish .stab symbols and select calculate their
984 section and value; and copy desc and ovly fields from input symbol
987 2020-06-04 Stephen Casner <casner@acm.org>
989 * aoutx.h (translate_symbol_table): Comment had external and
991 * pdp11.c (translate_symbol_table): Likewise.
993 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
995 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
996 (is_x86_elf): Check elf.hash_table_id instead of target_id.
997 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
999 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1002 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
1003 in debug section against symbol defined in shared library to 0.
1004 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
1005 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
1006 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
1007 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
1008 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
1009 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1010 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
1011 * elf32-sh.c (sh_elf_check_relocs): Likewise.
1012 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1013 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1014 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1015 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1016 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1017 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
1019 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
1020 there is non-GOT reference.
1021 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
1022 non-alloced sections.
1024 2020-06-03 Stephen Casner <casner@acm.org>
1026 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
1028 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
1030 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
1031 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
1032 other size that doesn't qcover the header word.
1033 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
1034 string table, and zero it.
1035 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
1036 message and set bfd_error on finding an invalid name string offset.
1037 (add_to_stringtab): INLINE -> inline
1038 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
1040 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
1041 any relocs that could not be recognised.
1042 92744f05809 PR 20929 - Check for relocs without an associated symbol.
1043 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
1044 name exists and is long enough, before attempting to see if it is
1046 c3864421222 - Correct case for N_SO being the last symbol.
1047 50455f1ab29 PR 20891 - Handle the case where the main file name
1048 and the directory name are both empty.
1049 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
1050 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
1051 range string table offsets.
1052 531336e3a0b PR 20909 - Fix off-by-one error in check for an
1053 illegal string offset.
1054 (aout_link_includes_newfunc): Add comment.
1055 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
1056 on unexpected relocation type rather than ASSERT.
1058 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1061 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
1062 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
1064 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1067 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
1068 non-alloced sections.
1070 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1072 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
1073 dynamic relocations for non SEC_ALLOC sections.
1075 2020-06-03 Gunther Nikl <gnikl@justmail.de>
1077 * aout64.c (BMAGIC, QMAGIC): Do not define.
1078 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
1079 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
1080 to check the file format.
1081 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
1082 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
1083 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
1085 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1087 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
1088 relocations for non SEC_ALLOC sections.
1090 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1092 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
1093 * elf32-arm.c (maybe_set_textrel): Removed.
1094 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
1095 with _bfd_elf_maybe_set_textrel.
1096 * elf32-csky.c (maybe_set_textrel): Removed.
1097 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
1098 with _bfd_elf_maybe_set_textrel.
1099 * elf32-hppa.c (maybe_set_textrel): Removed.
1100 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
1101 with _bfd_elf_maybe_set_textrel.
1102 * elf32-lm32.c (maybe_set_textrel): Removed.
1103 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
1104 with _bfd_elf_maybe_set_textrel.
1105 * elf32-m32r.c (maybe_set_textrel): Removed.
1106 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
1107 with _bfd_elf_maybe_set_textrel.
1108 * elf32-metag.c (maybe_set_textrel): Removed.
1109 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
1110 with _bfd_elf_maybe_set_textrel.
1111 * elf32-nds32.c (maybe_set_textrel): Removed.
1112 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
1113 with _bfd_elf_maybe_set_textrel.
1114 * elf32-or1k.c (maybe_set_textrel): Removed.
1115 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
1116 with _bfd_elf_maybe_set_textrel.
1117 * elf32-ppc.c (maybe_set_textrel): Removed.
1118 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
1119 with _bfd_elf_maybe_set_textrel.
1120 * elf32-s390.c (maybe_set_textrel): Removed.
1121 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1122 with _bfd_elf_maybe_set_textrel.
1123 * elf32-sh.c (maybe_set_textrel): Removed.
1124 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
1125 with _bfd_elf_maybe_set_textrel.
1126 * elf32-tic6x.c (maybe_set_textrel): Removed.
1127 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
1128 with _bfd_elf_maybe_set_textrel.
1129 * elf32-tilepro.c (maybe_set_textrel): Removed.
1130 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
1131 with _bfd_elf_maybe_set_textrel.
1132 * elf64-ppc.c (maybe_set_textrel): Removed.
1133 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
1134 with _bfd_elf_maybe_set_textrel.
1135 * elf64-s390.c (maybe_set_textrel): Removed.
1136 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1137 with _bfd_elf_maybe_set_textrel.
1138 * elfnn-aarch64.c (maybe_set_textrel): Removed.
1139 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
1140 with _bfd_elf_maybe_set_textrel.
1141 * elfnn-riscv.c (maybe_set_textrel): Removed.
1142 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
1143 with _bfd_elf_maybe_set_textrel.
1144 * elfxx-sparc.c (maybe_set_textrel): Removed.
1145 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
1146 with _bfd_elf_maybe_set_textrel.
1147 * elfxx-tilegx.c (maybe_set_textrel): Removed.
1148 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
1149 with _bfd_elf_maybe_set_textrel.
1150 * elfxx-x86.c (maybe_set_textrel): Removed.
1151 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
1152 with _bfd_elf_maybe_set_textrel.
1153 * elflink.c (_bfd_elf_maybe_set_textrel): New.
1155 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1158 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
1160 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
1161 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
1162 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
1163 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
1165 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
1166 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
1167 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
1168 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1169 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
1170 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
1171 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1172 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
1173 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
1174 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1175 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
1176 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1177 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
1178 (elf_backend_copy_indirect_symbol): Likewise.
1179 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
1180 (elf_backend_copy_indirect_symbol): Likewise.
1181 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
1183 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1186 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
1187 * elf32-arm.c (readonly_dynrelocs): Removed.
1188 (maybe_set_textrel): Replace readonly_dynrelocs with
1189 _bfd_elf_readonly_dynrelocs.
1190 * elf32-csky.c (readonly_dynrelocs): Removed.
1191 (maybe_set_textrel): Replace readonly_dynrelocs with
1192 _bfd_elf_readonly_dynrelocs.
1193 * elf32-hppa.c(readonly_dynrelocs): Removed.
1194 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1195 _bfd_elf_readonly_dynrelocs.
1196 (maybe_set_textrel): Likewise.
1197 * elf32-lm32.c (readonly_dynrelocs): Removed.
1198 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1199 with _bfd_elf_readonly_dynrelocs.
1200 (maybe_set_textrel): Likewise.
1201 * elf32-m32r.c (readonly_dynrelocs): Removed.
1202 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1203 with _bfd_elf_readonly_dynrelocs.
1204 (maybe_set_textrel): Likewise.
1205 * elf32-metag.c (readonly_dynrelocs): Removed.
1206 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
1207 with _bfd_elf_readonly_dynrelocs.
1208 (maybe_set_textrel): Likewise.
1209 * elf32-microblaze.c (readonly_dynrelocs): Removed.
1210 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1211 with _bfd_elf_readonly_dynrelocs.
1212 * elf32-nds32.c (readonly_dynrelocs): Removed.
1213 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1214 with _bfd_elf_readonly_dynrelocs.
1215 (maybe_set_textrel): Likewise.
1216 * elf32-or1k.c (readonly_dynrelocs): Removed.
1217 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1218 with _bfd_elf_readonly_dynrelocs.
1219 * elf32-ppc.c (readonly_dynrelocs): Removed.
1220 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1221 _bfd_elf_readonly_dynrelocs.
1222 (ppc_elf_adjust_dynamic_symbol): Likewise.
1223 (maybe_set_textrel): Likewise.
1224 * elf32-s390.c (readonly_dynrelocs): Removed.
1225 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1226 with _bfd_elf_readonly_dynrelocs.
1227 (maybe_set_textrel): Likewise.
1228 * elf32-sh.c (readonly_dynrelocs): Removed.
1229 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
1230 _bfd_elf_readonly_dynrelocs.
1231 (maybe_set_textrel): Likewise.
1232 * elf32-tic6x.c (readonly_dynrelocs): Removed.
1233 (maybe_set_textrel): Replace readonly_dynrelocs with
1234 _bfd_elf_readonly_dynrelocs.
1235 * elf32-tilepro.c (readonly_dynrelocs): Removed.
1236 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1237 with _bfd_elf_readonly_dynrelocs.
1238 (maybe_set_textrel): Likewise.
1239 * elf64-ppc.c (readonly_dynrelocs): Removed.
1240 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1241 _bfd_elf_readonly_dynrelocs.
1242 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1243 (maybe_set_textrel): Likewise.
1244 * elf64-s390.c (readonly_dynrelocs): Removed.
1245 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1246 with _bfd_elf_readonly_dynrelocs.
1247 (maybe_set_textrel): Likewise.
1248 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
1249 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
1250 (maybe_set_textrel): Replace readonly_dynrelocs with
1251 _bfd_elf_readonly_dynrelocs.
1252 * elfnn-riscv.c (readonly_dynrelocs): Removed.
1253 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1254 with _bfd_elf_readonly_dynrelocs.
1255 (maybe_set_textrel): Likewise.
1256 * elfxx-sparc.c (readonly_dynrelocs): Removed.
1257 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
1258 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
1259 (maybe_set_textrel): Likewise.
1260 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
1261 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1262 with _bfd_elf_readonly_dynrelocs.
1263 (maybe_set_textrel): Likewise.
1264 * elfxx-x86.c (readonly_dynrelocs): Removed.
1265 (maybe_set_textrel): Replace readonly_dynrelocs with
1266 _bfd_elf_readonly_dynrelocs.
1267 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1269 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1271 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
1272 -fsanitize=undefined.
1274 2020-06-03 Alan Modra <amodra@gmail.com>
1278 * peicode.h (pe_ILF_make_a_section): Align data for compilers
1280 (pe_ILF_build_a_bfd): Likewise.
1282 2020-06-03 Alan Modra <amodra@gmail.com>
1285 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
1286 core files as well as objects.
1288 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
1291 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
1292 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
1294 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
1295 (elf_arc_link_hash_newfunc): Updated.
1296 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
1297 (elf32_arm_link_hash_newfunc): Updated.
1298 (elf32_arm_copy_indirect_symbol): Likewise.
1299 (elf32_arm_check_relocs): Likewise.
1300 (readonly_dynrelocs): Likewise.
1301 (allocate_dynrelocs_for_symbol): Likewise.
1302 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
1303 (csky_elf_link_hash_newfunc): Updated.
1304 (csky_allocate_dynrelocs): Likewise.
1305 (readonly_dynrelocs): Likewise.
1306 (csky_elf_copy_indirect_symbol): Likewise.
1307 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
1308 (hppa_link_hash_newfunc): Updated.
1309 (elf32_hppa_copy_indirect_symbol): Likewise.
1310 (elf32_hppa_hide_symbol): Likewise.
1311 (elf32_hppa_adjust_dynamic_symbol): Likewise.
1312 (allocate_dynrelocs): Likewise.
1313 (elf32_hppa_relocate_section): Likewise.
1314 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1315 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
1316 (lm32_elf_link_hash_newfunc): Likewise.
1317 (lm32_elf_link_hash_table_create): Updated.
1318 (readonly_dynrelocs): Likewise.
1319 (allocate_dynrelocs): Likewise.
1320 (lm32_elf_copy_indirect_symbol): Likewise.
1321 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
1322 (m32r_elf_link_hash_newfunc): Likewise.
1323 (m32r_elf_link_hash_table_create): Updated.
1324 (m32r_elf_copy_indirect_symbol): Likewise.
1325 (allocate_dynrelocs): Likewise.
1326 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
1327 (metag_link_hash_newfunc): Updated.
1328 (elf_metag_copy_indirect_symbol): Likewise.
1329 (readonly_dynrelocs): Likewise.
1330 (allocate_dynrelocs): Likewise.
1331 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
1333 (link_hash_newfunc): Updated.
1334 (microblaze_elf_check_relocs): Likewise.
1335 (microblaze_elf_copy_indirect_symbol): Likewise.
1336 (readonly_dynrelocs): Likewise.
1337 (allocate_dynrelocs): Likewise.
1338 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
1339 (nds32_elf_link_hash_newfunc): Updated.
1340 (nds32_elf_copy_indirect_symbol): Likewise.
1341 (readonly_dynrelocs): Likewise.
1342 (allocate_dynrelocs): Likewise.
1343 (nds32_elf_check_relocs): Likewise.
1344 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
1345 (link_hash_newfunc): Updated.
1346 (nios2_elf32_copy_indirect_symbol): Likewise.
1347 (nios2_elf32_check_relocs): Likewise.
1348 (allocate_dynrelocs): Likewise.
1349 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
1350 (or1k_elf_link_hash_newfunc): Updated.
1351 (readonly_dynrelocs): Likewise.
1352 (allocate_dynrelocs): Likewise.
1353 (or1k_elf_copy_indirect_symbol): Likewise.
1354 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
1355 (ppc_elf_link_hash_newfunc): Updated.
1356 (ppc_elf_copy_indirect_symbol): Likewise.
1357 (ppc_elf_check_relocs): Likewise.
1358 (readonly_dynrelocs): Likewise.
1359 (ppc_elf_adjust_dynamic_symbol): Likewise.
1360 (allocate_dynrelocs): Likewise.
1361 (ppc_elf_relocate_section): Likewise.
1362 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1363 (link_hash_newfunc): Updated.
1364 (elf_s390_copy_indirect_symbol): Likewise.
1365 (readonly_dynrelocs): Likewise.
1366 (elf_s390_adjust_dynamic_symbol): Likewise.
1367 (allocate_dynrelocs): Likewise.
1368 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
1369 (sh_elf_link_hash_newfunc): Updated.
1370 (readonly_dynrelocs): Likewise.
1371 (allocate_dynrelocs): Likewise.
1372 (sh_elf_copy_indirect_symbol): Likewise.
1373 (sh_elf_check_relocs): Likewise.
1374 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
1375 (elf32_tic6x_link_hash_newfunc): Likewise.
1376 (elf32_tic6x_link_hash_table_create): Updated.
1377 (readonly_dynrelocs): Likewise.
1378 (elf32_tic6x_check_relocs): Likewise.
1379 (elf32_tic6x_allocate_dynrelocs): Likewise.
1380 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
1382 (link_hash_newfunc): Updated.
1383 (tilepro_elf_copy_indirect_symbol): Likewise.
1384 (tilepro_elf_check_relocs): Likewise.
1385 (allocate_dynrelocs): Likewise.
1386 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
1387 (ppc64_elf_copy_indirect_symbol): Updated.
1388 (ppc64_elf_check_relocs): Likewise.
1389 (readonly_dynrelocs): Likewise.
1390 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1391 (dec_dynrel_count): Likewise.
1392 (allocate_dynrelocs): Likewise.
1393 (ppc64_elf_relocate_section): Likewise.
1394 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1395 (link_hash_newfunc): Updated.
1396 (elf_s390_copy_indirect_symbol): Likewise.
1397 (readonly_dynrelocs): Likewise.
1398 (allocate_dynrelocs): Likewise.
1399 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1400 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1402 (elfNN_aarch64_link_hash_newfunc): Updated.
1403 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1404 (readonly_dynrelocs): Likewise.
1405 (need_copy_relocation_p): Likewise.
1406 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1407 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1408 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1409 (link_hash_newfunc): Updated.
1410 (riscv_elf_copy_indirect_symbol): Likewise.
1411 (riscv_elf_check_relocs): Likewise.
1412 (readonly_dynrelocs): Likewise.
1413 (allocate_dynrelocs): Likewise.
1414 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1416 (link_hash_newfunc): Updated.
1417 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1418 (_bfd_sparc_elf_check_relocs): Likewise.
1419 (readonly_dynrelocs): Likewise.
1420 (allocate_dynrelocs): Likewise.
1421 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1422 (link_hash_newfunc): Updated.
1423 (tilegx_elf_copy_indirect_symbol): Likewise.
1424 (tilegx_elf_check_relocs): Likewise.
1425 (readonly_dynrelocs): Likewise.
1426 (allocate_dynrelocs): Likewise.
1427 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1428 (readonly_dynrelocs): Likewise.
1429 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1430 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1432 2020-06-01 Alan Modra <amodra@gmail.com>
1434 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1435 command against cmd_length, not the end of record. For
1436 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1437 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1440 2020-05-28 David Faust <david.faust@oracle.com>
1442 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1443 R_BPF_INSN_{32,64} relocations.
1445 2020-05-28 Stephen Casner <casner@acm.org>
1447 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1448 addreses in .long (used in testsuites) and .stab values.
1450 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1453 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1454 Check bfd_link_dll when issue a DT_TEXTREL warning.
1455 * elfxx-x86.c (maybe_set_textrel): Likewise.
1456 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1458 2020-05-26 Nick Clifton <nickc@redhat.com>
1460 * plugin.c (try_load_plugin): Extend error message when a plugin
1463 2020-05-23 Alan Modra <amodra@gmail.com>
1465 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1467 2020-05-22 Alan Modra <amodra@gmail.com>
1470 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1471 attributes from shared libraries, and do not return an error if
1474 2020-05-21 Alan Modra <amodra@gmail.com>
1477 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1479 (_bfd_delete_bfd): Free the copy.
1480 (_bfd_new_bfd): Free nbfd->memory on error.
1482 2020-05-21 Alan Modra <amodra@gmail.com>
1484 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1485 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1486 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1487 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1488 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1489 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1490 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1491 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1492 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1493 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1494 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1495 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1496 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1497 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1498 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1499 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1500 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1501 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1502 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1503 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1505 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1507 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1508 get_default_version. It is used to find the default version for
1509 the specific extension.
1510 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1511 default_major_version and default_minor_version. Add new bfd_boolean
1512 parameter *use_default_version. Set it to TRUE if we need to call
1513 the callback rps->get_default_version to find the default version.
1514 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1515 the default version in riscv_parsing_subset_version, and then call
1516 riscv_add_subset to add the subset into subset list.
1517 (riscv_parse_prefixed_ext): Likewise.
1518 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1519 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1520 strings rather than characters.
1521 riscv_merge_arch_attr_info): The callback function get_default_version
1522 is only needed for assembler, so set it to NULL int the linker.
1523 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1524 * elfxx-riscv.h: Updated.
1526 2020-05-20 Alan Modra <amodra@gmail.com>
1529 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1530 use bfd_set_filename.
1531 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1532 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1533 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1534 (bfd_create): Likewise.
1535 (_bfd_delete_bfd): Don't free filename.
1536 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1537 return pointer to the copy or NULL on alloc fail.
1538 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1539 result of bfd_set_filename.
1540 * bfd-in2.h: Regenerate.
1542 2020-05-20 Alan Modra <amodra@gmail.com>
1545 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1546 section size against file size.
1547 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1549 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1552 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1553 and memset when allocating memory for the sections_being_created
1556 2020-05-19 Stafford Horne <shorne@gmail.com>
1558 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1560 (or1k_elf_relocate_section): Access srelgot via
1561 htab->root.srelgot. Add assertions for srelgot->contents.
1562 Introduce local variable for srelgot to not reuse global
1564 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1565 (or1k_set_got_and_rela_sizes): New function.
1566 (or1k_initial_exec_offset): New function.
1567 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1568 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1570 (or1k_elf_check_relocs): Use OR to set TLS access.
1571 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1573 (or1k_elf_size_dynamic_sections): Use
1574 or1k_set_got_and_rela_sizes to set sizes.
1575 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1576 (TCB_SIZE): New macro.
1577 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1578 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1579 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1580 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1581 (tpoff): Add dynamic boolean argument.
1582 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1584 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
1586 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1587 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1588 cases with BFD_RELOC_AARCH64_JUMP26.
1589 (elfNN_aarch64_check_relocs): Likewise.
1591 2020-05-19 Alan Modra <amodra@gmail.com>
1593 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1594 bfd_get_filename rather than accessing bfd->filename directly.
1595 * aout-target.h (MY (object_p)): Likewise.
1596 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1597 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1598 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1599 (_bfd_archive_bsd44_construct_extended_name_table),
1600 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1601 (_bfd_bsd_write_armap): Likewise.
1602 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
1603 * cache.c (bfd_open_file): Likewise.
1604 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
1605 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
1606 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1607 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1608 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
1609 * elf32-nds32.c (nds32_elf_output_symbol_hook),
1610 (patch_tls_desc_to_ie): Likewise.
1611 * elf32-spu.c (sort_bfds, print_one_overlay_section),
1612 (spu_elf_auto_overlay): Likewise.
1613 * elf64-hppa.c (elf_hppa_final_link): Likewise.
1614 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
1615 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
1616 * elflink.c (bfd_elf_size_dynamic_sections),
1617 (elf_link_input_bfd): Likewise.
1618 * linker.c (_bfd_generic_link_output_symbols): Likewise.
1619 * mach-o.c (bfd_mach_o_follow_dsym),
1620 (bfd_mach_o_close_and_cleanup): Likewise.
1621 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
1622 (find_separate_debug_file, get_build_id_name): Likewise.
1623 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1624 * plugin.c (bfd_plugin_open_input): Likewise.
1625 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
1626 * som.c (som_write_armap): Likewise.
1627 * srec.c (srec_write_record, srec_write_symbols): Likewise.
1628 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1629 (_bfd_vms_lib_write_archive_contents): Likewise.
1630 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1632 2020-05-19 Alan Modra <amodra@gmail.com>
1635 * bfdio.c (_bfd_real_fopen): Typo fix.
1637 2020-05-18 Nick Clifton <nickc@redhat.com>
1640 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1641 for the sections_being_created array.
1643 2020-05-18 Alan Modra <amodra@gmail.com>
1645 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1646 they can be freed without also freeing internal_relocs.
1648 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1651 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1652 separators into DOS style when creating a WIN32 fullpath.
1654 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
1656 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1657 to initialize RISC-V tdata.
1659 2020-05-12 Gunther Nikl <gnikl@justmail.de>
1661 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1664 2020-05-11 Alan Modra <amodra@gmail.com>
1666 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1668 2020-05-11 Alan Modra <amodra@gmail.com>
1670 * elf64-ppc.c: Rename powerxx to power10 throughout.
1672 2020-05-11 Alan Modra <amodra@gmail.com>
1675 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1676 contains required number of auxents before processing any auxent.
1677 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1678 file name from auxents for PE.
1680 2020-05-04 Gunther Nikl <gnikl@justmail.de>
1682 * aout-cris.c (DEFAULT_ARCH): Delete define.
1683 (MY_set_arch_mach): Likewise.
1684 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1686 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1687 of r_type before the shift.
1689 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
1692 * elfnn-aarch64.c (group_sections): Copy implementation from
1695 2020-05-01 Alan Modra <amodra@gmail.com>
1698 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1699 accessing root.u.def of symbols. Also check root.u.def.section
1700 is non-NULL. Reverse tests so as to make the logic positive.
1702 2020-05-01 Alan Modra <amodra@gmail.com>
1705 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1706 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1708 2020-05-01 Alan Modra <amodra@gmail.com>
1711 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1712 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1713 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1714 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1715 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1716 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1717 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1718 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1719 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1720 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1722 2020-05-01 Alan Modra <amodra@gmail.com>
1725 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1726 from shared libraries.
1728 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1730 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1731 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1732 equals 0. Report overflow when the result has negative sign but
1733 all significant bits are zero.
1735 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1737 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1738 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1740 2020-04-28 Alan Modra <amodra@gmail.com>
1742 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1743 Emit warning message.
1745 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1747 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1748 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1749 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1750 to x86_64_pe_big_vec as it not a big-endian format.
1751 (vec i386_pe_big_vec): New.
1752 * configure.ac: Likewise.
1753 * targets.c: Likewise.
1754 * configure: Regenerate.
1755 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1756 COFF_WITH_PE_BIGOBJ): New.
1757 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1759 (x86_64_pe_be_vec): Moved.
1761 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1763 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1764 * elf.c (elfcore_grok_arc_v2): New function.
1765 (elfcore_grok_note): Call the new function to handle the corresponding
1767 (elfcore_write_arc_v2): New function.
1768 (elfcore_write_register_note): Call the new function to handle the
1769 corresponding pseudo-sections.
1771 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1774 * bfd-in2.h: Regenerated.
1775 * elf32-xtensa.c (elf_howto_table): New entries for
1776 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1777 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1778 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1779 R_XTENSA_NDIFF{8,16,32}.
1780 * libbfd.h (bfd_reloc_code_real_names): Add names for
1781 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1782 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1783 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1784 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1786 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1789 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1792 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1795 * elf-bfd.h (elf_backend_data): Add
1796 elf_backend_strip_zero_sized_dynamic_sections.
1797 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1798 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1800 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1802 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1804 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1806 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1808 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1810 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1812 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1814 2020-04-21 Nick Clifton <nickc@redhat.com>
1816 * po/sr.po: Updated Serbian translation.
1818 2020-04-21 Alan Modra <amodra@gmail.com>
1820 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1823 2020-04-20 Stephen Casner <casner@acm.org>
1825 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1826 causing globals from linker script to be treated as debug symbols.
1827 (translate_symbol_table): Don't sign-extend symbol values from 16
1828 to 64 bits in nm output.
1830 2020-04-20 Alan Modra <amodra@gmail.com>
1832 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1834 2020-04-18 Alan Modra <amodra@gmail.com>
1836 * section.c (bfd_is_const_section): Correct test for special
1838 * bfd-in2.h: Regenerate.
1840 2020-04-17 Alan Modra <amodra@gmail.com>
1843 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1846 2020-04-16 Nick Clifton <nickc@redhat.com>
1849 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1850 abort with a more helpful error message.
1852 2020-04-16 Alan Modra <amodra@gmail.com>
1855 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1858 2020-04-15 Fangrui Song <maskray@google.com>
1861 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1862 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1863 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1864 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1865 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1866 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1867 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1868 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1869 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1870 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1871 * elflink.c (elf_link_output_extsym): Likewise.
1872 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1874 2020-04-15 Alan Modra <amodra@gmail.com>
1877 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1878 pointer into strings that may be freed for section name, always
1879 allocate a new string.
1881 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1882 Jan W. Jagersma <jwjagersma@gmail.com>
1884 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1885 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1886 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1887 (_bfd_go32_mkobject): New functions.
1888 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1889 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1890 (go32exe_mkobject): Call _bfd_go32_mkobject.
1891 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1892 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1894 (coff_write_relocs): Enable extended reloc counter code if
1895 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1896 (coff_write_object_contents): Likewise. Pad section headers
1897 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1898 instead of coff_swap_scnhdr_out.
1899 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1900 enable extended reloc counter.
1901 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1902 Declare with ATTRIBUTE_UNUSED.
1903 * libcoff-in.h: (struct coff_tdata): New field go32.
1905 * libcoff.h: Regenerate.
1907 2020-04-14 Fangrui Song <maskray@google.com>
1910 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1913 2020-04-14 Stephen Casner <casner@acm.org>
1916 * pdp11.c: Add implementation of --imagic option.
1917 (adjust_o_magic): Fix objcopy --extract-symbol test.
1918 * libaout.h (enum aout_magic): Add i_magic.
1920 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1921 Nick Clifton <nickc@redhat.com>
1923 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1925 <default>: Error rather than abort.
1927 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1930 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1931 relocation section from section group.
1933 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1935 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1936 bfd->origin to file offset.
1937 * bfdwin.c (bfd_get_file_window): Likewise.
1938 * bfd.c: Clarify the use of the bfd->origin field.
1939 * bfd-in2.h: Regenerate.
1940 * coff-i386.c: Don't include go32exe.h. Allow overriding
1941 coff_write_object_contents via COFF_WRITE_CONTENTS.
1942 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1943 (go32exe_write_object_contents): New functions.
1944 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1945 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1946 (create_go32_stub): Remove check for 2k size limit. Read stub
1947 from go32exe_temp_stub if present.
1948 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1949 copy variable-length stub.
1950 (go32_check_format): Read stub to go32exe_temp_stub, set
1951 origin, return go32exe_cleanup.
1952 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1953 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1954 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1955 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1956 Remove functions and their associated #defines.
1957 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1958 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1959 Rename field go32stub to stub.
1960 * libcoff.h: Regenerate.
1961 * coff-stgo32.c (go32_check_format): Rename to...
1962 (go32exe_check_format): ...this.
1963 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1964 (go32exe_copy_private_bfd_data): ...this.
1965 (stub_bytes): Rename to...
1966 (go32exe_default_stub): ...this.
1967 (create_go32_stub): Rename to...
1968 (go32exe_create_stub): ...this.
1969 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1972 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1976 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1977 relocation to R_386_32 for relocation against non-preemptible
1979 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1980 allocate dynamic relocation for non-preemptible absolute symbol.
1981 (elf_i386_relocate_section): Pass sec to
1982 GENERATE_DYNAMIC_RELOCATION_P.
1983 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1984 (elf_x86_64_convert_load_reloc): Covert load relocation to
1985 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1986 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1987 for non-preemptible absolute symbol if they overflow.
1988 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1989 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1990 symbol. Don't allocate dynamic relocation for non-preemptible
1992 (elf_x86_64_relocate_section): Don't generate relative relocation
1993 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1994 to GENERATE_DYNAMIC_RELOCATION_P.
1995 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1996 against non-preemptible absolute symbol.
1997 (_bfd_elf_x86_valid_reloc_p): New function.
1998 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
2000 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
2001 argument. Don't generate dynamic relocation against
2002 non-preemptible absolute symbol.
2003 (ABS_SYMBOL_P): New.
2004 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
2005 against non-preemptible absolute symbol.
2007 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
2008 (_bfd_elf_x86_valid_reloc_p): New.
2010 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2013 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
2014 address in the GOT if in thumb only mode.
2016 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2018 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
2020 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
2022 * mmo.c (mmo_scan): Create .text section only when needed, not
2025 2020-03-31 Alan Modra <amodra@gmail.com>
2027 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
2030 2020-03-31 Alan Modra <amodra@gmail.com>
2032 * vms-alpha.c (image_write): Check bounds for sections without
2033 contents too. Error on non-zero write to section without
2035 (_bfd_vms_slurp_etir): Check return of image_write* functions.
2037 2020-03-31 Alan Modra <amodra@gmail.com>
2039 * tekhex.c (pass_over): Check is_eof before reading buffer.
2041 2020-03-30 Nick Clifton <nickc@redhat.com>
2044 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
2045 field to timestamp and make it an integer.
2046 * libcoff.h: Regenerate.
2047 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
2048 field in the pe_data structure rather than the insert_timestamp
2051 2020-03-30 Alan Modra <amodra@gmail.com>
2054 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
2057 2020-03-26 Nick Clifton <nickc@redhat.com>
2059 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
2060 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
2062 * libbfd.h: Regenerate.
2064 2020-03-26 Alan Modra <amodra@gmail.com>
2066 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
2068 2020-03-26 Alan Modra <amodra@gmail.com>
2070 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
2072 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
2074 2020-03-25 Nick Clifton <nickc@redhat.com>
2076 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
2078 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
2079 * libbfd.h: Regenerate.
2081 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
2083 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
2084 correct field name in the output string.
2086 2020-03-25 Alan Modra <amodra@gmail.com>
2089 * elf.c (assign_file_positions_for_load_sections): Adjust offset
2090 for SHT_NOBITS section if first in segment.
2092 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2095 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
2096 (_bfd_elf_get_symbol_version_string): This.
2097 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
2098 (_bfd_elf_get_symbol_version_string): This.
2099 (bfd_elf_print_symbol): Pass TRUE to
2100 _bfd_elf_get_symbol_version_string.
2101 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
2102 bfd_boolean argument.
2103 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
2104 * targets.c (_bfd_get_symbol_version_string): Likewise.
2105 (bfd_get_symbol_version_string): Likewise.
2106 * bfd-in2.h: Regenerated.
2108 2020-03-24 Nick Clifton <nickc@redhat.com>
2109 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2112 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
2115 2020-03-24 Nick Clifton <nickc@redhat.com>
2118 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
2119 segment to use for PT_GNU_RELRO, ignore empty sections in a
2120 segment's current list.
2122 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2125 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2127 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2130 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
2131 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
2132 on the previous _bfd_elf_get_symbol_version_string.
2133 (_bfd_elf_get_symbol_version_string): Use it.
2135 2020-03-24 Alan Modra <amodra@gmail.com>
2137 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
2138 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
2141 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
2143 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
2145 2020-03-23 Alan Modra <amodra@gmail.com>
2147 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
2148 symbol count. Allocate an extra byte to ensure name strings
2149 are terminated. Sanity check name offsets. Release memory on
2152 2020-03-23 Alan Modra <amodra@gmail.com>
2154 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
2155 field hasn't been read. Remove unnecessary casts.
2157 2020-03-22 Alan Modra <amodra@gmail.com>
2159 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
2160 enough to read number of symbols.
2162 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
2164 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
2165 (EXECUTABLE_SUFFIX): Likewise.
2166 * config.in: Regenerated.
2167 * configure: Likewise.
2168 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
2169 _bfd_generic_close_and_cleanup.
2170 (plugin_list_entry): Remove resolution_file, resolution_option,
2171 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
2172 lto_wrapper, gcc_env and initialized,
2173 (need_lto_wrapper_p): Removed.
2174 (get_lto_wrapper): Likewise.
2175 (setup_lto_wrapper_env): Likewise.
2176 (register_all_symbols_read): Likewise.
2177 (egister_cleanup): Likewise.
2178 (get_symbols): Likewise.
2179 (add_input_file): Likewise.
2180 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
2181 (add_symbols): Updated.
2182 (try_claim): Likewise.
2183 (try_load_plugin): Likewise.
2184 (bfd_plugin_canonicalize_symtab): Likewise.
2185 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
2186 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
2188 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
2191 * plugin.c (plugin_list_entry): Add has_symbol_type.
2192 (add_symbols_v2): New function.
2193 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
2194 provides symbol type.
2195 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
2196 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
2199 2020-03-20 Alan Modra <amodra@gmail.com>
2201 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
2202 enough to read number of symbols.
2204 2020-03-20 Alan Modra <amodra@gmail.com>
2206 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
2207 backend functions for NULL before calling.
2208 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
2209 (bfd_section_from_shdr, assign_section_numbers): Likewise.
2210 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
2211 * elfnn-ia64.c (ignore_errors): New function.
2212 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
2214 2020-03-19 Nick Clifton <nickc@redhat.com>
2217 * dwarf2.c (struct varinfo): Add unit_offset field to record the
2218 location of the varinfo in the unit's debug info data. Change the
2219 type of the stack field to a boolean.
2220 (lookup_var_by_offset): New function. Returns the varinfo
2221 structure for the variable described at the given offset in the
2223 (scan_unit_for_symbols): Add support for variables which have the
2224 DW_AT_specification attribute.
2226 2020-03-19 Nick Clifton <nickc@redhat.com>
2229 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
2232 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
2234 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
2236 2020-03-18 Nick Clifton <nickc@redhat.com>
2239 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
2240 memory access when processing a corrupt secondary reloc section.
2242 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
2244 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
2245 instead of calling abort.
2246 * elf32-csky.c (csky_build_one_stub): Likewise.
2247 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2248 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2249 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2250 * elf32-metag.c (metag_build_one_stub): Likewise.
2251 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2252 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2253 (ppc_size_one_stub): Likewise.
2254 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2256 2020-03-17 Nick Clifton <nickc@redhat.com>
2259 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
2260 with error messages.
2262 2020-03-17 Nick Clifton <nickc@redhat.com>
2265 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
2266 free. Add free on another failure path.
2268 2020-03-16 Alan Modra <amodra@gmail.com>
2271 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
2272 we have a non-zero section count. Do lma comparison in octets.
2274 2020-03-16 Alan Modra <amodra@gmail.com>
2276 * vms-alpha.c (dst_restore_location): Validate index into
2277 dst_ptr_offsets array before accessing. Return status.
2278 (dst_retrieve_location): Similarly, making "loc" parameter a
2279 pointer to return value.
2280 (_bfd_vms_slurp_etir): Update calls to above functions.
2282 2020-03-14 Kamil Rytarowski <n54@gmx.com>
2284 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
2286 * configure: Regenerated.
2288 2020-03-14 Alan Modra <amodra@gmail.com>
2290 * section.c (BFD_FAKE_SECTIONS): Formatting.
2291 * bfd-in2.h: Regenerate.
2293 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2295 * elf.c (elfcore_grok_netbsd_note): Add support for
2296 NT_NETBSDCORE_LWPSTATUS notes.
2298 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
2300 * bfd-in2.h: Regenerate.
2301 * section.c (asection): Add already_assigned field.
2302 (BFD_FAKE_SECTION): Add default initializer for it.
2303 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
2304 * elf32-arm.c (arm_build_one_stub): Add support for
2305 non_contiguous_regions.
2306 * elf32-csky.c (csky_build_one_stub): Likewise.
2307 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2308 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2309 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2310 * elf32-metag.c (metag_build_one_stub): Likewise.
2311 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2312 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2313 (ppc_size_one_stub): Likewise.
2314 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2315 * elflink.c (elf_link_input_bfd): Likewise.
2317 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
2320 * elf-linker-x86.h (elf_linker_x86_params): Add
2321 static_before_all_inputs and has_dynamic_linker.
2322 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2323 dynamic input objects if -static is passed at command-line
2324 before all input files without --dynamic-linker unless
2325 --no-dynamic-linker is used.
2327 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2329 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
2331 2020-03-13 Christian Eggers <ceggers@gmx.de>
2333 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
2334 "p_paddr" from "at".
2335 * elfcode.h (bfd_from_remote_memory): Add units to several
2336 parameters. New local "opb". Fix usage of p_align. Fix
2337 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
2338 call of target_read_memory.
2339 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
2340 calculation of "offset" and "output_offset".
2341 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
2342 from "offset" and fix calculation of "end" from "vma+size". Fix
2343 comparison between "sh_addr" and "vma"/"output_offset".
2344 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
2345 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
2347 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
2348 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
2349 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
2350 assignment of p_paddr from phdr_lma. Fix comparison between
2351 "lma+size" and "next->lma".
2352 (elf_sort_segments): Fix assignment from p_paddr to lma.
2353 (assign_file_positions_for_load_sections): Add unit (bytes) to
2354 local "align". Fix calculation of local "off_adjust". Fix
2355 calculation of local "filehdr_vaddr".
2356 (assign_file_positions_for_non_load_sections): New local "opb".
2357 Fix calculation of "end" from "p_size". Fix comparison between
2358 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
2359 from "end" and "p_vaddr".
2360 (rewrite_elf_program_header): Fix comparison between p_vaddr and
2361 vma. Fix assignment to p_paddr from lma. Fix comparison between
2362 p_paddr and lma. Fix assignment to p_paddr from lma.
2363 * merge.c (sec_merge_emit): New local "opb". Convert
2364 "alignment_power" to octets.
2365 (_bfd_add_merge_section): New locals "alignment_power" and
2366 "opb". Fix comparison between "alignment_power" and
2368 (_bfd_merge_sections): New local "opb". Divide size by opb
2369 before checking align mask.
2371 2020-03-13 Christian Eggers <ceggers@gmx.de>
2373 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
2374 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
2376 (_bfd_elf_make_section_from_phdr): Similarly.
2377 (elf_fake_sections): Fix calculation of
2378 Elf_Internal_shdr::sh_addr from section VMA.
2379 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
2381 (assign_file_positions_for_load_sections): Fix calculations of
2382 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
2383 comparison between program header address and section LMA.
2384 (assign_file_positions_for_non_load_sections): Likewise.
2385 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
2386 (IS_CONTAINED_BY_VMA): Add parameter opb.
2387 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
2388 INCLUDE_SECTION_IN_SEGMENT): Likewise.
2389 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
2390 Fix calculations of p_addr_valid and p_vaddr_offset.
2391 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
2392 with octets per byte when comparing against p_vaddr.
2394 2020-03-11 Alan Modra <amodra@gmail.com>
2396 * som.c (setup_sections): Sanity check subspace.name.
2398 2020-03-11 Alan Modra <amodra@gmail.com>
2400 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2402 2020-03-10 Alan Modra <amodra@gmail.com>
2405 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2408 2020-03-09 Alan Modra <amodra@gmail.com>
2410 * wasm-module.c (wasm_scan): Sanity check file name length
2411 before allocating memory. Move common section setup code. Do
2412 without bfd_tell to calculate section size.
2414 2020-03-06 Nick Clifton <nickc@redhat.com>
2416 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2417 with error messages and failure return values.
2419 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
2421 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2422 relocation sections for any removed reference to a dynamic symbol.
2424 2020-03-05 Nick Clifton <nickc@redhat.com>
2426 * elf-bfd.h (struct elf_backend_data): Add new fields:
2427 init_secondary_reloc_section, slurp_secondary_reloc_section,
2428 write_secondary_reloc_section.
2429 (_bfd_elf_init_secondary_reloc_section): Prototype.
2430 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2431 (_bfd_elf_write_secondary_reloc_section): Prototype.
2432 * elf.c ( bfd_section_from_shdr): Invoke the new
2433 init_secondary_reloc_section backend function, if defined, when a
2434 second reloc section is encountered.
2435 (swap_out_syms): Invoke the new symbol_section_index function, if
2436 defined, when computing the section index of an OS/PROC specific
2438 (_bfd_elf_init_secondary_reloc_section): New function.
2439 (_bfd_elf_slurp_secondary_reloc_section): New function.
2440 (_bfd_elf_write_secondary_reloc_section): New function.
2441 (_bfd_elf_copy_special_section_fields): New function.
2442 * elfcode.h (elf_write_relocs): Invoke the new
2443 write_secondary_relocs function, if defined, in order to emit
2445 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2446 function, if defined, in order to read in secondary relocs.
2447 * elfxx-target.h (elf_backend_copy_special_section_fields):
2448 Provide a non-NULL default definition.
2449 (elf_backend_init_secondary_reloc_section): Likewise.
2450 (elf_backend_slurp_secondary_reloc_section): Likewise.
2451 (elf_backend_write_secondary_reloc_section): Likewise.
2452 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2454 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2455 * configure: Regenerate.
2457 2020-03-05 Alan Modra <amodra@gmail.com>
2459 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2460 against file size before allocating memory. Use bfd_alloc rather
2461 than bfd_zalloc for carsym/strings memory.
2463 2020-03-04 Alan Modra <amodra@gmail.com>
2465 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2466 sh_addr mod sh_addalign is zero.
2468 2020-03-04 Alan Modra <amodra@gmail.com>
2470 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2472 2020-03-03 Alan Modra <amodra@gmail.com>
2474 * format.c (struct bfd_preserve): Add cleanup field.
2475 (bfd_preserve_save): Add cleanup param and save.
2476 (bfd_preserve_restore): Return cleanup.
2477 (bfd_preserve_finish): Call the cleanup for the discarded match.
2478 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2479 and clear when preserving a match. Restore cleanup too when
2480 restoring that match.
2482 2020-03-02 Alan Modra <amodra@gmail.com>
2484 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2485 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2486 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2487 (core_sco5_vec): Correct initialisers.
2489 2020-03-02 Alan Modra <amodra@gmail.com>
2491 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2492 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2493 * cisco-core.c (cisco_core_file_validate): Likewise.
2494 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2495 * hpux-core.c (hpux_core_core_file_p): Likewise.
2496 * irix-core.c (irix_core_core_file_p): Likewise.
2497 * lynx-core.c (lynx_core_file_p): Likewise.
2498 * netbsd-core.c (netbsd_core_file_p): Likewise.
2499 * osf-core.c (osf_core_core_file_p): Likewise.
2500 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2501 * sco5-core.c (sco5_core_file_p): Likewise.
2503 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2505 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2507 2020-03-02 Alan Modra <amodra@gmail.com>
2509 * targets.c (bfd_cleanup): New typedef.
2510 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2511 * libbfd-in.h (_bfd_no_cleanup): Define.
2512 * format.c (bfd_reinit): Add cleanup parameter, call it.
2513 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2514 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2515 * aout-target.h (callback, object_p): Return bfd_cleanup.
2516 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2517 * archive.c (bfd_generic_archive_p): Likewise.
2518 * binary.c (binary_object_p): Likewise.
2519 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2520 * coff-ia64.c (ia64coff_object_p): Likewise.
2521 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2522 * coff-sh.c (coff_small_object_p): Likewise.
2523 * coff-stgo32.c (go32_check_format): Likewise.
2524 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2525 (xcoff64_core_p): Likewise.
2526 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2527 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2528 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2529 * elfcode.h (elf_object_p): Likewise.
2530 * elfcore.h (elf_core_file_p): Likewise.
2531 * i386msdos.c (msdos_object_p): Likewise.
2532 * ihex.c (ihex_object_p): Likewise.
2533 * libaout.h (some_aout_object_p): Likewise.
2534 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2535 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2536 * libbfd.c (_bfd_dummy_target): Likewise.
2537 * libcoff-in.h (coff_object_p): Likewise.
2538 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2539 (bfd_mach_o_arm64_core_p): Likewise.
2540 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2541 (bfd_mach_o_arm_core_p): Likewise.
2542 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2543 (bfd_mach_o_i386_core_p): Likewise.
2544 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2545 (bfd_mach_o_x86_64_core_p): Likewise.
2546 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2547 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2548 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2549 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2550 * mmo.c (mmo_object_p): Likewise.
2551 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2552 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2553 (pe_bfd_object_p): Likewise.
2554 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2555 * ppcboot.c (ppcboot_object_p): Likewise.
2556 * rs6000-core.c (rs6000coff_core_p): Likewise.
2557 * som.c (som_object_setup, som_object_p): Likewise.
2558 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2559 * tekhex.c (tekhex_object_p): Likewise.
2560 * vms-alpha.c (alpha_vms_object_p): Likewise.
2561 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2562 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2563 * wasm-module.c (wasm_object_p): Likewise.
2564 * xsym.c (bfd_sym_object_p): Likewise.
2565 * xsym.h (bfd_sym_object_p): Likewise.
2566 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2568 * pdp11.c (some_aout_object_p): Likewise.
2569 * plugin.c (register_ld_plugin_object_p): Update object_p
2571 * plugin.h (register_ld_plugin_object_p): Likewise.
2572 * bfd-in2.h: Regenerate.
2573 * libbfd.h: Regenerate.
2574 * libcoff.h: Regenerate.
2576 2020-03-02 Alan Modra <amodra@gmail.com>
2578 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2579 applicable section flags.
2580 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2581 (mips_ecoff_bele_vec): Likewise.
2582 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2584 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2585 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2587 2020-03-02 Alan Modra <amodra@gmail.com>
2589 * elf32-m32r.c (m32r_elf_section_flags): New function.
2590 (elf_backend_section_flags): Define.
2591 * elf32-nds32.c (nds32_elf_section_flags): New function.
2592 (elf_backend_section_flags): Define.
2593 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2594 .sbss and .sdata sections.
2595 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2596 for SHF_V850_GPREL sections.
2597 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2599 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2600 for SHF_PARISC_SHORT sections.
2601 * elf64-ppc.c (ppc64_elf_section_flags): New function.
2602 (elf_backend_section_flags): Define.
2603 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
2604 for SHF_MIPS_GPREL sections. Delete FIXME.
2606 2020-03-02 Alan Modra <amodra@gmail.com>
2608 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
2609 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
2610 calling elf_backend_section_flags with adjusted params. Use
2611 newsect->flags past that point.
2612 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
2614 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
2615 to have their type overridden, and all sh_flags but processor and
2617 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
2618 * elf32-mep.c (mep_elf_section_flags): Likewise.
2619 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
2620 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
2621 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
2622 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
2623 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
2624 stub BFD and non-aarch64 input files when scanning for stubs.
2626 2020-03-02 Alan Modra <amodra@gmail.com>
2628 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2629 limit to decompressed element size.
2631 2020-03-02 Alan Modra <amodra@gmail.com>
2633 * vms-lib.c (vms_traverse_index): Add recur_count param and
2634 update calls. Fail on excessive recursion.
2636 2020-03-02 Alan Modra <amodra@gmail.com>
2638 * vms-alpha.c (vms_get_remaining_object_record): Use
2639 bfd_realloc_or_free rather than bfd_realloc.
2640 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2641 (dst_define_location, parse_module): Likewise, and check realloc
2642 return status before using memory. Return status from function
2643 adjusting all callers.
2645 2020-02-28 Alan Modra <amodra@gmail.com>
2647 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2649 2020-02-28 Alan Modra <amodra@gmail.com>
2651 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2652 Remove duplicate undersize check.
2654 2020-02-27 Alan Modra <amodra@gmail.com>
2657 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2659 2020-02-27 Alan Modra <amodra@gmail.com>
2662 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2663 (coff_section_type): Adjust comment.
2664 (decode_section_type): Likewise. Call coff_section_type before
2665 decode_section_type.
2666 (bfd_decode_symclass): Use 'c' for common sections other than
2669 2020-02-27 Alan Modra <amodra@gmail.com>
2671 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2674 2020-02-27 Alan Modra <amodra@gmail.com>
2676 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2677 if file is an archive element.
2678 * bfd-in2.h: Regenerate.
2680 2020-02-26 Alan Modra <amodra@gmail.com>
2682 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2683 bfd_set_error on failing test. Don't bother changing bfd_error on
2684 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2685 Check sym name is within string buffer. Use size_t for some vars.
2686 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2687 int_buf. Don't change bfd_error on file read error. Use
2688 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2689 calculations to catch overflows before they occur. malloc and
2690 free raw armap rather than using bfd_alloc. Read raw armap before
2691 allocating carsym+strings buffer.
2692 (_bfd_slurp_extended_name_table): Localize variables. Check
2693 name size against file size.
2695 2020-02-26 Alan Modra <amodra@gmail.com>
2697 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2699 2020-02-26 Alan Modra <amodra@gmail.com>
2701 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2702 malloc. Check for NULL return from bfd_malloc.
2703 (rx_table_find, rx_table_map): Likewise.
2704 (rx_set_section_contents): Check bfd_alloc return.
2705 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2707 2020-02-26 Alan Modra <amodra@gmail.com>
2709 * aoutx.h: Indent labels correctly. Format error strings.
2710 * archive.c: Likewise.
2711 * archive64.c: Likewise.
2712 * coff-arm.c: Likewise.
2713 * coff-rs6000.c: Likewise.
2714 * coff-stgo32.c: Likewise.
2715 * cpu-arm.c: Likewise.
2716 * dwarf2.c: Likewise.
2717 * elf-ifunc.c: Likewise.
2718 * elf-properties.c: Likewise.
2719 * elf-s390-common.c: Likewise.
2720 * elf-strtab.c: Likewise.
2722 * elf32-arm.c: Likewise.
2723 * elf32-bfin.c: Likewise.
2724 * elf32-cr16.c: Likewise.
2725 * elf32-csky.c: Likewise.
2726 * elf32-i386.c: Likewise.
2727 * elf32-m68k.c: Likewise.
2728 * elf32-msp430.c: Likewise.
2729 * elf32-nds32.c: Likewise.
2730 * elf32-nios2.c: Likewise.
2731 * elf32-pru.c: Likewise.
2732 * elf32-xtensa.c: Likewise.
2733 * elf64-ia64-vms.c: Likewise.
2734 * elf64-x86-64.c: Likewise.
2735 * elfcode.h: Likewise.
2736 * elfcore.h: Likewise.
2737 * elflink.c: Likewise.
2738 * elfnn-aarch64.c: Likewise.
2739 * elfnn-ia64.c: Likewise.
2740 * elfnn-riscv.c: Likewise.
2741 * elfxx-mips.c: Likewise.
2742 * elfxx-sparc.c: Likewise.
2743 * elfxx-x86.c: Likewise.
2744 * i386lynx.c: Likewise.
2745 * merge.c: Likewise.
2746 * pdp11.c: Likewise.
2747 * plugin.c: Likewise.
2748 * reloc.c: Likewise.
2750 2020-02-26 Alan Modra <amodra@gmail.com>
2753 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2755 (bfd_elf_add_dt_needed_tag): Declare.
2756 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2757 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2758 from elf_add_dt_needed_tag. Remove soname and doit param.
2759 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2760 to see whether as-needed lib is already loaded, use dyn_loaded
2761 list instead. When saving and restoring around as-needed lib
2762 handle possibility that dynstr has not been initialised. Don't
2763 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2764 Mark libs loaded via DT_NEEDED entries of other libs with
2765 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2767 (elf_link_check_versioned_symbol): Remove now unneccesary
2768 DYNAMIC check when traversing dyn_loaded list.
2770 2020-02-26 Alan Modra <amodra@gmail.com>
2772 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2774 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2777 * plugin.c (need_lto_wrapper_p): New.
2778 (bfd_plugin_set_program_name): Add an int argument to set
2780 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2782 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2784 2020-02-24 Alan Modra <amodra@gmail.com>
2786 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2788 2020-02-24 Alan Modra <amodra@gmail.com>
2790 * vms-lib.c (struct carsym_mem): Add limit.
2791 (vms_add_index): Heed limit.
2792 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2793 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2794 Always return actual number read.
2795 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2796 assertion with error exit.
2798 2020-02-22 Alan Modra <amodra@gmail.com>
2801 * elf.c (assign_file_positions_for_load_sections): Continue linking
2802 on "PHDR segment not covered by LOAD segment" errors.
2804 2020-02-21 Alan Modra <amodra@gmail.com>
2806 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2808 (bfd_mach_o_canonicalize_reloc): Likewise.
2809 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2810 counts and offsets against file size.
2811 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2812 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2813 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2814 against file size. Delete symbol table error message.
2815 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2817 (bfd_mach_o_read_symtab): Likewise.
2818 (bfd_mach_o_read_command): Pass file size.
2819 (bfd_mach_o_scan): Sanity check command count against file size.
2821 2020-02-21 Alan Modra <amodra@gmail.com>
2824 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2825 "text", "data" and "bss" section pointer vars. Don't update
2826 section size, just exec header sizes.
2827 (adjust_sizes_and_vmas): Don't update text section size. Set
2828 initial exec header a_text. Print exec headers sizes.
2829 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2830 (adjust_sizes_and_vmas): Similarly. Formatting.
2831 (final_link): Correct final file extension.
2833 2020-02-20 Nick Clifton <nickc@redhat.com>
2835 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2837 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2839 (elfNN_bed): Initialise the symbol_section_index field.
2840 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2841 OS and PROC specific section indicies. Warn if converting other
2842 reserved incidies to SHN_ABS.
2844 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2847 * cpu-z80.c: Add machine type compatibility checking.
2849 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2852 * plugin.c (plugin_list_entry): Remove handle.
2853 (try_load_plugin): Call dlclose before return.
2855 2020-02-19 Alan Modra <amodra@gmail.com>
2857 * libbfd-in.h (_bfd_constant_p): Define.
2858 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2859 file size before allocating memory.
2860 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2861 * elf.c (bfd_elf_get_str_section): Likewise.
2862 (_bfd_elf_slurp_version_tables): Likewise.
2863 * libbfd.h: Regenerate.
2865 2020-02-19 Alan Modra <amodra@gmail.com>
2867 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2868 * aoutx.h (aout_get_external_symbols): Replace calls to
2869 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2870 (slurp_reloc_table): Likewise.
2871 * archive.c (do_slurp_bsd_armap): Likewise.
2872 (do_slurp_coff_armap): Likewise.
2873 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2874 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2875 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2876 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2877 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2878 (_bfd_coff_get_external_symbols): Likewise.
2879 * ecoff.c (ecoff_slurp_symbolic_header),
2880 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2881 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2882 (ecoff_indirect_link_order): Likewise.
2883 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2884 (_bfd_elf_slurp_version_tables): Likewise.
2885 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2886 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2887 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2888 * elf64-alpha.c (READ): Likewise.
2889 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2890 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2891 * elfcode.h (elf_slurp_symbol_table),
2892 (elf_slurp_reloc_table_from_section): Likewise.
2893 * elflink.c (elf_link_add_object_symbols),
2894 (elf_link_check_versioned_symbol): Likewise.
2895 * elfxx-mips.c (READ): Likewise.
2896 * i386lynx.c (slurp_reloc_table): Likewise.
2897 * lynx-core.c (lynx_core_file_p): Likewise.
2898 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2899 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2900 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2901 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2902 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2903 (bfd_pef_parse_symbols): Likewise.
2904 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2905 * som.c (setup_sections, som_slurp_string_table),
2906 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2907 (som_bfd_fill_in_ar_symbols): Likewise.
2908 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2909 (evax_bfd_print_image): Likewise.
2910 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2911 * wasm-module.c (wasm_scan): Likewise.
2912 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2913 * xsym.c (bfd_sym_read_name_table),
2914 (bfd_sym_print_type_information_table_entry): Likewise.
2915 * libbfd.h: Regenerate.
2917 2020-02-19 Alan Modra <amodra@gmail.com>
2919 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2920 reading external relocs.
2921 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2922 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2924 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2926 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2927 (m32c_elf_relax_section): Likewise.
2928 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2929 (rl78_elf_relax_section): Likewise.
2930 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2931 (elf32_rx_relax_section): Likewise.
2932 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2933 parameter types and use..
2934 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2935 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2936 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2937 being read from file, just the extra.
2938 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2939 after reading external syms. Free on failure.
2941 2020-02-19 Alan Modra <amodra@gmail.com>
2943 * coffcode.h (buy_and_read, coff_slurp_line_table),
2944 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2945 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2946 corresponding bfd_alloc call. Adjust variables to suit.
2947 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2948 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2949 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2950 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2951 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2952 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2953 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2954 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2955 * elf64-alpha.c (READ): Likewise.
2956 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2957 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2958 (bfd_from_remote_memory): Likewise.
2959 * elfcore.h (core_find_build_id): Likewise.
2960 * elfxx-mips.c (READ): Likewise.
2961 * mach-o.c (bfd_mach_o_mangle_sections),
2962 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2963 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2964 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2965 * som.c (setup_sections, som_prep_for_fixups)
2966 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2967 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2968 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2969 (som_bfd_ar_write_symbol_stuff): Likewise.
2970 * vms-alpha.c (vector_grow1): Likewise.
2971 * vms-lib.c (vms_add_index): Likewise.
2972 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2973 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2974 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2975 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2976 (bfd_alloc2, bfd_zalloc2): Delete.
2977 (_bfd_mul_overflow): Define.
2978 * libbfd.h: Regenerate.
2980 2020-02-19 Alan Modra <amodra@gmail.com>
2982 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2984 (assign_section_numbers): Likewise.
2985 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2986 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2987 bfd_malloc2, size_t amt, and unsigned tls_count.
2988 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2989 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2990 (elf_output_implib): Use bfd_alloc.
2992 2020-02-19 Alan Modra <amodra@gmail.com>
2994 * bfd.c (struct bfd): Move format and direction to other
2995 bitfields. Add "size".
2996 * bfdio.c (bfd_get_size): Cache size when not writing file.
2997 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2998 returning zero, ie. unknown.
2999 (bfd_get_alt_debug_link_info): Likewise.
3000 * bfd-in2.h: Regenerate.
3002 2020-02-19 Alan Modra <amodra@gmail.com>
3004 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
3005 bfd_get_file_size twice.
3006 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
3007 zero, ie. unknown, return.
3008 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
3009 * elfcode.h (elf_swap_shdr_in): Likewise.
3010 (elf_object_p): Don't call bfd_get_file_size twice and correct
3013 2020-02-19 Alan Modra <amodra@gmail.com>
3015 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
3016 FALSE if memory alloc fails. Adjust calls.
3017 * som.c (som_prep_for_fixups): Likewise.
3018 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
3019 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
3020 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
3021 * som.c (som_build_and_write_symbol_table): Return via error_return
3023 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
3024 (VEC_APPEND_EL): Delete.
3025 (vector_grow1): Return pointer to element. Catch overflow.
3026 Return NULL on memory allocation failure.
3027 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
3028 (alpha_vms_add_fixup_ca): Likewise.
3029 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
3031 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
3033 2020-02-19 Alan Modra <amodra@gmail.com>
3035 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
3036 * aout-target.h (object_p): Likewise.
3037 * aout-tic30.c (tic30_aout_object_p): Likewise.
3038 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
3039 (emit_stringtab, write_syms, link_hash_table_create),
3040 (aout_link_write_other_symbol): Likewise.
3041 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
3042 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
3043 (_bfd_compute_and_write_armap): Likewise.
3044 * archures.c (bfd_arch_list): Likewise.
3045 * bfd.c (bfd_record_phdr): Likewise.
3046 * binary.c (binary_canonicalize_symtab): Likewise.
3047 * cisco-core.c (cisco_core_file_validate): Likewise.
3048 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
3049 (find_arm_glue, record_arm_to_thumb_glue),
3050 (record_thumb_to_arm_glue): Likewise.
3051 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
3052 (ppc_allocate_toc_section): Likewise.
3053 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
3054 * coff-sh.c (sh_relax_section): Likewise.
3055 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
3056 * coffcode.h (handle_COMDAT, coff_new_section_hook),
3057 (coff_set_alignment_hook, coff_mkobject),
3058 (coff_compute_section_file_positions): Likewise.
3059 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
3060 (coff_find_nearest_line_with_names),
3061 ( bfd_coff_set_symbol_class): Likewise.
3062 * cofflink.c (_bfd_coff_link_hash_table_create),
3063 (_bfd_coff_link_input_bfd): Likewise.
3064 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
3065 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
3066 (build_line_info_table, sort_line_sequences),
3067 (line_info_add_include_dir, line_info_add_file_name),
3068 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
3069 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
3070 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
3071 (_bfd_ecoff_find_nearest_line),
3072 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
3073 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
3074 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
3075 * elf-m10300.c (mn10300_elf_relax_section),
3076 (elf32_mn10300_link_hash_table_create): Likewise.
3077 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
3078 * elf.c (make_mapping, copy_elf_program_header): Likewise.
3079 * elf32-arm.c (elf32_arm_link_hash_table_create),
3080 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
3081 (elf32_arm_new_section_hook): Likewise.
3082 * elf32-avr.c (elf_avr_new_section_hook),
3083 (elf32_avr_link_hash_table_create, get_local_syms),
3084 (elf32_avr_setup_section_lists): Likewise.
3085 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
3086 (bfin_link_hash_table_create): Likewise.
3087 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
3088 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
3089 * elf32-csky.c (csky_elf_link_hash_table_create),
3090 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
3091 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
3092 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
3093 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
3094 * elf32-i386.c (elf_i386_check_relocs): Likewise.
3095 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
3096 * elf32-m32r.c (m32r_elf_link_hash_table_create),
3097 (m32r_elf_check_relocs): Likewise.
3098 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
3099 (elf32_m68hc11_setup_section_lists),
3100 (elf32_m68hc11_size_stubs): Likewise.
3101 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
3102 * elf32-metag.c (elf_metag_link_hash_table_create),
3103 (elf_metag_setup_section_lists): Likewise.
3104 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
3105 (microblaze_elf_check_relocs): Likewise.
3106 * elf32-nds32.c (nds32_elf_link_hash_table_create),
3107 (nds32_elf_check_relocs): Likewise.
3108 * elf32-nios2.c (nios2_elf32_setup_section_lists),
3109 (get_local_syms, nios2_elf32_check_relocs),
3110 (nios2_elf32_link_hash_table_create): Likewise.
3111 * elf32-or1k.c (or1k_elf_link_hash_table_create),
3112 (or1k_elf_check_relocs): Likewise.
3113 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
3114 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
3115 * elf32-s390.c (elf_s390_link_hash_table_create),
3116 (elf_s390_check_relocs): Likewise.
3117 * elf32-score.c (score_elf_create_got_section),
3118 (s3_elf32_score_new_section_hook),
3119 (elf32_score_link_hash_table_create): Likewise.
3120 * elf32-score7.c (score_elf_create_got_section),
3121 (s7_elf32_score_new_section_hook): Likewise.
3122 * elf32-sh.c (sh_elf_link_hash_table_create),
3123 (sh_elf_check_relocs): Likewise.
3124 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
3125 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
3126 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
3127 (tilepro_elf_check_relocs): Likewise.
3128 * elf32-v850.c (remember_hi16s_reloc): Likewise.
3129 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
3130 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
3131 (elf_xtensa_new_section_hook): Likewise.
3132 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
3133 (get_got_entry, elf64_alpha_check_relocs): Likewise.
3134 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
3135 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
3136 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
3137 * elf64-ppc.c (ppc64_elf_new_section_hook),
3138 (ppc64_elf_link_hash_table_create, update_local_sym_info),
3139 (update_plt_info, ppc64_elf_check_relocs): Likewise.
3140 * elf64-s390.c (elf_s390_link_hash_table_create),
3141 (elf_s390_check_relocs): Likewise.
3142 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
3143 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
3144 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
3145 (elf_link_add_archive_symbols, compute_bucket_count),
3146 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
3147 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
3148 (bfd_elf_final_link): Likewise.
3149 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
3150 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
3151 (elfNN_aarch64_new_section_hook): Likewise.
3152 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
3153 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
3154 (riscv_elf_check_relocs): Likewise.
3155 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
3156 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
3157 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
3158 (_bfd_mips_elf_link_hash_table_create): Likewise.
3159 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
3160 (_bfd_sparc_elf_check_relocs),
3161 (_bfd_sparc_elf_new_section_hook): Likewise.
3162 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
3163 (tilegx_elf_check_relocs): Likewise.
3164 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
3165 * format.c (bfd_check_format_matches): Likewise.
3166 * hash.c (_bfd_stringtab_init): Likewise.
3167 * ihex.c (ihex_scan): Likewise.
3168 * irix-core.c (irix_core_core_file_p): Likewise.
3169 * linker.c (bfd_wrapped_link_hash_lookup),
3170 (_bfd_generic_link_hash_table_create),
3171 (_bfd_generic_reloc_link_order): Likewise.
3172 * lynx-core.c (lynx_core_file_p): Likewise.
3173 * netbsd-core.c (netbsd_core_file_p): Likewise.
3174 * osf-core.c (osf_core_core_file_p): Likewise.
3175 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
3176 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
3177 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
3178 * peicode.h (pe_mkobject): Likewise.
3179 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
3180 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3181 * sco5-core.c (read_uarea): Likewise.
3182 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
3183 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
3184 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
3185 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
3186 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
3187 * srec.c (srec_scan): Likewise.
3188 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
3189 * targets.c (bfd_target_list): Likewise.
3190 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
3191 * trad-core.c (trad_unix_core_file_p): Likewise.
3192 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
3193 (vms_new_section_hook): Likewise.
3194 * wasm-module.c (wasm_make_empty_symbol): Likewise.
3195 * xcofflink.c (xcoff_get_section_contents),
3196 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
3197 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
3198 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
3200 2020-02-19 Alan Modra <amodra@gmail.com>
3202 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
3204 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
3206 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
3207 and use it if it isn't NULL. Remove has_plugin_p argument. Add
3208 a build_list_p argument. Don't search plugin_list. Short circuit
3209 when building the plugin list.
3210 (has_plugin): Renamed to has_plugin_list.
3211 (bfd_plugin_set_plugin): Don't set has_plugin.
3212 (bfd_plugin_specified_p): Check plugin_list instead.
3213 (build_plugin_list): New function.
3214 (load_plugin): Call build_plugin_list and use plugin_list.
3216 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3219 * plugin.c (try_claim): Always clean up for LTO wrapper.
3220 (try_load_plugin): Treat each object as independent. Create a
3221 copy for plugin name.
3223 2020-02-11 Nick Clifton <nickc@redhat.com>
3225 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
3226 for addresses in print statements.
3227 (msp430_elf_relax_delete_bytes): Likewise.
3228 (msp430_elf_relax_add_words): Likewise.
3229 (msp430_elf_relax_section): Likewise.
3231 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3233 * plugin.c (add_symbols): Clear plugin_data memory.
3235 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
3238 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
3239 (EXECUTABLE_SUFFIX): Likewise.
3240 * config.in: Regenerated.
3241 * configure: Likewise.
3242 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
3243 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
3244 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
3245 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
3246 (get_lto_wrapper): New.
3247 (setup_lto_wrapper_env): Likewise.
3248 (current_plugin): Likewise.
3249 (register_all_symbols_read): Likewise.
3250 (register_cleanup): Likewise.
3251 (get_symbols): Likewise.
3252 (add_input_file): Likewise.
3253 (bfd_plugin_close_and_cleanup): Likewise.
3254 (claim_file): Removed.
3255 (register_claim_file): Set current_plugin->claim_file.
3256 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
3257 lto_syms in current_plugin.
3258 (try_claim): Use current_plugin->claim_file. Call LTO plugin
3259 all_symbols_read handler. Copy real symbols to plugin_data.
3260 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
3261 (try_load_plugin): Don't reuse the previous plugin for LTO
3262 wrapper. Set up GCC LTO wrapper if possible. Don't set
3263 plugin_list_iter->claim_file.
3264 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
3266 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
3269 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3271 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
3272 check if previous instruction matches a conditional jump inserted
3273 earlier. Invert conditional jump and delete branch in this case.
3275 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3277 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
3278 msp430_elf_relax_add_words. Support insertion of either one or two
3280 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
3281 needs to be grown. Handle insertion of branch instruction to replace
3284 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3286 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
3287 debugging relocations.
3288 (msp430_elf_relax_delete_bytes): Likewise.
3289 (msp430_elf_relax_add_two_words): Likewise.
3290 (msp430_elf_relax_section): Likewise.
3292 2020-02-10 Alan Modra <amodra@gmail.com>
3294 * archures.c: Wrap overlong z80 comments.
3295 * bfd-in2.h: Regenerate.
3297 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
3300 * archures.c: Add GBZ80 and Z80N machine values.
3301 * reloc.c: Add BFD_RELOC_Z80_16_BE.
3302 * coff-z80.c: Add support for new reloc.
3303 * coffcode.h: Add support for new machine values.
3304 * cpu-z80.c: Add support for new machine names.
3305 * elf32-z80.c: Add support for new reloc.
3306 * bfd-in2.h: Regenerate.
3307 * libbfd.h: Regenerate.
3309 2020-02-07 Nick Clifton <nickc@redhat.com>
3312 * elf.c (rewrite_elf_program_header): Do not complain if no
3313 sections are mapped to a segment.
3315 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3318 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
3319 for garbage collection on __patchable_function_entries section
3320 without linked-to section.
3322 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3325 * bfd-in2.h: Regenerated.
3326 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
3327 on section if gc_mark of any of its linked-to sections is set
3328 and don't set gc_mark again.
3329 * section.c (asection): Add linked_to_symbol_name to map_head
3332 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
3334 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
3335 reporting an unrecognized instruction with R_V850_LONGJUMP.
3337 2020-02-05 Alan Modra <amodra@gmail.com>
3339 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
3341 2020-02-04 Alan Modra <amodra@gmail.com>
3343 * elf32-ppc.c (ppc_elf_relocate_section): After applying
3344 R_PPC_VLE_ADDR20, goto copy_reloc.
3346 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3348 * bfd-in2.h: Regenerated.
3349 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
3351 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3354 * bfd-in2.h: Regenerated.
3355 * ecoff.c (bfd_debug_section): Add section_id.
3356 * section.c (bfd_section): Add section_id.
3357 (SEC_ASSEMBLER_SECTION_ID): New.
3358 (BFD_FAKE_SECTION): Add section_id.
3360 2020-02-01 Nick Clifton <nickc@redhat.com>
3362 * config.bfd: Move the c30-aout and tic30-aout targets onto the
3365 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
3367 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
3368 encodings are relative to the GOT on nios2, too.
3370 2020-01-31 Alan Modra <amodra@gmail.com>
3372 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
3373 file. Use $< and $@ in rules.
3374 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
3375 (elf32-ia64.c, elf64-ia64.c): Likewise.
3376 (elf32-riscv.c, elf64-riscv.c): Likewise.
3377 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3378 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
3379 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
3380 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
3381 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3382 * Makefile.in: Regenerate.
3384 2020-01-31 Alan Modra <amodra@gmail.com>
3387 * elf.c (setup_group): Don't clear entire section contents,
3388 just the padding after group flags. Release alloc'd memory
3389 after a seek or read failure.
3391 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3393 * peXXigen.c (pe_is_repro): New function.
3394 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
3395 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
3397 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3399 * peXXigen.c (debug_type_names): Add names for new debug data type
3402 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3404 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3405 inner loop. Fix a memory leak.
3407 2020-01-30 Alan Modra <amodra@gmail.com>
3409 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3410 or obj_coff_keep_strings here.
3411 (coff_get_normalized_symtab): Free external syms directly.
3412 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3415 2020-01-27 Jim Wilson <jimw@sifive.com>
3417 * cpu-riscv.c (riscv_scan): New.
3418 (N): Change bfd_default_scan to riscv_scan.
3420 2020-01-27 Andreas Schwab <schwab@suse.de>
3422 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3423 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3424 * Makefile.in: Regenerate.
3425 * cpu-plugin.c: Remove.
3426 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3427 (bfd_plugin_arch): Remove declaration.
3428 * bfd-in2.h: Regenerate.
3429 * po/SRC-POTFILES.in: Regenerate.
3431 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
3432 Alan Modra <amodra@gmail.com>
3435 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3437 2020-01-24 Jim Wilson <jimw@sifive.com>
3439 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3440 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3441 avoid over long line.
3443 2020-01-24 Nick Clifton <nickc@redhat.com>
3446 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3447 syms and keep strings flags as these may have been set in order to
3448 prevent a bogus call to free.
3450 2020-01-23 Nick Clifton <nickc@redhat.com>
3452 * po/fr.po: Updated French translation.
3454 2020-01-23 Alan Modra <amodra@gmail.com>
3457 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3458 by zero when p_align is zero.
3460 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3462 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3463 (riscv_prefix_cmp): Likewise.
3464 (riscv_non_std_ext_p): Deleted.
3465 (riscv_std_sv_ext_p): Likewise.
3466 (riscv_non_std_sv_ext_p): Likewise.
3467 (riscv_merge_non_std_and_sv_ext): Rename to...
3468 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3469 (riscv_merge_arch_attr_info): Replace 3 calls to
3470 riscv_merge_non_std_and_sv_ext with single call to
3471 riscv_merge_multi_letter_ext.
3472 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3473 encounter a 'z' prefix.
3474 (riscv_get_prefix_class): New function, return prefix class based
3475 on first few characters of input string.
3476 (riscv_parse_config): New structure to factor out minor differences
3477 in extension class parsing behaviour.
3478 (riscv_parse_sv_or_non_std_ext): Rename to...
3479 (riscv_parse_prefixed_ext): and parameterise with
3481 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3482 (riscv_multi_letter_ext_valid_p): New.
3483 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3484 (riscv_parse_subset): Delegate all non-single-letter parsing work
3485 to riscv_parse_prefixed_ext.
3486 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3487 (riscv_get_prefix_class): Declare.
3489 2020-01-22 Alan Modra <amodra@gmail.com>
3491 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3492 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3493 __tls_get_addr_desc.
3494 (ppc64_elf_size_stubs): Add section for linker generated
3495 __tls_get_addr_desc wrapper function. Loop at least once if
3496 generating this function.
3497 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3498 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3500 2020-01-22 Alan Modra <amodra@gmail.com>
3502 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3503 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3505 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3506 (STDU_R1_0R1, ADDI_R1_R1): Define.
3507 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3508 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3509 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3510 no_tls_get_addr_regsave.
3511 (branch_reloc_hash_match): Add hash3 and hash4.
3512 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3513 (ppc64_elf_size_dynamic_sections): Likewise.
3514 (ppc64_elf_relocate_section): Likewise.
3515 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3516 __tls_get_addr stub.
3517 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3519 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3520 eh_frame for regsave __tls_get_addr.
3522 2020-01-22 Alan Modra <amodra@gmail.com>
3524 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3525 which __tls_get_addr calls will be eliminated.
3527 2020-01-20 Nick Clifton <nickc@redhat.com>
3529 * po/pt.po: Updates Portuguese translation.
3530 * po/ru.po: Updated Russian translation.
3531 * po/uk.po: Updated Ukranian translation.
3533 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3536 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3537 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3539 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3540 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3541 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3542 "rex leal x@tlsdesc(%rip), %reg" to
3543 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3544 "call *(%eax)" to "nopl (%rax)".
3546 2020-01-20 Alan Modra <amodra@gmail.com>
3548 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3549 (MTLR_R11): Don't define.
3550 (LD_R0_0R3, CMPDI_R0_0): Define.
3551 (build_tls_get_addr_stub): Don't use r11 in stub.
3553 2020-01-20 Alan Modra <amodra@gmail.com>
3555 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3556 (defined_sym_val, is_tls_get_addr): Likewise.
3558 2020-01-18 Nick Clifton <nickc@redhat.com>
3560 * version.m4 (BFD_VERSION): Set to 2.34.50.
3561 * configure: Regenerate.
3562 * po/bfd.pot: Regenerate.
3564 2020-01-18 Nick Clifton <nickc@redhat.com>
3566 Binutils 2.34 branch created.
3568 2020-01-17 Christian Biesinger <cbiesinger@google.com>
3570 * coff-arm.c: Fix spelling error (seperate).
3571 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3573 * sysdep.h (strnlen): Fix spelling error (seperate).
3575 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
3578 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3580 2020-01-15 Alan Modra <amodra@gmail.com>
3583 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3584 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3585 of function symbols unless dot symbols are present. Do warn
3586 whenever one is created, regardles of whether a PLT entry is
3587 also emitted for the function symbol.
3589 2020-01-14 Alan Modra <amodra@gmail.com>
3591 * som.c (som_bfd_count_ar_symbols): Error when file position
3592 of symbols on chains is not strictly increasing.
3594 2020-01-14 Alan Modra <amodra@gmail.com>
3596 * vms.h (VMS_DEBUG): Define as 0.
3597 * vms-alpha.c (image_write): Move debug output after bounds check.
3599 (_bfd_vms_slurp_eihd): Warning fix.
3600 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
3602 2020-01-13 Alan Modra <amodra@gmail.com>
3604 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
3605 for "ignored" records.
3607 2020-01-13 Alan Modra <amodra@gmail.com>
3609 * wasm-module.c (wasm_scan_name_function_section): Formatting.
3610 Delete asect name check. Move asect NULL check to wasm_object_p.
3611 Correct bounds check of sizes against end. Replace uses of
3612 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
3613 just one bfd_release.
3614 (wasm_scan): Don't use malloc/strdup for section names,
3615 bfd_alloc instead. Simplify code prefixing section name.
3616 Formatting. Don't attempt to free memory here..
3617 (wasm_object_p): ..do so here.
3619 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
3622 * elf32-arm.c (elf32_arm_final_link_relocate): Use
3623 UNDEFWEAK_NO_DYNAMIC_RELOC.
3624 (allocate_dynrelocs_for_symbol): Likewise.
3626 2020-01-10 Tamar Christina <tamar.christina@arm.com>
3629 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3631 2020-01-10 Alan Modra <amodra@gmail.com>
3633 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3635 2020-01-09 Nick Clifton <nickc@redhat.com>
3638 * bfd.c (bfd_convert_section_contents): Check for a compress
3639 header size that is larger than the actual section size.
3641 2020-01-08 Alan Modra <amodra@gmail.com>
3644 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3645 after removing sections.
3647 2020-01-06 Jim Wilson <jimw@sifive.com>
3650 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3651 check for !bfd_link_pic (info).
3652 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3653 <R_RISCV_JAL>: Add comment.
3654 (_bfd_riscv_relax_section): For plt.offset check, add check for
3655 bfd_link_pic (info). Add comment.
3657 2020-01-06 Alan Modra <amodra@gmail.com>
3659 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3660 match failures. Don't init to bfd_error_wrong_format before
3661 calling _bfd_check_format.
3663 2020-01-06 Alan Modra <amodra@gmail.com>
3665 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3666 status rather than exiting on stack overflow or underflow.
3667 (_bfd_vms_slurp_etir): Adjust to suit.
3669 2020-01-06 Alan Modra <amodra@gmail.com>
3671 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3673 2020-01-06 Alan Modra <amodra@gmail.com>
3675 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3676 command. Check name offset is within command.
3677 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3678 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3679 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3680 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3681 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3682 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3683 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3684 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3685 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3686 (bfd_mach_o_read_segment): Similarly.
3687 (bfd_mach_o_read_thread): Properly bound check thread struct.
3688 Don't repeat checks on second loop.
3689 (bfd_mach_o_read_command): Fail on invalid command length.
3691 2020-01-04 Alan Modra <amodra@gmail.com>
3693 * format.c (bfd_check_format_matches): Add preserve_match.
3694 Save initial bfd state in "preserve", matched bfd state in
3695 "preserve_match". Save just the first match. Release
3696 bfd_alloc memory. Restore and finish preserved state as
3697 appropriate on all function exit paths.
3699 2020-01-04 Alan Modra <amodra@gmail.com>
3701 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3703 2020-01-04 Alan Modra <amodra@gmail.com>
3705 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3708 2020-01-03 Nick Clifton <nickc@redhat.com>
3711 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3712 there is enough data remaining in the code buffer before
3713 attempting to read a function stub.
3715 2020-01-03 Nick Clifton <nickc@redhat.com>
3718 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3719 return value from bfd_malloc.
3720 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3721 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3722 (elf32_arm_filter_cmse_symbols): Likewise.
3723 (elf32_arm_write_section): Likewise.
3724 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3725 (bfd_mach_o_follow_dsym): Likewise.
3726 * pef.c (bfd_pef_print_loader_section): Likewise.
3727 (bfd_pef_scan_start_address): Likewise.
3728 (bfd_pef_parse_function_stubs): Likewise.
3729 (bfd_pef_parse_symbols): Likewise.
3731 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3733 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3734 on binary inputs ld/PR25316.
3735 (is_ia64_elf): new helper to filter on ia64 objects.
3737 2020-01-03 Jan Beulich <jbeulich@suse.com>
3739 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3741 (bfd_mach_o_scan): Insert underscore in two variable names.
3743 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3745 * Makefile.am: Add z80-elf target support.
3746 * configure.ac: Likewise.
3747 * targets.c: Likewise.
3748 * Makefile.in: Regenerate.
3749 * configure: Regenerate.
3750 * config.bfd: Add z80-elf target support and new arches: ez80 and
3752 * elf32-z80.c: New file.
3753 * archures.c: Add new z80 architectures: eZ80 and Z180.
3754 * coffcode.h: Likewise.
3755 * cpu-z80.c: Likewise.
3756 * coff-z80.c: Add new relocations for Z80 target and local label
3758 * reloc.c: Add new relocs.
3759 * bfd-in2.h: Regenerate.
3760 * libbfd.h: Regenerate.
3762 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3766 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3768 2020-01-01 Alan Modra <amodra@gmail.com>
3770 Update year range in copyright notice of all files.
3772 For older changes see ChangeLog-2019
3774 Copyright (C) 2020 Free Software Foundation, Inc.
3776 Copying and distribution of this file, with or without modification,
3777 are permitted in any medium without royalty provided the copyright
3778 notice and this notice are preserved.
3784 version-control: never