64f01ef5ef6a5adba03f7f168c5aae0efd236956
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR ld/26067
4 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
5 * elf32-arm.c (readonly_dynrelocs): Removed.
6 (maybe_set_textrel): Replace readonly_dynrelocs with
7 _bfd_elf_readonly_dynrelocs.
8 * elf32-csky.c (readonly_dynrelocs): Removed.
9 (maybe_set_textrel): Replace readonly_dynrelocs with
10 _bfd_elf_readonly_dynrelocs.
11 * elf32-hppa.c(readonly_dynrelocs): Removed.
12 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
13 _bfd_elf_readonly_dynrelocs.
14 (maybe_set_textrel): Likewise.
15 * elf32-lm32.c (readonly_dynrelocs): Removed.
16 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
17 with _bfd_elf_readonly_dynrelocs.
18 (maybe_set_textrel): Likewise.
19 * elf32-m32r.c (readonly_dynrelocs): Removed.
20 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
21 with _bfd_elf_readonly_dynrelocs.
22 (maybe_set_textrel): Likewise.
23 * elf32-metag.c (readonly_dynrelocs): Removed.
24 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
25 with _bfd_elf_readonly_dynrelocs.
26 (maybe_set_textrel): Likewise.
27 * elf32-microblaze.c (readonly_dynrelocs): Removed.
28 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
29 with _bfd_elf_readonly_dynrelocs.
30 * elf32-nds32.c (readonly_dynrelocs): Removed.
31 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
32 with _bfd_elf_readonly_dynrelocs.
33 (maybe_set_textrel): Likewise.
34 * elf32-or1k.c (readonly_dynrelocs): Removed.
35 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
36 with _bfd_elf_readonly_dynrelocs.
37 * elf32-ppc.c (readonly_dynrelocs): Removed.
38 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
39 _bfd_elf_readonly_dynrelocs.
40 (ppc_elf_adjust_dynamic_symbol): Likewise.
41 (maybe_set_textrel): Likewise.
42 * elf32-s390.c (readonly_dynrelocs): Removed.
43 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
44 with _bfd_elf_readonly_dynrelocs.
45 (maybe_set_textrel): Likewise.
46 * elf32-sh.c (readonly_dynrelocs): Removed.
47 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
48 _bfd_elf_readonly_dynrelocs.
49 (maybe_set_textrel): Likewise.
50 * elf32-tic6x.c (readonly_dynrelocs): Removed.
51 (maybe_set_textrel): Replace readonly_dynrelocs with
52 _bfd_elf_readonly_dynrelocs.
53 * elf32-tilepro.c (readonly_dynrelocs): Removed.
54 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
55 with _bfd_elf_readonly_dynrelocs.
56 (maybe_set_textrel): Likewise.
57 * elf64-ppc.c (readonly_dynrelocs): Removed.
58 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
59 _bfd_elf_readonly_dynrelocs.
60 (ppc64_elf_adjust_dynamic_symbol): Likewise.
61 (maybe_set_textrel): Likewise.
62 * elf64-s390.c (readonly_dynrelocs): Removed.
63 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
64 with _bfd_elf_readonly_dynrelocs.
65 (maybe_set_textrel): Likewise.
66 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
67 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
68 (maybe_set_textrel): Replace readonly_dynrelocs with
69 _bfd_elf_readonly_dynrelocs.
70 * elfnn-riscv.c (readonly_dynrelocs): Removed.
71 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
72 with _bfd_elf_readonly_dynrelocs.
73 (maybe_set_textrel): Likewise.
74 * elfxx-sparc.c (readonly_dynrelocs): Removed.
75 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
76 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
77 (maybe_set_textrel): Likewise.
78 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
79 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
80 with _bfd_elf_readonly_dynrelocs.
81 (maybe_set_textrel): Likewise.
82 * elfxx-x86.c (readonly_dynrelocs): Removed.
83 (maybe_set_textrel): Replace readonly_dynrelocs with
84 _bfd_elf_readonly_dynrelocs.
85 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
86
87 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
88
89 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
90 -fsanitize=undefined.
91
92 2020-06-03 Alan Modra <amodra@gmail.com>
93
94 PR 26069
95 PR 18758
96 * peicode.h (pe_ILF_make_a_section): Align data for compilers
97 other than gcc.
98 (pe_ILF_build_a_bfd): Likewise.
99
100 2020-06-03 Alan Modra <amodra@gmail.com>
101
102 PR 26029
103 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
104 core files as well as objects.
105
106 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
107
108 PR ld/26067
109 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
110 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
111 Updated.
112 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
113 (elf_arc_link_hash_newfunc): Updated.
114 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
115 (elf32_arm_link_hash_newfunc): Updated.
116 (elf32_arm_copy_indirect_symbol): Likewise.
117 (elf32_arm_check_relocs): Likewise.
118 (readonly_dynrelocs): Likewise.
119 (allocate_dynrelocs_for_symbol): Likewise.
120 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
121 (csky_elf_link_hash_newfunc): Updated.
122 (csky_allocate_dynrelocs): Likewise.
123 (readonly_dynrelocs): Likewise.
124 (csky_elf_copy_indirect_symbol): Likewise.
125 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
126 (hppa_link_hash_newfunc): Updated.
127 (elf32_hppa_copy_indirect_symbol): Likewise.
128 (elf32_hppa_hide_symbol): Likewise.
129 (elf32_hppa_adjust_dynamic_symbol): Likewise.
130 (allocate_dynrelocs): Likewise.
131 (elf32_hppa_relocate_section): Likewise.
132 * elf32-i386.c (elf_i386_check_relocs): Likewise.
133 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
134 (lm32_elf_link_hash_newfunc): Likewise.
135 (lm32_elf_link_hash_table_create): Updated.
136 (readonly_dynrelocs): Likewise.
137 (allocate_dynrelocs): Likewise.
138 (lm32_elf_copy_indirect_symbol): Likewise.
139 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
140 (m32r_elf_link_hash_newfunc): Likewise.
141 (m32r_elf_link_hash_table_create): Updated.
142 (m32r_elf_copy_indirect_symbol): Likewise.
143 (allocate_dynrelocs): Likewise.
144 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
145 (metag_link_hash_newfunc): Updated.
146 (elf_metag_copy_indirect_symbol): Likewise.
147 (readonly_dynrelocs): Likewise.
148 (allocate_dynrelocs): Likewise.
149 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
150 dyn_relocs.
151 (link_hash_newfunc): Updated.
152 (microblaze_elf_check_relocs): Likewise.
153 (microblaze_elf_copy_indirect_symbol): Likewise.
154 (readonly_dynrelocs): Likewise.
155 (allocate_dynrelocs): Likewise.
156 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
157 (nds32_elf_link_hash_newfunc): Updated.
158 (nds32_elf_copy_indirect_symbol): Likewise.
159 (readonly_dynrelocs): Likewise.
160 (allocate_dynrelocs): Likewise.
161 (nds32_elf_check_relocs): Likewise.
162 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
163 (link_hash_newfunc): Updated.
164 (nios2_elf32_copy_indirect_symbol): Likewise.
165 (nios2_elf32_check_relocs): Likewise.
166 (allocate_dynrelocs): Likewise.
167 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
168 (or1k_elf_link_hash_newfunc): Updated.
169 (readonly_dynrelocs): Likewise.
170 (allocate_dynrelocs): Likewise.
171 (or1k_elf_copy_indirect_symbol): Likewise.
172 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
173 (ppc_elf_link_hash_newfunc): Updated.
174 (ppc_elf_copy_indirect_symbol): Likewise.
175 (ppc_elf_check_relocs): Likewise.
176 (readonly_dynrelocs): Likewise.
177 (ppc_elf_adjust_dynamic_symbol): Likewise.
178 (allocate_dynrelocs): Likewise.
179 (ppc_elf_relocate_section): Likewise.
180 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
181 (link_hash_newfunc): Updated.
182 (elf_s390_copy_indirect_symbol): Likewise.
183 (readonly_dynrelocs): Likewise.
184 (elf_s390_adjust_dynamic_symbol): Likewise.
185 (allocate_dynrelocs): Likewise.
186 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
187 (sh_elf_link_hash_newfunc): Updated.
188 (readonly_dynrelocs): Likewise.
189 (allocate_dynrelocs): Likewise.
190 (sh_elf_copy_indirect_symbol): Likewise.
191 (sh_elf_check_relocs): Likewise.
192 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
193 (elf32_tic6x_link_hash_newfunc): Likewise.
194 (elf32_tic6x_link_hash_table_create): Updated.
195 (readonly_dynrelocs): Likewise.
196 (elf32_tic6x_check_relocs): Likewise.
197 (elf32_tic6x_allocate_dynrelocs): Likewise.
198 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
199 dyn_relocs.
200 (link_hash_newfunc): Updated.
201 (tilepro_elf_copy_indirect_symbol): Likewise.
202 (tilepro_elf_check_relocs): Likewise.
203 (allocate_dynrelocs): Likewise.
204 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
205 (ppc64_elf_copy_indirect_symbol): Updated.
206 (ppc64_elf_check_relocs): Likewise.
207 (readonly_dynrelocs): Likewise.
208 (ppc64_elf_adjust_dynamic_symbol): Likewise.
209 (dec_dynrel_count): Likewise.
210 (allocate_dynrelocs): Likewise.
211 (ppc64_elf_relocate_section): Likewise.
212 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
213 (link_hash_newfunc): Updated.
214 (elf_s390_copy_indirect_symbol): Likewise.
215 (readonly_dynrelocs): Likewise.
216 (allocate_dynrelocs): Likewise.
217 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
218 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
219 dyn_relocs.
220 (elfNN_aarch64_link_hash_newfunc): Updated.
221 (elfNN_aarch64_copy_indirect_symbol): Likewise.
222 (readonly_dynrelocs): Likewise.
223 (need_copy_relocation_p): Likewise.
224 (elfNN_aarch64_allocate_dynrelocs): Likewise.
225 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
226 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
227 (link_hash_newfunc): Updated.
228 (riscv_elf_copy_indirect_symbol): Likewise.
229 (riscv_elf_check_relocs): Likewise.
230 (readonly_dynrelocs): Likewise.
231 (allocate_dynrelocs): Likewise.
232 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
233 dyn_relocs.
234 (link_hash_newfunc): Updated.
235 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
236 (_bfd_sparc_elf_check_relocs): Likewise.
237 (readonly_dynrelocs): Likewise.
238 (allocate_dynrelocs): Likewise.
239 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
240 (link_hash_newfunc): Updated.
241 (tilegx_elf_copy_indirect_symbol): Likewise.
242 (tilegx_elf_check_relocs): Likewise.
243 (readonly_dynrelocs): Likewise.
244 (allocate_dynrelocs): Likewise.
245 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
246 (readonly_dynrelocs): Likewise.
247 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
248 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
249
250 2020-06-01 Alan Modra <amodra@gmail.com>
251
252 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
253 command against cmd_length, not the end of record. For
254 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
255 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
256 cmd_length test.
257
258 2020-05-28 David Faust <david.faust@oracle.com>
259
260 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
261 R_BPF_INSN_{32,64} relocations.
262
263 2020-05-28 Stephen Casner <casner@acm.org>
264
265 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
266 addreses in .long (used in testsuites) and .stab values.
267
268 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
269
270 PR ld/22909
271 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
272 Check bfd_link_dll when issue a DT_TEXTREL warning.
273 * elfxx-x86.c (maybe_set_textrel): Likewise.
274 (_bfd_x86_elf_size_dynamic_sections): Likewise.
275
276 2020-05-26 Nick Clifton <nickc@redhat.com>
277
278 * plugin.c (try_load_plugin): Extend error message when a plugin
279 fails to open.
280
281 2020-05-23 Alan Modra <amodra@gmail.com>
282
283 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
284
285 2020-05-22 Alan Modra <amodra@gmail.com>
286
287 PR 25882
288 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
289 attributes from shared libraries, and do not return an error if
290 they don't match.
291
292 2020-05-21 Alan Modra <amodra@gmail.com>
293
294 PR 25993
295 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
296 filename.
297 (_bfd_delete_bfd): Free the copy.
298 (_bfd_new_bfd): Free nbfd->memory on error.
299
300 2020-05-21 Alan Modra <amodra@gmail.com>
301
302 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
303 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
304 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
305 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
306 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
307 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
308 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
309 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
310 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
311 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
312 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
313 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
314 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
315 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
316 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
317 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
318 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
319 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
320 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
321 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
322
323 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
324
325 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
326 get_default_version. It is used to find the default version for
327 the specific extension.
328 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
329 default_major_version and default_minor_version. Add new bfd_boolean
330 parameter *use_default_version. Set it to TRUE if we need to call
331 the callback rps->get_default_version to find the default version.
332 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
333 the default version in riscv_parsing_subset_version, and then call
334 riscv_add_subset to add the subset into subset list.
335 (riscv_parse_prefixed_ext): Likewise.
336 (riscv_std_z_ext_strtab): Support Zicsr extensions.
337 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
338 strings rather than characters.
339 riscv_merge_arch_attr_info): The callback function get_default_version
340 is only needed for assembler, so set it to NULL int the linker.
341 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
342 * elfxx-riscv.h: Updated.
343
344 2020-05-20 Alan Modra <amodra@gmail.com>
345
346 PR 25993
347 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
348 use bfd_set_filename.
349 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
350 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
351 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
352 (bfd_create): Likewise.
353 (_bfd_delete_bfd): Don't free filename.
354 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
355 return pointer to the copy or NULL on alloc fail.
356 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
357 result of bfd_set_filename.
358 * bfd-in2.h: Regenerate.
359
360 2020-05-20 Alan Modra <amodra@gmail.com>
361
362 PR 26011
363 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
364 section size against file size.
365 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
366
367 2020-05-19 Gunther Nikl <gnikl@justmail.de>
368
369 PR 26005
370 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
371 and memset when allocating memory for the sections_being_created
372 array.
373
374 2020-05-19 Stafford Horne <shorne@gmail.com>
375
376 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
377 to relgot.
378 (or1k_elf_relocate_section): Access srelgot via
379 htab->root.srelgot. Add assertions for srelgot->contents.
380 Introduce local variable for srelgot to not reuse global
381 sreloc.
382 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
383 (or1k_set_got_and_rela_sizes): New function.
384 (or1k_initial_exec_offset): New function.
385 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
386 (or1k_elf_relocate_section): Allow for TLS to handle multiple
387 model access.
388 (or1k_elf_check_relocs): Use OR to set TLS access.
389 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
390 sizes.
391 (or1k_elf_size_dynamic_sections): Use
392 or1k_set_got_and_rela_sizes to set sizes.
393 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
394 (TCB_SIZE): New macro.
395 (tpoff): Use TCB_SIZE and alignment to calculate offset.
396 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
397 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
398 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
399 (tpoff): Add dynamic boolean argument.
400 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
401
402 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
403
404 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
405 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
406 cases with BFD_RELOC_AARCH64_JUMP26.
407 (elfNN_aarch64_check_relocs): Likewise.
408
409 2020-05-19 Alan Modra <amodra@gmail.com>
410
411 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
412 bfd_get_filename rather than accessing bfd->filename directly.
413 * aout-target.h (MY (object_p)): Likewise.
414 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
415 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
416 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
417 (_bfd_archive_bsd44_construct_extended_name_table),
418 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
419 (_bfd_bsd_write_armap): Likewise.
420 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
421 * cache.c (bfd_open_file): Likewise.
422 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
423 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
424 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
425 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
426 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
427 * elf32-nds32.c (nds32_elf_output_symbol_hook),
428 (patch_tls_desc_to_ie): Likewise.
429 * elf32-spu.c (sort_bfds, print_one_overlay_section),
430 (spu_elf_auto_overlay): Likewise.
431 * elf64-hppa.c (elf_hppa_final_link): Likewise.
432 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
433 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
434 * elflink.c (bfd_elf_size_dynamic_sections),
435 (elf_link_input_bfd): Likewise.
436 * linker.c (_bfd_generic_link_output_symbols): Likewise.
437 * mach-o.c (bfd_mach_o_follow_dsym),
438 (bfd_mach_o_close_and_cleanup): Likewise.
439 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
440 (find_separate_debug_file, get_build_id_name): Likewise.
441 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
442 * plugin.c (bfd_plugin_open_input): Likewise.
443 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
444 * som.c (som_write_armap): Likewise.
445 * srec.c (srec_write_record, srec_write_symbols): Likewise.
446 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
447 (_bfd_vms_lib_write_archive_contents): Likewise.
448 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
449
450 2020-05-19 Alan Modra <amodra@gmail.com>
451
452 PR 25713
453 * bfdio.c (_bfd_real_fopen): Typo fix.
454
455 2020-05-18 Nick Clifton <nickc@redhat.com>
456
457 PR 26005
458 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
459 for the sections_being_created array.
460
461 2020-05-18 Alan Modra <amodra@gmail.com>
462
463 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
464 they can be freed without also freeing internal_relocs.
465
466 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
467
468 PR 25713
469 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
470 separators into DOS style when creating a WIN32 fullpath.
471
472 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
473
474 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
475 to initialize RISC-V tdata.
476
477 2020-05-12 Gunther Nikl <gnikl@justmail.de>
478
479 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
480 relocation size.
481
482 2020-05-11 Alan Modra <amodra@gmail.com>
483
484 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
485
486 2020-05-11 Alan Modra <amodra@gmail.com>
487
488 * elf64-ppc.c: Rename powerxx to power10 throughout.
489
490 2020-05-11 Alan Modra <amodra@gmail.com>
491
492 PR 25961
493 * coffgen.c (coff_get_normalized_symtab): Check that buffer
494 contains required number of auxents before processing any auxent.
495 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
496 file name from auxents for PE.
497
498 2020-05-04 Gunther Nikl <gnikl@justmail.de>
499
500 * aout-cris.c (DEFAULT_ARCH): Delete define.
501 (MY_set_arch_mach): Likewise.
502 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
503 of bfd_arch_cris.
504 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
505 of r_type before the shift.
506
507 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
508
509 PR ld/25665
510 * elfnn-aarch64.c (group_sections): Copy implementation from
511 elf32-arm.c.
512
513 2020-05-01 Alan Modra <amodra@gmail.com>
514
515 PR 25900
516 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
517 accessing root.u.def of symbols. Also check root.u.def.section
518 is non-NULL. Reverse tests so as to make the logic positive.
519
520 2020-05-01 Alan Modra <amodra@gmail.com>
521
522 PR 25882
523 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
524 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
525
526 2020-05-01 Alan Modra <amodra@gmail.com>
527
528 PR 25882
529 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
530 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
531 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
532 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
533 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
534 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
535 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
536 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
537 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
538 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
539
540 2020-05-01 Alan Modra <amodra@gmail.com>
541
542 PR 25882
543 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
544 from shared libraries.
545
546 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
547
548 * elf32-xtensa.c (relax_section): Don't negate diff_value for
549 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
550 equals 0. Report overflow when the result has negative sign but
551 all significant bits are zero.
552
553 2020-04-29 Gunther Nikl <gnikl@justmail.de>
554
555 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
556 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
557
558 2020-04-28 Alan Modra <amodra@gmail.com>
559
560 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
561 Emit warning message.
562
563 2020-04-27 Tamar Christina <tamar.christina@arm.com>
564
565 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
566 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
567 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
568 to x86_64_pe_big_vec as it not a big-endian format.
569 (vec i386_pe_big_vec): New.
570 * configure.ac: Likewise.
571 * targets.c: Likewise.
572 * configure: Regenerate.
573 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
574 COFF_WITH_PE_BIGOBJ): New.
575 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
576 New.
577 (x86_64_pe_be_vec): Moved.
578
579 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
580
581 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
582 * elf.c (elfcore_grok_arc_v2): New function.
583 (elfcore_grok_note): Call the new function to handle the corresponding
584 note.
585 (elfcore_write_arc_v2): New function.
586 (elfcore_write_register_note): Call the new function to handle the
587 corresponding pseudo-sections.
588
589 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
590
591 PR ld/25861
592 * bfd-in2.h: Regenerated.
593 * elf32-xtensa.c (elf_howto_table): New entries for
594 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
595 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
596 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
597 R_XTENSA_NDIFF{8,16,32}.
598 * libbfd.h (bfd_reloc_code_real_names): Add names for
599 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
600 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
601 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
602 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
603
604 2020-04-21 Tamar Christina <tamar.christina@arm.com>
605
606 PR binutils/24753
607 * compress.c (bfd_get_full_section_contents): Exclude sections with no
608 content.
609
610 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
611
612 PR ld/25849
613 * elf-bfd.h (elf_backend_data): Add
614 elf_backend_strip_zero_sized_dynamic_sections.
615 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
616 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
617 New macro.
618 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
619 function.
620 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
621 New macro.
622 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
623
624 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
625
626 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
627 sec.
628 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
629 DT_TEXTREL with -M.
630 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
631
632 2020-04-21 Nick Clifton <nickc@redhat.com>
633
634 * po/sr.po: Updated Serbian translation.
635
636 2020-04-21 Alan Modra <amodra@gmail.com>
637
638 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
639 processing.
640
641 2020-04-20 Stephen Casner <casner@acm.org>
642
643 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
644 causing globals from linker script to be treated as debug symbols.
645 (translate_symbol_table): Don't sign-extend symbol values from 16
646 to 64 bits in nm output.
647
648 2020-04-20 Alan Modra <amodra@gmail.com>
649
650 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
651
652 2020-04-18 Alan Modra <amodra@gmail.com>
653
654 * section.c (bfd_is_const_section): Correct test for special
655 sections.
656 * bfd-in2.h: Regenerate.
657
658 2020-04-17 Alan Modra <amodra@gmail.com>
659
660 PR 25842
661 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
662 NULL nodename.
663
664 2020-04-16 Nick Clifton <nickc@redhat.com>
665
666 PR 25803
667 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
668 abort with a more helpful error message.
669
670 2020-04-16 Alan Modra <amodra@gmail.com>
671
672 PR 25827
673 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
674 strdup(0).
675
676 2020-04-15 Fangrui Song <maskray@google.com>
677
678 PR binutils/24613
679 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
680 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
681 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
682 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
683 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
684 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
685 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
686 * elf32-sh.c (sh_elf_relocate_section): Likewise.
687 * elf32-spu.c (spu_elf_relocate_section): Likewise.
688 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
689 * elflink.c (elf_link_output_extsym): Likewise.
690 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
691
692 2020-04-15 Alan Modra <amodra@gmail.com>
693
694 PR 25823
695 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
696 pointer into strings that may be freed for section name, always
697 allocate a new string.
698
699 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
700 Jan W. Jagersma <jwjagersma@gmail.com>
701
702 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
703 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
704 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
705 (_bfd_go32_mkobject): New functions.
706 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
707 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
708 (go32exe_mkobject): Call _bfd_go32_mkobject.
709 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
710 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
711 and COFF_GO32.
712 (coff_write_relocs): Enable extended reloc counter code if
713 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
714 (coff_write_object_contents): Likewise. Pad section headers
715 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
716 instead of coff_swap_scnhdr_out.
717 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
718 enable extended reloc counter.
719 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
720 Declare with ATTRIBUTE_UNUSED.
721 * libcoff-in.h: (struct coff_tdata): New field go32.
722 (obj_go32): Define.
723 * libcoff.h: Regenerate.
724
725 2020-04-14 Fangrui Song <maskray@google.com>
726
727 PR gas/25768
728 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
729 12.
730
731 2020-04-14 Stephen Casner <casner@acm.org>
732
733 PR ld/25677
734 * pdp11.c: Add implementation of --imagic option.
735 (adjust_o_magic): Fix objcopy --extract-symbol test.
736 * libaout.h (enum aout_magic): Add i_magic.
737
738 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
739 Nick Clifton <nickc@redhat.com>
740
741 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
742 <0>: Ignore.
743 <default>: Error rather than abort.
744
745 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
746
747 PR ld/25767
748 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
749 relocation section from section group.
750
751 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
752
753 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
754 bfd->origin to file offset.
755 * bfdwin.c (bfd_get_file_window): Likewise.
756 * bfd.c: Clarify the use of the bfd->origin field.
757 * bfd-in2.h: Regenerate.
758 * coff-i386.c: Don't include go32exe.h. Allow overriding
759 coff_write_object_contents via COFF_WRITE_CONTENTS.
760 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
761 (go32exe_write_object_contents): New functions.
762 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
763 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
764 (create_go32_stub): Remove check for 2k size limit. Read stub
765 from go32exe_temp_stub if present.
766 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
767 copy variable-length stub.
768 (go32_check_format): Read stub to go32exe_temp_stub, set
769 origin, return go32exe_cleanup.
770 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
771 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
772 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
773 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
774 Remove functions and their associated #defines.
775 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
776 * libcoff-in.h: (struct coff_tdata): New field stub_size.
777 Rename field go32stub to stub.
778 * libcoff.h: Regenerate.
779 * coff-stgo32.c (go32_check_format): Rename to...
780 (go32exe_check_format): ...this.
781 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
782 (go32exe_copy_private_bfd_data): ...this.
783 (stub_bytes): Rename to...
784 (go32exe_default_stub): ...this.
785 (create_go32_stub): Rename to...
786 (go32exe_create_stub): ...this.
787 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
788 when possible.
789
790 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
791
792 PR ld/25749
793 PR ld/25754
794 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
795 relocation to R_386_32 for relocation against non-preemptible
796 absolute symbol.
797 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
798 allocate dynamic relocation for non-preemptible absolute symbol.
799 (elf_i386_relocate_section): Pass sec to
800 GENERATE_DYNAMIC_RELOCATION_P.
801 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
802 (elf_x86_64_convert_load_reloc): Covert load relocation to
803 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
804 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
805 for non-preemptible absolute symbol if they overflow.
806 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
807 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
808 symbol. Don't allocate dynamic relocation for non-preemptible
809 absolute symbol.
810 (elf_x86_64_relocate_section): Don't generate relative relocation
811 for GOTPCREL relocations aganst local absolute symbol. Pass sec
812 to GENERATE_DYNAMIC_RELOCATION_P.
813 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
814 against non-preemptible absolute symbol.
815 (_bfd_elf_x86_valid_reloc_p): New function.
816 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
817 GOT_ABS GOT slot.
818 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
819 argument. Don't generate dynamic relocation against
820 non-preemptible absolute symbol.
821 (ABS_SYMBOL_P): New.
822 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
823 against non-preemptible absolute symbol.
824 (GOT_ABS): New.
825 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
826 (_bfd_elf_x86_valid_reloc_p): New.
827
828 2020-04-01 Tamar Christina <tamar.christina@arm.com>
829
830 PR ld/16017
831 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
832 address in the GOT if in thumb only mode.
833
834 2020-04-01 Tamar Christina <tamar.christina@arm.com>
835
836 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
837
838 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
839
840 * mmo.c (mmo_scan): Create .text section only when needed, not
841 from the start.
842
843 2020-03-31 Alan Modra <amodra@gmail.com>
844
845 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
846 return value check.
847
848 2020-03-31 Alan Modra <amodra@gmail.com>
849
850 * vms-alpha.c (image_write): Check bounds for sections without
851 contents too. Error on non-zero write to section without
852 contents.
853 (_bfd_vms_slurp_etir): Check return of image_write* functions.
854
855 2020-03-31 Alan Modra <amodra@gmail.com>
856
857 * tekhex.c (pass_over): Check is_eof before reading buffer.
858
859 2020-03-30 Nick Clifton <nickc@redhat.com>
860
861 PR binutils/pr25662
862 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
863 field to timestamp and make it an integer.
864 * libcoff.h: Regenerate.
865 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
866 field in the pe_data structure rather than the insert_timestamp
867 field.
868
869 2020-03-30 Alan Modra <amodra@gmail.com>
870
871 PR 25745
872 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
873 statistics message.
874
875 2020-03-26 Nick Clifton <nickc@redhat.com>
876
877 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
878 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
879 prototype.
880 * libbfd.h: Regenerate.
881
882 2020-03-26 Alan Modra <amodra@gmail.com>
883
884 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
885
886 2020-03-26 Alan Modra <amodra@gmail.com>
887
888 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
889 array.
890 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
891
892 2020-03-25 Nick Clifton <nickc@redhat.com>
893
894 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
895 function.
896 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
897 * libbfd.h: Regenerate.
898
899 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
900
901 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
902 correct field name in the output string.
903
904 2020-03-25 Alan Modra <amodra@gmail.com>
905
906 PR 25662
907 * elf.c (assign_file_positions_for_load_sections): Adjust offset
908 for SHT_NOBITS section if first in segment.
909
910 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
911
912 PR binutils/25708
913 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
914 (_bfd_elf_get_symbol_version_string): This.
915 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
916 (_bfd_elf_get_symbol_version_string): This.
917 (bfd_elf_print_symbol): Pass TRUE to
918 _bfd_elf_get_symbol_version_string.
919 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
920 bfd_boolean argument.
921 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
922 * targets.c (_bfd_get_symbol_version_string): Likewise.
923 (bfd_get_symbol_version_string): Likewise.
924 * bfd-in2.h: Regenerated.
925
926 2020-03-24 Nick Clifton <nickc@redhat.com>
927 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
928
929 PR 25713
930 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
931 Win32 systems.
932
933 2020-03-24 Nick Clifton <nickc@redhat.com>
934
935 PR 25681
936 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
937 segment to use for PT_GNU_RELRO, ignore empty sections in a
938 segment's current list.
939
940 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
941
942 PR binutils/25717
943 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
944
945 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
946
947 PR binutils/25708
948 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
949 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
950 on the previous _bfd_elf_get_symbol_version_string.
951 (_bfd_elf_get_symbol_version_string): Use it.
952
953 2020-03-24 Alan Modra <amodra@gmail.com>
954
955 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
956 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
957 struct areltdata.
958
959 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
960
961 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
962
963 2020-03-23 Alan Modra <amodra@gmail.com>
964
965 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
966 symbol count. Allocate an extra byte to ensure name strings
967 are terminated. Sanity check name offsets. Release memory on
968 error return.
969
970 2020-03-23 Alan Modra <amodra@gmail.com>
971
972 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
973 field hasn't been read. Remove unnecessary casts.
974
975 2020-03-22 Alan Modra <amodra@gmail.com>
976
977 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
978 enough to read number of symbols.
979
980 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
981
982 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
983 (EXECUTABLE_SUFFIX): Likewise.
984 * config.in: Regenerated.
985 * configure: Likewise.
986 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
987 _bfd_generic_close_and_cleanup.
988 (plugin_list_entry): Remove resolution_file, resolution_option,
989 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
990 lto_wrapper, gcc_env and initialized,
991 (need_lto_wrapper_p): Removed.
992 (get_lto_wrapper): Likewise.
993 (setup_lto_wrapper_env): Likewise.
994 (register_all_symbols_read): Likewise.
995 (egister_cleanup): Likewise.
996 (get_symbols): Likewise.
997 (add_input_file): Likewise.
998 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
999 (add_symbols): Updated.
1000 (try_claim): Likewise.
1001 (try_load_plugin): Likewise.
1002 (bfd_plugin_canonicalize_symtab): Likewise.
1003 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1004 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1005
1006 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1007
1008 PR binutils/25640
1009 * plugin.c (plugin_list_entry): Add has_symbol_type.
1010 (add_symbols_v2): New function.
1011 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1012 provides symbol type.
1013 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1014 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1015 available.
1016
1017 2020-03-20 Alan Modra <amodra@gmail.com>
1018
1019 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1020 enough to read number of symbols.
1021
1022 2020-03-20 Alan Modra <amodra@gmail.com>
1023
1024 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1025 backend functions for NULL before calling.
1026 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1027 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1028 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1029 * elfnn-ia64.c (ignore_errors): New function.
1030 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1031
1032 2020-03-19 Nick Clifton <nickc@redhat.com>
1033
1034 PR 25676
1035 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1036 location of the varinfo in the unit's debug info data. Change the
1037 type of the stack field to a boolean.
1038 (lookup_var_by_offset): New function. Returns the varinfo
1039 structure for the variable described at the given offset in the
1040 unit's debug info.
1041 (scan_unit_for_symbols): Add support for variables which have the
1042 DW_AT_specification attribute.
1043
1044 2020-03-19 Nick Clifton <nickc@redhat.com>
1045
1046 PR 25699
1047 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1048 error return.
1049
1050 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1051
1052 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1053
1054 2020-03-18 Nick Clifton <nickc@redhat.com>
1055
1056 PR 25673
1057 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1058 memory access when processing a corrupt secondary reloc section.
1059
1060 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1061
1062 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1063 instead of calling abort.
1064 * elf32-csky.c (csky_build_one_stub): Likewise.
1065 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1066 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1067 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1068 * elf32-metag.c (metag_build_one_stub): Likewise.
1069 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1070 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1071 (ppc_size_one_stub): Likewise.
1072 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1073
1074 2020-03-17 Nick Clifton <nickc@redhat.com>
1075
1076 PR 25688
1077 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1078 with error messages.
1079
1080 2020-03-17 Nick Clifton <nickc@redhat.com>
1081
1082 PR 25687
1083 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1084 free. Add free on another failure path.
1085
1086 2020-03-16 Alan Modra <amodra@gmail.com>
1087
1088 PR 25675
1089 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1090 we have a non-zero section count. Do lma comparison in octets.
1091
1092 2020-03-16 Alan Modra <amodra@gmail.com>
1093
1094 * vms-alpha.c (dst_restore_location): Validate index into
1095 dst_ptr_offsets array before accessing. Return status.
1096 (dst_retrieve_location): Similarly, making "loc" parameter a
1097 pointer to return value.
1098 (_bfd_vms_slurp_etir): Update calls to above functions.
1099
1100 2020-03-14 Kamil Rytarowski <n54@gmx.com>
1101
1102 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1103 targets.
1104 * configure: Regenerated.
1105
1106 2020-03-14 Alan Modra <amodra@gmail.com>
1107
1108 * section.c (BFD_FAKE_SECTIONS): Formatting.
1109 * bfd-in2.h: Regenerate.
1110
1111 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1112
1113 * elf.c (elfcore_grok_netbsd_note): Add support for
1114 NT_NETBSDCORE_LWPSTATUS notes.
1115
1116 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1117
1118 * bfd-in2.h: Regenerate.
1119 * section.c (asection): Add already_assigned field.
1120 (BFD_FAKE_SECTION): Add default initializer for it.
1121 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1122 * elf32-arm.c (arm_build_one_stub): Add support for
1123 non_contiguous_regions.
1124 * elf32-csky.c (csky_build_one_stub): Likewise.
1125 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1126 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1127 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1128 * elf32-metag.c (metag_build_one_stub): Likewise.
1129 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1130 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1131 (ppc_size_one_stub): Likewise.
1132 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1133 * elflink.c (elf_link_input_bfd): Likewise.
1134
1135 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1136
1137 PR ld/24920
1138 * elf-linker-x86.h (elf_linker_x86_params): Add
1139 static_before_all_inputs and has_dynamic_linker.
1140 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1141 dynamic input objects if -static is passed at command-line
1142 before all input files without --dynamic-linker unless
1143 --no-dynamic-linker is used.
1144
1145 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1146
1147 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1148
1149 2020-03-13 Christian Eggers <ceggers@gmx.de>
1150
1151 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1152 "p_paddr" from "at".
1153 * elfcode.h (bfd_from_remote_memory): Add units to several
1154 parameters. New local "opb". Fix usage of p_align. Fix
1155 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1156 call of target_read_memory.
1157 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1158 calculation of "offset" and "output_offset".
1159 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1160 from "offset" and fix calculation of "end" from "vma+size". Fix
1161 comparison between "sh_addr" and "vma"/"output_offset".
1162 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1163 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1164 member.
1165 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1166 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1167 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1168 assignment of p_paddr from phdr_lma. Fix comparison between
1169 "lma+size" and "next->lma".
1170 (elf_sort_segments): Fix assignment from p_paddr to lma.
1171 (assign_file_positions_for_load_sections): Add unit (bytes) to
1172 local "align". Fix calculation of local "off_adjust". Fix
1173 calculation of local "filehdr_vaddr".
1174 (assign_file_positions_for_non_load_sections): New local "opb".
1175 Fix calculation of "end" from "p_size". Fix comparison between
1176 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1177 from "end" and "p_vaddr".
1178 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1179 vma. Fix assignment to p_paddr from lma. Fix comparison between
1180 p_paddr and lma. Fix assignment to p_paddr from lma.
1181 * merge.c (sec_merge_emit): New local "opb". Convert
1182 "alignment_power" to octets.
1183 (_bfd_add_merge_section): New locals "alignment_power" and
1184 "opb". Fix comparison between "alignment_power" and
1185 "sizeof(align)".
1186 (_bfd_merge_sections): New local "opb". Divide size by opb
1187 before checking align mask.
1188
1189 2020-03-13 Christian Eggers <ceggers@gmx.de>
1190
1191 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1192 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1193 section LMA/VMA.
1194 (_bfd_elf_make_section_from_phdr): Similarly.
1195 (elf_fake_sections): Fix calculation of
1196 Elf_Internal_shdr::sh_addr from section VMA.
1197 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1198 and bytes.
1199 (assign_file_positions_for_load_sections): Fix calculations of
1200 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1201 comparison between program header address and section LMA.
1202 (assign_file_positions_for_non_load_sections): Likewise.
1203 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1204 (IS_CONTAINED_BY_VMA): Add parameter opb.
1205 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1206 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1207 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1208 Fix calculations of p_addr_valid and p_vaddr_offset.
1209 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1210 with octets per byte when comparing against p_vaddr.
1211
1212 2020-03-11 Alan Modra <amodra@gmail.com>
1213
1214 * som.c (setup_sections): Sanity check subspace.name.
1215
1216 2020-03-11 Alan Modra <amodra@gmail.com>
1217
1218 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1219
1220 2020-03-10 Alan Modra <amodra@gmail.com>
1221
1222 PR 25648
1223 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1224 addresses here.
1225
1226 2020-03-09 Alan Modra <amodra@gmail.com>
1227
1228 * wasm-module.c (wasm_scan): Sanity check file name length
1229 before allocating memory. Move common section setup code. Do
1230 without bfd_tell to calculate section size.
1231
1232 2020-03-06 Nick Clifton <nickc@redhat.com>
1233
1234 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1235 with error messages and failure return values.
1236
1237 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1238
1239 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1240 relocation sections for any removed reference to a dynamic symbol.
1241
1242 2020-03-05 Nick Clifton <nickc@redhat.com>
1243
1244 * elf-bfd.h (struct elf_backend_data): Add new fields:
1245 init_secondary_reloc_section, slurp_secondary_reloc_section,
1246 write_secondary_reloc_section.
1247 (_bfd_elf_init_secondary_reloc_section): Prototype.
1248 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1249 (_bfd_elf_write_secondary_reloc_section): Prototype.
1250 * elf.c ( bfd_section_from_shdr): Invoke the new
1251 init_secondary_reloc_section backend function, if defined, when a
1252 second reloc section is encountered.
1253 (swap_out_syms): Invoke the new symbol_section_index function, if
1254 defined, when computing the section index of an OS/PROC specific
1255 symbol.
1256 (_bfd_elf_init_secondary_reloc_section): New function.
1257 (_bfd_elf_slurp_secondary_reloc_section): New function.
1258 (_bfd_elf_write_secondary_reloc_section): New function.
1259 (_bfd_elf_copy_special_section_fields): New function.
1260 * elfcode.h (elf_write_relocs): Invoke the new
1261 write_secondary_relocs function, if defined, in order to emit
1262 secondary relocs.
1263 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1264 function, if defined, in order to read in secondary relocs.
1265 * elfxx-target.h (elf_backend_copy_special_section_fields):
1266 Provide a non-NULL default definition.
1267 (elf_backend_init_secondary_reloc_section): Likewise.
1268 (elf_backend_slurp_secondary_reloc_section): Likewise.
1269 (elf_backend_write_secondary_reloc_section): Likewise.
1270 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1271 fields.
1272 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1273 * configure: Regenerate.
1274
1275 2020-03-05 Alan Modra <amodra@gmail.com>
1276
1277 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1278 against file size before allocating memory. Use bfd_alloc rather
1279 than bfd_zalloc for carsym/strings memory.
1280
1281 2020-03-04 Alan Modra <amodra@gmail.com>
1282
1283 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1284 sh_addr mod sh_addalign is zero.
1285
1286 2020-03-04 Alan Modra <amodra@gmail.com>
1287
1288 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1289
1290 2020-03-03 Alan Modra <amodra@gmail.com>
1291
1292 * format.c (struct bfd_preserve): Add cleanup field.
1293 (bfd_preserve_save): Add cleanup param and save.
1294 (bfd_preserve_restore): Return cleanup.
1295 (bfd_preserve_finish): Call the cleanup for the discarded match.
1296 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1297 and clear when preserving a match. Restore cleanup too when
1298 restoring that match.
1299
1300 2020-03-02 Alan Modra <amodra@gmail.com>
1301
1302 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1303 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1304 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1305 (core_sco5_vec): Correct initialisers.
1306
1307 2020-03-02 Alan Modra <amodra@gmail.com>
1308
1309 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1310 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1311 * cisco-core.c (cisco_core_file_validate): Likewise.
1312 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1313 * hpux-core.c (hpux_core_core_file_p): Likewise.
1314 * irix-core.c (irix_core_core_file_p): Likewise.
1315 * lynx-core.c (lynx_core_file_p): Likewise.
1316 * netbsd-core.c (netbsd_core_file_p): Likewise.
1317 * osf-core.c (osf_core_core_file_p): Likewise.
1318 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1319 * sco5-core.c (sco5_core_file_p): Likewise.
1320
1321 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1322
1323 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1324
1325 2020-03-02 Alan Modra <amodra@gmail.com>
1326
1327 * targets.c (bfd_cleanup): New typedef.
1328 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1329 * libbfd-in.h (_bfd_no_cleanup): Define.
1330 * format.c (bfd_reinit): Add cleanup parameter, call it.
1331 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1332 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1333 * aout-target.h (callback, object_p): Return bfd_cleanup.
1334 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1335 * archive.c (bfd_generic_archive_p): Likewise.
1336 * binary.c (binary_object_p): Likewise.
1337 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1338 * coff-ia64.c (ia64coff_object_p): Likewise.
1339 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1340 * coff-sh.c (coff_small_object_p): Likewise.
1341 * coff-stgo32.c (go32_check_format): Likewise.
1342 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1343 (xcoff64_core_p): Likewise.
1344 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1345 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1346 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1347 * elfcode.h (elf_object_p): Likewise.
1348 * elfcore.h (elf_core_file_p): Likewise.
1349 * i386msdos.c (msdos_object_p): Likewise.
1350 * ihex.c (ihex_object_p): Likewise.
1351 * libaout.h (some_aout_object_p): Likewise.
1352 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1353 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1354 * libbfd.c (_bfd_dummy_target): Likewise.
1355 * libcoff-in.h (coff_object_p): Likewise.
1356 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1357 (bfd_mach_o_arm64_core_p): Likewise.
1358 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1359 (bfd_mach_o_arm_core_p): Likewise.
1360 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1361 (bfd_mach_o_i386_core_p): Likewise.
1362 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1363 (bfd_mach_o_x86_64_core_p): Likewise.
1364 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1365 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1366 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1367 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1368 * mmo.c (mmo_object_p): Likewise.
1369 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1370 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1371 (pe_bfd_object_p): Likewise.
1372 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1373 * ppcboot.c (ppcboot_object_p): Likewise.
1374 * rs6000-core.c (rs6000coff_core_p): Likewise.
1375 * som.c (som_object_setup, som_object_p): Likewise.
1376 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1377 * tekhex.c (tekhex_object_p): Likewise.
1378 * vms-alpha.c (alpha_vms_object_p): Likewise.
1379 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1380 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1381 * wasm-module.c (wasm_object_p): Likewise.
1382 * xsym.c (bfd_sym_object_p): Likewise.
1383 * xsym.h (bfd_sym_object_p): Likewise.
1384 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1385 return type.
1386 * pdp11.c (some_aout_object_p): Likewise.
1387 * plugin.c (register_ld_plugin_object_p): Update object_p
1388 parameter type.
1389 * plugin.h (register_ld_plugin_object_p): Likewise.
1390 * bfd-in2.h: Regenerate.
1391 * libbfd.h: Regenerate.
1392 * libcoff.h: Regenerate.
1393
1394 2020-03-02 Alan Modra <amodra@gmail.com>
1395
1396 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1397 applicable section flags.
1398 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1399 (mips_ecoff_bele_vec): Likewise.
1400 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1401 and .sbss sections.
1402 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1403 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1404
1405 2020-03-02 Alan Modra <amodra@gmail.com>
1406
1407 * elf32-m32r.c (m32r_elf_section_flags): New function.
1408 (elf_backend_section_flags): Define.
1409 * elf32-nds32.c (nds32_elf_section_flags): New function.
1410 (elf_backend_section_flags): Define.
1411 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1412 .sbss and .sdata sections.
1413 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1414 for SHF_V850_GPREL sections.
1415 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1416 FIXME.
1417 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1418 for SHF_PARISC_SHORT sections.
1419 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1420 (elf_backend_section_flags): Define.
1421 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1422 for SHF_MIPS_GPREL sections. Delete FIXME.
1423
1424 2020-03-02 Alan Modra <amodra@gmail.com>
1425
1426 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1427 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1428 calling elf_backend_section_flags with adjusted params. Use
1429 newsect->flags past that point.
1430 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1431 special sections.
1432 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1433 to have their type overridden, and all sh_flags but processor and
1434 os specific.
1435 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1436 * elf32-mep.c (mep_elf_section_flags): Likewise.
1437 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1438 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1439 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1440 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1441 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1442 stub BFD and non-aarch64 input files when scanning for stubs.
1443
1444 2020-03-02 Alan Modra <amodra@gmail.com>
1445
1446 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1447 limit to decompressed element size.
1448
1449 2020-03-02 Alan Modra <amodra@gmail.com>
1450
1451 * vms-lib.c (vms_traverse_index): Add recur_count param and
1452 update calls. Fail on excessive recursion.
1453
1454 2020-03-02 Alan Modra <amodra@gmail.com>
1455
1456 * vms-alpha.c (vms_get_remaining_object_record): Use
1457 bfd_realloc_or_free rather than bfd_realloc.
1458 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1459 (dst_define_location, parse_module): Likewise, and check realloc
1460 return status before using memory. Return status from function
1461 adjusting all callers.
1462
1463 2020-02-28 Alan Modra <amodra@gmail.com>
1464
1465 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1466
1467 2020-02-28 Alan Modra <amodra@gmail.com>
1468
1469 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1470 Remove duplicate undersize check.
1471
1472 2020-02-27 Alan Modra <amodra@gmail.com>
1473
1474 PR 24511
1475 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1476
1477 2020-02-27 Alan Modra <amodra@gmail.com>
1478
1479 PR 24511
1480 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1481 (coff_section_type): Adjust comment.
1482 (decode_section_type): Likewise. Call coff_section_type before
1483 decode_section_type.
1484 (bfd_decode_symclass): Use 'c' for common sections other than
1485 the standard one.
1486
1487 2020-02-27 Alan Modra <amodra@gmail.com>
1488
1489 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1490 malloc'd block.
1491
1492 2020-02-27 Alan Modra <amodra@gmail.com>
1493
1494 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1495 if file is an archive element.
1496 * bfd-in2.h: Regenerate.
1497
1498 2020-02-26 Alan Modra <amodra@gmail.com>
1499
1500 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1501 bfd_set_error on failing test. Don't bother changing bfd_error on
1502 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1503 Check sym name is within string buffer. Use size_t for some vars.
1504 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1505 int_buf. Don't change bfd_error on file read error. Use
1506 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1507 calculations to catch overflows before they occur. malloc and
1508 free raw armap rather than using bfd_alloc. Read raw armap before
1509 allocating carsym+strings buffer.
1510 (_bfd_slurp_extended_name_table): Localize variables. Check
1511 name size against file size.
1512
1513 2020-02-26 Alan Modra <amodra@gmail.com>
1514
1515 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1516
1517 2020-02-26 Alan Modra <amodra@gmail.com>
1518
1519 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1520 malloc. Check for NULL return from bfd_malloc.
1521 (rx_table_find, rx_table_map): Likewise.
1522 (rx_set_section_contents): Check bfd_alloc return.
1523 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1524
1525 2020-02-26 Alan Modra <amodra@gmail.com>
1526
1527 * aoutx.h: Indent labels correctly. Format error strings.
1528 * archive.c: Likewise.
1529 * archive64.c: Likewise.
1530 * coff-arm.c: Likewise.
1531 * coff-rs6000.c: Likewise.
1532 * coff-stgo32.c: Likewise.
1533 * cpu-arm.c: Likewise.
1534 * dwarf2.c: Likewise.
1535 * elf-ifunc.c: Likewise.
1536 * elf-properties.c: Likewise.
1537 * elf-s390-common.c: Likewise.
1538 * elf-strtab.c: Likewise.
1539 * elf.c: Likewise.
1540 * elf32-arm.c: Likewise.
1541 * elf32-bfin.c: Likewise.
1542 * elf32-cr16.c: Likewise.
1543 * elf32-csky.c: Likewise.
1544 * elf32-i386.c: Likewise.
1545 * elf32-m68k.c: Likewise.
1546 * elf32-msp430.c: Likewise.
1547 * elf32-nds32.c: Likewise.
1548 * elf32-nios2.c: Likewise.
1549 * elf32-pru.c: Likewise.
1550 * elf32-xtensa.c: Likewise.
1551 * elf64-ia64-vms.c: Likewise.
1552 * elf64-x86-64.c: Likewise.
1553 * elfcode.h: Likewise.
1554 * elfcore.h: Likewise.
1555 * elflink.c: Likewise.
1556 * elfnn-aarch64.c: Likewise.
1557 * elfnn-ia64.c: Likewise.
1558 * elfnn-riscv.c: Likewise.
1559 * elfxx-mips.c: Likewise.
1560 * elfxx-sparc.c: Likewise.
1561 * elfxx-x86.c: Likewise.
1562 * i386lynx.c: Likewise.
1563 * merge.c: Likewise.
1564 * pdp11.c: Likewise.
1565 * plugin.c: Likewise.
1566 * reloc.c: Likewise.
1567
1568 2020-02-26 Alan Modra <amodra@gmail.com>
1569
1570 PR 25593
1571 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1572 "dyn_loaded".
1573 (bfd_elf_add_dt_needed_tag): Declare.
1574 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1575 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1576 from elf_add_dt_needed_tag. Remove soname and doit param.
1577 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1578 to see whether as-needed lib is already loaded, use dyn_loaded
1579 list instead. When saving and restoring around as-needed lib
1580 handle possibility that dynstr has not been initialised. Don't
1581 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1582 Mark libs loaded via DT_NEEDED entries of other libs with
1583 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1584 the output.
1585 (elf_link_check_versioned_symbol): Remove now unneccesary
1586 DYNAMIC check when traversing dyn_loaded list.
1587
1588 2020-02-26 Alan Modra <amodra@gmail.com>
1589
1590 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1591
1592 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1593
1594 PR binutils/25584
1595 * plugin.c (need_lto_wrapper_p): New.
1596 (bfd_plugin_set_program_name): Add an int argument to set
1597 need_lto_wrapper_p.
1598 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1599 set.
1600 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1601
1602 2020-02-24 Alan Modra <amodra@gmail.com>
1603
1604 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1605
1606 2020-02-24 Alan Modra <amodra@gmail.com>
1607
1608 * vms-lib.c (struct carsym_mem): Add limit.
1609 (vms_add_index): Heed limit.
1610 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1611 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1612 Always return actual number read.
1613 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1614 assertion with error exit.
1615
1616 2020-02-22 Alan Modra <amodra@gmail.com>
1617
1618 PR 25585
1619 * elf.c (assign_file_positions_for_load_sections): Continue linking
1620 on "PHDR segment not covered by LOAD segment" errors.
1621
1622 2020-02-21 Alan Modra <amodra@gmail.com>
1623
1624 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1625 overflow check.
1626 (bfd_mach_o_canonicalize_reloc): Likewise.
1627 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1628 counts and offsets against file size.
1629 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1630 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1631 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1632 against file size. Delete symbol table error message.
1633 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1634 against file size.
1635 (bfd_mach_o_read_symtab): Likewise.
1636 (bfd_mach_o_read_command): Pass file size.
1637 (bfd_mach_o_scan): Sanity check command count against file size.
1638
1639 2020-02-21 Alan Modra <amodra@gmail.com>
1640
1641 PR 25569
1642 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1643 "text", "data" and "bss" section pointer vars. Don't update
1644 section size, just exec header sizes.
1645 (adjust_sizes_and_vmas): Don't update text section size. Set
1646 initial exec header a_text. Print exec headers sizes.
1647 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1648 (adjust_sizes_and_vmas): Similarly. Formatting.
1649 (final_link): Correct final file extension.
1650
1651 2020-02-20 Nick Clifton <nickc@redhat.com>
1652
1653 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1654 callback.
1655 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1656 default definition.
1657 (elfNN_bed): Initialise the symbol_section_index field.
1658 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1659 OS and PROC specific section indicies. Warn if converting other
1660 reserved incidies to SHN_ABS.
1661
1662 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1663
1664 PR 25537
1665 * cpu-z80.c: Add machine type compatibility checking.
1666
1667 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1668
1669 PR binutils/25355
1670 * plugin.c (plugin_list_entry): Remove handle.
1671 (try_load_plugin): Call dlclose before return.
1672
1673 2020-02-19 Alan Modra <amodra@gmail.com>
1674
1675 * libbfd-in.h (_bfd_constant_p): Define.
1676 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1677 file size before allocating memory.
1678 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1679 * elf.c (bfd_elf_get_str_section): Likewise.
1680 (_bfd_elf_slurp_version_tables): Likewise.
1681 * libbfd.h: Regenerate.
1682
1683 2020-02-19 Alan Modra <amodra@gmail.com>
1684
1685 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1686 * aoutx.h (aout_get_external_symbols): Replace calls to
1687 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1688 (slurp_reloc_table): Likewise.
1689 * archive.c (do_slurp_bsd_armap): Likewise.
1690 (do_slurp_coff_armap): Likewise.
1691 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1692 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1693 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1694 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1695 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1696 (_bfd_coff_get_external_symbols): Likewise.
1697 * ecoff.c (ecoff_slurp_symbolic_header),
1698 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1699 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1700 (ecoff_indirect_link_order): Likewise.
1701 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1702 (_bfd_elf_slurp_version_tables): Likewise.
1703 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1704 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1705 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1706 * elf64-alpha.c (READ): Likewise.
1707 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1708 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1709 * elfcode.h (elf_slurp_symbol_table),
1710 (elf_slurp_reloc_table_from_section): Likewise.
1711 * elflink.c (elf_link_add_object_symbols),
1712 (elf_link_check_versioned_symbol): Likewise.
1713 * elfxx-mips.c (READ): Likewise.
1714 * i386lynx.c (slurp_reloc_table): Likewise.
1715 * lynx-core.c (lynx_core_file_p): Likewise.
1716 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1717 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1718 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1719 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1720 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1721 (bfd_pef_parse_symbols): Likewise.
1722 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1723 * som.c (setup_sections, som_slurp_string_table),
1724 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1725 (som_bfd_fill_in_ar_symbols): Likewise.
1726 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1727 (evax_bfd_print_image): Likewise.
1728 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1729 * wasm-module.c (wasm_scan): Likewise.
1730 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1731 * xsym.c (bfd_sym_read_name_table),
1732 (bfd_sym_print_type_information_table_entry): Likewise.
1733 * libbfd.h: Regenerate.
1734
1735 2020-02-19 Alan Modra <amodra@gmail.com>
1736
1737 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1738 reading external relocs.
1739 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1740 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1741 after bfd_bread.
1742 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1743 bfd_release.
1744 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1745 (m32c_elf_relax_section): Likewise.
1746 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1747 (rl78_elf_relax_section): Likewise.
1748 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1749 (elf32_rx_relax_section): Likewise.
1750 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1751 parameter types and use..
1752 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1753 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1754 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1755 being read from file, just the extra.
1756 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1757 after reading external syms. Free on failure.
1758
1759 2020-02-19 Alan Modra <amodra@gmail.com>
1760
1761 * coffcode.h (buy_and_read, coff_slurp_line_table),
1762 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1763 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1764 corresponding bfd_alloc call. Adjust variables to suit.
1765 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1766 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1767 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1768 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1769 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1770 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1771 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1772 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1773 * elf64-alpha.c (READ): Likewise.
1774 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1775 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1776 (bfd_from_remote_memory): Likewise.
1777 * elfcore.h (core_find_build_id): Likewise.
1778 * elfxx-mips.c (READ): Likewise.
1779 * mach-o.c (bfd_mach_o_mangle_sections),
1780 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1781 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1782 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1783 * som.c (setup_sections, som_prep_for_fixups)
1784 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1785 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1786 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1787 (som_bfd_ar_write_symbol_stuff): Likewise.
1788 * vms-alpha.c (vector_grow1): Likewise.
1789 * vms-lib.c (vms_add_index): Likewise.
1790 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1791 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1792 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1793 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1794 (bfd_alloc2, bfd_zalloc2): Delete.
1795 (_bfd_mul_overflow): Define.
1796 * libbfd.h: Regenerate.
1797
1798 2020-02-19 Alan Modra <amodra@gmail.com>
1799
1800 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1801 bfd_zalloc2.
1802 (assign_section_numbers): Likewise.
1803 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1804 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1805 bfd_malloc2, size_t amt, and unsigned tls_count.
1806 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1807 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1808 (elf_output_implib): Use bfd_alloc.
1809
1810 2020-02-19 Alan Modra <amodra@gmail.com>
1811
1812 * bfd.c (struct bfd): Move format and direction to other
1813 bitfields. Add "size".
1814 * bfdio.c (bfd_get_size): Cache size when not writing file.
1815 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1816 returning zero, ie. unknown.
1817 (bfd_get_alt_debug_link_info): Likewise.
1818 * bfd-in2.h: Regenerate.
1819
1820 2020-02-19 Alan Modra <amodra@gmail.com>
1821
1822 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1823 bfd_get_file_size twice.
1824 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1825 zero, ie. unknown, return.
1826 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1827 * elfcode.h (elf_swap_shdr_in): Likewise.
1828 (elf_object_p): Don't call bfd_get_file_size twice and correct
1829 file size check.
1830
1831 2020-02-19 Alan Modra <amodra@gmail.com>
1832
1833 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1834 FALSE if memory alloc fails. Adjust calls.
1835 * som.c (som_prep_for_fixups): Likewise.
1836 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1837 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1838 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1839 * som.c (som_build_and_write_symbol_table): Return via error_return
1840 on seek failure.
1841 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1842 (VEC_APPEND_EL): Delete.
1843 (vector_grow1): Return pointer to element. Catch overflow.
1844 Return NULL on memory allocation failure.
1845 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1846 (alpha_vms_add_fixup_ca): Likewise.
1847 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1848 before using.
1849 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1850
1851 2020-02-19 Alan Modra <amodra@gmail.com>
1852
1853 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1854 * aout-target.h (object_p): Likewise.
1855 * aout-tic30.c (tic30_aout_object_p): Likewise.
1856 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1857 (emit_stringtab, write_syms, link_hash_table_create),
1858 (aout_link_write_other_symbol): Likewise.
1859 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1860 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1861 (_bfd_compute_and_write_armap): Likewise.
1862 * archures.c (bfd_arch_list): Likewise.
1863 * bfd.c (bfd_record_phdr): Likewise.
1864 * binary.c (binary_canonicalize_symtab): Likewise.
1865 * cisco-core.c (cisco_core_file_validate): Likewise.
1866 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1867 (find_arm_glue, record_arm_to_thumb_glue),
1868 (record_thumb_to_arm_glue): Likewise.
1869 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1870 (ppc_allocate_toc_section): Likewise.
1871 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1872 * coff-sh.c (sh_relax_section): Likewise.
1873 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1874 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1875 (coff_set_alignment_hook, coff_mkobject),
1876 (coff_compute_section_file_positions): Likewise.
1877 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1878 (coff_find_nearest_line_with_names),
1879 ( bfd_coff_set_symbol_class): Likewise.
1880 * cofflink.c (_bfd_coff_link_hash_table_create),
1881 (_bfd_coff_link_input_bfd): Likewise.
1882 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1883 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1884 (build_line_info_table, sort_line_sequences),
1885 (line_info_add_include_dir, line_info_add_file_name),
1886 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1887 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1888 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1889 (_bfd_ecoff_find_nearest_line),
1890 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1891 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1892 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1893 * elf-m10300.c (mn10300_elf_relax_section),
1894 (elf32_mn10300_link_hash_table_create): Likewise.
1895 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1896 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1897 * elf32-arm.c (elf32_arm_link_hash_table_create),
1898 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1899 (elf32_arm_new_section_hook): Likewise.
1900 * elf32-avr.c (elf_avr_new_section_hook),
1901 (elf32_avr_link_hash_table_create, get_local_syms),
1902 (elf32_avr_setup_section_lists): Likewise.
1903 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1904 (bfin_link_hash_table_create): Likewise.
1905 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1906 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1907 * elf32-csky.c (csky_elf_link_hash_table_create),
1908 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1909 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1910 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1911 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1912 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1913 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1914 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1915 (m32r_elf_check_relocs): Likewise.
1916 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1917 (elf32_m68hc11_setup_section_lists),
1918 (elf32_m68hc11_size_stubs): Likewise.
1919 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1920 * elf32-metag.c (elf_metag_link_hash_table_create),
1921 (elf_metag_setup_section_lists): Likewise.
1922 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1923 (microblaze_elf_check_relocs): Likewise.
1924 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1925 (nds32_elf_check_relocs): Likewise.
1926 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1927 (get_local_syms, nios2_elf32_check_relocs),
1928 (nios2_elf32_link_hash_table_create): Likewise.
1929 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1930 (or1k_elf_check_relocs): Likewise.
1931 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1932 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1933 * elf32-s390.c (elf_s390_link_hash_table_create),
1934 (elf_s390_check_relocs): Likewise.
1935 * elf32-score.c (score_elf_create_got_section),
1936 (s3_elf32_score_new_section_hook),
1937 (elf32_score_link_hash_table_create): Likewise.
1938 * elf32-score7.c (score_elf_create_got_section),
1939 (s7_elf32_score_new_section_hook): Likewise.
1940 * elf32-sh.c (sh_elf_link_hash_table_create),
1941 (sh_elf_check_relocs): Likewise.
1942 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1943 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1944 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1945 (tilepro_elf_check_relocs): Likewise.
1946 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1947 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1948 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1949 (elf_xtensa_new_section_hook): Likewise.
1950 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1951 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1952 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1953 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1954 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1955 * elf64-ppc.c (ppc64_elf_new_section_hook),
1956 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1957 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1958 * elf64-s390.c (elf_s390_link_hash_table_create),
1959 (elf_s390_check_relocs): Likewise.
1960 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1961 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1962 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1963 (elf_link_add_archive_symbols, compute_bucket_count),
1964 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1965 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1966 (bfd_elf_final_link): Likewise.
1967 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1968 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1969 (elfNN_aarch64_new_section_hook): Likewise.
1970 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1971 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1972 (riscv_elf_check_relocs): Likewise.
1973 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1974 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1975 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1976 (_bfd_mips_elf_link_hash_table_create): Likewise.
1977 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1978 (_bfd_sparc_elf_check_relocs),
1979 (_bfd_sparc_elf_new_section_hook): Likewise.
1980 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1981 (tilegx_elf_check_relocs): Likewise.
1982 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1983 * format.c (bfd_check_format_matches): Likewise.
1984 * hash.c (_bfd_stringtab_init): Likewise.
1985 * ihex.c (ihex_scan): Likewise.
1986 * irix-core.c (irix_core_core_file_p): Likewise.
1987 * linker.c (bfd_wrapped_link_hash_lookup),
1988 (_bfd_generic_link_hash_table_create),
1989 (_bfd_generic_reloc_link_order): Likewise.
1990 * lynx-core.c (lynx_core_file_p): Likewise.
1991 * netbsd-core.c (netbsd_core_file_p): Likewise.
1992 * osf-core.c (osf_core_core_file_p): Likewise.
1993 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1994 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1995 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1996 * peicode.h (pe_mkobject): Likewise.
1997 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1998 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1999 * sco5-core.c (read_uarea): Likewise.
2000 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2001 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2002 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2003 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2004 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2005 * srec.c (srec_scan): Likewise.
2006 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2007 * targets.c (bfd_target_list): Likewise.
2008 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2009 * trad-core.c (trad_unix_core_file_p): Likewise.
2010 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2011 (vms_new_section_hook): Likewise.
2012 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2013 * xcofflink.c (xcoff_get_section_contents),
2014 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2015 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2016 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2017
2018 2020-02-19 Alan Modra <amodra@gmail.com>
2019
2020 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2021
2022 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2023
2024 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2025 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2026 a build_list_p argument. Don't search plugin_list. Short circuit
2027 when building the plugin list.
2028 (has_plugin): Renamed to has_plugin_list.
2029 (bfd_plugin_set_plugin): Don't set has_plugin.
2030 (bfd_plugin_specified_p): Check plugin_list instead.
2031 (build_plugin_list): New function.
2032 (load_plugin): Call build_plugin_list and use plugin_list.
2033
2034 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2035
2036 PR binutils/25355
2037 * plugin.c (try_claim): Always clean up for LTO wrapper.
2038 (try_load_plugin): Treat each object as independent. Create a
2039 copy for plugin name.
2040
2041 2020-02-11 Nick Clifton <nickc@redhat.com>
2042
2043 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2044 for addresses in print statements.
2045 (msp430_elf_relax_delete_bytes): Likewise.
2046 (msp430_elf_relax_add_words): Likewise.
2047 (msp430_elf_relax_section): Likewise.
2048
2049 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2050
2051 * plugin.c (add_symbols): Clear plugin_data memory.
2052
2053 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2054
2055 PR binutils/25355
2056 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2057 (EXECUTABLE_SUFFIX): Likewise.
2058 * config.in: Regenerated.
2059 * configure: Likewise.
2060 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2061 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2062 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2063 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2064 (get_lto_wrapper): New.
2065 (setup_lto_wrapper_env): Likewise.
2066 (current_plugin): Likewise.
2067 (register_all_symbols_read): Likewise.
2068 (register_cleanup): Likewise.
2069 (get_symbols): Likewise.
2070 (add_input_file): Likewise.
2071 (bfd_plugin_close_and_cleanup): Likewise.
2072 (claim_file): Removed.
2073 (register_claim_file): Set current_plugin->claim_file.
2074 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2075 lto_syms in current_plugin.
2076 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2077 all_symbols_read handler. Copy real symbols to plugin_data.
2078 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2079 (try_load_plugin): Don't reuse the previous plugin for LTO
2080 wrapper. Set up GCC LTO wrapper if possible. Don't set
2081 plugin_list_iter->claim_file.
2082 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2083 possible.
2084 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2085 real_syms.
2086
2087 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2088
2089 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2090 check if previous instruction matches a conditional jump inserted
2091 earlier. Invert conditional jump and delete branch in this case.
2092
2093 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2094
2095 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2096 msp430_elf_relax_add_words. Support insertion of either one or two
2097 words.
2098 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2099 needs to be grown. Handle insertion of branch instruction to replace
2100 jump.
2101
2102 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2103
2104 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2105 debugging relocations.
2106 (msp430_elf_relax_delete_bytes): Likewise.
2107 (msp430_elf_relax_add_two_words): Likewise.
2108 (msp430_elf_relax_section): Likewise.
2109
2110 2020-02-10 Alan Modra <amodra@gmail.com>
2111
2112 * archures.c: Wrap overlong z80 comments.
2113 * bfd-in2.h: Regenerate.
2114
2115 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2116
2117 PR 25469
2118 * archures.c: Add GBZ80 and Z80N machine values.
2119 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2120 * coff-z80.c: Add support for new reloc.
2121 * coffcode.h: Add support for new machine values.
2122 * cpu-z80.c: Add support for new machine names.
2123 * elf32-z80.c: Add support for new reloc.
2124 * bfd-in2.h: Regenerate.
2125 * libbfd.h: Regenerate.
2126
2127 2020-02-07 Nick Clifton <nickc@redhat.com>
2128
2129 PR 23932
2130 * elf.c (rewrite_elf_program_header): Do not complain if no
2131 sections are mapped to a segment.
2132
2133 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2134
2135 PR ld/25490
2136 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2137 for garbage collection on __patchable_function_entries section
2138 without linked-to section.
2139
2140 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2141
2142 PR gas/25381
2143 * bfd-in2.h: Regenerated.
2144 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2145 on section if gc_mark of any of its linked-to sections is set
2146 and don't set gc_mark again.
2147 * section.c (asection): Add linked_to_symbol_name to map_head
2148 union.
2149
2150 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
2151
2152 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2153 reporting an unrecognized instruction with R_V850_LONGJUMP.
2154
2155 2020-02-05 Alan Modra <amodra@gmail.com>
2156
2157 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2158
2159 2020-02-04 Alan Modra <amodra@gmail.com>
2160
2161 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2162 R_PPC_VLE_ADDR20, goto copy_reloc.
2163
2164 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2165
2166 * bfd-in2.h: Regenerated.
2167 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2168
2169 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2170
2171 PR gas/25380
2172 * bfd-in2.h: Regenerated.
2173 * ecoff.c (bfd_debug_section): Add section_id.
2174 * section.c (bfd_section): Add section_id.
2175 (SEC_ASSEMBLER_SECTION_ID): New.
2176 (BFD_FAKE_SECTION): Add section_id.
2177
2178 2020-02-01 Nick Clifton <nickc@redhat.com>
2179
2180 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2181 obsolete list.
2182
2183 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2184
2185 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2186 encodings are relative to the GOT on nios2, too.
2187
2188 2020-01-31 Alan Modra <amodra@gmail.com>
2189
2190 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2191 file. Use $< and $@ in rules.
2192 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2193 (elf32-ia64.c, elf64-ia64.c): Likewise.
2194 (elf32-riscv.c, elf64-riscv.c): Likewise.
2195 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2196 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2197 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2198 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2199 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2200 * Makefile.in: Regenerate.
2201
2202 2020-01-31 Alan Modra <amodra@gmail.com>
2203
2204 PR 4110
2205 * elf.c (setup_group): Don't clear entire section contents,
2206 just the padding after group flags. Release alloc'd memory
2207 after a seek or read failure.
2208
2209 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2210
2211 * peXXigen.c (pe_is_repro): New function.
2212 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2213 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2214
2215 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2216
2217 * peXXigen.c (debug_type_names): Add names for new debug data type
2218 values.
2219
2220 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2221
2222 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2223 inner loop. Fix a memory leak.
2224
2225 2020-01-30 Alan Modra <amodra@gmail.com>
2226
2227 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2228 or obj_coff_keep_strings here.
2229 (coff_get_normalized_symtab): Free external syms directly.
2230 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2231 on error exit path.
2232
2233 2020-01-27 Jim Wilson <jimw@sifive.com>
2234
2235 * cpu-riscv.c (riscv_scan): New.
2236 (N): Change bfd_default_scan to riscv_scan.
2237
2238 2020-01-27 Andreas Schwab <schwab@suse.de>
2239
2240 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2241 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2242 * Makefile.in: Regenerate.
2243 * cpu-plugin.c: Remove.
2244 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2245 (bfd_plugin_arch): Remove declaration.
2246 * bfd-in2.h: Regenerate.
2247 * po/SRC-POTFILES.in: Regenerate.
2248
2249 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2250 Alan Modra <amodra@gmail.com>
2251
2252 PR ld/25458
2253 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2254
2255 2020-01-24 Jim Wilson <jimw@sifive.com>
2256
2257 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2258 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2259 avoid over long line.
2260
2261 2020-01-24 Nick Clifton <nickc@redhat.com>
2262
2263 PR 25447
2264 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2265 syms and keep strings flags as these may have been set in order to
2266 prevent a bogus call to free.
2267
2268 2020-01-23 Nick Clifton <nickc@redhat.com>
2269
2270 * po/fr.po: Updated French translation.
2271
2272 2020-01-23 Alan Modra <amodra@gmail.com>
2273
2274 PR 25444
2275 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2276 by zero when p_align is zero.
2277
2278 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2279
2280 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2281 (riscv_prefix_cmp): Likewise.
2282 (riscv_non_std_ext_p): Deleted.
2283 (riscv_std_sv_ext_p): Likewise.
2284 (riscv_non_std_sv_ext_p): Likewise.
2285 (riscv_merge_non_std_and_sv_ext): Rename to...
2286 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2287 (riscv_merge_arch_attr_info): Replace 3 calls to
2288 riscv_merge_non_std_and_sv_ext with single call to
2289 riscv_merge_multi_letter_ext.
2290 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2291 encounter a 'z' prefix.
2292 (riscv_get_prefix_class): New function, return prefix class based
2293 on first few characters of input string.
2294 (riscv_parse_config): New structure to factor out minor differences
2295 in extension class parsing behaviour.
2296 (riscv_parse_sv_or_non_std_ext): Rename to...
2297 (riscv_parse_prefixed_ext): and parameterise with
2298 riscv_parse_config.
2299 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2300 (riscv_multi_letter_ext_valid_p): New.
2301 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2302 (riscv_parse_subset): Delegate all non-single-letter parsing work
2303 to riscv_parse_prefixed_ext.
2304 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2305 (riscv_get_prefix_class): Declare.
2306
2307 2020-01-22 Alan Modra <amodra@gmail.com>
2308
2309 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2310 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2311 __tls_get_addr_desc.
2312 (ppc64_elf_size_stubs): Add section for linker generated
2313 __tls_get_addr_desc wrapper function. Loop at least once if
2314 generating this function.
2315 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2316 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2317
2318 2020-01-22 Alan Modra <amodra@gmail.com>
2319
2320 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2321 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2322 tga_desc_fd.
2323 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2324 (STDU_R1_0R1, ADDI_R1_R1): Define.
2325 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2326 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2327 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2328 no_tls_get_addr_regsave.
2329 (branch_reloc_hash_match): Add hash3 and hash4.
2330 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2331 (ppc64_elf_size_dynamic_sections): Likewise.
2332 (ppc64_elf_relocate_section): Likewise.
2333 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2334 __tls_get_addr stub.
2335 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2336 eh_frame.
2337 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2338 eh_frame for regsave __tls_get_addr.
2339
2340 2020-01-22 Alan Modra <amodra@gmail.com>
2341
2342 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2343 which __tls_get_addr calls will be eliminated.
2344
2345 2020-01-20 Nick Clifton <nickc@redhat.com>
2346
2347 * po/pt.po: Updates Portuguese translation.
2348 * po/ru.po: Updated Russian translation.
2349 * po/uk.po: Updated Ukranian translation.
2350
2351 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2352
2353 PR ld/25416
2354 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2355 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2356 X32 mode.
2357 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2358 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2359 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2360 "rex leal x@tlsdesc(%rip), %reg" to
2361 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2362 "call *(%eax)" to "nopl (%rax)".
2363
2364 2020-01-20 Alan Modra <amodra@gmail.com>
2365
2366 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2367 (MTLR_R11): Don't define.
2368 (LD_R0_0R3, CMPDI_R0_0): Define.
2369 (build_tls_get_addr_stub): Don't use r11 in stub.
2370
2371 2020-01-20 Alan Modra <amodra@gmail.com>
2372
2373 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2374 (defined_sym_val, is_tls_get_addr): Likewise.
2375
2376 2020-01-18 Nick Clifton <nickc@redhat.com>
2377
2378 * version.m4 (BFD_VERSION): Set to 2.34.50.
2379 * configure: Regenerate.
2380 * po/bfd.pot: Regenerate.
2381
2382 2020-01-18 Nick Clifton <nickc@redhat.com>
2383
2384 Binutils 2.34 branch created.
2385
2386 2020-01-17 Christian Biesinger <cbiesinger@google.com>
2387
2388 * coff-arm.c: Fix spelling error (seperate).
2389 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2390 error (seperate).
2391 * sysdep.h (strnlen): Fix spelling error (seperate).
2392
2393 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
2394
2395 PR 20694
2396 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2397
2398 2020-01-15 Alan Modra <amodra@gmail.com>
2399
2400 PR 25384
2401 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2402 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2403 of function symbols unless dot symbols are present. Do warn
2404 whenever one is created, regardles of whether a PLT entry is
2405 also emitted for the function symbol.
2406
2407 2020-01-14 Alan Modra <amodra@gmail.com>
2408
2409 * som.c (som_bfd_count_ar_symbols): Error when file position
2410 of symbols on chains is not strictly increasing.
2411
2412 2020-01-14 Alan Modra <amodra@gmail.com>
2413
2414 * vms.h (VMS_DEBUG): Define as 0.
2415 * vms-alpha.c (image_write): Move debug output after bounds check.
2416 Tidy bounds check.
2417 (_bfd_vms_slurp_eihd): Warning fix.
2418 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2419
2420 2020-01-13 Alan Modra <amodra@gmail.com>
2421
2422 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2423 for "ignored" records.
2424
2425 2020-01-13 Alan Modra <amodra@gmail.com>
2426
2427 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2428 Delete asect name check. Move asect NULL check to wasm_object_p.
2429 Correct bounds check of sizes against end. Replace uses of
2430 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2431 just one bfd_release.
2432 (wasm_scan): Don't use malloc/strdup for section names,
2433 bfd_alloc instead. Simplify code prefixing section name.
2434 Formatting. Don't attempt to free memory here..
2435 (wasm_object_p): ..do so here.
2436
2437 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2438
2439 PR ld/22269
2440 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2441 UNDEFWEAK_NO_DYNAMIC_RELOC.
2442 (allocate_dynrelocs_for_symbol): Likewise.
2443
2444 2020-01-10 Tamar Christina <tamar.christina@arm.com>
2445
2446 PR 25210
2447 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2448
2449 2020-01-10 Alan Modra <amodra@gmail.com>
2450
2451 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2452
2453 2020-01-09 Nick Clifton <nickc@redhat.com>
2454
2455 PR 25221
2456 * bfd.c (bfd_convert_section_contents): Check for a compress
2457 header size that is larger than the actual section size.
2458
2459 2020-01-08 Alan Modra <amodra@gmail.com>
2460
2461 PR 25351
2462 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2463 after removing sections.
2464
2465 2020-01-06 Jim Wilson <jimw@sifive.com>
2466
2467 PR 25205
2468 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2469 check for !bfd_link_pic (info).
2470 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2471 <R_RISCV_JAL>: Add comment.
2472 (_bfd_riscv_relax_section): For plt.offset check, add check for
2473 bfd_link_pic (info). Add comment.
2474
2475 2020-01-06 Alan Modra <amodra@gmail.com>
2476
2477 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2478 match failures. Don't init to bfd_error_wrong_format before
2479 calling _bfd_check_format.
2480
2481 2020-01-06 Alan Modra <amodra@gmail.com>
2482
2483 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2484 status rather than exiting on stack overflow or underflow.
2485 (_bfd_vms_slurp_etir): Adjust to suit.
2486
2487 2020-01-06 Alan Modra <amodra@gmail.com>
2488
2489 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2490
2491 2020-01-06 Alan Modra <amodra@gmail.com>
2492
2493 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2494 command. Check name offset is within command.
2495 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2496 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2497 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2498 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2499 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2500 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2501 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2502 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2503 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2504 (bfd_mach_o_read_segment): Similarly.
2505 (bfd_mach_o_read_thread): Properly bound check thread struct.
2506 Don't repeat checks on second loop.
2507 (bfd_mach_o_read_command): Fail on invalid command length.
2508
2509 2020-01-04 Alan Modra <amodra@gmail.com>
2510
2511 * format.c (bfd_check_format_matches): Add preserve_match.
2512 Save initial bfd state in "preserve", matched bfd state in
2513 "preserve_match". Save just the first match. Release
2514 bfd_alloc memory. Restore and finish preserved state as
2515 appropriate on all function exit paths.
2516
2517 2020-01-04 Alan Modra <amodra@gmail.com>
2518
2519 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2520
2521 2020-01-04 Alan Modra <amodra@gmail.com>
2522
2523 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2524 match too.
2525
2526 2020-01-03 Nick Clifton <nickc@redhat.com>
2527
2528 PR 25307
2529 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2530 there is enough data remaining in the code buffer before
2531 attempting to read a function stub.
2532
2533 2020-01-03 Nick Clifton <nickc@redhat.com>
2534
2535 PR 25308
2536 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2537 return value from bfd_malloc.
2538 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2539 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2540 (elf32_arm_filter_cmse_symbols): Likewise.
2541 (elf32_arm_write_section): Likewise.
2542 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2543 (bfd_mach_o_follow_dsym): Likewise.
2544 * pef.c (bfd_pef_print_loader_section): Likewise.
2545 (bfd_pef_scan_start_address): Likewise.
2546 (bfd_pef_parse_function_stubs): Likewise.
2547 (bfd_pef_parse_symbols): Likewise.
2548
2549 2020-01-03 Sergei Trofimovich <siarheit@google.com>
2550
2551 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2552 on binary inputs ld/PR25316.
2553 (is_ia64_elf): new helper to filter on ia64 objects.
2554
2555 2020-01-03 Jan Beulich <jbeulich@suse.com>
2556
2557 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2558 in parameter names.
2559 (bfd_mach_o_scan): Insert underscore in two variable names.
2560
2561 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2562
2563 * Makefile.am: Add z80-elf target support.
2564 * configure.ac: Likewise.
2565 * targets.c: Likewise.
2566 * Makefile.in: Regenerate.
2567 * configure: Regenerate.
2568 * config.bfd: Add z80-elf target support and new arches: ez80 and
2569 z180.
2570 * elf32-z80.c: New file.
2571 * archures.c: Add new z80 architectures: eZ80 and Z180.
2572 * coffcode.h: Likewise.
2573 * cpu-z80.c: Likewise.
2574 * coff-z80.c: Add new relocations for Z80 target and local label
2575 check.
2576 * reloc.c: Add new relocs.
2577 * bfd-in2.h: Regenerate.
2578 * libbfd.h: Regenerate.
2579
2580 2020-01-02 Tamar Christina <tamar.christina@arm.com>
2581
2582 PR 25210
2583 PR 24753
2584 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2585
2586 2020-01-01 Alan Modra <amodra@gmail.com>
2587
2588 Update year range in copyright notice of all files.
2589
2590 For older changes see ChangeLog-2019
2591 \f
2592 Copyright (C) 2020 Free Software Foundation, Inc.
2593
2594 Copying and distribution of this file, with or without modification,
2595 are permitted in any medium without royalty provided the copyright
2596 notice and this notice are preserved.
2597
2598 Local Variables:
2599 mode: change-log
2600 left-margin: 8
2601 fill-column: 74
2602 version-control: never
2603 End:
This page took 0.096514 seconds and 3 git commands to generate.