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