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