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