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