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