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