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