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