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