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