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