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