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