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