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