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