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