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