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