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