1 2020-06-29 Alan Modra <amodra@gmail.com>
3 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
4 return value of bfd_bread. Don't read more than requested length.
5 Sanity check length. Properly terminate file name.
7 2020-06-29 Alan Modra <amodra@gmail.com>
9 * arc-got.h: Use C style comments.
10 * coff-z80.c: Likewise.
11 * elf32-csky.c: Likewise.
12 * peXXigen.c: Likewise.
13 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
16 2020-06-26 Pat Bernardi <bernardi@adacore.com>
18 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
19 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
21 2020-06-26 Alan Modra <amodra@gmail.com>
23 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
24 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
25 (riscv_get_priv_spec_name): Move to..
26 * cpu-riscv.c: ..here.
27 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
28 Use %u to print unsigned numbers.
30 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
32 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
35 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
38 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
39 _bfd_elf_add_dynamic_tags.
41 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
44 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
45 _bfd_elf_add_dynamic_tags.
47 2020-06-24 Alan Modra <amodra@gmail.com>
49 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
50 shifts without undefined behaviour.
52 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
54 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
56 (_bfd_elf_add_dynamic_tags): New.
57 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
58 _bfd_elf_add_dynamic_tags.
59 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
60 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
61 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
62 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
63 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
64 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
65 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
66 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
68 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
69 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
70 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
71 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
72 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
73 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
74 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
75 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
76 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
78 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
79 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
80 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
81 _bfd_elf_maybe_vxworks_add_dynamic_tags.
82 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
83 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
85 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
86 (_bfd_x86_elf_size_dynamic_sections): Likewise.
87 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
88 dt_reloc_sz and dt_reloc_ent.
89 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
90 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
92 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
93 etab.dt_pltgot_required.
94 (elf32_hppa_size_dynamic_sections): Call
95 _bfd_elf_add_dynamic_tags.
96 * elf32-metag.c (elf_metag_link_hash_table_create): Set
97 etab.dt_pltgot_required.
98 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
99 * elf32-sh.c (sh_elf_link_hash_table_create): Set
100 root.dt_pltgot_required for FDPIC output.
101 (sh_elf_size_dynamic_sections): Call
102 _bfd_elf_maybe_vxworks_add_dynamic_tags.
103 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
104 elf.dt_pltgot_required.
105 (elf_xtensa_size_dynamic_sections): Call
106 _bfd_elf_add_dynamic_tags.
107 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
108 root.dt_pltgot_required.
109 (elf64_hppa_size_dynamic_sections): Call
110 _bfd_elf_add_dynamic_tags.
111 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
112 root.dt_pltgot_required.
113 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
114 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
115 * elflink.c (_bfd_elf_add_dynamic_tags): New.
117 2020-06-22 Saagar Jha <saagar@saagarjha.com>
119 * mach-o.c: Support the new load commands by reading a linkedit
120 data command for them.
122 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
124 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
125 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
126 (riscv_get_priv_spec_class): Likewise.
127 (riscv_get_priv_spec_name): Likewise.
128 (riscv_get_priv_spec_class_from_numbers): New function, convert
129 the version numbers into string, then call riscv_get_priv_spec_class
130 to get the priv spec class.
131 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
132 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
133 (riscv_get_priv_spec_name): Likewise.
134 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
135 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
136 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
137 of input and output objects form their priv spec attributes by
138 riscv_get_priv_spec_class_from_numbers. Report warning rather than
139 errors when linking objects with differnet priv spec versions. We do
140 know v1.9.1 may have conflicts to other versions, so report the
141 warning, too. After that, update the output priv spec version to the
144 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
146 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
147 priv attributes, we will check the conflicts for all of them (major,
148 minor and revision), and then set the priv_attrs_merged to TRUE to
149 indicate that we have handled all of the priv attributes. Remove
150 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
152 2020-06-21 Alan Modra <amodra@gmail.com>
155 * configure.ac: Disable plugins by default for some targets.
156 * plugin.c: Comment typo fix.
157 * configure: Regenerate.
159 2020-06-19 Nick Clifton <nickc@redhat.com>
161 * plugin.c (try_load_plugin): Suppress the error message about
162 being unable to open a plugin if creating a list of viable
165 2020-06-16 Alan Modra <amodra@gmail.com>
167 * aout-tic30.c: Delete file.
168 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
169 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
170 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
171 (xc16x-*-elf): Sort properly.
172 * configure.ac: Remove tic30_aout_vec.
173 * targets.c: Likewise.
174 * Makefile.in: Regenerate.
175 * configure: Regenerate.
176 * po/SRC-POTFILES.in: Regenerate.
178 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
180 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
181 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
182 (elf32xtensa_abi): New global variable.
183 (xtensa_abi_choice): New function.
184 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
185 XSHAL_ABI to select PLT code.
187 2020-06-15 Roland McGrath <mcgrathr@google.com>
189 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
190 field of bfd_link_info.
192 2020-06-15 Alan Modra <amodra@gmail.com>
194 * config.bfd: Obsolete powerpcle-*-pe targets.
196 2020-06-15 Alan Modra <amodra@gmail.com>
199 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
200 symbols that were defined in discarded sections.
201 * cofflink.c (coff_link_check_archive_element): Likewise.
202 (coff_link_add_symbols): Set indx to -3 for symbols defined in
204 (_bfd_coff_write_global_sym): Don't emit such symbols.
205 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
206 libcoff.h: Regenerate.
208 2020-06-11 Alan Modra <amodra@gmail.com>
211 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
213 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
215 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
216 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
217 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
220 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
223 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
224 Clear verinfo.verdef.
226 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
229 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
230 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
231 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
233 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
234 Set ifunc_resolvers if there are FUNC resolvers.
235 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
236 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
237 with elf.ifunc_resolvers.
238 (write_plt_relocs_for_local_syms): Likewise.
239 (ppc64_elf_relocate_section): Likewise.
240 (ppc64_elf_finish_dynamic_sections): Likewise.
241 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
243 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
244 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
245 instead of readonly_dynrelocs_against_ifunc.
246 * elfxx-x86.h (elf_x86_link_hash_table): Remove
247 readonly_dynrelocs_against_ifunc.
249 2020-06-09 Alan Modra <amodra@gmail.com>
251 * elf64-ppc.c (struct ppc_link_hash_table): Delete
252 maybe_local_ifunc_resolver field.
253 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
254 cases where maybe_local_ifunc_resolver was set.
255 (ppc64_elf_relocate_section): Likewise.
256 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
259 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
261 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
263 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
265 (elf32_arm_size_dynamic_sections): Updated. Clear
266 root.tlsdesc_plt for DF_BIND_NOW.
267 (elf32_arm_finish_dynamic_sections): Updated.
268 (elf32_arm_output_arch_local_syms): Likewise.
269 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
270 Clear root.tlsdesc_plt for DF_BIND_NOW.
271 (nds32_elf_finish_dynamic_sections): Updated.
272 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
273 dt_tlsdesc_plt and dt_tlsdesc_got.
274 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
275 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
276 tlsdesc_plt and dt_tlsdesc_got.
277 (elfNN_aarch64_allocate_dynrelocs): Updated.
278 (elfNN_aarch64_finish_dynamic_sections): Likewise.
279 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
280 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
282 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
283 (_bfd_x86_elf_size_dynamic_sections): Likewise.
284 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
285 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
288 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
290 * elf32-tic6x.c (elf32_bed): Defined the default to
293 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
295 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
297 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
298 root.splt/root.srelplt.
299 (elf64_hppa_create_dynamic_sections): Likewise.
300 (elf64_hppa_size_dynamic_sections): Likewise.
301 (elf64_hppa_finish_dynamic_symbol): Likewise.
302 (elf_hppa_final_link): Likewise.
303 (elf_hppa_final_link_relocate): Likewise.
305 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
307 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
308 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
311 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
313 * elf-bfd.h (elf_target_os): New.
314 (elf_link_hash_table): Add target_os.
315 (elf_backend_data): Add target_os.
316 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
317 symbian_p and nacl_p.
318 (create_got_section): Updated.
319 (elf32_arm_create_dynamic_sections): Likewise.
320 (arm_type_of_stub): Likewise.
321 (elf32_arm_create_or_find_stub_sec): Likewise.
322 (elf32_arm_allocate_plt_entry): Likewise.
323 (elf32_arm_populate_plt_entry): Likewise.
324 (elf32_arm_final_link_relocate): Likewise.
325 (elf32_arm_check_relocs): Likewise.
326 (allocate_dynrelocs_for_symbol): Likewise.
327 (elf32_arm_finish_dynamic_symbol): Likewise.
328 (elf32_arm_finish_dynamic_sections): Likewise.
329 (elf32_arm_output_plt_map_1): Likewise.
330 (elf32_arm_output_arch_local_syms): Likewise.
331 (elf32_arm_add_symbol_hook): Likewise.
332 (elf32_arm_nacl_link_hash_table_create): Likewise.
333 (elf32_arm_vxworks_link_hash_table_create): Likewise.
334 (elf32_arm_symbian_link_hash_table_create): Likewise.
335 (ELF_TARGET_OS): New.
336 * elf32-i386.c (elf_i386_arch_bed): Removed.
337 (elf_backend_arch_data): Likewise.
338 (elf_i386_solaris_arch_bed): Likewise.
339 (elf_i386_nacl_arch_bed): Likewise.
340 (elf_i386_vxworks_arch_bed): Likewise.
341 (elf_i386_relocate_section): Updated.
342 (elf_i386_finish_dynamic_sections): Likewise.
343 (elf_i386_get_synthetic_symtab): Likewise.
344 (elf_i386_link_setup_gnu_properties): Likewise.
345 (ELF_TARGET_OS): New.
346 * elf32-mips.c (ELF_TARGET_OS): New.
347 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
348 (ppc_elf_create_got): Updated.
349 (ppc_elf_create_dynamic_sections): Likewise.
350 (ppc_elf_check_relocs): Likewise.
351 (ppc_elf_adjust_dynamic_symbol): Likewise.
352 (ppc_elf_size_dynamic_sections): Likewise.
353 (ppc_elf_relocate_section): Likewise.
354 (ppc_elf_finish_dynamic_sections): Likewise.
355 (ppc_elf_vxworks_link_hash_table_create): Likewise.
356 (ELF_TARGET_OS): New.
357 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
358 (sh_elf_link_hash_table_create): Updated.
359 (sh_elf_create_dynamic_sections): Likewise.
360 (allocate_dynrelocs): Likewise.
361 (sh_elf_size_dynamic_sections): Likewise.
362 (sh_elf_relocate_section): Likewise.
363 (sh_elf_finish_dynamic_symbol): Likewise.
364 (sh_elf_finish_dynamic_sections): Likewise.
365 (ELF_TARGET_OS): New.
366 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
368 (bfd_elf32_bfd_link_hash_table_create): Likewise.
369 (ELF_TARGET_OS): New.
370 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
371 (elf_x86_64_solaris_arch_bed): Likewise.
372 (elf_x86_64_nacl_arch_bed): Likewise.
373 (elf_x86_64_finish_dynamic_sections): Updated.
374 (elf_x86_64_get_synthetic_symtab): Likewise.
375 (elf_x86_64_link_setup_gnu_properties): Likewise.
376 (ELF_TARGET_OS): New.
377 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
379 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
380 (MIPS_ELF_REL_DYN_NAME): Updated.
381 (ELF_MIPS_GP_OFFSET): Likewise.
382 (mips_elf_create_local_got_entry): Likewise.
383 (mips_elf_allocate_dynamic_relocations): Likewise.
384 (mips_elf_count_got_symbols): Likewise.
385 (is_gott_symbol): Likewise.
386 (mips_elf_calculate_relocation): Likewise.
387 (mips_elf_create_dynamic_relocation): Likewise.
388 (_bfd_mips_elf_check_relocs): Likewise.
389 (allocate_dynrelocs): Likewise.
390 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
391 (mips_elf_lay_out_got): Likewise.
392 (mips_elf_set_plt_sym_value): Likewise.
393 (_bfd_mips_elf_size_dynamic_sections): Likewise.
394 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
395 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
396 (_bfd_mips_elf_final_link): Likewise.
397 (_bfd_mips_init_file_header): Likewise.
398 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
400 (allocate_dynrelocs): Likewise.
401 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
402 (_bfd_sparc_elf_relocate_section): Likewise.
403 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
404 (sparc_finish_dyn): Likewise.
405 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
406 * elfxx-target.h (ELF_TARGET_OS): New.
407 (elfNN_bed): Add ELF_TARGET_OS.
408 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
409 (_bfd_x86_elf_link_hash_table_create): Likewise.
410 (_bfd_x86_elf_size_dynamic_sections): Likewise.
411 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
412 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
413 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
414 * elfxx-x86.h (elf_x86_target_os): Removed.
415 (elf_x86_backend_data): Likewise.
416 (get_elf_x86_backend_data): Likewise.
417 (elf_x86_link_hash_table): Remove target_os.
419 2020-06-06 Alan Modra <amodra@gmail.com>
422 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
423 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
424 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
425 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
426 * elf64-ppc.c: Update throughout for reloc renaming.
427 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
428 * libbfd.h: Regenerate.
429 * bfd-in2.h: Regenerate.
431 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
434 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
437 2020-06-05 Nick Clifton <nickc@redhat.com>
439 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
442 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
444 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
445 priv_may_conflict, in_priv_zero and out_priv_zero to decide
446 whether the object can be linked according to it's priv
447 attributes. The object without any priv spec attributes can
448 be linked with others. If the first input object doesn't contain
449 any priv attributes, then we need to copy the setting from the
450 next input one. Also report more detailed error messages to user.
452 2020-06-04 Stephen Casner <casner@acm.org>
454 Extend pdp11-aout symbol table format to accommodate .stab
455 symbols and implement correct handling of them.
457 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
458 (N_STAB, is_stab): Needed new function is_stab to disambiguate
459 normal vs. .stab symbol table type values, replacing N_STAB mask.
460 (translate_from_native_sym_flags): Determine correct section for
461 different .stab types.
462 (translate_to_native_sym_flags): Leave .stab types intact.
463 (translate_symbol_table): Error if symbol indicates overlay;
464 store desc field from .stab symbols.
465 (write_syms): Output desc field with symbol.
466 (aout_link_check_ar_symbols): Skip .stab symbols.
467 (aout_link_add_symbols): Correctly distinguish .stab symbols.
468 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
469 (aout_link_write_symbols): Write 0 for desk and ovly fields;
470 correctly distinguish .stab symbols and select calculate their
471 section and value; and copy desc and ovly fields from input symbol
474 2020-06-04 Stephen Casner <casner@acm.org>
476 * aoutx.h (translate_symbol_table): Comment had external and
478 * pdp11.c (translate_symbol_table): Likewise.
480 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
482 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
483 (is_x86_elf): Check elf.hash_table_id instead of target_id.
484 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
486 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
489 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
490 in debug section against symbol defined in shared library to 0.
491 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
492 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
493 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
494 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
495 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
496 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
497 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
498 * elf32-sh.c (sh_elf_check_relocs): Likewise.
499 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
500 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
501 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
502 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
503 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
504 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
506 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
507 there is non-GOT reference.
508 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
509 non-alloced sections.
511 2020-06-03 Stephen Casner <casner@acm.org>
513 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
515 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
517 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
518 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
519 other size that doesn't qcover the header word.
520 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
521 string table, and zero it.
522 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
523 message and set bfd_error on finding an invalid name string offset.
524 (add_to_stringtab): INLINE -> inline
525 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
527 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
528 any relocs that could not be recognised.
529 92744f05809 PR 20929 - Check for relocs without an associated symbol.
530 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
531 name exists and is long enough, before attempting to see if it is
533 c3864421222 - Correct case for N_SO being the last symbol.
534 50455f1ab29 PR 20891 - Handle the case where the main file name
535 and the directory name are both empty.
536 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
537 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
538 range string table offsets.
539 531336e3a0b PR 20909 - Fix off-by-one error in check for an
540 illegal string offset.
541 (aout_link_includes_newfunc): Add comment.
542 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
543 on unexpected relocation type rather than ASSERT.
545 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
548 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
549 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
551 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
554 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
555 non-alloced sections.
557 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
559 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
560 dynamic relocations for non SEC_ALLOC sections.
562 2020-06-03 Gunther Nikl <gnikl@justmail.de>
564 * aout64.c (BMAGIC, QMAGIC): Do not define.
565 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
566 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
567 to check the file format.
568 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
569 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
570 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
572 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
574 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
575 relocations for non SEC_ALLOC sections.
577 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
579 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
580 * elf32-arm.c (maybe_set_textrel): Removed.
581 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
582 with _bfd_elf_maybe_set_textrel.
583 * elf32-csky.c (maybe_set_textrel): Removed.
584 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
585 with _bfd_elf_maybe_set_textrel.
586 * elf32-hppa.c (maybe_set_textrel): Removed.
587 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
588 with _bfd_elf_maybe_set_textrel.
589 * elf32-lm32.c (maybe_set_textrel): Removed.
590 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
591 with _bfd_elf_maybe_set_textrel.
592 * elf32-m32r.c (maybe_set_textrel): Removed.
593 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
594 with _bfd_elf_maybe_set_textrel.
595 * elf32-metag.c (maybe_set_textrel): Removed.
596 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
597 with _bfd_elf_maybe_set_textrel.
598 * elf32-nds32.c (maybe_set_textrel): Removed.
599 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
600 with _bfd_elf_maybe_set_textrel.
601 * elf32-or1k.c (maybe_set_textrel): Removed.
602 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
603 with _bfd_elf_maybe_set_textrel.
604 * elf32-ppc.c (maybe_set_textrel): Removed.
605 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
606 with _bfd_elf_maybe_set_textrel.
607 * elf32-s390.c (maybe_set_textrel): Removed.
608 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
609 with _bfd_elf_maybe_set_textrel.
610 * elf32-sh.c (maybe_set_textrel): Removed.
611 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
612 with _bfd_elf_maybe_set_textrel.
613 * elf32-tic6x.c (maybe_set_textrel): Removed.
614 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
615 with _bfd_elf_maybe_set_textrel.
616 * elf32-tilepro.c (maybe_set_textrel): Removed.
617 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
618 with _bfd_elf_maybe_set_textrel.
619 * elf64-ppc.c (maybe_set_textrel): Removed.
620 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
621 with _bfd_elf_maybe_set_textrel.
622 * elf64-s390.c (maybe_set_textrel): Removed.
623 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
624 with _bfd_elf_maybe_set_textrel.
625 * elfnn-aarch64.c (maybe_set_textrel): Removed.
626 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
627 with _bfd_elf_maybe_set_textrel.
628 * elfnn-riscv.c (maybe_set_textrel): Removed.
629 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
630 with _bfd_elf_maybe_set_textrel.
631 * elfxx-sparc.c (maybe_set_textrel): Removed.
632 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
633 with _bfd_elf_maybe_set_textrel.
634 * elfxx-tilegx.c (maybe_set_textrel): Removed.
635 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
636 with _bfd_elf_maybe_set_textrel.
637 * elfxx-x86.c (maybe_set_textrel): Removed.
638 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
639 with _bfd_elf_maybe_set_textrel.
640 * elflink.c (_bfd_elf_maybe_set_textrel): New.
642 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
645 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
647 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
648 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
649 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
650 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
652 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
653 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
654 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
655 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
656 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
657 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
658 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
659 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
660 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
661 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
662 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
663 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
664 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
665 (elf_backend_copy_indirect_symbol): Likewise.
666 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
667 (elf_backend_copy_indirect_symbol): Likewise.
668 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
670 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
673 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
674 * elf32-arm.c (readonly_dynrelocs): Removed.
675 (maybe_set_textrel): Replace readonly_dynrelocs with
676 _bfd_elf_readonly_dynrelocs.
677 * elf32-csky.c (readonly_dynrelocs): Removed.
678 (maybe_set_textrel): Replace readonly_dynrelocs with
679 _bfd_elf_readonly_dynrelocs.
680 * elf32-hppa.c(readonly_dynrelocs): Removed.
681 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
682 _bfd_elf_readonly_dynrelocs.
683 (maybe_set_textrel): Likewise.
684 * elf32-lm32.c (readonly_dynrelocs): Removed.
685 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
686 with _bfd_elf_readonly_dynrelocs.
687 (maybe_set_textrel): Likewise.
688 * elf32-m32r.c (readonly_dynrelocs): Removed.
689 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
690 with _bfd_elf_readonly_dynrelocs.
691 (maybe_set_textrel): Likewise.
692 * elf32-metag.c (readonly_dynrelocs): Removed.
693 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
694 with _bfd_elf_readonly_dynrelocs.
695 (maybe_set_textrel): Likewise.
696 * elf32-microblaze.c (readonly_dynrelocs): Removed.
697 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
698 with _bfd_elf_readonly_dynrelocs.
699 * elf32-nds32.c (readonly_dynrelocs): Removed.
700 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
701 with _bfd_elf_readonly_dynrelocs.
702 (maybe_set_textrel): Likewise.
703 * elf32-or1k.c (readonly_dynrelocs): Removed.
704 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
705 with _bfd_elf_readonly_dynrelocs.
706 * elf32-ppc.c (readonly_dynrelocs): Removed.
707 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
708 _bfd_elf_readonly_dynrelocs.
709 (ppc_elf_adjust_dynamic_symbol): Likewise.
710 (maybe_set_textrel): Likewise.
711 * elf32-s390.c (readonly_dynrelocs): Removed.
712 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
713 with _bfd_elf_readonly_dynrelocs.
714 (maybe_set_textrel): Likewise.
715 * elf32-sh.c (readonly_dynrelocs): Removed.
716 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
717 _bfd_elf_readonly_dynrelocs.
718 (maybe_set_textrel): Likewise.
719 * elf32-tic6x.c (readonly_dynrelocs): Removed.
720 (maybe_set_textrel): Replace readonly_dynrelocs with
721 _bfd_elf_readonly_dynrelocs.
722 * elf32-tilepro.c (readonly_dynrelocs): Removed.
723 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
724 with _bfd_elf_readonly_dynrelocs.
725 (maybe_set_textrel): Likewise.
726 * elf64-ppc.c (readonly_dynrelocs): Removed.
727 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
728 _bfd_elf_readonly_dynrelocs.
729 (ppc64_elf_adjust_dynamic_symbol): Likewise.
730 (maybe_set_textrel): Likewise.
731 * elf64-s390.c (readonly_dynrelocs): Removed.
732 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
733 with _bfd_elf_readonly_dynrelocs.
734 (maybe_set_textrel): Likewise.
735 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
736 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
737 (maybe_set_textrel): Replace readonly_dynrelocs with
738 _bfd_elf_readonly_dynrelocs.
739 * elfnn-riscv.c (readonly_dynrelocs): Removed.
740 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
741 with _bfd_elf_readonly_dynrelocs.
742 (maybe_set_textrel): Likewise.
743 * elfxx-sparc.c (readonly_dynrelocs): Removed.
744 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
745 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
746 (maybe_set_textrel): Likewise.
747 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
748 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
749 with _bfd_elf_readonly_dynrelocs.
750 (maybe_set_textrel): Likewise.
751 * elfxx-x86.c (readonly_dynrelocs): Removed.
752 (maybe_set_textrel): Replace readonly_dynrelocs with
753 _bfd_elf_readonly_dynrelocs.
754 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
756 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
758 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
759 -fsanitize=undefined.
761 2020-06-03 Alan Modra <amodra@gmail.com>
765 * peicode.h (pe_ILF_make_a_section): Align data for compilers
767 (pe_ILF_build_a_bfd): Likewise.
769 2020-06-03 Alan Modra <amodra@gmail.com>
772 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
773 core files as well as objects.
775 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
778 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
779 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
781 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
782 (elf_arc_link_hash_newfunc): Updated.
783 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
784 (elf32_arm_link_hash_newfunc): Updated.
785 (elf32_arm_copy_indirect_symbol): Likewise.
786 (elf32_arm_check_relocs): Likewise.
787 (readonly_dynrelocs): Likewise.
788 (allocate_dynrelocs_for_symbol): Likewise.
789 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
790 (csky_elf_link_hash_newfunc): Updated.
791 (csky_allocate_dynrelocs): Likewise.
792 (readonly_dynrelocs): Likewise.
793 (csky_elf_copy_indirect_symbol): Likewise.
794 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
795 (hppa_link_hash_newfunc): Updated.
796 (elf32_hppa_copy_indirect_symbol): Likewise.
797 (elf32_hppa_hide_symbol): Likewise.
798 (elf32_hppa_adjust_dynamic_symbol): Likewise.
799 (allocate_dynrelocs): Likewise.
800 (elf32_hppa_relocate_section): Likewise.
801 * elf32-i386.c (elf_i386_check_relocs): Likewise.
802 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
803 (lm32_elf_link_hash_newfunc): Likewise.
804 (lm32_elf_link_hash_table_create): Updated.
805 (readonly_dynrelocs): Likewise.
806 (allocate_dynrelocs): Likewise.
807 (lm32_elf_copy_indirect_symbol): Likewise.
808 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
809 (m32r_elf_link_hash_newfunc): Likewise.
810 (m32r_elf_link_hash_table_create): Updated.
811 (m32r_elf_copy_indirect_symbol): Likewise.
812 (allocate_dynrelocs): Likewise.
813 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
814 (metag_link_hash_newfunc): Updated.
815 (elf_metag_copy_indirect_symbol): Likewise.
816 (readonly_dynrelocs): Likewise.
817 (allocate_dynrelocs): Likewise.
818 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
820 (link_hash_newfunc): Updated.
821 (microblaze_elf_check_relocs): Likewise.
822 (microblaze_elf_copy_indirect_symbol): Likewise.
823 (readonly_dynrelocs): Likewise.
824 (allocate_dynrelocs): Likewise.
825 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
826 (nds32_elf_link_hash_newfunc): Updated.
827 (nds32_elf_copy_indirect_symbol): Likewise.
828 (readonly_dynrelocs): Likewise.
829 (allocate_dynrelocs): Likewise.
830 (nds32_elf_check_relocs): Likewise.
831 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
832 (link_hash_newfunc): Updated.
833 (nios2_elf32_copy_indirect_symbol): Likewise.
834 (nios2_elf32_check_relocs): Likewise.
835 (allocate_dynrelocs): Likewise.
836 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
837 (or1k_elf_link_hash_newfunc): Updated.
838 (readonly_dynrelocs): Likewise.
839 (allocate_dynrelocs): Likewise.
840 (or1k_elf_copy_indirect_symbol): Likewise.
841 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
842 (ppc_elf_link_hash_newfunc): Updated.
843 (ppc_elf_copy_indirect_symbol): Likewise.
844 (ppc_elf_check_relocs): Likewise.
845 (readonly_dynrelocs): Likewise.
846 (ppc_elf_adjust_dynamic_symbol): Likewise.
847 (allocate_dynrelocs): Likewise.
848 (ppc_elf_relocate_section): Likewise.
849 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
850 (link_hash_newfunc): Updated.
851 (elf_s390_copy_indirect_symbol): Likewise.
852 (readonly_dynrelocs): Likewise.
853 (elf_s390_adjust_dynamic_symbol): Likewise.
854 (allocate_dynrelocs): Likewise.
855 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
856 (sh_elf_link_hash_newfunc): Updated.
857 (readonly_dynrelocs): Likewise.
858 (allocate_dynrelocs): Likewise.
859 (sh_elf_copy_indirect_symbol): Likewise.
860 (sh_elf_check_relocs): Likewise.
861 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
862 (elf32_tic6x_link_hash_newfunc): Likewise.
863 (elf32_tic6x_link_hash_table_create): Updated.
864 (readonly_dynrelocs): Likewise.
865 (elf32_tic6x_check_relocs): Likewise.
866 (elf32_tic6x_allocate_dynrelocs): Likewise.
867 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
869 (link_hash_newfunc): Updated.
870 (tilepro_elf_copy_indirect_symbol): Likewise.
871 (tilepro_elf_check_relocs): Likewise.
872 (allocate_dynrelocs): Likewise.
873 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
874 (ppc64_elf_copy_indirect_symbol): Updated.
875 (ppc64_elf_check_relocs): Likewise.
876 (readonly_dynrelocs): Likewise.
877 (ppc64_elf_adjust_dynamic_symbol): Likewise.
878 (dec_dynrel_count): Likewise.
879 (allocate_dynrelocs): Likewise.
880 (ppc64_elf_relocate_section): Likewise.
881 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
882 (link_hash_newfunc): Updated.
883 (elf_s390_copy_indirect_symbol): Likewise.
884 (readonly_dynrelocs): Likewise.
885 (allocate_dynrelocs): Likewise.
886 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
887 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
889 (elfNN_aarch64_link_hash_newfunc): Updated.
890 (elfNN_aarch64_copy_indirect_symbol): Likewise.
891 (readonly_dynrelocs): Likewise.
892 (need_copy_relocation_p): Likewise.
893 (elfNN_aarch64_allocate_dynrelocs): Likewise.
894 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
895 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
896 (link_hash_newfunc): Updated.
897 (riscv_elf_copy_indirect_symbol): Likewise.
898 (riscv_elf_check_relocs): Likewise.
899 (readonly_dynrelocs): Likewise.
900 (allocate_dynrelocs): Likewise.
901 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
903 (link_hash_newfunc): Updated.
904 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
905 (_bfd_sparc_elf_check_relocs): Likewise.
906 (readonly_dynrelocs): Likewise.
907 (allocate_dynrelocs): Likewise.
908 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
909 (link_hash_newfunc): Updated.
910 (tilegx_elf_copy_indirect_symbol): Likewise.
911 (tilegx_elf_check_relocs): Likewise.
912 (readonly_dynrelocs): Likewise.
913 (allocate_dynrelocs): Likewise.
914 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
915 (readonly_dynrelocs): Likewise.
916 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
917 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
919 2020-06-01 Alan Modra <amodra@gmail.com>
921 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
922 command against cmd_length, not the end of record. For
923 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
924 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
927 2020-05-28 David Faust <david.faust@oracle.com>
929 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
930 R_BPF_INSN_{32,64} relocations.
932 2020-05-28 Stephen Casner <casner@acm.org>
934 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
935 addreses in .long (used in testsuites) and .stab values.
937 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
940 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
941 Check bfd_link_dll when issue a DT_TEXTREL warning.
942 * elfxx-x86.c (maybe_set_textrel): Likewise.
943 (_bfd_x86_elf_size_dynamic_sections): Likewise.
945 2020-05-26 Nick Clifton <nickc@redhat.com>
947 * plugin.c (try_load_plugin): Extend error message when a plugin
950 2020-05-23 Alan Modra <amodra@gmail.com>
952 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
954 2020-05-22 Alan Modra <amodra@gmail.com>
957 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
958 attributes from shared libraries, and do not return an error if
961 2020-05-21 Alan Modra <amodra@gmail.com>
964 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
966 (_bfd_delete_bfd): Free the copy.
967 (_bfd_new_bfd): Free nbfd->memory on error.
969 2020-05-21 Alan Modra <amodra@gmail.com>
971 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
972 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
973 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
974 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
975 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
976 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
977 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
978 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
979 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
980 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
981 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
982 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
983 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
984 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
985 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
986 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
987 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
988 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
989 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
990 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
992 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
994 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
995 get_default_version. It is used to find the default version for
996 the specific extension.
997 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
998 default_major_version and default_minor_version. Add new bfd_boolean
999 parameter *use_default_version. Set it to TRUE if we need to call
1000 the callback rps->get_default_version to find the default version.
1001 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1002 the default version in riscv_parsing_subset_version, and then call
1003 riscv_add_subset to add the subset into subset list.
1004 (riscv_parse_prefixed_ext): Likewise.
1005 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1006 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1007 strings rather than characters.
1008 riscv_merge_arch_attr_info): The callback function get_default_version
1009 is only needed for assembler, so set it to NULL int the linker.
1010 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1011 * elfxx-riscv.h: Updated.
1013 2020-05-20 Alan Modra <amodra@gmail.com>
1016 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1017 use bfd_set_filename.
1018 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1019 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1020 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1021 (bfd_create): Likewise.
1022 (_bfd_delete_bfd): Don't free filename.
1023 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1024 return pointer to the copy or NULL on alloc fail.
1025 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1026 result of bfd_set_filename.
1027 * bfd-in2.h: Regenerate.
1029 2020-05-20 Alan Modra <amodra@gmail.com>
1032 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1033 section size against file size.
1034 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1036 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1039 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1040 and memset when allocating memory for the sections_being_created
1043 2020-05-19 Stafford Horne <shorne@gmail.com>
1045 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1047 (or1k_elf_relocate_section): Access srelgot via
1048 htab->root.srelgot. Add assertions for srelgot->contents.
1049 Introduce local variable for srelgot to not reuse global
1051 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1052 (or1k_set_got_and_rela_sizes): New function.
1053 (or1k_initial_exec_offset): New function.
1054 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1055 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1057 (or1k_elf_check_relocs): Use OR to set TLS access.
1058 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1060 (or1k_elf_size_dynamic_sections): Use
1061 or1k_set_got_and_rela_sizes to set sizes.
1062 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1063 (TCB_SIZE): New macro.
1064 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1065 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1066 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1067 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1068 (tpoff): Add dynamic boolean argument.
1069 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1071 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
1073 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1074 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1075 cases with BFD_RELOC_AARCH64_JUMP26.
1076 (elfNN_aarch64_check_relocs): Likewise.
1078 2020-05-19 Alan Modra <amodra@gmail.com>
1080 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1081 bfd_get_filename rather than accessing bfd->filename directly.
1082 * aout-target.h (MY (object_p)): Likewise.
1083 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1084 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1085 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1086 (_bfd_archive_bsd44_construct_extended_name_table),
1087 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1088 (_bfd_bsd_write_armap): Likewise.
1089 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
1090 * cache.c (bfd_open_file): Likewise.
1091 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
1092 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
1093 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1094 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1095 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
1096 * elf32-nds32.c (nds32_elf_output_symbol_hook),
1097 (patch_tls_desc_to_ie): Likewise.
1098 * elf32-spu.c (sort_bfds, print_one_overlay_section),
1099 (spu_elf_auto_overlay): Likewise.
1100 * elf64-hppa.c (elf_hppa_final_link): Likewise.
1101 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
1102 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
1103 * elflink.c (bfd_elf_size_dynamic_sections),
1104 (elf_link_input_bfd): Likewise.
1105 * linker.c (_bfd_generic_link_output_symbols): Likewise.
1106 * mach-o.c (bfd_mach_o_follow_dsym),
1107 (bfd_mach_o_close_and_cleanup): Likewise.
1108 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
1109 (find_separate_debug_file, get_build_id_name): Likewise.
1110 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1111 * plugin.c (bfd_plugin_open_input): Likewise.
1112 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
1113 * som.c (som_write_armap): Likewise.
1114 * srec.c (srec_write_record, srec_write_symbols): Likewise.
1115 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1116 (_bfd_vms_lib_write_archive_contents): Likewise.
1117 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1119 2020-05-19 Alan Modra <amodra@gmail.com>
1122 * bfdio.c (_bfd_real_fopen): Typo fix.
1124 2020-05-18 Nick Clifton <nickc@redhat.com>
1127 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1128 for the sections_being_created array.
1130 2020-05-18 Alan Modra <amodra@gmail.com>
1132 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1133 they can be freed without also freeing internal_relocs.
1135 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1138 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1139 separators into DOS style when creating a WIN32 fullpath.
1141 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
1143 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1144 to initialize RISC-V tdata.
1146 2020-05-12 Gunther Nikl <gnikl@justmail.de>
1148 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1151 2020-05-11 Alan Modra <amodra@gmail.com>
1153 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1155 2020-05-11 Alan Modra <amodra@gmail.com>
1157 * elf64-ppc.c: Rename powerxx to power10 throughout.
1159 2020-05-11 Alan Modra <amodra@gmail.com>
1162 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1163 contains required number of auxents before processing any auxent.
1164 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1165 file name from auxents for PE.
1167 2020-05-04 Gunther Nikl <gnikl@justmail.de>
1169 * aout-cris.c (DEFAULT_ARCH): Delete define.
1170 (MY_set_arch_mach): Likewise.
1171 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1173 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1174 of r_type before the shift.
1176 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
1179 * elfnn-aarch64.c (group_sections): Copy implementation from
1182 2020-05-01 Alan Modra <amodra@gmail.com>
1185 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1186 accessing root.u.def of symbols. Also check root.u.def.section
1187 is non-NULL. Reverse tests so as to make the logic positive.
1189 2020-05-01 Alan Modra <amodra@gmail.com>
1192 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1193 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1195 2020-05-01 Alan Modra <amodra@gmail.com>
1198 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1199 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1200 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1201 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1202 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1203 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1204 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1205 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1206 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1207 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1209 2020-05-01 Alan Modra <amodra@gmail.com>
1212 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1213 from shared libraries.
1215 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1217 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1218 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1219 equals 0. Report overflow when the result has negative sign but
1220 all significant bits are zero.
1222 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1224 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1225 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1227 2020-04-28 Alan Modra <amodra@gmail.com>
1229 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1230 Emit warning message.
1232 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1234 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1235 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1236 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1237 to x86_64_pe_big_vec as it not a big-endian format.
1238 (vec i386_pe_big_vec): New.
1239 * configure.ac: Likewise.
1240 * targets.c: Likewise.
1241 * configure: Regenerate.
1242 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1243 COFF_WITH_PE_BIGOBJ): New.
1244 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1246 (x86_64_pe_be_vec): Moved.
1248 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1250 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1251 * elf.c (elfcore_grok_arc_v2): New function.
1252 (elfcore_grok_note): Call the new function to handle the corresponding
1254 (elfcore_write_arc_v2): New function.
1255 (elfcore_write_register_note): Call the new function to handle the
1256 corresponding pseudo-sections.
1258 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1261 * bfd-in2.h: Regenerated.
1262 * elf32-xtensa.c (elf_howto_table): New entries for
1263 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1264 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1265 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1266 R_XTENSA_NDIFF{8,16,32}.
1267 * libbfd.h (bfd_reloc_code_real_names): Add names for
1268 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1269 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1270 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1271 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1273 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1276 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1279 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1282 * elf-bfd.h (elf_backend_data): Add
1283 elf_backend_strip_zero_sized_dynamic_sections.
1284 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1285 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1287 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1289 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1291 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1293 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1295 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1297 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1299 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1301 2020-04-21 Nick Clifton <nickc@redhat.com>
1303 * po/sr.po: Updated Serbian translation.
1305 2020-04-21 Alan Modra <amodra@gmail.com>
1307 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1310 2020-04-20 Stephen Casner <casner@acm.org>
1312 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1313 causing globals from linker script to be treated as debug symbols.
1314 (translate_symbol_table): Don't sign-extend symbol values from 16
1315 to 64 bits in nm output.
1317 2020-04-20 Alan Modra <amodra@gmail.com>
1319 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1321 2020-04-18 Alan Modra <amodra@gmail.com>
1323 * section.c (bfd_is_const_section): Correct test for special
1325 * bfd-in2.h: Regenerate.
1327 2020-04-17 Alan Modra <amodra@gmail.com>
1330 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1333 2020-04-16 Nick Clifton <nickc@redhat.com>
1336 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1337 abort with a more helpful error message.
1339 2020-04-16 Alan Modra <amodra@gmail.com>
1342 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1345 2020-04-15 Fangrui Song <maskray@google.com>
1348 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1349 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1350 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1351 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1352 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1353 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1354 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1355 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1356 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1357 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1358 * elflink.c (elf_link_output_extsym): Likewise.
1359 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1361 2020-04-15 Alan Modra <amodra@gmail.com>
1364 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1365 pointer into strings that may be freed for section name, always
1366 allocate a new string.
1368 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1369 Jan W. Jagersma <jwjagersma@gmail.com>
1371 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1372 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1373 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1374 (_bfd_go32_mkobject): New functions.
1375 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1376 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1377 (go32exe_mkobject): Call _bfd_go32_mkobject.
1378 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1379 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1381 (coff_write_relocs): Enable extended reloc counter code if
1382 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1383 (coff_write_object_contents): Likewise. Pad section headers
1384 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1385 instead of coff_swap_scnhdr_out.
1386 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1387 enable extended reloc counter.
1388 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1389 Declare with ATTRIBUTE_UNUSED.
1390 * libcoff-in.h: (struct coff_tdata): New field go32.
1392 * libcoff.h: Regenerate.
1394 2020-04-14 Fangrui Song <maskray@google.com>
1397 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1400 2020-04-14 Stephen Casner <casner@acm.org>
1403 * pdp11.c: Add implementation of --imagic option.
1404 (adjust_o_magic): Fix objcopy --extract-symbol test.
1405 * libaout.h (enum aout_magic): Add i_magic.
1407 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1408 Nick Clifton <nickc@redhat.com>
1410 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1412 <default>: Error rather than abort.
1414 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1417 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1418 relocation section from section group.
1420 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1422 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1423 bfd->origin to file offset.
1424 * bfdwin.c (bfd_get_file_window): Likewise.
1425 * bfd.c: Clarify the use of the bfd->origin field.
1426 * bfd-in2.h: Regenerate.
1427 * coff-i386.c: Don't include go32exe.h. Allow overriding
1428 coff_write_object_contents via COFF_WRITE_CONTENTS.
1429 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1430 (go32exe_write_object_contents): New functions.
1431 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1432 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1433 (create_go32_stub): Remove check for 2k size limit. Read stub
1434 from go32exe_temp_stub if present.
1435 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1436 copy variable-length stub.
1437 (go32_check_format): Read stub to go32exe_temp_stub, set
1438 origin, return go32exe_cleanup.
1439 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1440 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1441 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1442 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1443 Remove functions and their associated #defines.
1444 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1445 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1446 Rename field go32stub to stub.
1447 * libcoff.h: Regenerate.
1448 * coff-stgo32.c (go32_check_format): Rename to...
1449 (go32exe_check_format): ...this.
1450 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1451 (go32exe_copy_private_bfd_data): ...this.
1452 (stub_bytes): Rename to...
1453 (go32exe_default_stub): ...this.
1454 (create_go32_stub): Rename to...
1455 (go32exe_create_stub): ...this.
1456 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1459 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1463 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1464 relocation to R_386_32 for relocation against non-preemptible
1466 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1467 allocate dynamic relocation for non-preemptible absolute symbol.
1468 (elf_i386_relocate_section): Pass sec to
1469 GENERATE_DYNAMIC_RELOCATION_P.
1470 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1471 (elf_x86_64_convert_load_reloc): Covert load relocation to
1472 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1473 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1474 for non-preemptible absolute symbol if they overflow.
1475 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1476 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1477 symbol. Don't allocate dynamic relocation for non-preemptible
1479 (elf_x86_64_relocate_section): Don't generate relative relocation
1480 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1481 to GENERATE_DYNAMIC_RELOCATION_P.
1482 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1483 against non-preemptible absolute symbol.
1484 (_bfd_elf_x86_valid_reloc_p): New function.
1485 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1487 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1488 argument. Don't generate dynamic relocation against
1489 non-preemptible absolute symbol.
1490 (ABS_SYMBOL_P): New.
1491 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1492 against non-preemptible absolute symbol.
1494 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1495 (_bfd_elf_x86_valid_reloc_p): New.
1497 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1500 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1501 address in the GOT if in thumb only mode.
1503 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1505 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1507 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1509 * mmo.c (mmo_scan): Create .text section only when needed, not
1512 2020-03-31 Alan Modra <amodra@gmail.com>
1514 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1517 2020-03-31 Alan Modra <amodra@gmail.com>
1519 * vms-alpha.c (image_write): Check bounds for sections without
1520 contents too. Error on non-zero write to section without
1522 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1524 2020-03-31 Alan Modra <amodra@gmail.com>
1526 * tekhex.c (pass_over): Check is_eof before reading buffer.
1528 2020-03-30 Nick Clifton <nickc@redhat.com>
1531 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1532 field to timestamp and make it an integer.
1533 * libcoff.h: Regenerate.
1534 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1535 field in the pe_data structure rather than the insert_timestamp
1538 2020-03-30 Alan Modra <amodra@gmail.com>
1541 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1544 2020-03-26 Nick Clifton <nickc@redhat.com>
1546 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1547 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1549 * libbfd.h: Regenerate.
1551 2020-03-26 Alan Modra <amodra@gmail.com>
1553 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1555 2020-03-26 Alan Modra <amodra@gmail.com>
1557 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1559 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1561 2020-03-25 Nick Clifton <nickc@redhat.com>
1563 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1565 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1566 * libbfd.h: Regenerate.
1568 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1570 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1571 correct field name in the output string.
1573 2020-03-25 Alan Modra <amodra@gmail.com>
1576 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1577 for SHT_NOBITS section if first in segment.
1579 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1582 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1583 (_bfd_elf_get_symbol_version_string): This.
1584 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1585 (_bfd_elf_get_symbol_version_string): This.
1586 (bfd_elf_print_symbol): Pass TRUE to
1587 _bfd_elf_get_symbol_version_string.
1588 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1589 bfd_boolean argument.
1590 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1591 * targets.c (_bfd_get_symbol_version_string): Likewise.
1592 (bfd_get_symbol_version_string): Likewise.
1593 * bfd-in2.h: Regenerated.
1595 2020-03-24 Nick Clifton <nickc@redhat.com>
1596 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1599 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1602 2020-03-24 Nick Clifton <nickc@redhat.com>
1605 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1606 segment to use for PT_GNU_RELRO, ignore empty sections in a
1607 segment's current list.
1609 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1612 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1614 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1617 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1618 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1619 on the previous _bfd_elf_get_symbol_version_string.
1620 (_bfd_elf_get_symbol_version_string): Use it.
1622 2020-03-24 Alan Modra <amodra@gmail.com>
1624 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1625 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1628 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1630 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1632 2020-03-23 Alan Modra <amodra@gmail.com>
1634 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1635 symbol count. Allocate an extra byte to ensure name strings
1636 are terminated. Sanity check name offsets. Release memory on
1639 2020-03-23 Alan Modra <amodra@gmail.com>
1641 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1642 field hasn't been read. Remove unnecessary casts.
1644 2020-03-22 Alan Modra <amodra@gmail.com>
1646 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1647 enough to read number of symbols.
1649 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1651 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1652 (EXECUTABLE_SUFFIX): Likewise.
1653 * config.in: Regenerated.
1654 * configure: Likewise.
1655 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1656 _bfd_generic_close_and_cleanup.
1657 (plugin_list_entry): Remove resolution_file, resolution_option,
1658 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1659 lto_wrapper, gcc_env and initialized,
1660 (need_lto_wrapper_p): Removed.
1661 (get_lto_wrapper): Likewise.
1662 (setup_lto_wrapper_env): Likewise.
1663 (register_all_symbols_read): Likewise.
1664 (egister_cleanup): Likewise.
1665 (get_symbols): Likewise.
1666 (add_input_file): Likewise.
1667 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1668 (add_symbols): Updated.
1669 (try_claim): Likewise.
1670 (try_load_plugin): Likewise.
1671 (bfd_plugin_canonicalize_symtab): Likewise.
1672 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1673 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1675 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1678 * plugin.c (plugin_list_entry): Add has_symbol_type.
1679 (add_symbols_v2): New function.
1680 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1681 provides symbol type.
1682 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1683 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1686 2020-03-20 Alan Modra <amodra@gmail.com>
1688 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1689 enough to read number of symbols.
1691 2020-03-20 Alan Modra <amodra@gmail.com>
1693 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1694 backend functions for NULL before calling.
1695 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1696 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1697 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1698 * elfnn-ia64.c (ignore_errors): New function.
1699 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1701 2020-03-19 Nick Clifton <nickc@redhat.com>
1704 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1705 location of the varinfo in the unit's debug info data. Change the
1706 type of the stack field to a boolean.
1707 (lookup_var_by_offset): New function. Returns the varinfo
1708 structure for the variable described at the given offset in the
1710 (scan_unit_for_symbols): Add support for variables which have the
1711 DW_AT_specification attribute.
1713 2020-03-19 Nick Clifton <nickc@redhat.com>
1716 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1719 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1721 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1723 2020-03-18 Nick Clifton <nickc@redhat.com>
1726 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1727 memory access when processing a corrupt secondary reloc section.
1729 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1731 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1732 instead of calling abort.
1733 * elf32-csky.c (csky_build_one_stub): Likewise.
1734 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1735 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1736 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1737 * elf32-metag.c (metag_build_one_stub): Likewise.
1738 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1739 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1740 (ppc_size_one_stub): Likewise.
1741 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1743 2020-03-17 Nick Clifton <nickc@redhat.com>
1746 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1747 with error messages.
1749 2020-03-17 Nick Clifton <nickc@redhat.com>
1752 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1753 free. Add free on another failure path.
1755 2020-03-16 Alan Modra <amodra@gmail.com>
1758 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1759 we have a non-zero section count. Do lma comparison in octets.
1761 2020-03-16 Alan Modra <amodra@gmail.com>
1763 * vms-alpha.c (dst_restore_location): Validate index into
1764 dst_ptr_offsets array before accessing. Return status.
1765 (dst_retrieve_location): Similarly, making "loc" parameter a
1766 pointer to return value.
1767 (_bfd_vms_slurp_etir): Update calls to above functions.
1769 2020-03-14 Kamil Rytarowski <n54@gmx.com>
1771 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1773 * configure: Regenerated.
1775 2020-03-14 Alan Modra <amodra@gmail.com>
1777 * section.c (BFD_FAKE_SECTIONS): Formatting.
1778 * bfd-in2.h: Regenerate.
1780 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1782 * elf.c (elfcore_grok_netbsd_note): Add support for
1783 NT_NETBSDCORE_LWPSTATUS notes.
1785 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1787 * bfd-in2.h: Regenerate.
1788 * section.c (asection): Add already_assigned field.
1789 (BFD_FAKE_SECTION): Add default initializer for it.
1790 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1791 * elf32-arm.c (arm_build_one_stub): Add support for
1792 non_contiguous_regions.
1793 * elf32-csky.c (csky_build_one_stub): Likewise.
1794 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1795 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1796 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1797 * elf32-metag.c (metag_build_one_stub): Likewise.
1798 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1799 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1800 (ppc_size_one_stub): Likewise.
1801 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1802 * elflink.c (elf_link_input_bfd): Likewise.
1804 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1807 * elf-linker-x86.h (elf_linker_x86_params): Add
1808 static_before_all_inputs and has_dynamic_linker.
1809 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1810 dynamic input objects if -static is passed at command-line
1811 before all input files without --dynamic-linker unless
1812 --no-dynamic-linker is used.
1814 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1816 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1818 2020-03-13 Christian Eggers <ceggers@gmx.de>
1820 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1821 "p_paddr" from "at".
1822 * elfcode.h (bfd_from_remote_memory): Add units to several
1823 parameters. New local "opb". Fix usage of p_align. Fix
1824 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1825 call of target_read_memory.
1826 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1827 calculation of "offset" and "output_offset".
1828 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1829 from "offset" and fix calculation of "end" from "vma+size". Fix
1830 comparison between "sh_addr" and "vma"/"output_offset".
1831 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1832 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1834 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1835 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1836 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1837 assignment of p_paddr from phdr_lma. Fix comparison between
1838 "lma+size" and "next->lma".
1839 (elf_sort_segments): Fix assignment from p_paddr to lma.
1840 (assign_file_positions_for_load_sections): Add unit (bytes) to
1841 local "align". Fix calculation of local "off_adjust". Fix
1842 calculation of local "filehdr_vaddr".
1843 (assign_file_positions_for_non_load_sections): New local "opb".
1844 Fix calculation of "end" from "p_size". Fix comparison between
1845 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1846 from "end" and "p_vaddr".
1847 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1848 vma. Fix assignment to p_paddr from lma. Fix comparison between
1849 p_paddr and lma. Fix assignment to p_paddr from lma.
1850 * merge.c (sec_merge_emit): New local "opb". Convert
1851 "alignment_power" to octets.
1852 (_bfd_add_merge_section): New locals "alignment_power" and
1853 "opb". Fix comparison between "alignment_power" and
1855 (_bfd_merge_sections): New local "opb". Divide size by opb
1856 before checking align mask.
1858 2020-03-13 Christian Eggers <ceggers@gmx.de>
1860 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1861 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1863 (_bfd_elf_make_section_from_phdr): Similarly.
1864 (elf_fake_sections): Fix calculation of
1865 Elf_Internal_shdr::sh_addr from section VMA.
1866 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1868 (assign_file_positions_for_load_sections): Fix calculations of
1869 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1870 comparison between program header address and section LMA.
1871 (assign_file_positions_for_non_load_sections): Likewise.
1872 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1873 (IS_CONTAINED_BY_VMA): Add parameter opb.
1874 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1875 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1876 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1877 Fix calculations of p_addr_valid and p_vaddr_offset.
1878 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1879 with octets per byte when comparing against p_vaddr.
1881 2020-03-11 Alan Modra <amodra@gmail.com>
1883 * som.c (setup_sections): Sanity check subspace.name.
1885 2020-03-11 Alan Modra <amodra@gmail.com>
1887 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1889 2020-03-10 Alan Modra <amodra@gmail.com>
1892 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1895 2020-03-09 Alan Modra <amodra@gmail.com>
1897 * wasm-module.c (wasm_scan): Sanity check file name length
1898 before allocating memory. Move common section setup code. Do
1899 without bfd_tell to calculate section size.
1901 2020-03-06 Nick Clifton <nickc@redhat.com>
1903 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1904 with error messages and failure return values.
1906 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1908 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1909 relocation sections for any removed reference to a dynamic symbol.
1911 2020-03-05 Nick Clifton <nickc@redhat.com>
1913 * elf-bfd.h (struct elf_backend_data): Add new fields:
1914 init_secondary_reloc_section, slurp_secondary_reloc_section,
1915 write_secondary_reloc_section.
1916 (_bfd_elf_init_secondary_reloc_section): Prototype.
1917 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1918 (_bfd_elf_write_secondary_reloc_section): Prototype.
1919 * elf.c ( bfd_section_from_shdr): Invoke the new
1920 init_secondary_reloc_section backend function, if defined, when a
1921 second reloc section is encountered.
1922 (swap_out_syms): Invoke the new symbol_section_index function, if
1923 defined, when computing the section index of an OS/PROC specific
1925 (_bfd_elf_init_secondary_reloc_section): New function.
1926 (_bfd_elf_slurp_secondary_reloc_section): New function.
1927 (_bfd_elf_write_secondary_reloc_section): New function.
1928 (_bfd_elf_copy_special_section_fields): New function.
1929 * elfcode.h (elf_write_relocs): Invoke the new
1930 write_secondary_relocs function, if defined, in order to emit
1932 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1933 function, if defined, in order to read in secondary relocs.
1934 * elfxx-target.h (elf_backend_copy_special_section_fields):
1935 Provide a non-NULL default definition.
1936 (elf_backend_init_secondary_reloc_section): Likewise.
1937 (elf_backend_slurp_secondary_reloc_section): Likewise.
1938 (elf_backend_write_secondary_reloc_section): Likewise.
1939 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1941 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1942 * configure: Regenerate.
1944 2020-03-05 Alan Modra <amodra@gmail.com>
1946 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1947 against file size before allocating memory. Use bfd_alloc rather
1948 than bfd_zalloc for carsym/strings memory.
1950 2020-03-04 Alan Modra <amodra@gmail.com>
1952 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1953 sh_addr mod sh_addalign is zero.
1955 2020-03-04 Alan Modra <amodra@gmail.com>
1957 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1959 2020-03-03 Alan Modra <amodra@gmail.com>
1961 * format.c (struct bfd_preserve): Add cleanup field.
1962 (bfd_preserve_save): Add cleanup param and save.
1963 (bfd_preserve_restore): Return cleanup.
1964 (bfd_preserve_finish): Call the cleanup for the discarded match.
1965 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1966 and clear when preserving a match. Restore cleanup too when
1967 restoring that match.
1969 2020-03-02 Alan Modra <amodra@gmail.com>
1971 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1972 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1973 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1974 (core_sco5_vec): Correct initialisers.
1976 2020-03-02 Alan Modra <amodra@gmail.com>
1978 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1979 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1980 * cisco-core.c (cisco_core_file_validate): Likewise.
1981 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1982 * hpux-core.c (hpux_core_core_file_p): Likewise.
1983 * irix-core.c (irix_core_core_file_p): Likewise.
1984 * lynx-core.c (lynx_core_file_p): Likewise.
1985 * netbsd-core.c (netbsd_core_file_p): Likewise.
1986 * osf-core.c (osf_core_core_file_p): Likewise.
1987 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1988 * sco5-core.c (sco5_core_file_p): Likewise.
1990 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1992 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1994 2020-03-02 Alan Modra <amodra@gmail.com>
1996 * targets.c (bfd_cleanup): New typedef.
1997 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1998 * libbfd-in.h (_bfd_no_cleanup): Define.
1999 * format.c (bfd_reinit): Add cleanup parameter, call it.
2000 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2001 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2002 * aout-target.h (callback, object_p): Return bfd_cleanup.
2003 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2004 * archive.c (bfd_generic_archive_p): Likewise.
2005 * binary.c (binary_object_p): Likewise.
2006 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2007 * coff-ia64.c (ia64coff_object_p): Likewise.
2008 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2009 * coff-sh.c (coff_small_object_p): Likewise.
2010 * coff-stgo32.c (go32_check_format): Likewise.
2011 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2012 (xcoff64_core_p): Likewise.
2013 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2014 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2015 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2016 * elfcode.h (elf_object_p): Likewise.
2017 * elfcore.h (elf_core_file_p): Likewise.
2018 * i386msdos.c (msdos_object_p): Likewise.
2019 * ihex.c (ihex_object_p): Likewise.
2020 * libaout.h (some_aout_object_p): Likewise.
2021 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2022 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2023 * libbfd.c (_bfd_dummy_target): Likewise.
2024 * libcoff-in.h (coff_object_p): Likewise.
2025 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2026 (bfd_mach_o_arm64_core_p): Likewise.
2027 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2028 (bfd_mach_o_arm_core_p): Likewise.
2029 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2030 (bfd_mach_o_i386_core_p): Likewise.
2031 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2032 (bfd_mach_o_x86_64_core_p): Likewise.
2033 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2034 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2035 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2036 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2037 * mmo.c (mmo_object_p): Likewise.
2038 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2039 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2040 (pe_bfd_object_p): Likewise.
2041 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2042 * ppcboot.c (ppcboot_object_p): Likewise.
2043 * rs6000-core.c (rs6000coff_core_p): Likewise.
2044 * som.c (som_object_setup, som_object_p): Likewise.
2045 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2046 * tekhex.c (tekhex_object_p): Likewise.
2047 * vms-alpha.c (alpha_vms_object_p): Likewise.
2048 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2049 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2050 * wasm-module.c (wasm_object_p): Likewise.
2051 * xsym.c (bfd_sym_object_p): Likewise.
2052 * xsym.h (bfd_sym_object_p): Likewise.
2053 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2055 * pdp11.c (some_aout_object_p): Likewise.
2056 * plugin.c (register_ld_plugin_object_p): Update object_p
2058 * plugin.h (register_ld_plugin_object_p): Likewise.
2059 * bfd-in2.h: Regenerate.
2060 * libbfd.h: Regenerate.
2061 * libcoff.h: Regenerate.
2063 2020-03-02 Alan Modra <amodra@gmail.com>
2065 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2066 applicable section flags.
2067 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2068 (mips_ecoff_bele_vec): Likewise.
2069 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2071 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2072 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2074 2020-03-02 Alan Modra <amodra@gmail.com>
2076 * elf32-m32r.c (m32r_elf_section_flags): New function.
2077 (elf_backend_section_flags): Define.
2078 * elf32-nds32.c (nds32_elf_section_flags): New function.
2079 (elf_backend_section_flags): Define.
2080 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2081 .sbss and .sdata sections.
2082 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2083 for SHF_V850_GPREL sections.
2084 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2086 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2087 for SHF_PARISC_SHORT sections.
2088 * elf64-ppc.c (ppc64_elf_section_flags): New function.
2089 (elf_backend_section_flags): Define.
2090 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
2091 for SHF_MIPS_GPREL sections. Delete FIXME.
2093 2020-03-02 Alan Modra <amodra@gmail.com>
2095 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
2096 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
2097 calling elf_backend_section_flags with adjusted params. Use
2098 newsect->flags past that point.
2099 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
2101 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
2102 to have their type overridden, and all sh_flags but processor and
2104 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
2105 * elf32-mep.c (mep_elf_section_flags): Likewise.
2106 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
2107 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
2108 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
2109 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
2110 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
2111 stub BFD and non-aarch64 input files when scanning for stubs.
2113 2020-03-02 Alan Modra <amodra@gmail.com>
2115 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2116 limit to decompressed element size.
2118 2020-03-02 Alan Modra <amodra@gmail.com>
2120 * vms-lib.c (vms_traverse_index): Add recur_count param and
2121 update calls. Fail on excessive recursion.
2123 2020-03-02 Alan Modra <amodra@gmail.com>
2125 * vms-alpha.c (vms_get_remaining_object_record): Use
2126 bfd_realloc_or_free rather than bfd_realloc.
2127 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2128 (dst_define_location, parse_module): Likewise, and check realloc
2129 return status before using memory. Return status from function
2130 adjusting all callers.
2132 2020-02-28 Alan Modra <amodra@gmail.com>
2134 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2136 2020-02-28 Alan Modra <amodra@gmail.com>
2138 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2139 Remove duplicate undersize check.
2141 2020-02-27 Alan Modra <amodra@gmail.com>
2144 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2146 2020-02-27 Alan Modra <amodra@gmail.com>
2149 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2150 (coff_section_type): Adjust comment.
2151 (decode_section_type): Likewise. Call coff_section_type before
2152 decode_section_type.
2153 (bfd_decode_symclass): Use 'c' for common sections other than
2156 2020-02-27 Alan Modra <amodra@gmail.com>
2158 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2161 2020-02-27 Alan Modra <amodra@gmail.com>
2163 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2164 if file is an archive element.
2165 * bfd-in2.h: Regenerate.
2167 2020-02-26 Alan Modra <amodra@gmail.com>
2169 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2170 bfd_set_error on failing test. Don't bother changing bfd_error on
2171 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2172 Check sym name is within string buffer. Use size_t for some vars.
2173 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2174 int_buf. Don't change bfd_error on file read error. Use
2175 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2176 calculations to catch overflows before they occur. malloc and
2177 free raw armap rather than using bfd_alloc. Read raw armap before
2178 allocating carsym+strings buffer.
2179 (_bfd_slurp_extended_name_table): Localize variables. Check
2180 name size against file size.
2182 2020-02-26 Alan Modra <amodra@gmail.com>
2184 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2186 2020-02-26 Alan Modra <amodra@gmail.com>
2188 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2189 malloc. Check for NULL return from bfd_malloc.
2190 (rx_table_find, rx_table_map): Likewise.
2191 (rx_set_section_contents): Check bfd_alloc return.
2192 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2194 2020-02-26 Alan Modra <amodra@gmail.com>
2196 * aoutx.h: Indent labels correctly. Format error strings.
2197 * archive.c: Likewise.
2198 * archive64.c: Likewise.
2199 * coff-arm.c: Likewise.
2200 * coff-rs6000.c: Likewise.
2201 * coff-stgo32.c: Likewise.
2202 * cpu-arm.c: Likewise.
2203 * dwarf2.c: Likewise.
2204 * elf-ifunc.c: Likewise.
2205 * elf-properties.c: Likewise.
2206 * elf-s390-common.c: Likewise.
2207 * elf-strtab.c: Likewise.
2209 * elf32-arm.c: Likewise.
2210 * elf32-bfin.c: Likewise.
2211 * elf32-cr16.c: Likewise.
2212 * elf32-csky.c: Likewise.
2213 * elf32-i386.c: Likewise.
2214 * elf32-m68k.c: Likewise.
2215 * elf32-msp430.c: Likewise.
2216 * elf32-nds32.c: Likewise.
2217 * elf32-nios2.c: Likewise.
2218 * elf32-pru.c: Likewise.
2219 * elf32-xtensa.c: Likewise.
2220 * elf64-ia64-vms.c: Likewise.
2221 * elf64-x86-64.c: Likewise.
2222 * elfcode.h: Likewise.
2223 * elfcore.h: Likewise.
2224 * elflink.c: Likewise.
2225 * elfnn-aarch64.c: Likewise.
2226 * elfnn-ia64.c: Likewise.
2227 * elfnn-riscv.c: Likewise.
2228 * elfxx-mips.c: Likewise.
2229 * elfxx-sparc.c: Likewise.
2230 * elfxx-x86.c: Likewise.
2231 * i386lynx.c: Likewise.
2232 * merge.c: Likewise.
2233 * pdp11.c: Likewise.
2234 * plugin.c: Likewise.
2235 * reloc.c: Likewise.
2237 2020-02-26 Alan Modra <amodra@gmail.com>
2240 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2242 (bfd_elf_add_dt_needed_tag): Declare.
2243 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2244 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2245 from elf_add_dt_needed_tag. Remove soname and doit param.
2246 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2247 to see whether as-needed lib is already loaded, use dyn_loaded
2248 list instead. When saving and restoring around as-needed lib
2249 handle possibility that dynstr has not been initialised. Don't
2250 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2251 Mark libs loaded via DT_NEEDED entries of other libs with
2252 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2254 (elf_link_check_versioned_symbol): Remove now unneccesary
2255 DYNAMIC check when traversing dyn_loaded list.
2257 2020-02-26 Alan Modra <amodra@gmail.com>
2259 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2261 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2264 * plugin.c (need_lto_wrapper_p): New.
2265 (bfd_plugin_set_program_name): Add an int argument to set
2267 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2269 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2271 2020-02-24 Alan Modra <amodra@gmail.com>
2273 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2275 2020-02-24 Alan Modra <amodra@gmail.com>
2277 * vms-lib.c (struct carsym_mem): Add limit.
2278 (vms_add_index): Heed limit.
2279 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2280 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2281 Always return actual number read.
2282 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2283 assertion with error exit.
2285 2020-02-22 Alan Modra <amodra@gmail.com>
2288 * elf.c (assign_file_positions_for_load_sections): Continue linking
2289 on "PHDR segment not covered by LOAD segment" errors.
2291 2020-02-21 Alan Modra <amodra@gmail.com>
2293 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2295 (bfd_mach_o_canonicalize_reloc): Likewise.
2296 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2297 counts and offsets against file size.
2298 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2299 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2300 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2301 against file size. Delete symbol table error message.
2302 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2304 (bfd_mach_o_read_symtab): Likewise.
2305 (bfd_mach_o_read_command): Pass file size.
2306 (bfd_mach_o_scan): Sanity check command count against file size.
2308 2020-02-21 Alan Modra <amodra@gmail.com>
2311 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2312 "text", "data" and "bss" section pointer vars. Don't update
2313 section size, just exec header sizes.
2314 (adjust_sizes_and_vmas): Don't update text section size. Set
2315 initial exec header a_text. Print exec headers sizes.
2316 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2317 (adjust_sizes_and_vmas): Similarly. Formatting.
2318 (final_link): Correct final file extension.
2320 2020-02-20 Nick Clifton <nickc@redhat.com>
2322 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2324 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2326 (elfNN_bed): Initialise the symbol_section_index field.
2327 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2328 OS and PROC specific section indicies. Warn if converting other
2329 reserved incidies to SHN_ABS.
2331 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2334 * cpu-z80.c: Add machine type compatibility checking.
2336 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2339 * plugin.c (plugin_list_entry): Remove handle.
2340 (try_load_plugin): Call dlclose before return.
2342 2020-02-19 Alan Modra <amodra@gmail.com>
2344 * libbfd-in.h (_bfd_constant_p): Define.
2345 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2346 file size before allocating memory.
2347 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2348 * elf.c (bfd_elf_get_str_section): Likewise.
2349 (_bfd_elf_slurp_version_tables): Likewise.
2350 * libbfd.h: Regenerate.
2352 2020-02-19 Alan Modra <amodra@gmail.com>
2354 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2355 * aoutx.h (aout_get_external_symbols): Replace calls to
2356 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2357 (slurp_reloc_table): Likewise.
2358 * archive.c (do_slurp_bsd_armap): Likewise.
2359 (do_slurp_coff_armap): Likewise.
2360 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2361 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2362 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2363 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2364 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2365 (_bfd_coff_get_external_symbols): Likewise.
2366 * ecoff.c (ecoff_slurp_symbolic_header),
2367 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2368 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2369 (ecoff_indirect_link_order): Likewise.
2370 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2371 (_bfd_elf_slurp_version_tables): Likewise.
2372 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2373 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2374 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2375 * elf64-alpha.c (READ): Likewise.
2376 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2377 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2378 * elfcode.h (elf_slurp_symbol_table),
2379 (elf_slurp_reloc_table_from_section): Likewise.
2380 * elflink.c (elf_link_add_object_symbols),
2381 (elf_link_check_versioned_symbol): Likewise.
2382 * elfxx-mips.c (READ): Likewise.
2383 * i386lynx.c (slurp_reloc_table): Likewise.
2384 * lynx-core.c (lynx_core_file_p): Likewise.
2385 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2386 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2387 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2388 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2389 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2390 (bfd_pef_parse_symbols): Likewise.
2391 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2392 * som.c (setup_sections, som_slurp_string_table),
2393 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2394 (som_bfd_fill_in_ar_symbols): Likewise.
2395 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2396 (evax_bfd_print_image): Likewise.
2397 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2398 * wasm-module.c (wasm_scan): Likewise.
2399 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2400 * xsym.c (bfd_sym_read_name_table),
2401 (bfd_sym_print_type_information_table_entry): Likewise.
2402 * libbfd.h: Regenerate.
2404 2020-02-19 Alan Modra <amodra@gmail.com>
2406 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2407 reading external relocs.
2408 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2409 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2411 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2413 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2414 (m32c_elf_relax_section): Likewise.
2415 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2416 (rl78_elf_relax_section): Likewise.
2417 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2418 (elf32_rx_relax_section): Likewise.
2419 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2420 parameter types and use..
2421 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2422 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2423 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2424 being read from file, just the extra.
2425 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2426 after reading external syms. Free on failure.
2428 2020-02-19 Alan Modra <amodra@gmail.com>
2430 * coffcode.h (buy_and_read, coff_slurp_line_table),
2431 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2432 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2433 corresponding bfd_alloc call. Adjust variables to suit.
2434 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2435 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2436 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2437 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2438 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2439 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2440 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2441 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2442 * elf64-alpha.c (READ): Likewise.
2443 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2444 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2445 (bfd_from_remote_memory): Likewise.
2446 * elfcore.h (core_find_build_id): Likewise.
2447 * elfxx-mips.c (READ): Likewise.
2448 * mach-o.c (bfd_mach_o_mangle_sections),
2449 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2450 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2451 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2452 * som.c (setup_sections, som_prep_for_fixups)
2453 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2454 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2455 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2456 (som_bfd_ar_write_symbol_stuff): Likewise.
2457 * vms-alpha.c (vector_grow1): Likewise.
2458 * vms-lib.c (vms_add_index): Likewise.
2459 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2460 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2461 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2462 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2463 (bfd_alloc2, bfd_zalloc2): Delete.
2464 (_bfd_mul_overflow): Define.
2465 * libbfd.h: Regenerate.
2467 2020-02-19 Alan Modra <amodra@gmail.com>
2469 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2471 (assign_section_numbers): Likewise.
2472 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2473 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2474 bfd_malloc2, size_t amt, and unsigned tls_count.
2475 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2476 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2477 (elf_output_implib): Use bfd_alloc.
2479 2020-02-19 Alan Modra <amodra@gmail.com>
2481 * bfd.c (struct bfd): Move format and direction to other
2482 bitfields. Add "size".
2483 * bfdio.c (bfd_get_size): Cache size when not writing file.
2484 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2485 returning zero, ie. unknown.
2486 (bfd_get_alt_debug_link_info): Likewise.
2487 * bfd-in2.h: Regenerate.
2489 2020-02-19 Alan Modra <amodra@gmail.com>
2491 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2492 bfd_get_file_size twice.
2493 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2494 zero, ie. unknown, return.
2495 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2496 * elfcode.h (elf_swap_shdr_in): Likewise.
2497 (elf_object_p): Don't call bfd_get_file_size twice and correct
2500 2020-02-19 Alan Modra <amodra@gmail.com>
2502 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2503 FALSE if memory alloc fails. Adjust calls.
2504 * som.c (som_prep_for_fixups): Likewise.
2505 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2506 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2507 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2508 * som.c (som_build_and_write_symbol_table): Return via error_return
2510 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2511 (VEC_APPEND_EL): Delete.
2512 (vector_grow1): Return pointer to element. Catch overflow.
2513 Return NULL on memory allocation failure.
2514 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2515 (alpha_vms_add_fixup_ca): Likewise.
2516 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2518 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2520 2020-02-19 Alan Modra <amodra@gmail.com>
2522 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2523 * aout-target.h (object_p): Likewise.
2524 * aout-tic30.c (tic30_aout_object_p): Likewise.
2525 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2526 (emit_stringtab, write_syms, link_hash_table_create),
2527 (aout_link_write_other_symbol): Likewise.
2528 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2529 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2530 (_bfd_compute_and_write_armap): Likewise.
2531 * archures.c (bfd_arch_list): Likewise.
2532 * bfd.c (bfd_record_phdr): Likewise.
2533 * binary.c (binary_canonicalize_symtab): Likewise.
2534 * cisco-core.c (cisco_core_file_validate): Likewise.
2535 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2536 (find_arm_glue, record_arm_to_thumb_glue),
2537 (record_thumb_to_arm_glue): Likewise.
2538 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2539 (ppc_allocate_toc_section): Likewise.
2540 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2541 * coff-sh.c (sh_relax_section): Likewise.
2542 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2543 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2544 (coff_set_alignment_hook, coff_mkobject),
2545 (coff_compute_section_file_positions): Likewise.
2546 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2547 (coff_find_nearest_line_with_names),
2548 ( bfd_coff_set_symbol_class): Likewise.
2549 * cofflink.c (_bfd_coff_link_hash_table_create),
2550 (_bfd_coff_link_input_bfd): Likewise.
2551 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2552 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2553 (build_line_info_table, sort_line_sequences),
2554 (line_info_add_include_dir, line_info_add_file_name),
2555 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2556 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2557 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2558 (_bfd_ecoff_find_nearest_line),
2559 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2560 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2561 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2562 * elf-m10300.c (mn10300_elf_relax_section),
2563 (elf32_mn10300_link_hash_table_create): Likewise.
2564 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2565 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2566 * elf32-arm.c (elf32_arm_link_hash_table_create),
2567 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2568 (elf32_arm_new_section_hook): Likewise.
2569 * elf32-avr.c (elf_avr_new_section_hook),
2570 (elf32_avr_link_hash_table_create, get_local_syms),
2571 (elf32_avr_setup_section_lists): Likewise.
2572 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2573 (bfin_link_hash_table_create): Likewise.
2574 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2575 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2576 * elf32-csky.c (csky_elf_link_hash_table_create),
2577 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2578 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2579 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2580 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2581 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2582 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2583 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2584 (m32r_elf_check_relocs): Likewise.
2585 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2586 (elf32_m68hc11_setup_section_lists),
2587 (elf32_m68hc11_size_stubs): Likewise.
2588 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2589 * elf32-metag.c (elf_metag_link_hash_table_create),
2590 (elf_metag_setup_section_lists): Likewise.
2591 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2592 (microblaze_elf_check_relocs): Likewise.
2593 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2594 (nds32_elf_check_relocs): Likewise.
2595 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2596 (get_local_syms, nios2_elf32_check_relocs),
2597 (nios2_elf32_link_hash_table_create): Likewise.
2598 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2599 (or1k_elf_check_relocs): Likewise.
2600 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2601 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2602 * elf32-s390.c (elf_s390_link_hash_table_create),
2603 (elf_s390_check_relocs): Likewise.
2604 * elf32-score.c (score_elf_create_got_section),
2605 (s3_elf32_score_new_section_hook),
2606 (elf32_score_link_hash_table_create): Likewise.
2607 * elf32-score7.c (score_elf_create_got_section),
2608 (s7_elf32_score_new_section_hook): Likewise.
2609 * elf32-sh.c (sh_elf_link_hash_table_create),
2610 (sh_elf_check_relocs): Likewise.
2611 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2612 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2613 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2614 (tilepro_elf_check_relocs): Likewise.
2615 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2616 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2617 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2618 (elf_xtensa_new_section_hook): Likewise.
2619 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2620 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2621 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2622 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2623 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2624 * elf64-ppc.c (ppc64_elf_new_section_hook),
2625 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2626 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2627 * elf64-s390.c (elf_s390_link_hash_table_create),
2628 (elf_s390_check_relocs): Likewise.
2629 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2630 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2631 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2632 (elf_link_add_archive_symbols, compute_bucket_count),
2633 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2634 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2635 (bfd_elf_final_link): Likewise.
2636 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2637 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2638 (elfNN_aarch64_new_section_hook): Likewise.
2639 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2640 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2641 (riscv_elf_check_relocs): Likewise.
2642 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2643 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2644 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2645 (_bfd_mips_elf_link_hash_table_create): Likewise.
2646 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2647 (_bfd_sparc_elf_check_relocs),
2648 (_bfd_sparc_elf_new_section_hook): Likewise.
2649 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2650 (tilegx_elf_check_relocs): Likewise.
2651 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2652 * format.c (bfd_check_format_matches): Likewise.
2653 * hash.c (_bfd_stringtab_init): Likewise.
2654 * ihex.c (ihex_scan): Likewise.
2655 * irix-core.c (irix_core_core_file_p): Likewise.
2656 * linker.c (bfd_wrapped_link_hash_lookup),
2657 (_bfd_generic_link_hash_table_create),
2658 (_bfd_generic_reloc_link_order): Likewise.
2659 * lynx-core.c (lynx_core_file_p): Likewise.
2660 * netbsd-core.c (netbsd_core_file_p): Likewise.
2661 * osf-core.c (osf_core_core_file_p): Likewise.
2662 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2663 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2664 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2665 * peicode.h (pe_mkobject): Likewise.
2666 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2667 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2668 * sco5-core.c (read_uarea): Likewise.
2669 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2670 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2671 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2672 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2673 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2674 * srec.c (srec_scan): Likewise.
2675 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2676 * targets.c (bfd_target_list): Likewise.
2677 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2678 * trad-core.c (trad_unix_core_file_p): Likewise.
2679 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2680 (vms_new_section_hook): Likewise.
2681 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2682 * xcofflink.c (xcoff_get_section_contents),
2683 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2684 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2685 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2687 2020-02-19 Alan Modra <amodra@gmail.com>
2689 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2691 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2693 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2694 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2695 a build_list_p argument. Don't search plugin_list. Short circuit
2696 when building the plugin list.
2697 (has_plugin): Renamed to has_plugin_list.
2698 (bfd_plugin_set_plugin): Don't set has_plugin.
2699 (bfd_plugin_specified_p): Check plugin_list instead.
2700 (build_plugin_list): New function.
2701 (load_plugin): Call build_plugin_list and use plugin_list.
2703 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2706 * plugin.c (try_claim): Always clean up for LTO wrapper.
2707 (try_load_plugin): Treat each object as independent. Create a
2708 copy for plugin name.
2710 2020-02-11 Nick Clifton <nickc@redhat.com>
2712 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2713 for addresses in print statements.
2714 (msp430_elf_relax_delete_bytes): Likewise.
2715 (msp430_elf_relax_add_words): Likewise.
2716 (msp430_elf_relax_section): Likewise.
2718 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2720 * plugin.c (add_symbols): Clear plugin_data memory.
2722 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2725 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2726 (EXECUTABLE_SUFFIX): Likewise.
2727 * config.in: Regenerated.
2728 * configure: Likewise.
2729 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2730 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2731 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2732 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2733 (get_lto_wrapper): New.
2734 (setup_lto_wrapper_env): Likewise.
2735 (current_plugin): Likewise.
2736 (register_all_symbols_read): Likewise.
2737 (register_cleanup): Likewise.
2738 (get_symbols): Likewise.
2739 (add_input_file): Likewise.
2740 (bfd_plugin_close_and_cleanup): Likewise.
2741 (claim_file): Removed.
2742 (register_claim_file): Set current_plugin->claim_file.
2743 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2744 lto_syms in current_plugin.
2745 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2746 all_symbols_read handler. Copy real symbols to plugin_data.
2747 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2748 (try_load_plugin): Don't reuse the previous plugin for LTO
2749 wrapper. Set up GCC LTO wrapper if possible. Don't set
2750 plugin_list_iter->claim_file.
2751 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2753 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2756 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2758 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2759 check if previous instruction matches a conditional jump inserted
2760 earlier. Invert conditional jump and delete branch in this case.
2762 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2764 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2765 msp430_elf_relax_add_words. Support insertion of either one or two
2767 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2768 needs to be grown. Handle insertion of branch instruction to replace
2771 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2773 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2774 debugging relocations.
2775 (msp430_elf_relax_delete_bytes): Likewise.
2776 (msp430_elf_relax_add_two_words): Likewise.
2777 (msp430_elf_relax_section): Likewise.
2779 2020-02-10 Alan Modra <amodra@gmail.com>
2781 * archures.c: Wrap overlong z80 comments.
2782 * bfd-in2.h: Regenerate.
2784 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2787 * archures.c: Add GBZ80 and Z80N machine values.
2788 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2789 * coff-z80.c: Add support for new reloc.
2790 * coffcode.h: Add support for new machine values.
2791 * cpu-z80.c: Add support for new machine names.
2792 * elf32-z80.c: Add support for new reloc.
2793 * bfd-in2.h: Regenerate.
2794 * libbfd.h: Regenerate.
2796 2020-02-07 Nick Clifton <nickc@redhat.com>
2799 * elf.c (rewrite_elf_program_header): Do not complain if no
2800 sections are mapped to a segment.
2802 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2805 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2806 for garbage collection on __patchable_function_entries section
2807 without linked-to section.
2809 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2812 * bfd-in2.h: Regenerated.
2813 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2814 on section if gc_mark of any of its linked-to sections is set
2815 and don't set gc_mark again.
2816 * section.c (asection): Add linked_to_symbol_name to map_head
2819 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
2821 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2822 reporting an unrecognized instruction with R_V850_LONGJUMP.
2824 2020-02-05 Alan Modra <amodra@gmail.com>
2826 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2828 2020-02-04 Alan Modra <amodra@gmail.com>
2830 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2831 R_PPC_VLE_ADDR20, goto copy_reloc.
2833 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2835 * bfd-in2.h: Regenerated.
2836 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2838 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2841 * bfd-in2.h: Regenerated.
2842 * ecoff.c (bfd_debug_section): Add section_id.
2843 * section.c (bfd_section): Add section_id.
2844 (SEC_ASSEMBLER_SECTION_ID): New.
2845 (BFD_FAKE_SECTION): Add section_id.
2847 2020-02-01 Nick Clifton <nickc@redhat.com>
2849 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2852 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2854 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2855 encodings are relative to the GOT on nios2, too.
2857 2020-01-31 Alan Modra <amodra@gmail.com>
2859 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2860 file. Use $< and $@ in rules.
2861 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2862 (elf32-ia64.c, elf64-ia64.c): Likewise.
2863 (elf32-riscv.c, elf64-riscv.c): Likewise.
2864 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2865 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2866 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2867 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2868 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2869 * Makefile.in: Regenerate.
2871 2020-01-31 Alan Modra <amodra@gmail.com>
2874 * elf.c (setup_group): Don't clear entire section contents,
2875 just the padding after group flags. Release alloc'd memory
2876 after a seek or read failure.
2878 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2880 * peXXigen.c (pe_is_repro): New function.
2881 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2882 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2884 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2886 * peXXigen.c (debug_type_names): Add names for new debug data type
2889 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2891 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2892 inner loop. Fix a memory leak.
2894 2020-01-30 Alan Modra <amodra@gmail.com>
2896 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2897 or obj_coff_keep_strings here.
2898 (coff_get_normalized_symtab): Free external syms directly.
2899 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2902 2020-01-27 Jim Wilson <jimw@sifive.com>
2904 * cpu-riscv.c (riscv_scan): New.
2905 (N): Change bfd_default_scan to riscv_scan.
2907 2020-01-27 Andreas Schwab <schwab@suse.de>
2909 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2910 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2911 * Makefile.in: Regenerate.
2912 * cpu-plugin.c: Remove.
2913 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2914 (bfd_plugin_arch): Remove declaration.
2915 * bfd-in2.h: Regenerate.
2916 * po/SRC-POTFILES.in: Regenerate.
2918 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2919 Alan Modra <amodra@gmail.com>
2922 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2924 2020-01-24 Jim Wilson <jimw@sifive.com>
2926 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2927 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2928 avoid over long line.
2930 2020-01-24 Nick Clifton <nickc@redhat.com>
2933 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2934 syms and keep strings flags as these may have been set in order to
2935 prevent a bogus call to free.
2937 2020-01-23 Nick Clifton <nickc@redhat.com>
2939 * po/fr.po: Updated French translation.
2941 2020-01-23 Alan Modra <amodra@gmail.com>
2944 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2945 by zero when p_align is zero.
2947 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2949 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2950 (riscv_prefix_cmp): Likewise.
2951 (riscv_non_std_ext_p): Deleted.
2952 (riscv_std_sv_ext_p): Likewise.
2953 (riscv_non_std_sv_ext_p): Likewise.
2954 (riscv_merge_non_std_and_sv_ext): Rename to...
2955 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2956 (riscv_merge_arch_attr_info): Replace 3 calls to
2957 riscv_merge_non_std_and_sv_ext with single call to
2958 riscv_merge_multi_letter_ext.
2959 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2960 encounter a 'z' prefix.
2961 (riscv_get_prefix_class): New function, return prefix class based
2962 on first few characters of input string.
2963 (riscv_parse_config): New structure to factor out minor differences
2964 in extension class parsing behaviour.
2965 (riscv_parse_sv_or_non_std_ext): Rename to...
2966 (riscv_parse_prefixed_ext): and parameterise with
2968 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2969 (riscv_multi_letter_ext_valid_p): New.
2970 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2971 (riscv_parse_subset): Delegate all non-single-letter parsing work
2972 to riscv_parse_prefixed_ext.
2973 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2974 (riscv_get_prefix_class): Declare.
2976 2020-01-22 Alan Modra <amodra@gmail.com>
2978 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2979 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2980 __tls_get_addr_desc.
2981 (ppc64_elf_size_stubs): Add section for linker generated
2982 __tls_get_addr_desc wrapper function. Loop at least once if
2983 generating this function.
2984 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2985 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2987 2020-01-22 Alan Modra <amodra@gmail.com>
2989 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2990 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2992 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2993 (STDU_R1_0R1, ADDI_R1_R1): Define.
2994 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2995 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2996 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2997 no_tls_get_addr_regsave.
2998 (branch_reloc_hash_match): Add hash3 and hash4.
2999 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3000 (ppc64_elf_size_dynamic_sections): Likewise.
3001 (ppc64_elf_relocate_section): Likewise.
3002 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3003 __tls_get_addr stub.
3004 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3006 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3007 eh_frame for regsave __tls_get_addr.
3009 2020-01-22 Alan Modra <amodra@gmail.com>
3011 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3012 which __tls_get_addr calls will be eliminated.
3014 2020-01-20 Nick Clifton <nickc@redhat.com>
3016 * po/pt.po: Updates Portuguese translation.
3017 * po/ru.po: Updated Russian translation.
3018 * po/uk.po: Updated Ukranian translation.
3020 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3023 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3024 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3026 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3027 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3028 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3029 "rex leal x@tlsdesc(%rip), %reg" to
3030 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3031 "call *(%eax)" to "nopl (%rax)".
3033 2020-01-20 Alan Modra <amodra@gmail.com>
3035 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3036 (MTLR_R11): Don't define.
3037 (LD_R0_0R3, CMPDI_R0_0): Define.
3038 (build_tls_get_addr_stub): Don't use r11 in stub.
3040 2020-01-20 Alan Modra <amodra@gmail.com>
3042 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3043 (defined_sym_val, is_tls_get_addr): Likewise.
3045 2020-01-18 Nick Clifton <nickc@redhat.com>
3047 * version.m4 (BFD_VERSION): Set to 2.34.50.
3048 * configure: Regenerate.
3049 * po/bfd.pot: Regenerate.
3051 2020-01-18 Nick Clifton <nickc@redhat.com>
3053 Binutils 2.34 branch created.
3055 2020-01-17 Christian Biesinger <cbiesinger@google.com>
3057 * coff-arm.c: Fix spelling error (seperate).
3058 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3060 * sysdep.h (strnlen): Fix spelling error (seperate).
3062 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
3065 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3067 2020-01-15 Alan Modra <amodra@gmail.com>
3070 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3071 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3072 of function symbols unless dot symbols are present. Do warn
3073 whenever one is created, regardles of whether a PLT entry is
3074 also emitted for the function symbol.
3076 2020-01-14 Alan Modra <amodra@gmail.com>
3078 * som.c (som_bfd_count_ar_symbols): Error when file position
3079 of symbols on chains is not strictly increasing.
3081 2020-01-14 Alan Modra <amodra@gmail.com>
3083 * vms.h (VMS_DEBUG): Define as 0.
3084 * vms-alpha.c (image_write): Move debug output after bounds check.
3086 (_bfd_vms_slurp_eihd): Warning fix.
3087 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
3089 2020-01-13 Alan Modra <amodra@gmail.com>
3091 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
3092 for "ignored" records.
3094 2020-01-13 Alan Modra <amodra@gmail.com>
3096 * wasm-module.c (wasm_scan_name_function_section): Formatting.
3097 Delete asect name check. Move asect NULL check to wasm_object_p.
3098 Correct bounds check of sizes against end. Replace uses of
3099 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
3100 just one bfd_release.
3101 (wasm_scan): Don't use malloc/strdup for section names,
3102 bfd_alloc instead. Simplify code prefixing section name.
3103 Formatting. Don't attempt to free memory here..
3104 (wasm_object_p): ..do so here.
3106 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
3109 * elf32-arm.c (elf32_arm_final_link_relocate): Use
3110 UNDEFWEAK_NO_DYNAMIC_RELOC.
3111 (allocate_dynrelocs_for_symbol): Likewise.
3113 2020-01-10 Tamar Christina <tamar.christina@arm.com>
3116 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3118 2020-01-10 Alan Modra <amodra@gmail.com>
3120 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3122 2020-01-09 Nick Clifton <nickc@redhat.com>
3125 * bfd.c (bfd_convert_section_contents): Check for a compress
3126 header size that is larger than the actual section size.
3128 2020-01-08 Alan Modra <amodra@gmail.com>
3131 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3132 after removing sections.
3134 2020-01-06 Jim Wilson <jimw@sifive.com>
3137 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3138 check for !bfd_link_pic (info).
3139 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3140 <R_RISCV_JAL>: Add comment.
3141 (_bfd_riscv_relax_section): For plt.offset check, add check for
3142 bfd_link_pic (info). Add comment.
3144 2020-01-06 Alan Modra <amodra@gmail.com>
3146 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3147 match failures. Don't init to bfd_error_wrong_format before
3148 calling _bfd_check_format.
3150 2020-01-06 Alan Modra <amodra@gmail.com>
3152 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3153 status rather than exiting on stack overflow or underflow.
3154 (_bfd_vms_slurp_etir): Adjust to suit.
3156 2020-01-06 Alan Modra <amodra@gmail.com>
3158 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3160 2020-01-06 Alan Modra <amodra@gmail.com>
3162 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3163 command. Check name offset is within command.
3164 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3165 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3166 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3167 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3168 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3169 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3170 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3171 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3172 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3173 (bfd_mach_o_read_segment): Similarly.
3174 (bfd_mach_o_read_thread): Properly bound check thread struct.
3175 Don't repeat checks on second loop.
3176 (bfd_mach_o_read_command): Fail on invalid command length.
3178 2020-01-04 Alan Modra <amodra@gmail.com>
3180 * format.c (bfd_check_format_matches): Add preserve_match.
3181 Save initial bfd state in "preserve", matched bfd state in
3182 "preserve_match". Save just the first match. Release
3183 bfd_alloc memory. Restore and finish preserved state as
3184 appropriate on all function exit paths.
3186 2020-01-04 Alan Modra <amodra@gmail.com>
3188 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3190 2020-01-04 Alan Modra <amodra@gmail.com>
3192 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3195 2020-01-03 Nick Clifton <nickc@redhat.com>
3198 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3199 there is enough data remaining in the code buffer before
3200 attempting to read a function stub.
3202 2020-01-03 Nick Clifton <nickc@redhat.com>
3205 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3206 return value from bfd_malloc.
3207 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3208 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3209 (elf32_arm_filter_cmse_symbols): Likewise.
3210 (elf32_arm_write_section): Likewise.
3211 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3212 (bfd_mach_o_follow_dsym): Likewise.
3213 * pef.c (bfd_pef_print_loader_section): Likewise.
3214 (bfd_pef_scan_start_address): Likewise.
3215 (bfd_pef_parse_function_stubs): Likewise.
3216 (bfd_pef_parse_symbols): Likewise.
3218 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3220 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3221 on binary inputs ld/PR25316.
3222 (is_ia64_elf): new helper to filter on ia64 objects.
3224 2020-01-03 Jan Beulich <jbeulich@suse.com>
3226 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3228 (bfd_mach_o_scan): Insert underscore in two variable names.
3230 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3232 * Makefile.am: Add z80-elf target support.
3233 * configure.ac: Likewise.
3234 * targets.c: Likewise.
3235 * Makefile.in: Regenerate.
3236 * configure: Regenerate.
3237 * config.bfd: Add z80-elf target support and new arches: ez80 and
3239 * elf32-z80.c: New file.
3240 * archures.c: Add new z80 architectures: eZ80 and Z180.
3241 * coffcode.h: Likewise.
3242 * cpu-z80.c: Likewise.
3243 * coff-z80.c: Add new relocations for Z80 target and local label
3245 * reloc.c: Add new relocs.
3246 * bfd-in2.h: Regenerate.
3247 * libbfd.h: Regenerate.
3249 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3253 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3255 2020-01-01 Alan Modra <amodra@gmail.com>
3257 Update year range in copyright notice of all files.
3259 For older changes see ChangeLog-2019
3261 Copyright (C) 2020 Free Software Foundation, Inc.
3263 Copying and distribution of this file, with or without modification,
3264 are permitted in any medium without royalty provided the copyright
3265 notice and this notice are preserved.
3271 version-control: never