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