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