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