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