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