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