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