1 2020-07-07 Alan Modra <amodra@gmail.com>
3 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
6 2020-07-06 Nick Clifton <nickc@redhat.com>
8 * po/pt.po: Updated Portuguese translation.
9 * po/uk.po: Updated Ukranian translation.
11 2020-07-04 Nick Clifton <nickc@redhat.com>
13 * version.m4: Set version to 2.35.50.
14 * configure: Regenerate.
15 * po/bbfd.pot: Regenerate.
17 2020-07-04 Nick Clifton <nickc@redhat.com>
19 Binutils 2.35 branch created.
21 2020-07-01 Alan Modra <amodra@gmail.com>
24 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
25 raw syment index before dereferencing.
27 2020-07-01 Alan Modra <amodra@gmail.com>
29 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
31 2020-07-01 Alan Modra <amodra@gmail.com>
33 * config.bfd: Obsolete xc16x.
35 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
37 * archures.c (bfd_mach_i386_nacl): Removed.
38 (bfd_mach_i386_i386_nacl): Likewise.
39 (bfd_mach_x86_64_nacl): Likewise.
40 (bfd_mach_x64_32_nacl): Likewise.
41 * config.bfd: Remove *-*-nacl* targets.
42 * configure.ac: Remove x86 NaCl target vectors.
43 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
44 (bfd_x64_32_nacl_arch): Likewise.
45 (bfd_x86_64_nacl_arch): Likewise.
46 (bfd_i386_nacl_arch): Likewise.
47 (bfd_x64_32_arch_intel_syntax): Updated.
48 * elf32-i386.c: Don't include "elf-nacl.h".
49 (elf_i386_nacl_plt): Removed.
50 (elf_i386_nacl_plt0_entry): Likewise.
51 (elf_i386_nacl_plt_entry): Likewise.
52 (elf_i386_nacl_pic_plt0_entry): Likewise.
53 (elf_i386_nacl_pic_plt_entry): Likewise.
54 (elf_i386_nacl_eh_frame_plt): Likewise.
55 (elf_i386_nacl_plt): Likewise.
56 (elf32_i386_nacl_elf_object_p): Likewise.
57 (elf_i386_get_synthetic_symtab): Updated.
58 (elf_i386_link_setup_gnu_properties): Likewise.
59 * elf64-x86-64.c: Don't include "elf-nacl.h".
60 (elf_x86_64_nacl_plt): Removed.
61 (elf64_x86_64_nacl_elf_object_p): Likewise.
62 (elf_x86_64_nacl_plt0_entry): Likewise.
63 (elf_x86_64_nacl_plt_entry): Likewise.
64 (elf_x86_64_nacl_eh_frame_plt): Likewise.
65 (elf_x86_64_nacl_plt): Likewise.
66 (elf32_x86_64_nacl_elf_object_p): Likewise.
67 (elf_x86_64_get_synthetic_symtab): Updated.
68 (elf_x86_64_link_setup_gnu_properties): Likewise.
69 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
70 * targets.c: Remove x86 NaCl target vectors.
71 * bfd-in2.h: Regenerated.
72 * configure: Likewise.
74 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
76 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
77 _bfd_elf_add_dynamic_tags.
79 2020-06-29 Alan Modra <amodra@gmail.com>
81 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
82 return value of bfd_bread. Don't read more than requested length.
83 Sanity check length. Properly terminate file name.
85 2020-06-29 Alan Modra <amodra@gmail.com>
87 * arc-got.h: Use C style comments.
88 * coff-z80.c: Likewise.
89 * elf32-csky.c: Likewise.
90 * peXXigen.c: Likewise.
91 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
94 2020-06-26 Pat Bernardi <bernardi@adacore.com>
96 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
97 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
99 2020-06-26 Alan Modra <amodra@gmail.com>
101 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
102 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
103 (riscv_get_priv_spec_name): Move to..
104 * cpu-riscv.c: ..here.
105 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
106 Use %u to print unsigned numbers.
108 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
110 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
111 default architecture.
113 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
116 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
117 _bfd_elf_add_dynamic_tags.
119 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
122 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
123 _bfd_elf_add_dynamic_tags.
125 2020-06-24 Alan Modra <amodra@gmail.com>
127 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
128 shifts without undefined behaviour.
130 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
132 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
134 (_bfd_elf_add_dynamic_tags): New.
135 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
136 _bfd_elf_add_dynamic_tags.
137 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
138 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
139 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
140 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
141 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
142 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
143 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
144 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
146 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
147 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
148 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
149 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
150 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
151 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
152 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
153 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
154 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
156 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
157 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
158 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
159 _bfd_elf_maybe_vxworks_add_dynamic_tags.
160 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
161 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
163 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
164 (_bfd_x86_elf_size_dynamic_sections): Likewise.
165 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
166 dt_reloc_sz and dt_reloc_ent.
167 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
168 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
170 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
171 etab.dt_pltgot_required.
172 (elf32_hppa_size_dynamic_sections): Call
173 _bfd_elf_add_dynamic_tags.
174 * elf32-metag.c (elf_metag_link_hash_table_create): Set
175 etab.dt_pltgot_required.
176 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
177 * elf32-sh.c (sh_elf_link_hash_table_create): Set
178 root.dt_pltgot_required for FDPIC output.
179 (sh_elf_size_dynamic_sections): Call
180 _bfd_elf_maybe_vxworks_add_dynamic_tags.
181 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
182 elf.dt_pltgot_required.
183 (elf_xtensa_size_dynamic_sections): Call
184 _bfd_elf_add_dynamic_tags.
185 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
186 root.dt_pltgot_required.
187 (elf64_hppa_size_dynamic_sections): Call
188 _bfd_elf_add_dynamic_tags.
189 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
190 root.dt_pltgot_required.
191 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
192 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
193 * elflink.c (_bfd_elf_add_dynamic_tags): New.
195 2020-06-22 Saagar Jha <saagar@saagarjha.com>
197 * mach-o.c: Support the new load commands by reading a linkedit
198 data command for them.
200 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
202 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
203 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
204 (riscv_get_priv_spec_class): Likewise.
205 (riscv_get_priv_spec_name): Likewise.
206 (riscv_get_priv_spec_class_from_numbers): New function, convert
207 the version numbers into string, then call riscv_get_priv_spec_class
208 to get the priv spec class.
209 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
210 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
211 (riscv_get_priv_spec_name): Likewise.
212 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
213 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
214 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
215 of input and output objects form their priv spec attributes by
216 riscv_get_priv_spec_class_from_numbers. Report warning rather than
217 errors when linking objects with differnet priv spec versions. We do
218 know v1.9.1 may have conflicts to other versions, so report the
219 warning, too. After that, update the output priv spec version to the
222 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
224 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
225 priv attributes, we will check the conflicts for all of them (major,
226 minor and revision), and then set the priv_attrs_merged to TRUE to
227 indicate that we have handled all of the priv attributes. Remove
228 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
230 2020-06-21 Alan Modra <amodra@gmail.com>
233 * configure.ac: Disable plugins by default for some targets.
234 * plugin.c: Comment typo fix.
235 * configure: Regenerate.
237 2020-06-19 Nick Clifton <nickc@redhat.com>
239 * plugin.c (try_load_plugin): Suppress the error message about
240 being unable to open a plugin if creating a list of viable
243 2020-06-16 Alan Modra <amodra@gmail.com>
245 * aout-tic30.c: Delete file.
246 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
247 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
248 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
249 (xc16x-*-elf): Sort properly.
250 * configure.ac: Remove tic30_aout_vec.
251 * targets.c: Likewise.
252 * Makefile.in: Regenerate.
253 * configure: Regenerate.
254 * po/SRC-POTFILES.in: Regenerate.
256 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
258 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
259 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
260 (elf32xtensa_abi): New global variable.
261 (xtensa_abi_choice): New function.
262 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
263 XSHAL_ABI to select PLT code.
265 2020-06-15 Roland McGrath <mcgrathr@google.com>
267 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
268 field of bfd_link_info.
270 2020-06-15 Alan Modra <amodra@gmail.com>
272 * config.bfd: Obsolete powerpcle-*-pe targets.
274 2020-06-15 Alan Modra <amodra@gmail.com>
277 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
278 symbols that were defined in discarded sections.
279 * cofflink.c (coff_link_check_archive_element): Likewise.
280 (coff_link_add_symbols): Set indx to -3 for symbols defined in
282 (_bfd_coff_write_global_sym): Don't emit such symbols.
283 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
284 libcoff.h: Regenerate.
286 2020-06-11 Alan Modra <amodra@gmail.com>
289 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
291 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
293 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
294 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
295 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
298 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
301 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
302 Clear verinfo.verdef.
304 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
307 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
308 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
309 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
311 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
312 Set ifunc_resolvers if there are FUNC resolvers.
313 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
314 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
315 with elf.ifunc_resolvers.
316 (write_plt_relocs_for_local_syms): Likewise.
317 (ppc64_elf_relocate_section): Likewise.
318 (ppc64_elf_finish_dynamic_sections): Likewise.
319 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
321 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
322 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
323 instead of readonly_dynrelocs_against_ifunc.
324 * elfxx-x86.h (elf_x86_link_hash_table): Remove
325 readonly_dynrelocs_against_ifunc.
327 2020-06-09 Alan Modra <amodra@gmail.com>
329 * elf64-ppc.c (struct ppc_link_hash_table): Delete
330 maybe_local_ifunc_resolver field.
331 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
332 cases where maybe_local_ifunc_resolver was set.
333 (ppc64_elf_relocate_section): Likewise.
334 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
337 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
339 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
341 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
343 (elf32_arm_size_dynamic_sections): Updated. Clear
344 root.tlsdesc_plt for DF_BIND_NOW.
345 (elf32_arm_finish_dynamic_sections): Updated.
346 (elf32_arm_output_arch_local_syms): Likewise.
347 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
348 Clear root.tlsdesc_plt for DF_BIND_NOW.
349 (nds32_elf_finish_dynamic_sections): Updated.
350 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
351 dt_tlsdesc_plt and dt_tlsdesc_got.
352 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
353 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
354 tlsdesc_plt and dt_tlsdesc_got.
355 (elfNN_aarch64_allocate_dynrelocs): Updated.
356 (elfNN_aarch64_finish_dynamic_sections): Likewise.
357 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
358 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
360 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
361 (_bfd_x86_elf_size_dynamic_sections): Likewise.
362 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
363 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
366 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
368 * elf32-tic6x.c (elf32_bed): Defined the default to
371 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
373 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
375 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
376 root.splt/root.srelplt.
377 (elf64_hppa_create_dynamic_sections): Likewise.
378 (elf64_hppa_size_dynamic_sections): Likewise.
379 (elf64_hppa_finish_dynamic_symbol): Likewise.
380 (elf_hppa_final_link): Likewise.
381 (elf_hppa_final_link_relocate): Likewise.
383 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
385 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
386 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
389 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
391 * elf-bfd.h (elf_target_os): New.
392 (elf_link_hash_table): Add target_os.
393 (elf_backend_data): Add target_os.
394 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
395 symbian_p and nacl_p.
396 (create_got_section): Updated.
397 (elf32_arm_create_dynamic_sections): Likewise.
398 (arm_type_of_stub): Likewise.
399 (elf32_arm_create_or_find_stub_sec): Likewise.
400 (elf32_arm_allocate_plt_entry): Likewise.
401 (elf32_arm_populate_plt_entry): Likewise.
402 (elf32_arm_final_link_relocate): Likewise.
403 (elf32_arm_check_relocs): Likewise.
404 (allocate_dynrelocs_for_symbol): Likewise.
405 (elf32_arm_finish_dynamic_symbol): Likewise.
406 (elf32_arm_finish_dynamic_sections): Likewise.
407 (elf32_arm_output_plt_map_1): Likewise.
408 (elf32_arm_output_arch_local_syms): Likewise.
409 (elf32_arm_add_symbol_hook): Likewise.
410 (elf32_arm_nacl_link_hash_table_create): Likewise.
411 (elf32_arm_vxworks_link_hash_table_create): Likewise.
412 (elf32_arm_symbian_link_hash_table_create): Likewise.
413 (ELF_TARGET_OS): New.
414 * elf32-i386.c (elf_i386_arch_bed): Removed.
415 (elf_backend_arch_data): Likewise.
416 (elf_i386_solaris_arch_bed): Likewise.
417 (elf_i386_nacl_arch_bed): Likewise.
418 (elf_i386_vxworks_arch_bed): Likewise.
419 (elf_i386_relocate_section): Updated.
420 (elf_i386_finish_dynamic_sections): Likewise.
421 (elf_i386_get_synthetic_symtab): Likewise.
422 (elf_i386_link_setup_gnu_properties): Likewise.
423 (ELF_TARGET_OS): New.
424 * elf32-mips.c (ELF_TARGET_OS): New.
425 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
426 (ppc_elf_create_got): Updated.
427 (ppc_elf_create_dynamic_sections): Likewise.
428 (ppc_elf_check_relocs): Likewise.
429 (ppc_elf_adjust_dynamic_symbol): Likewise.
430 (ppc_elf_size_dynamic_sections): Likewise.
431 (ppc_elf_relocate_section): Likewise.
432 (ppc_elf_finish_dynamic_sections): Likewise.
433 (ppc_elf_vxworks_link_hash_table_create): Likewise.
434 (ELF_TARGET_OS): New.
435 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
436 (sh_elf_link_hash_table_create): Updated.
437 (sh_elf_create_dynamic_sections): Likewise.
438 (allocate_dynrelocs): Likewise.
439 (sh_elf_size_dynamic_sections): Likewise.
440 (sh_elf_relocate_section): Likewise.
441 (sh_elf_finish_dynamic_symbol): Likewise.
442 (sh_elf_finish_dynamic_sections): Likewise.
443 (ELF_TARGET_OS): New.
444 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
446 (bfd_elf32_bfd_link_hash_table_create): Likewise.
447 (ELF_TARGET_OS): New.
448 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
449 (elf_x86_64_solaris_arch_bed): Likewise.
450 (elf_x86_64_nacl_arch_bed): Likewise.
451 (elf_x86_64_finish_dynamic_sections): Updated.
452 (elf_x86_64_get_synthetic_symtab): Likewise.
453 (elf_x86_64_link_setup_gnu_properties): Likewise.
454 (ELF_TARGET_OS): New.
455 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
457 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
458 (MIPS_ELF_REL_DYN_NAME): Updated.
459 (ELF_MIPS_GP_OFFSET): Likewise.
460 (mips_elf_create_local_got_entry): Likewise.
461 (mips_elf_allocate_dynamic_relocations): Likewise.
462 (mips_elf_count_got_symbols): Likewise.
463 (is_gott_symbol): Likewise.
464 (mips_elf_calculate_relocation): Likewise.
465 (mips_elf_create_dynamic_relocation): Likewise.
466 (_bfd_mips_elf_check_relocs): Likewise.
467 (allocate_dynrelocs): Likewise.
468 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
469 (mips_elf_lay_out_got): Likewise.
470 (mips_elf_set_plt_sym_value): Likewise.
471 (_bfd_mips_elf_size_dynamic_sections): Likewise.
472 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
473 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
474 (_bfd_mips_elf_final_link): Likewise.
475 (_bfd_mips_init_file_header): Likewise.
476 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
478 (allocate_dynrelocs): Likewise.
479 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
480 (_bfd_sparc_elf_relocate_section): Likewise.
481 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
482 (sparc_finish_dyn): Likewise.
483 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
484 * elfxx-target.h (ELF_TARGET_OS): New.
485 (elfNN_bed): Add ELF_TARGET_OS.
486 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
487 (_bfd_x86_elf_link_hash_table_create): Likewise.
488 (_bfd_x86_elf_size_dynamic_sections): Likewise.
489 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
490 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
491 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
492 * elfxx-x86.h (elf_x86_target_os): Removed.
493 (elf_x86_backend_data): Likewise.
494 (get_elf_x86_backend_data): Likewise.
495 (elf_x86_link_hash_table): Remove target_os.
497 2020-06-06 Alan Modra <amodra@gmail.com>
500 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
501 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
502 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
503 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
504 * elf64-ppc.c: Update throughout for reloc renaming.
505 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
506 * libbfd.h: Regenerate.
507 * bfd-in2.h: Regenerate.
509 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
512 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
515 2020-06-05 Nick Clifton <nickc@redhat.com>
517 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
520 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
522 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
523 priv_may_conflict, in_priv_zero and out_priv_zero to decide
524 whether the object can be linked according to it's priv
525 attributes. The object without any priv spec attributes can
526 be linked with others. If the first input object doesn't contain
527 any priv attributes, then we need to copy the setting from the
528 next input one. Also report more detailed error messages to user.
530 2020-06-04 Stephen Casner <casner@acm.org>
532 Extend pdp11-aout symbol table format to accommodate .stab
533 symbols and implement correct handling of them.
535 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
536 (N_STAB, is_stab): Needed new function is_stab to disambiguate
537 normal vs. .stab symbol table type values, replacing N_STAB mask.
538 (translate_from_native_sym_flags): Determine correct section for
539 different .stab types.
540 (translate_to_native_sym_flags): Leave .stab types intact.
541 (translate_symbol_table): Error if symbol indicates overlay;
542 store desc field from .stab symbols.
543 (write_syms): Output desc field with symbol.
544 (aout_link_check_ar_symbols): Skip .stab symbols.
545 (aout_link_add_symbols): Correctly distinguish .stab symbols.
546 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
547 (aout_link_write_symbols): Write 0 for desk and ovly fields;
548 correctly distinguish .stab symbols and select calculate their
549 section and value; and copy desc and ovly fields from input symbol
552 2020-06-04 Stephen Casner <casner@acm.org>
554 * aoutx.h (translate_symbol_table): Comment had external and
556 * pdp11.c (translate_symbol_table): Likewise.
558 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
560 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
561 (is_x86_elf): Check elf.hash_table_id instead of target_id.
562 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
564 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
567 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
568 in debug section against symbol defined in shared library to 0.
569 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
570 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
571 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
572 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
573 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
574 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
575 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
576 * elf32-sh.c (sh_elf_check_relocs): Likewise.
577 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
578 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
579 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
580 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
581 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
582 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
584 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
585 there is non-GOT reference.
586 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
587 non-alloced sections.
589 2020-06-03 Stephen Casner <casner@acm.org>
591 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
593 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
595 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
596 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
597 other size that doesn't qcover the header word.
598 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
599 string table, and zero it.
600 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
601 message and set bfd_error on finding an invalid name string offset.
602 (add_to_stringtab): INLINE -> inline
603 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
605 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
606 any relocs that could not be recognised.
607 92744f05809 PR 20929 - Check for relocs without an associated symbol.
608 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
609 name exists and is long enough, before attempting to see if it is
611 c3864421222 - Correct case for N_SO being the last symbol.
612 50455f1ab29 PR 20891 - Handle the case where the main file name
613 and the directory name are both empty.
614 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
615 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
616 range string table offsets.
617 531336e3a0b PR 20909 - Fix off-by-one error in check for an
618 illegal string offset.
619 (aout_link_includes_newfunc): Add comment.
620 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
621 on unexpected relocation type rather than ASSERT.
623 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
626 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
627 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
629 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
632 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
633 non-alloced sections.
635 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
637 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
638 dynamic relocations for non SEC_ALLOC sections.
640 2020-06-03 Gunther Nikl <gnikl@justmail.de>
642 * aout64.c (BMAGIC, QMAGIC): Do not define.
643 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
644 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
645 to check the file format.
646 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
647 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
648 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
650 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
652 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
653 relocations for non SEC_ALLOC sections.
655 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
657 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
658 * elf32-arm.c (maybe_set_textrel): Removed.
659 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
660 with _bfd_elf_maybe_set_textrel.
661 * elf32-csky.c (maybe_set_textrel): Removed.
662 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
663 with _bfd_elf_maybe_set_textrel.
664 * elf32-hppa.c (maybe_set_textrel): Removed.
665 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
666 with _bfd_elf_maybe_set_textrel.
667 * elf32-lm32.c (maybe_set_textrel): Removed.
668 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
669 with _bfd_elf_maybe_set_textrel.
670 * elf32-m32r.c (maybe_set_textrel): Removed.
671 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
672 with _bfd_elf_maybe_set_textrel.
673 * elf32-metag.c (maybe_set_textrel): Removed.
674 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
675 with _bfd_elf_maybe_set_textrel.
676 * elf32-nds32.c (maybe_set_textrel): Removed.
677 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
678 with _bfd_elf_maybe_set_textrel.
679 * elf32-or1k.c (maybe_set_textrel): Removed.
680 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
681 with _bfd_elf_maybe_set_textrel.
682 * elf32-ppc.c (maybe_set_textrel): Removed.
683 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
684 with _bfd_elf_maybe_set_textrel.
685 * elf32-s390.c (maybe_set_textrel): Removed.
686 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
687 with _bfd_elf_maybe_set_textrel.
688 * elf32-sh.c (maybe_set_textrel): Removed.
689 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
690 with _bfd_elf_maybe_set_textrel.
691 * elf32-tic6x.c (maybe_set_textrel): Removed.
692 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
693 with _bfd_elf_maybe_set_textrel.
694 * elf32-tilepro.c (maybe_set_textrel): Removed.
695 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
696 with _bfd_elf_maybe_set_textrel.
697 * elf64-ppc.c (maybe_set_textrel): Removed.
698 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
699 with _bfd_elf_maybe_set_textrel.
700 * elf64-s390.c (maybe_set_textrel): Removed.
701 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
702 with _bfd_elf_maybe_set_textrel.
703 * elfnn-aarch64.c (maybe_set_textrel): Removed.
704 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
705 with _bfd_elf_maybe_set_textrel.
706 * elfnn-riscv.c (maybe_set_textrel): Removed.
707 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
708 with _bfd_elf_maybe_set_textrel.
709 * elfxx-sparc.c (maybe_set_textrel): Removed.
710 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
711 with _bfd_elf_maybe_set_textrel.
712 * elfxx-tilegx.c (maybe_set_textrel): Removed.
713 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
714 with _bfd_elf_maybe_set_textrel.
715 * elfxx-x86.c (maybe_set_textrel): Removed.
716 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
717 with _bfd_elf_maybe_set_textrel.
718 * elflink.c (_bfd_elf_maybe_set_textrel): New.
720 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
723 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
725 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
726 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
727 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
728 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
730 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
731 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
732 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
733 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
734 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
735 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
736 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
737 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
738 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
739 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
740 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
741 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
742 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
743 (elf_backend_copy_indirect_symbol): Likewise.
744 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
745 (elf_backend_copy_indirect_symbol): Likewise.
746 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
748 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
751 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
752 * elf32-arm.c (readonly_dynrelocs): Removed.
753 (maybe_set_textrel): Replace readonly_dynrelocs with
754 _bfd_elf_readonly_dynrelocs.
755 * elf32-csky.c (readonly_dynrelocs): Removed.
756 (maybe_set_textrel): Replace readonly_dynrelocs with
757 _bfd_elf_readonly_dynrelocs.
758 * elf32-hppa.c(readonly_dynrelocs): Removed.
759 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
760 _bfd_elf_readonly_dynrelocs.
761 (maybe_set_textrel): Likewise.
762 * elf32-lm32.c (readonly_dynrelocs): Removed.
763 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
764 with _bfd_elf_readonly_dynrelocs.
765 (maybe_set_textrel): Likewise.
766 * elf32-m32r.c (readonly_dynrelocs): Removed.
767 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
768 with _bfd_elf_readonly_dynrelocs.
769 (maybe_set_textrel): Likewise.
770 * elf32-metag.c (readonly_dynrelocs): Removed.
771 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
772 with _bfd_elf_readonly_dynrelocs.
773 (maybe_set_textrel): Likewise.
774 * elf32-microblaze.c (readonly_dynrelocs): Removed.
775 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
776 with _bfd_elf_readonly_dynrelocs.
777 * elf32-nds32.c (readonly_dynrelocs): Removed.
778 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
779 with _bfd_elf_readonly_dynrelocs.
780 (maybe_set_textrel): Likewise.
781 * elf32-or1k.c (readonly_dynrelocs): Removed.
782 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
783 with _bfd_elf_readonly_dynrelocs.
784 * elf32-ppc.c (readonly_dynrelocs): Removed.
785 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
786 _bfd_elf_readonly_dynrelocs.
787 (ppc_elf_adjust_dynamic_symbol): Likewise.
788 (maybe_set_textrel): Likewise.
789 * elf32-s390.c (readonly_dynrelocs): Removed.
790 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
791 with _bfd_elf_readonly_dynrelocs.
792 (maybe_set_textrel): Likewise.
793 * elf32-sh.c (readonly_dynrelocs): Removed.
794 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
795 _bfd_elf_readonly_dynrelocs.
796 (maybe_set_textrel): Likewise.
797 * elf32-tic6x.c (readonly_dynrelocs): Removed.
798 (maybe_set_textrel): Replace readonly_dynrelocs with
799 _bfd_elf_readonly_dynrelocs.
800 * elf32-tilepro.c (readonly_dynrelocs): Removed.
801 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
802 with _bfd_elf_readonly_dynrelocs.
803 (maybe_set_textrel): Likewise.
804 * elf64-ppc.c (readonly_dynrelocs): Removed.
805 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
806 _bfd_elf_readonly_dynrelocs.
807 (ppc64_elf_adjust_dynamic_symbol): Likewise.
808 (maybe_set_textrel): Likewise.
809 * elf64-s390.c (readonly_dynrelocs): Removed.
810 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
811 with _bfd_elf_readonly_dynrelocs.
812 (maybe_set_textrel): Likewise.
813 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
814 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
815 (maybe_set_textrel): Replace readonly_dynrelocs with
816 _bfd_elf_readonly_dynrelocs.
817 * elfnn-riscv.c (readonly_dynrelocs): Removed.
818 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
819 with _bfd_elf_readonly_dynrelocs.
820 (maybe_set_textrel): Likewise.
821 * elfxx-sparc.c (readonly_dynrelocs): Removed.
822 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
823 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
824 (maybe_set_textrel): Likewise.
825 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
826 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
827 with _bfd_elf_readonly_dynrelocs.
828 (maybe_set_textrel): Likewise.
829 * elfxx-x86.c (readonly_dynrelocs): Removed.
830 (maybe_set_textrel): Replace readonly_dynrelocs with
831 _bfd_elf_readonly_dynrelocs.
832 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
834 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
836 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
837 -fsanitize=undefined.
839 2020-06-03 Alan Modra <amodra@gmail.com>
843 * peicode.h (pe_ILF_make_a_section): Align data for compilers
845 (pe_ILF_build_a_bfd): Likewise.
847 2020-06-03 Alan Modra <amodra@gmail.com>
850 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
851 core files as well as objects.
853 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
856 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
857 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
859 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
860 (elf_arc_link_hash_newfunc): Updated.
861 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
862 (elf32_arm_link_hash_newfunc): Updated.
863 (elf32_arm_copy_indirect_symbol): Likewise.
864 (elf32_arm_check_relocs): Likewise.
865 (readonly_dynrelocs): Likewise.
866 (allocate_dynrelocs_for_symbol): Likewise.
867 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
868 (csky_elf_link_hash_newfunc): Updated.
869 (csky_allocate_dynrelocs): Likewise.
870 (readonly_dynrelocs): Likewise.
871 (csky_elf_copy_indirect_symbol): Likewise.
872 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
873 (hppa_link_hash_newfunc): Updated.
874 (elf32_hppa_copy_indirect_symbol): Likewise.
875 (elf32_hppa_hide_symbol): Likewise.
876 (elf32_hppa_adjust_dynamic_symbol): Likewise.
877 (allocate_dynrelocs): Likewise.
878 (elf32_hppa_relocate_section): Likewise.
879 * elf32-i386.c (elf_i386_check_relocs): Likewise.
880 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
881 (lm32_elf_link_hash_newfunc): Likewise.
882 (lm32_elf_link_hash_table_create): Updated.
883 (readonly_dynrelocs): Likewise.
884 (allocate_dynrelocs): Likewise.
885 (lm32_elf_copy_indirect_symbol): Likewise.
886 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
887 (m32r_elf_link_hash_newfunc): Likewise.
888 (m32r_elf_link_hash_table_create): Updated.
889 (m32r_elf_copy_indirect_symbol): Likewise.
890 (allocate_dynrelocs): Likewise.
891 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
892 (metag_link_hash_newfunc): Updated.
893 (elf_metag_copy_indirect_symbol): Likewise.
894 (readonly_dynrelocs): Likewise.
895 (allocate_dynrelocs): Likewise.
896 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
898 (link_hash_newfunc): Updated.
899 (microblaze_elf_check_relocs): Likewise.
900 (microblaze_elf_copy_indirect_symbol): Likewise.
901 (readonly_dynrelocs): Likewise.
902 (allocate_dynrelocs): Likewise.
903 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
904 (nds32_elf_link_hash_newfunc): Updated.
905 (nds32_elf_copy_indirect_symbol): Likewise.
906 (readonly_dynrelocs): Likewise.
907 (allocate_dynrelocs): Likewise.
908 (nds32_elf_check_relocs): Likewise.
909 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
910 (link_hash_newfunc): Updated.
911 (nios2_elf32_copy_indirect_symbol): Likewise.
912 (nios2_elf32_check_relocs): Likewise.
913 (allocate_dynrelocs): Likewise.
914 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
915 (or1k_elf_link_hash_newfunc): Updated.
916 (readonly_dynrelocs): Likewise.
917 (allocate_dynrelocs): Likewise.
918 (or1k_elf_copy_indirect_symbol): Likewise.
919 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
920 (ppc_elf_link_hash_newfunc): Updated.
921 (ppc_elf_copy_indirect_symbol): Likewise.
922 (ppc_elf_check_relocs): Likewise.
923 (readonly_dynrelocs): Likewise.
924 (ppc_elf_adjust_dynamic_symbol): Likewise.
925 (allocate_dynrelocs): Likewise.
926 (ppc_elf_relocate_section): Likewise.
927 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
928 (link_hash_newfunc): Updated.
929 (elf_s390_copy_indirect_symbol): Likewise.
930 (readonly_dynrelocs): Likewise.
931 (elf_s390_adjust_dynamic_symbol): Likewise.
932 (allocate_dynrelocs): Likewise.
933 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
934 (sh_elf_link_hash_newfunc): Updated.
935 (readonly_dynrelocs): Likewise.
936 (allocate_dynrelocs): Likewise.
937 (sh_elf_copy_indirect_symbol): Likewise.
938 (sh_elf_check_relocs): Likewise.
939 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
940 (elf32_tic6x_link_hash_newfunc): Likewise.
941 (elf32_tic6x_link_hash_table_create): Updated.
942 (readonly_dynrelocs): Likewise.
943 (elf32_tic6x_check_relocs): Likewise.
944 (elf32_tic6x_allocate_dynrelocs): Likewise.
945 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
947 (link_hash_newfunc): Updated.
948 (tilepro_elf_copy_indirect_symbol): Likewise.
949 (tilepro_elf_check_relocs): Likewise.
950 (allocate_dynrelocs): Likewise.
951 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
952 (ppc64_elf_copy_indirect_symbol): Updated.
953 (ppc64_elf_check_relocs): Likewise.
954 (readonly_dynrelocs): Likewise.
955 (ppc64_elf_adjust_dynamic_symbol): Likewise.
956 (dec_dynrel_count): Likewise.
957 (allocate_dynrelocs): Likewise.
958 (ppc64_elf_relocate_section): Likewise.
959 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
960 (link_hash_newfunc): Updated.
961 (elf_s390_copy_indirect_symbol): Likewise.
962 (readonly_dynrelocs): Likewise.
963 (allocate_dynrelocs): Likewise.
964 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
965 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
967 (elfNN_aarch64_link_hash_newfunc): Updated.
968 (elfNN_aarch64_copy_indirect_symbol): Likewise.
969 (readonly_dynrelocs): Likewise.
970 (need_copy_relocation_p): Likewise.
971 (elfNN_aarch64_allocate_dynrelocs): Likewise.
972 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
973 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
974 (link_hash_newfunc): Updated.
975 (riscv_elf_copy_indirect_symbol): Likewise.
976 (riscv_elf_check_relocs): Likewise.
977 (readonly_dynrelocs): Likewise.
978 (allocate_dynrelocs): Likewise.
979 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
981 (link_hash_newfunc): Updated.
982 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
983 (_bfd_sparc_elf_check_relocs): Likewise.
984 (readonly_dynrelocs): Likewise.
985 (allocate_dynrelocs): Likewise.
986 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
987 (link_hash_newfunc): Updated.
988 (tilegx_elf_copy_indirect_symbol): Likewise.
989 (tilegx_elf_check_relocs): Likewise.
990 (readonly_dynrelocs): Likewise.
991 (allocate_dynrelocs): Likewise.
992 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
993 (readonly_dynrelocs): Likewise.
994 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
995 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
997 2020-06-01 Alan Modra <amodra@gmail.com>
999 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1000 command against cmd_length, not the end of record. For
1001 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1002 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1005 2020-05-28 David Faust <david.faust@oracle.com>
1007 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1008 R_BPF_INSN_{32,64} relocations.
1010 2020-05-28 Stephen Casner <casner@acm.org>
1012 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1013 addreses in .long (used in testsuites) and .stab values.
1015 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1018 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1019 Check bfd_link_dll when issue a DT_TEXTREL warning.
1020 * elfxx-x86.c (maybe_set_textrel): Likewise.
1021 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1023 2020-05-26 Nick Clifton <nickc@redhat.com>
1025 * plugin.c (try_load_plugin): Extend error message when a plugin
1028 2020-05-23 Alan Modra <amodra@gmail.com>
1030 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1032 2020-05-22 Alan Modra <amodra@gmail.com>
1035 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1036 attributes from shared libraries, and do not return an error if
1039 2020-05-21 Alan Modra <amodra@gmail.com>
1042 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1044 (_bfd_delete_bfd): Free the copy.
1045 (_bfd_new_bfd): Free nbfd->memory on error.
1047 2020-05-21 Alan Modra <amodra@gmail.com>
1049 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1050 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1051 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1052 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1053 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1054 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1055 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1056 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1057 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1058 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1059 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1060 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1061 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1062 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1063 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1064 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1065 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1066 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1067 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1068 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1070 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1072 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1073 get_default_version. It is used to find the default version for
1074 the specific extension.
1075 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1076 default_major_version and default_minor_version. Add new bfd_boolean
1077 parameter *use_default_version. Set it to TRUE if we need to call
1078 the callback rps->get_default_version to find the default version.
1079 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1080 the default version in riscv_parsing_subset_version, and then call
1081 riscv_add_subset to add the subset into subset list.
1082 (riscv_parse_prefixed_ext): Likewise.
1083 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1084 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1085 strings rather than characters.
1086 riscv_merge_arch_attr_info): The callback function get_default_version
1087 is only needed for assembler, so set it to NULL int the linker.
1088 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1089 * elfxx-riscv.h: Updated.
1091 2020-05-20 Alan Modra <amodra@gmail.com>
1094 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1095 use bfd_set_filename.
1096 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1097 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1098 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1099 (bfd_create): Likewise.
1100 (_bfd_delete_bfd): Don't free filename.
1101 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1102 return pointer to the copy or NULL on alloc fail.
1103 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1104 result of bfd_set_filename.
1105 * bfd-in2.h: Regenerate.
1107 2020-05-20 Alan Modra <amodra@gmail.com>
1110 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1111 section size against file size.
1112 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1114 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1117 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1118 and memset when allocating memory for the sections_being_created
1121 2020-05-19 Stafford Horne <shorne@gmail.com>
1123 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1125 (or1k_elf_relocate_section): Access srelgot via
1126 htab->root.srelgot. Add assertions for srelgot->contents.
1127 Introduce local variable for srelgot to not reuse global
1129 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1130 (or1k_set_got_and_rela_sizes): New function.
1131 (or1k_initial_exec_offset): New function.
1132 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1133 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1135 (or1k_elf_check_relocs): Use OR to set TLS access.
1136 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1138 (or1k_elf_size_dynamic_sections): Use
1139 or1k_set_got_and_rela_sizes to set sizes.
1140 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1141 (TCB_SIZE): New macro.
1142 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1143 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1144 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1145 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1146 (tpoff): Add dynamic boolean argument.
1147 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1149 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
1151 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1152 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1153 cases with BFD_RELOC_AARCH64_JUMP26.
1154 (elfNN_aarch64_check_relocs): Likewise.
1156 2020-05-19 Alan Modra <amodra@gmail.com>
1158 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1159 bfd_get_filename rather than accessing bfd->filename directly.
1160 * aout-target.h (MY (object_p)): Likewise.
1161 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1162 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1163 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1164 (_bfd_archive_bsd44_construct_extended_name_table),
1165 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1166 (_bfd_bsd_write_armap): Likewise.
1167 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
1168 * cache.c (bfd_open_file): Likewise.
1169 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
1170 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
1171 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1172 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1173 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
1174 * elf32-nds32.c (nds32_elf_output_symbol_hook),
1175 (patch_tls_desc_to_ie): Likewise.
1176 * elf32-spu.c (sort_bfds, print_one_overlay_section),
1177 (spu_elf_auto_overlay): Likewise.
1178 * elf64-hppa.c (elf_hppa_final_link): Likewise.
1179 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
1180 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
1181 * elflink.c (bfd_elf_size_dynamic_sections),
1182 (elf_link_input_bfd): Likewise.
1183 * linker.c (_bfd_generic_link_output_symbols): Likewise.
1184 * mach-o.c (bfd_mach_o_follow_dsym),
1185 (bfd_mach_o_close_and_cleanup): Likewise.
1186 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
1187 (find_separate_debug_file, get_build_id_name): Likewise.
1188 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1189 * plugin.c (bfd_plugin_open_input): Likewise.
1190 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
1191 * som.c (som_write_armap): Likewise.
1192 * srec.c (srec_write_record, srec_write_symbols): Likewise.
1193 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1194 (_bfd_vms_lib_write_archive_contents): Likewise.
1195 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1197 2020-05-19 Alan Modra <amodra@gmail.com>
1200 * bfdio.c (_bfd_real_fopen): Typo fix.
1202 2020-05-18 Nick Clifton <nickc@redhat.com>
1205 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1206 for the sections_being_created array.
1208 2020-05-18 Alan Modra <amodra@gmail.com>
1210 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1211 they can be freed without also freeing internal_relocs.
1213 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1216 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1217 separators into DOS style when creating a WIN32 fullpath.
1219 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
1221 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1222 to initialize RISC-V tdata.
1224 2020-05-12 Gunther Nikl <gnikl@justmail.de>
1226 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1229 2020-05-11 Alan Modra <amodra@gmail.com>
1231 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1233 2020-05-11 Alan Modra <amodra@gmail.com>
1235 * elf64-ppc.c: Rename powerxx to power10 throughout.
1237 2020-05-11 Alan Modra <amodra@gmail.com>
1240 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1241 contains required number of auxents before processing any auxent.
1242 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1243 file name from auxents for PE.
1245 2020-05-04 Gunther Nikl <gnikl@justmail.de>
1247 * aout-cris.c (DEFAULT_ARCH): Delete define.
1248 (MY_set_arch_mach): Likewise.
1249 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1251 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1252 of r_type before the shift.
1254 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
1257 * elfnn-aarch64.c (group_sections): Copy implementation from
1260 2020-05-01 Alan Modra <amodra@gmail.com>
1263 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1264 accessing root.u.def of symbols. Also check root.u.def.section
1265 is non-NULL. Reverse tests so as to make the logic positive.
1267 2020-05-01 Alan Modra <amodra@gmail.com>
1270 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1271 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1273 2020-05-01 Alan Modra <amodra@gmail.com>
1276 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1277 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1278 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1279 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1280 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1281 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1282 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1283 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1284 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1285 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1287 2020-05-01 Alan Modra <amodra@gmail.com>
1290 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1291 from shared libraries.
1293 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1295 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1296 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1297 equals 0. Report overflow when the result has negative sign but
1298 all significant bits are zero.
1300 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1302 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1303 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1305 2020-04-28 Alan Modra <amodra@gmail.com>
1307 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1308 Emit warning message.
1310 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1312 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1313 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1314 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1315 to x86_64_pe_big_vec as it not a big-endian format.
1316 (vec i386_pe_big_vec): New.
1317 * configure.ac: Likewise.
1318 * targets.c: Likewise.
1319 * configure: Regenerate.
1320 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1321 COFF_WITH_PE_BIGOBJ): New.
1322 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1324 (x86_64_pe_be_vec): Moved.
1326 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1328 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1329 * elf.c (elfcore_grok_arc_v2): New function.
1330 (elfcore_grok_note): Call the new function to handle the corresponding
1332 (elfcore_write_arc_v2): New function.
1333 (elfcore_write_register_note): Call the new function to handle the
1334 corresponding pseudo-sections.
1336 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1339 * bfd-in2.h: Regenerated.
1340 * elf32-xtensa.c (elf_howto_table): New entries for
1341 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1342 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1343 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1344 R_XTENSA_NDIFF{8,16,32}.
1345 * libbfd.h (bfd_reloc_code_real_names): Add names for
1346 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1347 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1348 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1349 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1351 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1354 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1357 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1360 * elf-bfd.h (elf_backend_data): Add
1361 elf_backend_strip_zero_sized_dynamic_sections.
1362 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1363 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1365 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1367 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1369 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1371 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1373 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1375 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1377 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1379 2020-04-21 Nick Clifton <nickc@redhat.com>
1381 * po/sr.po: Updated Serbian translation.
1383 2020-04-21 Alan Modra <amodra@gmail.com>
1385 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1388 2020-04-20 Stephen Casner <casner@acm.org>
1390 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1391 causing globals from linker script to be treated as debug symbols.
1392 (translate_symbol_table): Don't sign-extend symbol values from 16
1393 to 64 bits in nm output.
1395 2020-04-20 Alan Modra <amodra@gmail.com>
1397 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1399 2020-04-18 Alan Modra <amodra@gmail.com>
1401 * section.c (bfd_is_const_section): Correct test for special
1403 * bfd-in2.h: Regenerate.
1405 2020-04-17 Alan Modra <amodra@gmail.com>
1408 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1411 2020-04-16 Nick Clifton <nickc@redhat.com>
1414 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1415 abort with a more helpful error message.
1417 2020-04-16 Alan Modra <amodra@gmail.com>
1420 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1423 2020-04-15 Fangrui Song <maskray@google.com>
1426 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1427 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1428 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1429 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1430 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1431 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1432 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1433 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1434 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1435 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1436 * elflink.c (elf_link_output_extsym): Likewise.
1437 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1439 2020-04-15 Alan Modra <amodra@gmail.com>
1442 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1443 pointer into strings that may be freed for section name, always
1444 allocate a new string.
1446 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1447 Jan W. Jagersma <jwjagersma@gmail.com>
1449 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1450 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1451 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1452 (_bfd_go32_mkobject): New functions.
1453 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1454 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1455 (go32exe_mkobject): Call _bfd_go32_mkobject.
1456 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1457 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1459 (coff_write_relocs): Enable extended reloc counter code if
1460 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1461 (coff_write_object_contents): Likewise. Pad section headers
1462 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1463 instead of coff_swap_scnhdr_out.
1464 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1465 enable extended reloc counter.
1466 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1467 Declare with ATTRIBUTE_UNUSED.
1468 * libcoff-in.h: (struct coff_tdata): New field go32.
1470 * libcoff.h: Regenerate.
1472 2020-04-14 Fangrui Song <maskray@google.com>
1475 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1478 2020-04-14 Stephen Casner <casner@acm.org>
1481 * pdp11.c: Add implementation of --imagic option.
1482 (adjust_o_magic): Fix objcopy --extract-symbol test.
1483 * libaout.h (enum aout_magic): Add i_magic.
1485 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1486 Nick Clifton <nickc@redhat.com>
1488 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1490 <default>: Error rather than abort.
1492 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1495 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1496 relocation section from section group.
1498 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1500 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1501 bfd->origin to file offset.
1502 * bfdwin.c (bfd_get_file_window): Likewise.
1503 * bfd.c: Clarify the use of the bfd->origin field.
1504 * bfd-in2.h: Regenerate.
1505 * coff-i386.c: Don't include go32exe.h. Allow overriding
1506 coff_write_object_contents via COFF_WRITE_CONTENTS.
1507 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1508 (go32exe_write_object_contents): New functions.
1509 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1510 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1511 (create_go32_stub): Remove check for 2k size limit. Read stub
1512 from go32exe_temp_stub if present.
1513 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1514 copy variable-length stub.
1515 (go32_check_format): Read stub to go32exe_temp_stub, set
1516 origin, return go32exe_cleanup.
1517 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1518 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1519 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1520 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1521 Remove functions and their associated #defines.
1522 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1523 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1524 Rename field go32stub to stub.
1525 * libcoff.h: Regenerate.
1526 * coff-stgo32.c (go32_check_format): Rename to...
1527 (go32exe_check_format): ...this.
1528 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1529 (go32exe_copy_private_bfd_data): ...this.
1530 (stub_bytes): Rename to...
1531 (go32exe_default_stub): ...this.
1532 (create_go32_stub): Rename to...
1533 (go32exe_create_stub): ...this.
1534 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1537 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1541 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1542 relocation to R_386_32 for relocation against non-preemptible
1544 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1545 allocate dynamic relocation for non-preemptible absolute symbol.
1546 (elf_i386_relocate_section): Pass sec to
1547 GENERATE_DYNAMIC_RELOCATION_P.
1548 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1549 (elf_x86_64_convert_load_reloc): Covert load relocation to
1550 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1551 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1552 for non-preemptible absolute symbol if they overflow.
1553 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1554 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1555 symbol. Don't allocate dynamic relocation for non-preemptible
1557 (elf_x86_64_relocate_section): Don't generate relative relocation
1558 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1559 to GENERATE_DYNAMIC_RELOCATION_P.
1560 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1561 against non-preemptible absolute symbol.
1562 (_bfd_elf_x86_valid_reloc_p): New function.
1563 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1565 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1566 argument. Don't generate dynamic relocation against
1567 non-preemptible absolute symbol.
1568 (ABS_SYMBOL_P): New.
1569 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1570 against non-preemptible absolute symbol.
1572 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1573 (_bfd_elf_x86_valid_reloc_p): New.
1575 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1578 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1579 address in the GOT if in thumb only mode.
1581 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1583 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1585 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1587 * mmo.c (mmo_scan): Create .text section only when needed, not
1590 2020-03-31 Alan Modra <amodra@gmail.com>
1592 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1595 2020-03-31 Alan Modra <amodra@gmail.com>
1597 * vms-alpha.c (image_write): Check bounds for sections without
1598 contents too. Error on non-zero write to section without
1600 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1602 2020-03-31 Alan Modra <amodra@gmail.com>
1604 * tekhex.c (pass_over): Check is_eof before reading buffer.
1606 2020-03-30 Nick Clifton <nickc@redhat.com>
1609 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1610 field to timestamp and make it an integer.
1611 * libcoff.h: Regenerate.
1612 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1613 field in the pe_data structure rather than the insert_timestamp
1616 2020-03-30 Alan Modra <amodra@gmail.com>
1619 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1622 2020-03-26 Nick Clifton <nickc@redhat.com>
1624 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1625 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1627 * libbfd.h: Regenerate.
1629 2020-03-26 Alan Modra <amodra@gmail.com>
1631 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1633 2020-03-26 Alan Modra <amodra@gmail.com>
1635 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1637 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1639 2020-03-25 Nick Clifton <nickc@redhat.com>
1641 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1643 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1644 * libbfd.h: Regenerate.
1646 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1648 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1649 correct field name in the output string.
1651 2020-03-25 Alan Modra <amodra@gmail.com>
1654 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1655 for SHT_NOBITS section if first in segment.
1657 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1660 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1661 (_bfd_elf_get_symbol_version_string): This.
1662 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1663 (_bfd_elf_get_symbol_version_string): This.
1664 (bfd_elf_print_symbol): Pass TRUE to
1665 _bfd_elf_get_symbol_version_string.
1666 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1667 bfd_boolean argument.
1668 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1669 * targets.c (_bfd_get_symbol_version_string): Likewise.
1670 (bfd_get_symbol_version_string): Likewise.
1671 * bfd-in2.h: Regenerated.
1673 2020-03-24 Nick Clifton <nickc@redhat.com>
1674 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1677 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1680 2020-03-24 Nick Clifton <nickc@redhat.com>
1683 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1684 segment to use for PT_GNU_RELRO, ignore empty sections in a
1685 segment's current list.
1687 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1690 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1692 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1695 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1696 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1697 on the previous _bfd_elf_get_symbol_version_string.
1698 (_bfd_elf_get_symbol_version_string): Use it.
1700 2020-03-24 Alan Modra <amodra@gmail.com>
1702 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1703 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1706 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1708 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1710 2020-03-23 Alan Modra <amodra@gmail.com>
1712 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1713 symbol count. Allocate an extra byte to ensure name strings
1714 are terminated. Sanity check name offsets. Release memory on
1717 2020-03-23 Alan Modra <amodra@gmail.com>
1719 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1720 field hasn't been read. Remove unnecessary casts.
1722 2020-03-22 Alan Modra <amodra@gmail.com>
1724 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1725 enough to read number of symbols.
1727 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1729 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1730 (EXECUTABLE_SUFFIX): Likewise.
1731 * config.in: Regenerated.
1732 * configure: Likewise.
1733 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1734 _bfd_generic_close_and_cleanup.
1735 (plugin_list_entry): Remove resolution_file, resolution_option,
1736 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1737 lto_wrapper, gcc_env and initialized,
1738 (need_lto_wrapper_p): Removed.
1739 (get_lto_wrapper): Likewise.
1740 (setup_lto_wrapper_env): Likewise.
1741 (register_all_symbols_read): Likewise.
1742 (egister_cleanup): Likewise.
1743 (get_symbols): Likewise.
1744 (add_input_file): Likewise.
1745 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1746 (add_symbols): Updated.
1747 (try_claim): Likewise.
1748 (try_load_plugin): Likewise.
1749 (bfd_plugin_canonicalize_symtab): Likewise.
1750 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1751 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1753 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1756 * plugin.c (plugin_list_entry): Add has_symbol_type.
1757 (add_symbols_v2): New function.
1758 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1759 provides symbol type.
1760 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1761 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1764 2020-03-20 Alan Modra <amodra@gmail.com>
1766 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1767 enough to read number of symbols.
1769 2020-03-20 Alan Modra <amodra@gmail.com>
1771 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1772 backend functions for NULL before calling.
1773 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1774 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1775 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1776 * elfnn-ia64.c (ignore_errors): New function.
1777 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1779 2020-03-19 Nick Clifton <nickc@redhat.com>
1782 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1783 location of the varinfo in the unit's debug info data. Change the
1784 type of the stack field to a boolean.
1785 (lookup_var_by_offset): New function. Returns the varinfo
1786 structure for the variable described at the given offset in the
1788 (scan_unit_for_symbols): Add support for variables which have the
1789 DW_AT_specification attribute.
1791 2020-03-19 Nick Clifton <nickc@redhat.com>
1794 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1797 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1799 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1801 2020-03-18 Nick Clifton <nickc@redhat.com>
1804 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1805 memory access when processing a corrupt secondary reloc section.
1807 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1809 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1810 instead of calling abort.
1811 * elf32-csky.c (csky_build_one_stub): Likewise.
1812 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1813 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1814 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1815 * elf32-metag.c (metag_build_one_stub): Likewise.
1816 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1817 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1818 (ppc_size_one_stub): Likewise.
1819 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1821 2020-03-17 Nick Clifton <nickc@redhat.com>
1824 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1825 with error messages.
1827 2020-03-17 Nick Clifton <nickc@redhat.com>
1830 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1831 free. Add free on another failure path.
1833 2020-03-16 Alan Modra <amodra@gmail.com>
1836 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1837 we have a non-zero section count. Do lma comparison in octets.
1839 2020-03-16 Alan Modra <amodra@gmail.com>
1841 * vms-alpha.c (dst_restore_location): Validate index into
1842 dst_ptr_offsets array before accessing. Return status.
1843 (dst_retrieve_location): Similarly, making "loc" parameter a
1844 pointer to return value.
1845 (_bfd_vms_slurp_etir): Update calls to above functions.
1847 2020-03-14 Kamil Rytarowski <n54@gmx.com>
1849 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1851 * configure: Regenerated.
1853 2020-03-14 Alan Modra <amodra@gmail.com>
1855 * section.c (BFD_FAKE_SECTIONS): Formatting.
1856 * bfd-in2.h: Regenerate.
1858 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1860 * elf.c (elfcore_grok_netbsd_note): Add support for
1861 NT_NETBSDCORE_LWPSTATUS notes.
1863 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1865 * bfd-in2.h: Regenerate.
1866 * section.c (asection): Add already_assigned field.
1867 (BFD_FAKE_SECTION): Add default initializer for it.
1868 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1869 * elf32-arm.c (arm_build_one_stub): Add support for
1870 non_contiguous_regions.
1871 * elf32-csky.c (csky_build_one_stub): Likewise.
1872 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1873 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1874 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1875 * elf32-metag.c (metag_build_one_stub): Likewise.
1876 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1877 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1878 (ppc_size_one_stub): Likewise.
1879 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1880 * elflink.c (elf_link_input_bfd): Likewise.
1882 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1885 * elf-linker-x86.h (elf_linker_x86_params): Add
1886 static_before_all_inputs and has_dynamic_linker.
1887 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1888 dynamic input objects if -static is passed at command-line
1889 before all input files without --dynamic-linker unless
1890 --no-dynamic-linker is used.
1892 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1894 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1896 2020-03-13 Christian Eggers <ceggers@gmx.de>
1898 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1899 "p_paddr" from "at".
1900 * elfcode.h (bfd_from_remote_memory): Add units to several
1901 parameters. New local "opb". Fix usage of p_align. Fix
1902 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1903 call of target_read_memory.
1904 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1905 calculation of "offset" and "output_offset".
1906 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1907 from "offset" and fix calculation of "end" from "vma+size". Fix
1908 comparison between "sh_addr" and "vma"/"output_offset".
1909 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1910 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1912 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1913 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1914 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1915 assignment of p_paddr from phdr_lma. Fix comparison between
1916 "lma+size" and "next->lma".
1917 (elf_sort_segments): Fix assignment from p_paddr to lma.
1918 (assign_file_positions_for_load_sections): Add unit (bytes) to
1919 local "align". Fix calculation of local "off_adjust". Fix
1920 calculation of local "filehdr_vaddr".
1921 (assign_file_positions_for_non_load_sections): New local "opb".
1922 Fix calculation of "end" from "p_size". Fix comparison between
1923 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1924 from "end" and "p_vaddr".
1925 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1926 vma. Fix assignment to p_paddr from lma. Fix comparison between
1927 p_paddr and lma. Fix assignment to p_paddr from lma.
1928 * merge.c (sec_merge_emit): New local "opb". Convert
1929 "alignment_power" to octets.
1930 (_bfd_add_merge_section): New locals "alignment_power" and
1931 "opb". Fix comparison between "alignment_power" and
1933 (_bfd_merge_sections): New local "opb". Divide size by opb
1934 before checking align mask.
1936 2020-03-13 Christian Eggers <ceggers@gmx.de>
1938 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1939 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1941 (_bfd_elf_make_section_from_phdr): Similarly.
1942 (elf_fake_sections): Fix calculation of
1943 Elf_Internal_shdr::sh_addr from section VMA.
1944 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1946 (assign_file_positions_for_load_sections): Fix calculations of
1947 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1948 comparison between program header address and section LMA.
1949 (assign_file_positions_for_non_load_sections): Likewise.
1950 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1951 (IS_CONTAINED_BY_VMA): Add parameter opb.
1952 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1953 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1954 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1955 Fix calculations of p_addr_valid and p_vaddr_offset.
1956 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1957 with octets per byte when comparing against p_vaddr.
1959 2020-03-11 Alan Modra <amodra@gmail.com>
1961 * som.c (setup_sections): Sanity check subspace.name.
1963 2020-03-11 Alan Modra <amodra@gmail.com>
1965 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1967 2020-03-10 Alan Modra <amodra@gmail.com>
1970 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1973 2020-03-09 Alan Modra <amodra@gmail.com>
1975 * wasm-module.c (wasm_scan): Sanity check file name length
1976 before allocating memory. Move common section setup code. Do
1977 without bfd_tell to calculate section size.
1979 2020-03-06 Nick Clifton <nickc@redhat.com>
1981 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1982 with error messages and failure return values.
1984 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1986 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1987 relocation sections for any removed reference to a dynamic symbol.
1989 2020-03-05 Nick Clifton <nickc@redhat.com>
1991 * elf-bfd.h (struct elf_backend_data): Add new fields:
1992 init_secondary_reloc_section, slurp_secondary_reloc_section,
1993 write_secondary_reloc_section.
1994 (_bfd_elf_init_secondary_reloc_section): Prototype.
1995 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1996 (_bfd_elf_write_secondary_reloc_section): Prototype.
1997 * elf.c ( bfd_section_from_shdr): Invoke the new
1998 init_secondary_reloc_section backend function, if defined, when a
1999 second reloc section is encountered.
2000 (swap_out_syms): Invoke the new symbol_section_index function, if
2001 defined, when computing the section index of an OS/PROC specific
2003 (_bfd_elf_init_secondary_reloc_section): New function.
2004 (_bfd_elf_slurp_secondary_reloc_section): New function.
2005 (_bfd_elf_write_secondary_reloc_section): New function.
2006 (_bfd_elf_copy_special_section_fields): New function.
2007 * elfcode.h (elf_write_relocs): Invoke the new
2008 write_secondary_relocs function, if defined, in order to emit
2010 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2011 function, if defined, in order to read in secondary relocs.
2012 * elfxx-target.h (elf_backend_copy_special_section_fields):
2013 Provide a non-NULL default definition.
2014 (elf_backend_init_secondary_reloc_section): Likewise.
2015 (elf_backend_slurp_secondary_reloc_section): Likewise.
2016 (elf_backend_write_secondary_reloc_section): Likewise.
2017 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2019 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2020 * configure: Regenerate.
2022 2020-03-05 Alan Modra <amodra@gmail.com>
2024 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2025 against file size before allocating memory. Use bfd_alloc rather
2026 than bfd_zalloc for carsym/strings memory.
2028 2020-03-04 Alan Modra <amodra@gmail.com>
2030 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2031 sh_addr mod sh_addalign is zero.
2033 2020-03-04 Alan Modra <amodra@gmail.com>
2035 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2037 2020-03-03 Alan Modra <amodra@gmail.com>
2039 * format.c (struct bfd_preserve): Add cleanup field.
2040 (bfd_preserve_save): Add cleanup param and save.
2041 (bfd_preserve_restore): Return cleanup.
2042 (bfd_preserve_finish): Call the cleanup for the discarded match.
2043 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2044 and clear when preserving a match. Restore cleanup too when
2045 restoring that match.
2047 2020-03-02 Alan Modra <amodra@gmail.com>
2049 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2050 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2051 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2052 (core_sco5_vec): Correct initialisers.
2054 2020-03-02 Alan Modra <amodra@gmail.com>
2056 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2057 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2058 * cisco-core.c (cisco_core_file_validate): Likewise.
2059 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2060 * hpux-core.c (hpux_core_core_file_p): Likewise.
2061 * irix-core.c (irix_core_core_file_p): Likewise.
2062 * lynx-core.c (lynx_core_file_p): Likewise.
2063 * netbsd-core.c (netbsd_core_file_p): Likewise.
2064 * osf-core.c (osf_core_core_file_p): Likewise.
2065 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2066 * sco5-core.c (sco5_core_file_p): Likewise.
2068 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2070 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2072 2020-03-02 Alan Modra <amodra@gmail.com>
2074 * targets.c (bfd_cleanup): New typedef.
2075 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2076 * libbfd-in.h (_bfd_no_cleanup): Define.
2077 * format.c (bfd_reinit): Add cleanup parameter, call it.
2078 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2079 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2080 * aout-target.h (callback, object_p): Return bfd_cleanup.
2081 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2082 * archive.c (bfd_generic_archive_p): Likewise.
2083 * binary.c (binary_object_p): Likewise.
2084 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2085 * coff-ia64.c (ia64coff_object_p): Likewise.
2086 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2087 * coff-sh.c (coff_small_object_p): Likewise.
2088 * coff-stgo32.c (go32_check_format): Likewise.
2089 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2090 (xcoff64_core_p): Likewise.
2091 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2092 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2093 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2094 * elfcode.h (elf_object_p): Likewise.
2095 * elfcore.h (elf_core_file_p): Likewise.
2096 * i386msdos.c (msdos_object_p): Likewise.
2097 * ihex.c (ihex_object_p): Likewise.
2098 * libaout.h (some_aout_object_p): Likewise.
2099 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2100 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2101 * libbfd.c (_bfd_dummy_target): Likewise.
2102 * libcoff-in.h (coff_object_p): Likewise.
2103 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2104 (bfd_mach_o_arm64_core_p): Likewise.
2105 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2106 (bfd_mach_o_arm_core_p): Likewise.
2107 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2108 (bfd_mach_o_i386_core_p): Likewise.
2109 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2110 (bfd_mach_o_x86_64_core_p): Likewise.
2111 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2112 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2113 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2114 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2115 * mmo.c (mmo_object_p): Likewise.
2116 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2117 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2118 (pe_bfd_object_p): Likewise.
2119 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2120 * ppcboot.c (ppcboot_object_p): Likewise.
2121 * rs6000-core.c (rs6000coff_core_p): Likewise.
2122 * som.c (som_object_setup, som_object_p): Likewise.
2123 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2124 * tekhex.c (tekhex_object_p): Likewise.
2125 * vms-alpha.c (alpha_vms_object_p): Likewise.
2126 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2127 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2128 * wasm-module.c (wasm_object_p): Likewise.
2129 * xsym.c (bfd_sym_object_p): Likewise.
2130 * xsym.h (bfd_sym_object_p): Likewise.
2131 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2133 * pdp11.c (some_aout_object_p): Likewise.
2134 * plugin.c (register_ld_plugin_object_p): Update object_p
2136 * plugin.h (register_ld_plugin_object_p): Likewise.
2137 * bfd-in2.h: Regenerate.
2138 * libbfd.h: Regenerate.
2139 * libcoff.h: Regenerate.
2141 2020-03-02 Alan Modra <amodra@gmail.com>
2143 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2144 applicable section flags.
2145 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2146 (mips_ecoff_bele_vec): Likewise.
2147 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2149 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2150 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2152 2020-03-02 Alan Modra <amodra@gmail.com>
2154 * elf32-m32r.c (m32r_elf_section_flags): New function.
2155 (elf_backend_section_flags): Define.
2156 * elf32-nds32.c (nds32_elf_section_flags): New function.
2157 (elf_backend_section_flags): Define.
2158 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2159 .sbss and .sdata sections.
2160 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2161 for SHF_V850_GPREL sections.
2162 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2164 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2165 for SHF_PARISC_SHORT sections.
2166 * elf64-ppc.c (ppc64_elf_section_flags): New function.
2167 (elf_backend_section_flags): Define.
2168 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
2169 for SHF_MIPS_GPREL sections. Delete FIXME.
2171 2020-03-02 Alan Modra <amodra@gmail.com>
2173 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
2174 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
2175 calling elf_backend_section_flags with adjusted params. Use
2176 newsect->flags past that point.
2177 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
2179 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
2180 to have their type overridden, and all sh_flags but processor and
2182 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
2183 * elf32-mep.c (mep_elf_section_flags): Likewise.
2184 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
2185 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
2186 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
2187 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
2188 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
2189 stub BFD and non-aarch64 input files when scanning for stubs.
2191 2020-03-02 Alan Modra <amodra@gmail.com>
2193 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2194 limit to decompressed element size.
2196 2020-03-02 Alan Modra <amodra@gmail.com>
2198 * vms-lib.c (vms_traverse_index): Add recur_count param and
2199 update calls. Fail on excessive recursion.
2201 2020-03-02 Alan Modra <amodra@gmail.com>
2203 * vms-alpha.c (vms_get_remaining_object_record): Use
2204 bfd_realloc_or_free rather than bfd_realloc.
2205 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2206 (dst_define_location, parse_module): Likewise, and check realloc
2207 return status before using memory. Return status from function
2208 adjusting all callers.
2210 2020-02-28 Alan Modra <amodra@gmail.com>
2212 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2214 2020-02-28 Alan Modra <amodra@gmail.com>
2216 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2217 Remove duplicate undersize check.
2219 2020-02-27 Alan Modra <amodra@gmail.com>
2222 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2224 2020-02-27 Alan Modra <amodra@gmail.com>
2227 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2228 (coff_section_type): Adjust comment.
2229 (decode_section_type): Likewise. Call coff_section_type before
2230 decode_section_type.
2231 (bfd_decode_symclass): Use 'c' for common sections other than
2234 2020-02-27 Alan Modra <amodra@gmail.com>
2236 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2239 2020-02-27 Alan Modra <amodra@gmail.com>
2241 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2242 if file is an archive element.
2243 * bfd-in2.h: Regenerate.
2245 2020-02-26 Alan Modra <amodra@gmail.com>
2247 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2248 bfd_set_error on failing test. Don't bother changing bfd_error on
2249 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2250 Check sym name is within string buffer. Use size_t for some vars.
2251 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2252 int_buf. Don't change bfd_error on file read error. Use
2253 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2254 calculations to catch overflows before they occur. malloc and
2255 free raw armap rather than using bfd_alloc. Read raw armap before
2256 allocating carsym+strings buffer.
2257 (_bfd_slurp_extended_name_table): Localize variables. Check
2258 name size against file size.
2260 2020-02-26 Alan Modra <amodra@gmail.com>
2262 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2264 2020-02-26 Alan Modra <amodra@gmail.com>
2266 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2267 malloc. Check for NULL return from bfd_malloc.
2268 (rx_table_find, rx_table_map): Likewise.
2269 (rx_set_section_contents): Check bfd_alloc return.
2270 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2272 2020-02-26 Alan Modra <amodra@gmail.com>
2274 * aoutx.h: Indent labels correctly. Format error strings.
2275 * archive.c: Likewise.
2276 * archive64.c: Likewise.
2277 * coff-arm.c: Likewise.
2278 * coff-rs6000.c: Likewise.
2279 * coff-stgo32.c: Likewise.
2280 * cpu-arm.c: Likewise.
2281 * dwarf2.c: Likewise.
2282 * elf-ifunc.c: Likewise.
2283 * elf-properties.c: Likewise.
2284 * elf-s390-common.c: Likewise.
2285 * elf-strtab.c: Likewise.
2287 * elf32-arm.c: Likewise.
2288 * elf32-bfin.c: Likewise.
2289 * elf32-cr16.c: Likewise.
2290 * elf32-csky.c: Likewise.
2291 * elf32-i386.c: Likewise.
2292 * elf32-m68k.c: Likewise.
2293 * elf32-msp430.c: Likewise.
2294 * elf32-nds32.c: Likewise.
2295 * elf32-nios2.c: Likewise.
2296 * elf32-pru.c: Likewise.
2297 * elf32-xtensa.c: Likewise.
2298 * elf64-ia64-vms.c: Likewise.
2299 * elf64-x86-64.c: Likewise.
2300 * elfcode.h: Likewise.
2301 * elfcore.h: Likewise.
2302 * elflink.c: Likewise.
2303 * elfnn-aarch64.c: Likewise.
2304 * elfnn-ia64.c: Likewise.
2305 * elfnn-riscv.c: Likewise.
2306 * elfxx-mips.c: Likewise.
2307 * elfxx-sparc.c: Likewise.
2308 * elfxx-x86.c: Likewise.
2309 * i386lynx.c: Likewise.
2310 * merge.c: Likewise.
2311 * pdp11.c: Likewise.
2312 * plugin.c: Likewise.
2313 * reloc.c: Likewise.
2315 2020-02-26 Alan Modra <amodra@gmail.com>
2318 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2320 (bfd_elf_add_dt_needed_tag): Declare.
2321 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2322 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2323 from elf_add_dt_needed_tag. Remove soname and doit param.
2324 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2325 to see whether as-needed lib is already loaded, use dyn_loaded
2326 list instead. When saving and restoring around as-needed lib
2327 handle possibility that dynstr has not been initialised. Don't
2328 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2329 Mark libs loaded via DT_NEEDED entries of other libs with
2330 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2332 (elf_link_check_versioned_symbol): Remove now unneccesary
2333 DYNAMIC check when traversing dyn_loaded list.
2335 2020-02-26 Alan Modra <amodra@gmail.com>
2337 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2339 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2342 * plugin.c (need_lto_wrapper_p): New.
2343 (bfd_plugin_set_program_name): Add an int argument to set
2345 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2347 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2349 2020-02-24 Alan Modra <amodra@gmail.com>
2351 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2353 2020-02-24 Alan Modra <amodra@gmail.com>
2355 * vms-lib.c (struct carsym_mem): Add limit.
2356 (vms_add_index): Heed limit.
2357 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2358 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2359 Always return actual number read.
2360 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2361 assertion with error exit.
2363 2020-02-22 Alan Modra <amodra@gmail.com>
2366 * elf.c (assign_file_positions_for_load_sections): Continue linking
2367 on "PHDR segment not covered by LOAD segment" errors.
2369 2020-02-21 Alan Modra <amodra@gmail.com>
2371 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2373 (bfd_mach_o_canonicalize_reloc): Likewise.
2374 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2375 counts and offsets against file size.
2376 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2377 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2378 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2379 against file size. Delete symbol table error message.
2380 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2382 (bfd_mach_o_read_symtab): Likewise.
2383 (bfd_mach_o_read_command): Pass file size.
2384 (bfd_mach_o_scan): Sanity check command count against file size.
2386 2020-02-21 Alan Modra <amodra@gmail.com>
2389 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2390 "text", "data" and "bss" section pointer vars. Don't update
2391 section size, just exec header sizes.
2392 (adjust_sizes_and_vmas): Don't update text section size. Set
2393 initial exec header a_text. Print exec headers sizes.
2394 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2395 (adjust_sizes_and_vmas): Similarly. Formatting.
2396 (final_link): Correct final file extension.
2398 2020-02-20 Nick Clifton <nickc@redhat.com>
2400 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2402 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2404 (elfNN_bed): Initialise the symbol_section_index field.
2405 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2406 OS and PROC specific section indicies. Warn if converting other
2407 reserved incidies to SHN_ABS.
2409 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2412 * cpu-z80.c: Add machine type compatibility checking.
2414 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2417 * plugin.c (plugin_list_entry): Remove handle.
2418 (try_load_plugin): Call dlclose before return.
2420 2020-02-19 Alan Modra <amodra@gmail.com>
2422 * libbfd-in.h (_bfd_constant_p): Define.
2423 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2424 file size before allocating memory.
2425 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2426 * elf.c (bfd_elf_get_str_section): Likewise.
2427 (_bfd_elf_slurp_version_tables): Likewise.
2428 * libbfd.h: Regenerate.
2430 2020-02-19 Alan Modra <amodra@gmail.com>
2432 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2433 * aoutx.h (aout_get_external_symbols): Replace calls to
2434 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2435 (slurp_reloc_table): Likewise.
2436 * archive.c (do_slurp_bsd_armap): Likewise.
2437 (do_slurp_coff_armap): Likewise.
2438 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2439 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2440 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2441 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2442 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2443 (_bfd_coff_get_external_symbols): Likewise.
2444 * ecoff.c (ecoff_slurp_symbolic_header),
2445 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2446 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2447 (ecoff_indirect_link_order): Likewise.
2448 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2449 (_bfd_elf_slurp_version_tables): Likewise.
2450 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2451 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2452 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2453 * elf64-alpha.c (READ): Likewise.
2454 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2455 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2456 * elfcode.h (elf_slurp_symbol_table),
2457 (elf_slurp_reloc_table_from_section): Likewise.
2458 * elflink.c (elf_link_add_object_symbols),
2459 (elf_link_check_versioned_symbol): Likewise.
2460 * elfxx-mips.c (READ): Likewise.
2461 * i386lynx.c (slurp_reloc_table): Likewise.
2462 * lynx-core.c (lynx_core_file_p): Likewise.
2463 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2464 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2465 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2466 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2467 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2468 (bfd_pef_parse_symbols): Likewise.
2469 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2470 * som.c (setup_sections, som_slurp_string_table),
2471 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2472 (som_bfd_fill_in_ar_symbols): Likewise.
2473 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2474 (evax_bfd_print_image): Likewise.
2475 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2476 * wasm-module.c (wasm_scan): Likewise.
2477 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2478 * xsym.c (bfd_sym_read_name_table),
2479 (bfd_sym_print_type_information_table_entry): Likewise.
2480 * libbfd.h: Regenerate.
2482 2020-02-19 Alan Modra <amodra@gmail.com>
2484 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2485 reading external relocs.
2486 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2487 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2489 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2491 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2492 (m32c_elf_relax_section): Likewise.
2493 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2494 (rl78_elf_relax_section): Likewise.
2495 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2496 (elf32_rx_relax_section): Likewise.
2497 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2498 parameter types and use..
2499 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2500 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2501 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2502 being read from file, just the extra.
2503 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2504 after reading external syms. Free on failure.
2506 2020-02-19 Alan Modra <amodra@gmail.com>
2508 * coffcode.h (buy_and_read, coff_slurp_line_table),
2509 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2510 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2511 corresponding bfd_alloc call. Adjust variables to suit.
2512 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2513 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2514 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2515 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2516 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2517 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2518 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2519 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2520 * elf64-alpha.c (READ): Likewise.
2521 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2522 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2523 (bfd_from_remote_memory): Likewise.
2524 * elfcore.h (core_find_build_id): Likewise.
2525 * elfxx-mips.c (READ): Likewise.
2526 * mach-o.c (bfd_mach_o_mangle_sections),
2527 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2528 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2529 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2530 * som.c (setup_sections, som_prep_for_fixups)
2531 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2532 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2533 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2534 (som_bfd_ar_write_symbol_stuff): Likewise.
2535 * vms-alpha.c (vector_grow1): Likewise.
2536 * vms-lib.c (vms_add_index): Likewise.
2537 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2538 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2539 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2540 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2541 (bfd_alloc2, bfd_zalloc2): Delete.
2542 (_bfd_mul_overflow): Define.
2543 * libbfd.h: Regenerate.
2545 2020-02-19 Alan Modra <amodra@gmail.com>
2547 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2549 (assign_section_numbers): Likewise.
2550 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2551 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2552 bfd_malloc2, size_t amt, and unsigned tls_count.
2553 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2554 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2555 (elf_output_implib): Use bfd_alloc.
2557 2020-02-19 Alan Modra <amodra@gmail.com>
2559 * bfd.c (struct bfd): Move format and direction to other
2560 bitfields. Add "size".
2561 * bfdio.c (bfd_get_size): Cache size when not writing file.
2562 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2563 returning zero, ie. unknown.
2564 (bfd_get_alt_debug_link_info): Likewise.
2565 * bfd-in2.h: Regenerate.
2567 2020-02-19 Alan Modra <amodra@gmail.com>
2569 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2570 bfd_get_file_size twice.
2571 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2572 zero, ie. unknown, return.
2573 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2574 * elfcode.h (elf_swap_shdr_in): Likewise.
2575 (elf_object_p): Don't call bfd_get_file_size twice and correct
2578 2020-02-19 Alan Modra <amodra@gmail.com>
2580 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2581 FALSE if memory alloc fails. Adjust calls.
2582 * som.c (som_prep_for_fixups): Likewise.
2583 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2584 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2585 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2586 * som.c (som_build_and_write_symbol_table): Return via error_return
2588 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2589 (VEC_APPEND_EL): Delete.
2590 (vector_grow1): Return pointer to element. Catch overflow.
2591 Return NULL on memory allocation failure.
2592 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2593 (alpha_vms_add_fixup_ca): Likewise.
2594 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2596 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2598 2020-02-19 Alan Modra <amodra@gmail.com>
2600 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2601 * aout-target.h (object_p): Likewise.
2602 * aout-tic30.c (tic30_aout_object_p): Likewise.
2603 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2604 (emit_stringtab, write_syms, link_hash_table_create),
2605 (aout_link_write_other_symbol): Likewise.
2606 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2607 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2608 (_bfd_compute_and_write_armap): Likewise.
2609 * archures.c (bfd_arch_list): Likewise.
2610 * bfd.c (bfd_record_phdr): Likewise.
2611 * binary.c (binary_canonicalize_symtab): Likewise.
2612 * cisco-core.c (cisco_core_file_validate): Likewise.
2613 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2614 (find_arm_glue, record_arm_to_thumb_glue),
2615 (record_thumb_to_arm_glue): Likewise.
2616 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2617 (ppc_allocate_toc_section): Likewise.
2618 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2619 * coff-sh.c (sh_relax_section): Likewise.
2620 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2621 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2622 (coff_set_alignment_hook, coff_mkobject),
2623 (coff_compute_section_file_positions): Likewise.
2624 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2625 (coff_find_nearest_line_with_names),
2626 ( bfd_coff_set_symbol_class): Likewise.
2627 * cofflink.c (_bfd_coff_link_hash_table_create),
2628 (_bfd_coff_link_input_bfd): Likewise.
2629 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2630 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2631 (build_line_info_table, sort_line_sequences),
2632 (line_info_add_include_dir, line_info_add_file_name),
2633 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2634 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2635 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2636 (_bfd_ecoff_find_nearest_line),
2637 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2638 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2639 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2640 * elf-m10300.c (mn10300_elf_relax_section),
2641 (elf32_mn10300_link_hash_table_create): Likewise.
2642 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2643 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2644 * elf32-arm.c (elf32_arm_link_hash_table_create),
2645 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2646 (elf32_arm_new_section_hook): Likewise.
2647 * elf32-avr.c (elf_avr_new_section_hook),
2648 (elf32_avr_link_hash_table_create, get_local_syms),
2649 (elf32_avr_setup_section_lists): Likewise.
2650 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2651 (bfin_link_hash_table_create): Likewise.
2652 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2653 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2654 * elf32-csky.c (csky_elf_link_hash_table_create),
2655 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2656 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2657 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2658 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2659 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2660 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2661 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2662 (m32r_elf_check_relocs): Likewise.
2663 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2664 (elf32_m68hc11_setup_section_lists),
2665 (elf32_m68hc11_size_stubs): Likewise.
2666 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2667 * elf32-metag.c (elf_metag_link_hash_table_create),
2668 (elf_metag_setup_section_lists): Likewise.
2669 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2670 (microblaze_elf_check_relocs): Likewise.
2671 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2672 (nds32_elf_check_relocs): Likewise.
2673 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2674 (get_local_syms, nios2_elf32_check_relocs),
2675 (nios2_elf32_link_hash_table_create): Likewise.
2676 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2677 (or1k_elf_check_relocs): Likewise.
2678 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2679 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2680 * elf32-s390.c (elf_s390_link_hash_table_create),
2681 (elf_s390_check_relocs): Likewise.
2682 * elf32-score.c (score_elf_create_got_section),
2683 (s3_elf32_score_new_section_hook),
2684 (elf32_score_link_hash_table_create): Likewise.
2685 * elf32-score7.c (score_elf_create_got_section),
2686 (s7_elf32_score_new_section_hook): Likewise.
2687 * elf32-sh.c (sh_elf_link_hash_table_create),
2688 (sh_elf_check_relocs): Likewise.
2689 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2690 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2691 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2692 (tilepro_elf_check_relocs): Likewise.
2693 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2694 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2695 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2696 (elf_xtensa_new_section_hook): Likewise.
2697 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2698 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2699 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2700 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2701 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2702 * elf64-ppc.c (ppc64_elf_new_section_hook),
2703 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2704 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2705 * elf64-s390.c (elf_s390_link_hash_table_create),
2706 (elf_s390_check_relocs): Likewise.
2707 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2708 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2709 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2710 (elf_link_add_archive_symbols, compute_bucket_count),
2711 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2712 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2713 (bfd_elf_final_link): Likewise.
2714 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2715 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2716 (elfNN_aarch64_new_section_hook): Likewise.
2717 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2718 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2719 (riscv_elf_check_relocs): Likewise.
2720 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2721 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2722 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2723 (_bfd_mips_elf_link_hash_table_create): Likewise.
2724 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2725 (_bfd_sparc_elf_check_relocs),
2726 (_bfd_sparc_elf_new_section_hook): Likewise.
2727 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2728 (tilegx_elf_check_relocs): Likewise.
2729 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2730 * format.c (bfd_check_format_matches): Likewise.
2731 * hash.c (_bfd_stringtab_init): Likewise.
2732 * ihex.c (ihex_scan): Likewise.
2733 * irix-core.c (irix_core_core_file_p): Likewise.
2734 * linker.c (bfd_wrapped_link_hash_lookup),
2735 (_bfd_generic_link_hash_table_create),
2736 (_bfd_generic_reloc_link_order): Likewise.
2737 * lynx-core.c (lynx_core_file_p): Likewise.
2738 * netbsd-core.c (netbsd_core_file_p): Likewise.
2739 * osf-core.c (osf_core_core_file_p): Likewise.
2740 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2741 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2742 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2743 * peicode.h (pe_mkobject): Likewise.
2744 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2745 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2746 * sco5-core.c (read_uarea): Likewise.
2747 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2748 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2749 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2750 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2751 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2752 * srec.c (srec_scan): Likewise.
2753 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2754 * targets.c (bfd_target_list): Likewise.
2755 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2756 * trad-core.c (trad_unix_core_file_p): Likewise.
2757 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2758 (vms_new_section_hook): Likewise.
2759 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2760 * xcofflink.c (xcoff_get_section_contents),
2761 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2762 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2763 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2765 2020-02-19 Alan Modra <amodra@gmail.com>
2767 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2769 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2771 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2772 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2773 a build_list_p argument. Don't search plugin_list. Short circuit
2774 when building the plugin list.
2775 (has_plugin): Renamed to has_plugin_list.
2776 (bfd_plugin_set_plugin): Don't set has_plugin.
2777 (bfd_plugin_specified_p): Check plugin_list instead.
2778 (build_plugin_list): New function.
2779 (load_plugin): Call build_plugin_list and use plugin_list.
2781 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2784 * plugin.c (try_claim): Always clean up for LTO wrapper.
2785 (try_load_plugin): Treat each object as independent. Create a
2786 copy for plugin name.
2788 2020-02-11 Nick Clifton <nickc@redhat.com>
2790 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2791 for addresses in print statements.
2792 (msp430_elf_relax_delete_bytes): Likewise.
2793 (msp430_elf_relax_add_words): Likewise.
2794 (msp430_elf_relax_section): Likewise.
2796 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2798 * plugin.c (add_symbols): Clear plugin_data memory.
2800 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2803 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2804 (EXECUTABLE_SUFFIX): Likewise.
2805 * config.in: Regenerated.
2806 * configure: Likewise.
2807 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2808 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2809 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2810 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2811 (get_lto_wrapper): New.
2812 (setup_lto_wrapper_env): Likewise.
2813 (current_plugin): Likewise.
2814 (register_all_symbols_read): Likewise.
2815 (register_cleanup): Likewise.
2816 (get_symbols): Likewise.
2817 (add_input_file): Likewise.
2818 (bfd_plugin_close_and_cleanup): Likewise.
2819 (claim_file): Removed.
2820 (register_claim_file): Set current_plugin->claim_file.
2821 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2822 lto_syms in current_plugin.
2823 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2824 all_symbols_read handler. Copy real symbols to plugin_data.
2825 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2826 (try_load_plugin): Don't reuse the previous plugin for LTO
2827 wrapper. Set up GCC LTO wrapper if possible. Don't set
2828 plugin_list_iter->claim_file.
2829 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2831 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2834 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2836 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2837 check if previous instruction matches a conditional jump inserted
2838 earlier. Invert conditional jump and delete branch in this case.
2840 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2842 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2843 msp430_elf_relax_add_words. Support insertion of either one or two
2845 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2846 needs to be grown. Handle insertion of branch instruction to replace
2849 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2851 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2852 debugging relocations.
2853 (msp430_elf_relax_delete_bytes): Likewise.
2854 (msp430_elf_relax_add_two_words): Likewise.
2855 (msp430_elf_relax_section): Likewise.
2857 2020-02-10 Alan Modra <amodra@gmail.com>
2859 * archures.c: Wrap overlong z80 comments.
2860 * bfd-in2.h: Regenerate.
2862 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2865 * archures.c: Add GBZ80 and Z80N machine values.
2866 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2867 * coff-z80.c: Add support for new reloc.
2868 * coffcode.h: Add support for new machine values.
2869 * cpu-z80.c: Add support for new machine names.
2870 * elf32-z80.c: Add support for new reloc.
2871 * bfd-in2.h: Regenerate.
2872 * libbfd.h: Regenerate.
2874 2020-02-07 Nick Clifton <nickc@redhat.com>
2877 * elf.c (rewrite_elf_program_header): Do not complain if no
2878 sections are mapped to a segment.
2880 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2883 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2884 for garbage collection on __patchable_function_entries section
2885 without linked-to section.
2887 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2890 * bfd-in2.h: Regenerated.
2891 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2892 on section if gc_mark of any of its linked-to sections is set
2893 and don't set gc_mark again.
2894 * section.c (asection): Add linked_to_symbol_name to map_head
2897 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
2899 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2900 reporting an unrecognized instruction with R_V850_LONGJUMP.
2902 2020-02-05 Alan Modra <amodra@gmail.com>
2904 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2906 2020-02-04 Alan Modra <amodra@gmail.com>
2908 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2909 R_PPC_VLE_ADDR20, goto copy_reloc.
2911 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2913 * bfd-in2.h: Regenerated.
2914 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2916 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2919 * bfd-in2.h: Regenerated.
2920 * ecoff.c (bfd_debug_section): Add section_id.
2921 * section.c (bfd_section): Add section_id.
2922 (SEC_ASSEMBLER_SECTION_ID): New.
2923 (BFD_FAKE_SECTION): Add section_id.
2925 2020-02-01 Nick Clifton <nickc@redhat.com>
2927 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2930 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2932 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2933 encodings are relative to the GOT on nios2, too.
2935 2020-01-31 Alan Modra <amodra@gmail.com>
2937 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2938 file. Use $< and $@ in rules.
2939 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2940 (elf32-ia64.c, elf64-ia64.c): Likewise.
2941 (elf32-riscv.c, elf64-riscv.c): Likewise.
2942 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2943 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2944 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2945 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2946 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2947 * Makefile.in: Regenerate.
2949 2020-01-31 Alan Modra <amodra@gmail.com>
2952 * elf.c (setup_group): Don't clear entire section contents,
2953 just the padding after group flags. Release alloc'd memory
2954 after a seek or read failure.
2956 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2958 * peXXigen.c (pe_is_repro): New function.
2959 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2960 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2962 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2964 * peXXigen.c (debug_type_names): Add names for new debug data type
2967 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2969 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2970 inner loop. Fix a memory leak.
2972 2020-01-30 Alan Modra <amodra@gmail.com>
2974 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2975 or obj_coff_keep_strings here.
2976 (coff_get_normalized_symtab): Free external syms directly.
2977 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2980 2020-01-27 Jim Wilson <jimw@sifive.com>
2982 * cpu-riscv.c (riscv_scan): New.
2983 (N): Change bfd_default_scan to riscv_scan.
2985 2020-01-27 Andreas Schwab <schwab@suse.de>
2987 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2988 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2989 * Makefile.in: Regenerate.
2990 * cpu-plugin.c: Remove.
2991 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2992 (bfd_plugin_arch): Remove declaration.
2993 * bfd-in2.h: Regenerate.
2994 * po/SRC-POTFILES.in: Regenerate.
2996 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2997 Alan Modra <amodra@gmail.com>
3000 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3002 2020-01-24 Jim Wilson <jimw@sifive.com>
3004 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3005 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3006 avoid over long line.
3008 2020-01-24 Nick Clifton <nickc@redhat.com>
3011 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3012 syms and keep strings flags as these may have been set in order to
3013 prevent a bogus call to free.
3015 2020-01-23 Nick Clifton <nickc@redhat.com>
3017 * po/fr.po: Updated French translation.
3019 2020-01-23 Alan Modra <amodra@gmail.com>
3022 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3023 by zero when p_align is zero.
3025 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3027 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3028 (riscv_prefix_cmp): Likewise.
3029 (riscv_non_std_ext_p): Deleted.
3030 (riscv_std_sv_ext_p): Likewise.
3031 (riscv_non_std_sv_ext_p): Likewise.
3032 (riscv_merge_non_std_and_sv_ext): Rename to...
3033 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3034 (riscv_merge_arch_attr_info): Replace 3 calls to
3035 riscv_merge_non_std_and_sv_ext with single call to
3036 riscv_merge_multi_letter_ext.
3037 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3038 encounter a 'z' prefix.
3039 (riscv_get_prefix_class): New function, return prefix class based
3040 on first few characters of input string.
3041 (riscv_parse_config): New structure to factor out minor differences
3042 in extension class parsing behaviour.
3043 (riscv_parse_sv_or_non_std_ext): Rename to...
3044 (riscv_parse_prefixed_ext): and parameterise with
3046 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3047 (riscv_multi_letter_ext_valid_p): New.
3048 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3049 (riscv_parse_subset): Delegate all non-single-letter parsing work
3050 to riscv_parse_prefixed_ext.
3051 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3052 (riscv_get_prefix_class): Declare.
3054 2020-01-22 Alan Modra <amodra@gmail.com>
3056 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3057 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3058 __tls_get_addr_desc.
3059 (ppc64_elf_size_stubs): Add section for linker generated
3060 __tls_get_addr_desc wrapper function. Loop at least once if
3061 generating this function.
3062 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3063 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3065 2020-01-22 Alan Modra <amodra@gmail.com>
3067 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3068 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3070 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3071 (STDU_R1_0R1, ADDI_R1_R1): Define.
3072 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3073 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3074 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3075 no_tls_get_addr_regsave.
3076 (branch_reloc_hash_match): Add hash3 and hash4.
3077 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3078 (ppc64_elf_size_dynamic_sections): Likewise.
3079 (ppc64_elf_relocate_section): Likewise.
3080 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3081 __tls_get_addr stub.
3082 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3084 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3085 eh_frame for regsave __tls_get_addr.
3087 2020-01-22 Alan Modra <amodra@gmail.com>
3089 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3090 which __tls_get_addr calls will be eliminated.
3092 2020-01-20 Nick Clifton <nickc@redhat.com>
3094 * po/pt.po: Updates Portuguese translation.
3095 * po/ru.po: Updated Russian translation.
3096 * po/uk.po: Updated Ukranian translation.
3098 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3101 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3102 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3104 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3105 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3106 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3107 "rex leal x@tlsdesc(%rip), %reg" to
3108 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3109 "call *(%eax)" to "nopl (%rax)".
3111 2020-01-20 Alan Modra <amodra@gmail.com>
3113 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3114 (MTLR_R11): Don't define.
3115 (LD_R0_0R3, CMPDI_R0_0): Define.
3116 (build_tls_get_addr_stub): Don't use r11 in stub.
3118 2020-01-20 Alan Modra <amodra@gmail.com>
3120 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3121 (defined_sym_val, is_tls_get_addr): Likewise.
3123 2020-01-18 Nick Clifton <nickc@redhat.com>
3125 * version.m4 (BFD_VERSION): Set to 2.34.50.
3126 * configure: Regenerate.
3127 * po/bfd.pot: Regenerate.
3129 2020-01-18 Nick Clifton <nickc@redhat.com>
3131 Binutils 2.34 branch created.
3133 2020-01-17 Christian Biesinger <cbiesinger@google.com>
3135 * coff-arm.c: Fix spelling error (seperate).
3136 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3138 * sysdep.h (strnlen): Fix spelling error (seperate).
3140 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
3143 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3145 2020-01-15 Alan Modra <amodra@gmail.com>
3148 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3149 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3150 of function symbols unless dot symbols are present. Do warn
3151 whenever one is created, regardles of whether a PLT entry is
3152 also emitted for the function symbol.
3154 2020-01-14 Alan Modra <amodra@gmail.com>
3156 * som.c (som_bfd_count_ar_symbols): Error when file position
3157 of symbols on chains is not strictly increasing.
3159 2020-01-14 Alan Modra <amodra@gmail.com>
3161 * vms.h (VMS_DEBUG): Define as 0.
3162 * vms-alpha.c (image_write): Move debug output after bounds check.
3164 (_bfd_vms_slurp_eihd): Warning fix.
3165 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
3167 2020-01-13 Alan Modra <amodra@gmail.com>
3169 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
3170 for "ignored" records.
3172 2020-01-13 Alan Modra <amodra@gmail.com>
3174 * wasm-module.c (wasm_scan_name_function_section): Formatting.
3175 Delete asect name check. Move asect NULL check to wasm_object_p.
3176 Correct bounds check of sizes against end. Replace uses of
3177 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
3178 just one bfd_release.
3179 (wasm_scan): Don't use malloc/strdup for section names,
3180 bfd_alloc instead. Simplify code prefixing section name.
3181 Formatting. Don't attempt to free memory here..
3182 (wasm_object_p): ..do so here.
3184 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
3187 * elf32-arm.c (elf32_arm_final_link_relocate): Use
3188 UNDEFWEAK_NO_DYNAMIC_RELOC.
3189 (allocate_dynrelocs_for_symbol): Likewise.
3191 2020-01-10 Tamar Christina <tamar.christina@arm.com>
3194 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3196 2020-01-10 Alan Modra <amodra@gmail.com>
3198 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3200 2020-01-09 Nick Clifton <nickc@redhat.com>
3203 * bfd.c (bfd_convert_section_contents): Check for a compress
3204 header size that is larger than the actual section size.
3206 2020-01-08 Alan Modra <amodra@gmail.com>
3209 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3210 after removing sections.
3212 2020-01-06 Jim Wilson <jimw@sifive.com>
3215 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3216 check for !bfd_link_pic (info).
3217 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3218 <R_RISCV_JAL>: Add comment.
3219 (_bfd_riscv_relax_section): For plt.offset check, add check for
3220 bfd_link_pic (info). Add comment.
3222 2020-01-06 Alan Modra <amodra@gmail.com>
3224 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3225 match failures. Don't init to bfd_error_wrong_format before
3226 calling _bfd_check_format.
3228 2020-01-06 Alan Modra <amodra@gmail.com>
3230 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3231 status rather than exiting on stack overflow or underflow.
3232 (_bfd_vms_slurp_etir): Adjust to suit.
3234 2020-01-06 Alan Modra <amodra@gmail.com>
3236 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3238 2020-01-06 Alan Modra <amodra@gmail.com>
3240 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3241 command. Check name offset is within command.
3242 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3243 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3244 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3245 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3246 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3247 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3248 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3249 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3250 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3251 (bfd_mach_o_read_segment): Similarly.
3252 (bfd_mach_o_read_thread): Properly bound check thread struct.
3253 Don't repeat checks on second loop.
3254 (bfd_mach_o_read_command): Fail on invalid command length.
3256 2020-01-04 Alan Modra <amodra@gmail.com>
3258 * format.c (bfd_check_format_matches): Add preserve_match.
3259 Save initial bfd state in "preserve", matched bfd state in
3260 "preserve_match". Save just the first match. Release
3261 bfd_alloc memory. Restore and finish preserved state as
3262 appropriate on all function exit paths.
3264 2020-01-04 Alan Modra <amodra@gmail.com>
3266 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3268 2020-01-04 Alan Modra <amodra@gmail.com>
3270 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3273 2020-01-03 Nick Clifton <nickc@redhat.com>
3276 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3277 there is enough data remaining in the code buffer before
3278 attempting to read a function stub.
3280 2020-01-03 Nick Clifton <nickc@redhat.com>
3283 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3284 return value from bfd_malloc.
3285 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3286 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3287 (elf32_arm_filter_cmse_symbols): Likewise.
3288 (elf32_arm_write_section): Likewise.
3289 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3290 (bfd_mach_o_follow_dsym): Likewise.
3291 * pef.c (bfd_pef_print_loader_section): Likewise.
3292 (bfd_pef_scan_start_address): Likewise.
3293 (bfd_pef_parse_function_stubs): Likewise.
3294 (bfd_pef_parse_symbols): Likewise.
3296 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3298 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3299 on binary inputs ld/PR25316.
3300 (is_ia64_elf): new helper to filter on ia64 objects.
3302 2020-01-03 Jan Beulich <jbeulich@suse.com>
3304 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3306 (bfd_mach_o_scan): Insert underscore in two variable names.
3308 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3310 * Makefile.am: Add z80-elf target support.
3311 * configure.ac: Likewise.
3312 * targets.c: Likewise.
3313 * Makefile.in: Regenerate.
3314 * configure: Regenerate.
3315 * config.bfd: Add z80-elf target support and new arches: ez80 and
3317 * elf32-z80.c: New file.
3318 * archures.c: Add new z80 architectures: eZ80 and Z180.
3319 * coffcode.h: Likewise.
3320 * cpu-z80.c: Likewise.
3321 * coff-z80.c: Add new relocations for Z80 target and local label
3323 * reloc.c: Add new relocs.
3324 * bfd-in2.h: Regenerate.
3325 * libbfd.h: Regenerate.
3327 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3331 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3333 2020-01-01 Alan Modra <amodra@gmail.com>
3335 Update year range in copyright notice of all files.
3337 For older changes see ChangeLog-2019
3339 Copyright (C) 2020 Free Software Foundation, Inc.
3341 Copying and distribution of this file, with or without modification,
3342 are permitted in any medium without royalty provided the copyright
3343 notice and this notice are preserved.
3349 version-control: never