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