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