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