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