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