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