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