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