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