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