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