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