ECOFF archive uninitialised read
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2020-03-23 Alan Modra <amodra@gmail.com>
2
3 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
4 symbol count. Allocate an extra byte to ensure name strings
5 are terminated. Sanity check name offsets. Release memory on
6 error return.
7
8 2020-03-23 Alan Modra <amodra@gmail.com>
9
10 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
11 field hasn't been read. Remove unnecessary casts.
12
13 2020-03-22 Alan Modra <amodra@gmail.com>
14
15 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
16 enough to read number of symbols.
17
18 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
19
20 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
21 (EXECUTABLE_SUFFIX): Likewise.
22 * config.in: Regenerated.
23 * configure: Likewise.
24 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
25 _bfd_generic_close_and_cleanup.
26 (plugin_list_entry): Remove resolution_file, resolution_option,
27 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
28 lto_wrapper, gcc_env and initialized,
29 (need_lto_wrapper_p): Removed.
30 (get_lto_wrapper): Likewise.
31 (setup_lto_wrapper_env): Likewise.
32 (register_all_symbols_read): Likewise.
33 (egister_cleanup): Likewise.
34 (get_symbols): Likewise.
35 (add_input_file): Likewise.
36 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
37 (add_symbols): Updated.
38 (try_claim): Likewise.
39 (try_load_plugin): Likewise.
40 (bfd_plugin_canonicalize_symtab): Likewise.
41 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
42 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
43
44 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
45
46 PR binutils/25640
47 * plugin.c (plugin_list_entry): Add has_symbol_type.
48 (add_symbols_v2): New function.
49 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
50 provides symbol type.
51 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
52 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
53 available.
54
55 2020-03-20 Alan Modra <amodra@gmail.com>
56
57 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
58 enough to read number of symbols.
59
60 2020-03-20 Alan Modra <amodra@gmail.com>
61
62 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
63 backend functions for NULL before calling.
64 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
65 (bfd_section_from_shdr, assign_section_numbers): Likewise.
66 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
67 * elfnn-ia64.c (ignore_errors): New function.
68 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
69
70 2020-03-19 Nick Clifton <nickc@redhat.com>
71
72 PR 25676
73 * dwarf2.c (struct varinfo): Add unit_offset field to record the
74 location of the varinfo in the unit's debug info data. Change the
75 type of the stack field to a boolean.
76 (lookup_var_by_offset): New function. Returns the varinfo
77 structure for the variable described at the given offset in the
78 unit's debug info.
79 (scan_unit_for_symbols): Add support for variables which have the
80 DW_AT_specification attribute.
81
82 2020-03-19 Nick Clifton <nickc@redhat.com>
83
84 PR 25699
85 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
86 error return.
87
88 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
89
90 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
91
92 2020-03-18 Nick Clifton <nickc@redhat.com>
93
94 PR 25673
95 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
96 memory access when processing a corrupt secondary reloc section.
97
98 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
99
100 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
101 instead of calling abort.
102 * elf32-csky.c (csky_build_one_stub): Likewise.
103 * elf32-hppa.c (hppa_build_one_stub): Likewise.
104 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
105 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
106 * elf32-metag.c (metag_build_one_stub): Likewise.
107 * elf32-nios2.c (nios2_build_one_stub): Likewise.
108 * elf64-ppc.c (ppc_build_one_stub): Likewise.
109 (ppc_size_one_stub): Likewise.
110 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
111
112 2020-03-17 Nick Clifton <nickc@redhat.com>
113
114 PR 25688
115 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
116 with error messages.
117
118 2020-03-17 Nick Clifton <nickc@redhat.com>
119
120 PR 25687
121 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
122 free. Add free on another failure path.
123
124 2020-03-16 Alan Modra <amodra@gmail.com>
125
126 PR 25675
127 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
128 we have a non-zero section count. Do lma comparison in octets.
129
130 2020-03-16 Alan Modra <amodra@gmail.com>
131
132 * vms-alpha.c (dst_restore_location): Validate index into
133 dst_ptr_offsets array before accessing. Return status.
134 (dst_retrieve_location): Similarly, making "loc" parameter a
135 pointer to return value.
136 (_bfd_vms_slurp_etir): Update calls to above functions.
137
138 2020-03-14 Kamil Rytarowski <n54@gmx.com>
139
140 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
141 targets.
142 * configure: Regenerated.
143
144 2020-03-14 Alan Modra <amodra@gmail.com>
145
146 * section.c (BFD_FAKE_SECTIONS): Formatting.
147 * bfd-in2.h: Regenerate.
148
149 2020-03-13 Kamil Rytarowski <n54@gmx.com>
150
151 * elf.c (elfcore_grok_netbsd_note): Add support for
152 NT_NETBSDCORE_LWPSTATUS notes.
153
154 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
155
156 * bfd-in2.h: Regenerate.
157 * section.c (asection): Add already_assigned field.
158 (BFD_FAKE_SECTION): Add default initializer for it.
159 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
160 * elf32-arm.c (arm_build_one_stub): Add support for
161 non_contiguous_regions.
162 * elf32-csky.c (csky_build_one_stub): Likewise.
163 * elf32-hppa.c (hppa_build_one_stub): Likewise.
164 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
165 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
166 * elf32-metag.c (metag_build_one_stub): Likewise.
167 * elf32-nios2.c (nios2_build_one_stub): Likewise.
168 * elf64-ppc.c (ppc_build_one_stub): Likewise.
169 (ppc_size_one_stub): Likewise.
170 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
171 * elflink.c (elf_link_input_bfd): Likewise.
172
173 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
174
175 PR ld/24920
176 * elf-linker-x86.h (elf_linker_x86_params): Add
177 static_before_all_inputs and has_dynamic_linker.
178 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
179 dynamic input objects if -static is passed at command-line
180 before all input files without --dynamic-linker unless
181 --no-dynamic-linker is used.
182
183 2020-03-13 Kamil Rytarowski <n54@gmx.com>
184
185 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
186
187 2020-03-13 Christian Eggers <ceggers@gmx.de>
188
189 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
190 "p_paddr" from "at".
191 * elfcode.h (bfd_from_remote_memory): Add units to several
192 parameters. New local "opb". Fix usage of p_align. Fix
193 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
194 call of target_read_memory.
195 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
196 calculation of "offset" and "output_offset".
197 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
198 from "offset" and fix calculation of "end" from "vma+size". Fix
199 comparison between "sh_addr" and "vma"/"output_offset".
200 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
201 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
202 member.
203 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
204 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
205 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
206 assignment of p_paddr from phdr_lma. Fix comparison between
207 "lma+size" and "next->lma".
208 (elf_sort_segments): Fix assignment from p_paddr to lma.
209 (assign_file_positions_for_load_sections): Add unit (bytes) to
210 local "align". Fix calculation of local "off_adjust". Fix
211 calculation of local "filehdr_vaddr".
212 (assign_file_positions_for_non_load_sections): New local "opb".
213 Fix calculation of "end" from "p_size". Fix comparison between
214 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
215 from "end" and "p_vaddr".
216 (rewrite_elf_program_header): Fix comparison between p_vaddr and
217 vma. Fix assignment to p_paddr from lma. Fix comparison between
218 p_paddr and lma. Fix assignment to p_paddr from lma.
219 * merge.c (sec_merge_emit): New local "opb". Convert
220 "alignment_power" to octets.
221 (_bfd_add_merge_section): New locals "alignment_power" and
222 "opb". Fix comparison between "alignment_power" and
223 "sizeof(align)".
224 (_bfd_merge_sections): New local "opb". Divide size by opb
225 before checking align mask.
226
227 2020-03-13 Christian Eggers <ceggers@gmx.de>
228
229 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
230 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
231 section LMA/VMA.
232 (_bfd_elf_make_section_from_phdr): Similarly.
233 (elf_fake_sections): Fix calculation of
234 Elf_Internal_shdr::sh_addr from section VMA.
235 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
236 and bytes.
237 (assign_file_positions_for_load_sections): Fix calculations of
238 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
239 comparison between program header address and section LMA.
240 (assign_file_positions_for_non_load_sections): Likewise.
241 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
242 (IS_CONTAINED_BY_VMA): Add parameter opb.
243 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
244 INCLUDE_SECTION_IN_SEGMENT): Likewise.
245 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
246 Fix calculations of p_addr_valid and p_vaddr_offset.
247 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
248 with octets per byte when comparing against p_vaddr.
249
250 2020-03-11 Alan Modra <amodra@gmail.com>
251
252 * som.c (setup_sections): Sanity check subspace.name.
253
254 2020-03-11 Alan Modra <amodra@gmail.com>
255
256 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
257
258 2020-03-10 Alan Modra <amodra@gmail.com>
259
260 PR 25648
261 * ihex.c (ihex_write_object_contents): Don't assume ordering of
262 addresses here.
263
264 2020-03-09 Alan Modra <amodra@gmail.com>
265
266 * wasm-module.c (wasm_scan): Sanity check file name length
267 before allocating memory. Move common section setup code. Do
268 without bfd_tell to calculate section size.
269
270 2020-03-06 Nick Clifton <nickc@redhat.com>
271
272 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
273 with error messages and failure return values.
274
275 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
276
277 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
278 relocation sections for any removed reference to a dynamic symbol.
279
280 2020-03-05 Nick Clifton <nickc@redhat.com>
281
282 * elf-bfd.h (struct elf_backend_data): Add new fields:
283 init_secondary_reloc_section, slurp_secondary_reloc_section,
284 write_secondary_reloc_section.
285 (_bfd_elf_init_secondary_reloc_section): Prototype.
286 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
287 (_bfd_elf_write_secondary_reloc_section): Prototype.
288 * elf.c ( bfd_section_from_shdr): Invoke the new
289 init_secondary_reloc_section backend function, if defined, when a
290 second reloc section is encountered.
291 (swap_out_syms): Invoke the new symbol_section_index function, if
292 defined, when computing the section index of an OS/PROC specific
293 symbol.
294 (_bfd_elf_init_secondary_reloc_section): New function.
295 (_bfd_elf_slurp_secondary_reloc_section): New function.
296 (_bfd_elf_write_secondary_reloc_section): New function.
297 (_bfd_elf_copy_special_section_fields): New function.
298 * elfcode.h (elf_write_relocs): Invoke the new
299 write_secondary_relocs function, if defined, in order to emit
300 secondary relocs.
301 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
302 function, if defined, in order to read in secondary relocs.
303 * elfxx-target.h (elf_backend_copy_special_section_fields):
304 Provide a non-NULL default definition.
305 (elf_backend_init_secondary_reloc_section): Likewise.
306 (elf_backend_slurp_secondary_reloc_section): Likewise.
307 (elf_backend_write_secondary_reloc_section): Likewise.
308 (struct elf_backend_data elfNN_bed): Add initialisers for the new
309 fields.
310 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
311 * configure: Regenerate.
312
313 2020-03-05 Alan Modra <amodra@gmail.com>
314
315 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
316 against file size before allocating memory. Use bfd_alloc rather
317 than bfd_zalloc for carsym/strings memory.
318
319 2020-03-04 Alan Modra <amodra@gmail.com>
320
321 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
322 sh_addr mod sh_addalign is zero.
323
324 2020-03-04 Alan Modra <amodra@gmail.com>
325
326 * format.c (bfd_check_format_matches): Call cleanup on error exit.
327
328 2020-03-03 Alan Modra <amodra@gmail.com>
329
330 * format.c (struct bfd_preserve): Add cleanup field.
331 (bfd_preserve_save): Add cleanup param and save.
332 (bfd_preserve_restore): Return cleanup.
333 (bfd_preserve_finish): Call the cleanup for the discarded match.
334 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
335 and clear when preserving a match. Restore cleanup too when
336 restoring that match.
337
338 2020-03-02 Alan Modra <amodra@gmail.com>
339
340 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
341 * hpux-core.c (hpux_core_core_file_p): Update prototype.
342 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
343 (core_sco5_vec): Correct initialisers.
344
345 2020-03-02 Alan Modra <amodra@gmail.com>
346
347 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
348 * aix5ppc-core.c (xcoff64_core_p): Likewise.
349 * cisco-core.c (cisco_core_file_validate): Likewise.
350 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
351 * hpux-core.c (hpux_core_core_file_p): Likewise.
352 * irix-core.c (irix_core_core_file_p): Likewise.
353 * lynx-core.c (lynx_core_file_p): Likewise.
354 * netbsd-core.c (netbsd_core_file_p): Likewise.
355 * osf-core.c (osf_core_core_file_p): Likewise.
356 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
357 * sco5-core.c (sco5_core_file_p): Likewise.
358
359 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
360
361 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
362
363 2020-03-02 Alan Modra <amodra@gmail.com>
364
365 * targets.c (bfd_cleanup): New typedef.
366 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
367 * libbfd-in.h (_bfd_no_cleanup): Define.
368 * format.c (bfd_reinit): Add cleanup parameter, call it.
369 (bfd_check_format_matches): Set cleanup from _bfd_check_format
370 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
371 * aout-target.h (callback, object_p): Return bfd_cleanup.
372 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
373 * archive.c (bfd_generic_archive_p): Likewise.
374 * binary.c (binary_object_p): Likewise.
375 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
376 * coff-ia64.c (ia64coff_object_p): Likewise.
377 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
378 * coff-sh.c (coff_small_object_p): Likewise.
379 * coff-stgo32.c (go32_check_format): Likewise.
380 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
381 (xcoff64_core_p): Likewise.
382 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
383 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
384 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
385 * elfcode.h (elf_object_p): Likewise.
386 * elfcore.h (elf_core_file_p): Likewise.
387 * i386msdos.c (msdos_object_p): Likewise.
388 * ihex.c (ihex_object_p): Likewise.
389 * libaout.h (some_aout_object_p): Likewise.
390 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
391 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
392 * libbfd.c (_bfd_dummy_target): Likewise.
393 * libcoff-in.h (coff_object_p): Likewise.
394 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
395 (bfd_mach_o_arm64_core_p): Likewise.
396 * mach-o-arm.c (bfd_mach_o_arm_object_p),
397 (bfd_mach_o_arm_core_p): Likewise.
398 * mach-o-i386.c (bfd_mach_o_i386_object_p),
399 (bfd_mach_o_i386_core_p): Likewise.
400 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
401 (bfd_mach_o_x86_64_core_p): Likewise.
402 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
403 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
404 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
405 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
406 * mmo.c (mmo_object_p): Likewise.
407 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
408 * peicode.h (coff_real_object_p, pe_ILF_object_p),
409 (pe_bfd_object_p): Likewise.
410 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
411 * ppcboot.c (ppcboot_object_p): Likewise.
412 * rs6000-core.c (rs6000coff_core_p): Likewise.
413 * som.c (som_object_setup, som_object_p): Likewise.
414 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
415 * tekhex.c (tekhex_object_p): Likewise.
416 * vms-alpha.c (alpha_vms_object_p): Likewise.
417 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
418 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
419 * wasm-module.c (wasm_object_p): Likewise.
420 * xsym.c (bfd_sym_object_p): Likewise.
421 * xsym.h (bfd_sym_object_p): Likewise.
422 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
423 return type.
424 * pdp11.c (some_aout_object_p): Likewise.
425 * plugin.c (register_ld_plugin_object_p): Update object_p
426 parameter type.
427 * plugin.h (register_ld_plugin_object_p): Likewise.
428 * bfd-in2.h: Regenerate.
429 * libbfd.h: Regenerate.
430 * libcoff.h: Regenerate.
431
432 2020-03-02 Alan Modra <amodra@gmail.com>
433
434 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
435 applicable section flags.
436 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
437 (mips_ecoff_bele_vec): Likewise.
438 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
439 and .sbss sections.
440 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
441 (_bfd_ecoff_styp_to_sec_flags): Likewise.
442
443 2020-03-02 Alan Modra <amodra@gmail.com>
444
445 * elf32-m32r.c (m32r_elf_section_flags): New function.
446 (elf_backend_section_flags): Define.
447 * elf32-nds32.c (nds32_elf_section_flags): New function.
448 (elf_backend_section_flags): Define.
449 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
450 .sbss and .sdata sections.
451 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
452 for SHF_V850_GPREL sections.
453 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
454 FIXME.
455 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
456 for SHF_PARISC_SHORT sections.
457 * elf64-ppc.c (ppc64_elf_section_flags): New function.
458 (elf_backend_section_flags): Define.
459 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
460 for SHF_MIPS_GPREL sections. Delete FIXME.
461
462 2020-03-02 Alan Modra <amodra@gmail.com>
463
464 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
465 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
466 calling elf_backend_section_flags with adjusted params. Use
467 newsect->flags past that point.
468 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
469 special sections.
470 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
471 to have their type overridden, and all sh_flags but processor and
472 os specific.
473 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
474 * elf32-mep.c (mep_elf_section_flags): Likewise.
475 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
476 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
477 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
478 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
479 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
480 stub BFD and non-aarch64 input files when scanning for stubs.
481
482 2020-03-02 Alan Modra <amodra@gmail.com>
483
484 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
485 limit to decompressed element size.
486
487 2020-03-02 Alan Modra <amodra@gmail.com>
488
489 * vms-lib.c (vms_traverse_index): Add recur_count param and
490 update calls. Fail on excessive recursion.
491
492 2020-03-02 Alan Modra <amodra@gmail.com>
493
494 * vms-alpha.c (vms_get_remaining_object_record): Use
495 bfd_realloc_or_free rather than bfd_realloc.
496 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
497 (dst_define_location, parse_module): Likewise, and check realloc
498 return status before using memory. Return status from function
499 adjusting all callers.
500
501 2020-02-28 Alan Modra <amodra@gmail.com>
502
503 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
504
505 2020-02-28 Alan Modra <amodra@gmail.com>
506
507 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
508 Remove duplicate undersize check.
509
510 2020-02-27 Alan Modra <amodra@gmail.com>
511
512 PR 24511
513 * mmo.c (mmo_scan): Set SEC_DATA for .data.
514
515 2020-02-27 Alan Modra <amodra@gmail.com>
516
517 PR 24511
518 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
519 (coff_section_type): Adjust comment.
520 (decode_section_type): Likewise. Call coff_section_type before
521 decode_section_type.
522 (bfd_decode_symclass): Use 'c' for common sections other than
523 the standard one.
524
525 2020-02-27 Alan Modra <amodra@gmail.com>
526
527 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
528 malloc'd block.
529
530 2020-02-27 Alan Modra <amodra@gmail.com>
531
532 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
533 if file is an archive element.
534 * bfd-in2.h: Regenerate.
535
536 2020-02-26 Alan Modra <amodra@gmail.com>
537
538 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
539 bfd_set_error on failing test. Don't bother changing bfd_error on
540 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
541 Check sym name is within string buffer. Use size_t for some vars.
542 (do_slurp_coff_armap): Use size_t for some variables, fix size of
543 int_buf. Don't change bfd_error on file read error. Use
544 _bfd_mul_overflow when calculating carsym buffer size. Reorder
545 calculations to catch overflows before they occur. malloc and
546 free raw armap rather than using bfd_alloc. Read raw armap before
547 allocating carsym+strings buffer.
548 (_bfd_slurp_extended_name_table): Localize variables. Check
549 name size against file size.
550
551 2020-02-26 Alan Modra <amodra@gmail.com>
552
553 * vms-lib.c (vms_lib_read_index): Release correct buffer.
554
555 2020-02-26 Alan Modra <amodra@gmail.com>
556
557 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
558 malloc. Check for NULL return from bfd_malloc.
559 (rx_table_find, rx_table_map): Likewise.
560 (rx_set_section_contents): Check bfd_alloc return.
561 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
562
563 2020-02-26 Alan Modra <amodra@gmail.com>
564
565 * aoutx.h: Indent labels correctly. Format error strings.
566 * archive.c: Likewise.
567 * archive64.c: Likewise.
568 * coff-arm.c: Likewise.
569 * coff-rs6000.c: Likewise.
570 * coff-stgo32.c: Likewise.
571 * cpu-arm.c: Likewise.
572 * dwarf2.c: Likewise.
573 * elf-ifunc.c: Likewise.
574 * elf-properties.c: Likewise.
575 * elf-s390-common.c: Likewise.
576 * elf-strtab.c: Likewise.
577 * elf.c: Likewise.
578 * elf32-arm.c: Likewise.
579 * elf32-bfin.c: Likewise.
580 * elf32-cr16.c: Likewise.
581 * elf32-csky.c: Likewise.
582 * elf32-i386.c: Likewise.
583 * elf32-m68k.c: Likewise.
584 * elf32-msp430.c: Likewise.
585 * elf32-nds32.c: Likewise.
586 * elf32-nios2.c: Likewise.
587 * elf32-pru.c: Likewise.
588 * elf32-xtensa.c: Likewise.
589 * elf64-ia64-vms.c: Likewise.
590 * elf64-x86-64.c: Likewise.
591 * elfcode.h: Likewise.
592 * elfcore.h: Likewise.
593 * elflink.c: Likewise.
594 * elfnn-aarch64.c: Likewise.
595 * elfnn-ia64.c: Likewise.
596 * elfnn-riscv.c: Likewise.
597 * elfxx-mips.c: Likewise.
598 * elfxx-sparc.c: Likewise.
599 * elfxx-x86.c: Likewise.
600 * i386lynx.c: Likewise.
601 * merge.c: Likewise.
602 * pdp11.c: Likewise.
603 * plugin.c: Likewise.
604 * reloc.c: Likewise.
605
606 2020-02-26 Alan Modra <amodra@gmail.com>
607
608 PR 25593
609 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
610 "dyn_loaded".
611 (bfd_elf_add_dt_needed_tag): Declare.
612 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
613 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
614 from elf_add_dt_needed_tag. Remove soname and doit param.
615 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
616 to see whether as-needed lib is already loaded, use dyn_loaded
617 list instead. When saving and restoring around as-needed lib
618 handle possibility that dynstr has not been initialised. Don't
619 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
620 Mark libs loaded via DT_NEEDED entries of other libs with
621 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
622 the output.
623 (elf_link_check_versioned_symbol): Remove now unneccesary
624 DYNAMIC check when traversing dyn_loaded list.
625
626 2020-02-26 Alan Modra <amodra@gmail.com>
627
628 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
629
630 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
631
632 PR binutils/25584
633 * plugin.c (need_lto_wrapper_p): New.
634 (bfd_plugin_set_program_name): Add an int argument to set
635 need_lto_wrapper_p.
636 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
637 set.
638 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
639
640 2020-02-24 Alan Modra <amodra@gmail.com>
641
642 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
643
644 2020-02-24 Alan Modra <amodra@gmail.com>
645
646 * vms-lib.c (struct carsym_mem): Add limit.
647 (vms_add_index): Heed limit.
648 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
649 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
650 Always return actual number read.
651 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
652 assertion with error exit.
653
654 2020-02-22 Alan Modra <amodra@gmail.com>
655
656 PR 25585
657 * elf.c (assign_file_positions_for_load_sections): Continue linking
658 on "PHDR segment not covered by LOAD segment" errors.
659
660 2020-02-21 Alan Modra <amodra@gmail.com>
661
662 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
663 overflow check.
664 (bfd_mach_o_canonicalize_reloc): Likewise.
665 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
666 counts and offsets against file size.
667 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
668 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
669 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
670 against file size. Delete symbol table error message.
671 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
672 against file size.
673 (bfd_mach_o_read_symtab): Likewise.
674 (bfd_mach_o_read_command): Pass file size.
675 (bfd_mach_o_scan): Sanity check command count against file size.
676
677 2020-02-21 Alan Modra <amodra@gmail.com>
678
679 PR 25569
680 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
681 "text", "data" and "bss" section pointer vars. Don't update
682 section size, just exec header sizes.
683 (adjust_sizes_and_vmas): Don't update text section size. Set
684 initial exec header a_text. Print exec headers sizes.
685 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
686 (adjust_sizes_and_vmas): Similarly. Formatting.
687 (final_link): Correct final file extension.
688
689 2020-02-20 Nick Clifton <nickc@redhat.com>
690
691 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
692 callback.
693 * elfxx-target.h (elf_backend_symbol_section_index): Provide
694 default definition.
695 (elfNN_bed): Initialise the symbol_section_index field.
696 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
697 OS and PROC specific section indicies. Warn if converting other
698 reserved incidies to SHN_ABS.
699
700 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
701
702 PR 25537
703 * cpu-z80.c: Add machine type compatibility checking.
704
705 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
706
707 PR binutils/25355
708 * plugin.c (plugin_list_entry): Remove handle.
709 (try_load_plugin): Call dlclose before return.
710
711 2020-02-19 Alan Modra <amodra@gmail.com>
712
713 * libbfd-in.h (_bfd_constant_p): Define.
714 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
715 file size before allocating memory.
716 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
717 * elf.c (bfd_elf_get_str_section): Likewise.
718 (_bfd_elf_slurp_version_tables): Likewise.
719 * libbfd.h: Regenerate.
720
721 2020-02-19 Alan Modra <amodra@gmail.com>
722
723 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
724 * aoutx.h (aout_get_external_symbols): Replace calls to
725 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
726 (slurp_reloc_table): Likewise.
727 * archive.c (do_slurp_bsd_armap): Likewise.
728 (do_slurp_coff_armap): Likewise.
729 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
730 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
731 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
732 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
733 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
734 (_bfd_coff_get_external_symbols): Likewise.
735 * ecoff.c (ecoff_slurp_symbolic_header),
736 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
737 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
738 (ecoff_indirect_link_order): Likewise.
739 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
740 (_bfd_elf_slurp_version_tables): Likewise.
741 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
742 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
743 * elf32-rx.c (elf32_rx_relax_section): Likewise.
744 * elf64-alpha.c (READ): Likewise.
745 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
746 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
747 * elfcode.h (elf_slurp_symbol_table),
748 (elf_slurp_reloc_table_from_section): Likewise.
749 * elflink.c (elf_link_add_object_symbols),
750 (elf_link_check_versioned_symbol): Likewise.
751 * elfxx-mips.c (READ): Likewise.
752 * i386lynx.c (slurp_reloc_table): Likewise.
753 * lynx-core.c (lynx_core_file_p): Likewise.
754 * mach-o.c (bfd_mach_o_canonicalize_relocs),
755 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
756 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
757 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
758 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
759 (bfd_pef_parse_symbols): Likewise.
760 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
761 * som.c (setup_sections, som_slurp_string_table),
762 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
763 (som_bfd_fill_in_ar_symbols): Likewise.
764 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
765 (evax_bfd_print_image): Likewise.
766 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
767 * wasm-module.c (wasm_scan): Likewise.
768 * xcofflink.c (xcoff_link_add_symbols): Likewise.
769 * xsym.c (bfd_sym_read_name_table),
770 (bfd_sym_print_type_information_table_entry): Likewise.
771 * libbfd.h: Regenerate.
772
773 2020-02-19 Alan Modra <amodra@gmail.com>
774
775 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
776 reading external relocs.
777 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
778 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
779 after bfd_bread.
780 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
781 bfd_release.
782 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
783 (m32c_elf_relax_section): Likewise.
784 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
785 (rl78_elf_relax_section): Likewise.
786 * elf32-rx.c (rx_offset_for_reloc): Likewise.
787 (elf32_rx_relax_section): Likewise.
788 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
789 parameter types and use..
790 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
791 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
792 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
793 being read from file, just the extra.
794 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
795 after reading external syms. Free on failure.
796
797 2020-02-19 Alan Modra <amodra@gmail.com>
798
799 * coffcode.h (buy_and_read, coff_slurp_line_table),
800 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
801 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
802 corresponding bfd_alloc call. Adjust variables to suit.
803 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
804 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
805 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
806 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
807 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
808 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
809 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
810 * elf32-rx.c (elf32_rx_relax_section): Likewise.
811 * elf64-alpha.c (READ): Likewise.
812 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
813 (elf_slurp_symbol_table, elf_slurp_reloc_table),
814 (bfd_from_remote_memory): Likewise.
815 * elfcore.h (core_find_build_id): Likewise.
816 * elfxx-mips.c (READ): Likewise.
817 * mach-o.c (bfd_mach_o_mangle_sections),
818 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
819 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
820 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
821 * som.c (setup_sections, som_prep_for_fixups)
822 (som_build_and_write_symbol_table, som_slurp_symbol_table),
823 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
824 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
825 (som_bfd_ar_write_symbol_stuff): Likewise.
826 * vms-alpha.c (vector_grow1): Likewise.
827 * vms-lib.c (vms_add_index): Likewise.
828 * wasm-module.c (wasm_scan_name_function_section): Likewise.
829 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
830 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
831 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
832 (bfd_alloc2, bfd_zalloc2): Delete.
833 (_bfd_mul_overflow): Define.
834 * libbfd.h: Regenerate.
835
836 2020-02-19 Alan Modra <amodra@gmail.com>
837
838 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
839 bfd_zalloc2.
840 (assign_section_numbers): Likewise.
841 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
842 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
843 bfd_malloc2, size_t amt, and unsigned tls_count.
844 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
845 * elflink.c (elf_create_symbuf): Use bfd_malloc.
846 (elf_output_implib): Use bfd_alloc.
847
848 2020-02-19 Alan Modra <amodra@gmail.com>
849
850 * bfd.c (struct bfd): Move format and direction to other
851 bitfields. Add "size".
852 * bfdio.c (bfd_get_size): Cache size when not writing file.
853 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
854 returning zero, ie. unknown.
855 (bfd_get_alt_debug_link_info): Likewise.
856 * bfd-in2.h: Regenerate.
857
858 2020-02-19 Alan Modra <amodra@gmail.com>
859
860 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
861 bfd_get_file_size twice.
862 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
863 zero, ie. unknown, return.
864 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
865 * elfcode.h (elf_swap_shdr_in): Likewise.
866 (elf_object_p): Don't call bfd_get_file_size twice and correct
867 file size check.
868
869 2020-02-19 Alan Modra <amodra@gmail.com>
870
871 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
872 FALSE if memory alloc fails. Adjust calls.
873 * som.c (som_prep_for_fixups): Likewise.
874 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
875 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
876 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
877 * som.c (som_build_and_write_symbol_table): Return via error_return
878 on seek failure.
879 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
880 (VEC_APPEND_EL): Delete.
881 (vector_grow1): Return pointer to element. Catch overflow.
882 Return NULL on memory allocation failure.
883 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
884 (alpha_vms_add_fixup_ca): Likewise.
885 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
886 before using.
887 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
888
889 2020-02-19 Alan Modra <amodra@gmail.com>
890
891 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
892 * aout-target.h (object_p): Likewise.
893 * aout-tic30.c (tic30_aout_object_p): Likewise.
894 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
895 (emit_stringtab, write_syms, link_hash_table_create),
896 (aout_link_write_other_symbol): Likewise.
897 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
898 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
899 (_bfd_compute_and_write_armap): Likewise.
900 * archures.c (bfd_arch_list): Likewise.
901 * bfd.c (bfd_record_phdr): Likewise.
902 * binary.c (binary_canonicalize_symtab): Likewise.
903 * cisco-core.c (cisco_core_file_validate): Likewise.
904 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
905 (find_arm_glue, record_arm_to_thumb_glue),
906 (record_thumb_to_arm_glue): Likewise.
907 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
908 (ppc_allocate_toc_section): Likewise.
909 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
910 * coff-sh.c (sh_relax_section): Likewise.
911 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
912 * coffcode.h (handle_COMDAT, coff_new_section_hook),
913 (coff_set_alignment_hook, coff_mkobject),
914 (coff_compute_section_file_positions): Likewise.
915 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
916 (coff_find_nearest_line_with_names),
917 ( bfd_coff_set_symbol_class): Likewise.
918 * cofflink.c (_bfd_coff_link_hash_table_create),
919 (_bfd_coff_link_input_bfd): Likewise.
920 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
921 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
922 (build_line_info_table, sort_line_sequences),
923 (line_info_add_include_dir, line_info_add_file_name),
924 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
925 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
926 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
927 (_bfd_ecoff_find_nearest_line),
928 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
929 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
930 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
931 * elf-m10300.c (mn10300_elf_relax_section),
932 (elf32_mn10300_link_hash_table_create): Likewise.
933 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
934 * elf.c (make_mapping, copy_elf_program_header): Likewise.
935 * elf32-arm.c (elf32_arm_link_hash_table_create),
936 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
937 (elf32_arm_new_section_hook): Likewise.
938 * elf32-avr.c (elf_avr_new_section_hook),
939 (elf32_avr_link_hash_table_create, get_local_syms),
940 (elf32_avr_setup_section_lists): Likewise.
941 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
942 (bfin_link_hash_table_create): Likewise.
943 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
944 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
945 * elf32-csky.c (csky_elf_link_hash_table_create),
946 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
947 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
948 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
949 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
950 * elf32-i386.c (elf_i386_check_relocs): Likewise.
951 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
952 * elf32-m32r.c (m32r_elf_link_hash_table_create),
953 (m32r_elf_check_relocs): Likewise.
954 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
955 (elf32_m68hc11_setup_section_lists),
956 (elf32_m68hc11_size_stubs): Likewise.
957 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
958 * elf32-metag.c (elf_metag_link_hash_table_create),
959 (elf_metag_setup_section_lists): Likewise.
960 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
961 (microblaze_elf_check_relocs): Likewise.
962 * elf32-nds32.c (nds32_elf_link_hash_table_create),
963 (nds32_elf_check_relocs): Likewise.
964 * elf32-nios2.c (nios2_elf32_setup_section_lists),
965 (get_local_syms, nios2_elf32_check_relocs),
966 (nios2_elf32_link_hash_table_create): Likewise.
967 * elf32-or1k.c (or1k_elf_link_hash_table_create),
968 (or1k_elf_check_relocs): Likewise.
969 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
970 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
971 * elf32-s390.c (elf_s390_link_hash_table_create),
972 (elf_s390_check_relocs): Likewise.
973 * elf32-score.c (score_elf_create_got_section),
974 (s3_elf32_score_new_section_hook),
975 (elf32_score_link_hash_table_create): Likewise.
976 * elf32-score7.c (score_elf_create_got_section),
977 (s7_elf32_score_new_section_hook): Likewise.
978 * elf32-sh.c (sh_elf_link_hash_table_create),
979 (sh_elf_check_relocs): Likewise.
980 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
981 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
982 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
983 (tilepro_elf_check_relocs): Likewise.
984 * elf32-v850.c (remember_hi16s_reloc): Likewise.
985 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
986 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
987 (elf_xtensa_new_section_hook): Likewise.
988 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
989 (get_got_entry, elf64_alpha_check_relocs): Likewise.
990 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
991 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
992 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
993 * elf64-ppc.c (ppc64_elf_new_section_hook),
994 (ppc64_elf_link_hash_table_create, update_local_sym_info),
995 (update_plt_info, ppc64_elf_check_relocs): Likewise.
996 * elf64-s390.c (elf_s390_link_hash_table_create),
997 (elf_s390_check_relocs): Likewise.
998 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
999 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1000 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1001 (elf_link_add_archive_symbols, compute_bucket_count),
1002 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1003 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1004 (bfd_elf_final_link): Likewise.
1005 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1006 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1007 (elfNN_aarch64_new_section_hook): Likewise.
1008 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1009 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1010 (riscv_elf_check_relocs): Likewise.
1011 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1012 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1013 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1014 (_bfd_mips_elf_link_hash_table_create): Likewise.
1015 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1016 (_bfd_sparc_elf_check_relocs),
1017 (_bfd_sparc_elf_new_section_hook): Likewise.
1018 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1019 (tilegx_elf_check_relocs): Likewise.
1020 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1021 * format.c (bfd_check_format_matches): Likewise.
1022 * hash.c (_bfd_stringtab_init): Likewise.
1023 * ihex.c (ihex_scan): Likewise.
1024 * irix-core.c (irix_core_core_file_p): Likewise.
1025 * linker.c (bfd_wrapped_link_hash_lookup),
1026 (_bfd_generic_link_hash_table_create),
1027 (_bfd_generic_reloc_link_order): Likewise.
1028 * lynx-core.c (lynx_core_file_p): Likewise.
1029 * netbsd-core.c (netbsd_core_file_p): Likewise.
1030 * osf-core.c (osf_core_core_file_p): Likewise.
1031 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1032 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1033 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1034 * peicode.h (pe_mkobject): Likewise.
1035 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1036 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1037 * sco5-core.c (read_uarea): Likewise.
1038 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1039 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1040 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1041 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1042 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1043 * srec.c (srec_scan): Likewise.
1044 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1045 * targets.c (bfd_target_list): Likewise.
1046 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1047 * trad-core.c (trad_unix_core_file_p): Likewise.
1048 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1049 (vms_new_section_hook): Likewise.
1050 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1051 * xcofflink.c (xcoff_get_section_contents),
1052 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1053 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1054 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1055
1056 2020-02-19 Alan Modra <amodra@gmail.com>
1057
1058 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1059
1060 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1061
1062 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1063 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1064 a build_list_p argument. Don't search plugin_list. Short circuit
1065 when building the plugin list.
1066 (has_plugin): Renamed to has_plugin_list.
1067 (bfd_plugin_set_plugin): Don't set has_plugin.
1068 (bfd_plugin_specified_p): Check plugin_list instead.
1069 (build_plugin_list): New function.
1070 (load_plugin): Call build_plugin_list and use plugin_list.
1071
1072 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1073
1074 PR binutils/25355
1075 * plugin.c (try_claim): Always clean up for LTO wrapper.
1076 (try_load_plugin): Treat each object as independent. Create a
1077 copy for plugin name.
1078
1079 2020-02-11 Nick Clifton <nickc@redhat.com>
1080
1081 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1082 for addresses in print statements.
1083 (msp430_elf_relax_delete_bytes): Likewise.
1084 (msp430_elf_relax_add_words): Likewise.
1085 (msp430_elf_relax_section): Likewise.
1086
1087 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1088
1089 * plugin.c (add_symbols): Clear plugin_data memory.
1090
1091 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1092
1093 PR binutils/25355
1094 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1095 (EXECUTABLE_SUFFIX): Likewise.
1096 * config.in: Regenerated.
1097 * configure: Likewise.
1098 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1099 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1100 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1101 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1102 (get_lto_wrapper): New.
1103 (setup_lto_wrapper_env): Likewise.
1104 (current_plugin): Likewise.
1105 (register_all_symbols_read): Likewise.
1106 (register_cleanup): Likewise.
1107 (get_symbols): Likewise.
1108 (add_input_file): Likewise.
1109 (bfd_plugin_close_and_cleanup): Likewise.
1110 (claim_file): Removed.
1111 (register_claim_file): Set current_plugin->claim_file.
1112 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1113 lto_syms in current_plugin.
1114 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1115 all_symbols_read handler. Copy real symbols to plugin_data.
1116 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1117 (try_load_plugin): Don't reuse the previous plugin for LTO
1118 wrapper. Set up GCC LTO wrapper if possible. Don't set
1119 plugin_list_iter->claim_file.
1120 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1121 possible.
1122 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1123 real_syms.
1124
1125 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1126
1127 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1128 check if previous instruction matches a conditional jump inserted
1129 earlier. Invert conditional jump and delete branch in this case.
1130
1131 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1132
1133 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1134 msp430_elf_relax_add_words. Support insertion of either one or two
1135 words.
1136 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1137 needs to be grown. Handle insertion of branch instruction to replace
1138 jump.
1139
1140 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1141
1142 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1143 debugging relocations.
1144 (msp430_elf_relax_delete_bytes): Likewise.
1145 (msp430_elf_relax_add_two_words): Likewise.
1146 (msp430_elf_relax_section): Likewise.
1147
1148 2020-02-10 Alan Modra <amodra@gmail.com>
1149
1150 * archures.c: Wrap overlong z80 comments.
1151 * bfd-in2.h: Regenerate.
1152
1153 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1154
1155 PR 25469
1156 * archures.c: Add GBZ80 and Z80N machine values.
1157 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1158 * coff-z80.c: Add support for new reloc.
1159 * coffcode.h: Add support for new machine values.
1160 * cpu-z80.c: Add support for new machine names.
1161 * elf32-z80.c: Add support for new reloc.
1162 * bfd-in2.h: Regenerate.
1163 * libbfd.h: Regenerate.
1164
1165 2020-02-07 Nick Clifton <nickc@redhat.com>
1166
1167 PR 23932
1168 * elf.c (rewrite_elf_program_header): Do not complain if no
1169 sections are mapped to a segment.
1170
1171 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1172
1173 PR ld/25490
1174 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1175 for garbage collection on __patchable_function_entries section
1176 without linked-to section.
1177
1178 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1179
1180 PR gas/25381
1181 * bfd-in2.h: Regenerated.
1182 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1183 on section if gc_mark of any of its linked-to sections is set
1184 and don't set gc_mark again.
1185 * section.c (asection): Add linked_to_symbol_name to map_head
1186 union.
1187
1188 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
1189
1190 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1191 reporting an unrecognized instruction with R_V850_LONGJUMP.
1192
1193 2020-02-05 Alan Modra <amodra@gmail.com>
1194
1195 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1196
1197 2020-02-04 Alan Modra <amodra@gmail.com>
1198
1199 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1200 R_PPC_VLE_ADDR20, goto copy_reloc.
1201
1202 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1203
1204 * bfd-in2.h: Regenerated.
1205 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1206
1207 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1208
1209 PR gas/25380
1210 * bfd-in2.h: Regenerated.
1211 * ecoff.c (bfd_debug_section): Add section_id.
1212 * section.c (bfd_section): Add section_id.
1213 (SEC_ASSEMBLER_SECTION_ID): New.
1214 (BFD_FAKE_SECTION): Add section_id.
1215
1216 2020-02-01 Nick Clifton <nickc@redhat.com>
1217
1218 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1219 obsolete list.
1220
1221 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1222
1223 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1224 encodings are relative to the GOT on nios2, too.
1225
1226 2020-01-31 Alan Modra <amodra@gmail.com>
1227
1228 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1229 file. Use $< and $@ in rules.
1230 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1231 (elf32-ia64.c, elf64-ia64.c): Likewise.
1232 (elf32-riscv.c, elf64-riscv.c): Likewise.
1233 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1234 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1235 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1236 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1237 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1238 * Makefile.in: Regenerate.
1239
1240 2020-01-31 Alan Modra <amodra@gmail.com>
1241
1242 PR 4110
1243 * elf.c (setup_group): Don't clear entire section contents,
1244 just the padding after group flags. Release alloc'd memory
1245 after a seek or read failure.
1246
1247 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1248
1249 * peXXigen.c (pe_is_repro): New function.
1250 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1251 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1252
1253 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1254
1255 * peXXigen.c (debug_type_names): Add names for new debug data type
1256 values.
1257
1258 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1259
1260 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1261 inner loop. Fix a memory leak.
1262
1263 2020-01-30 Alan Modra <amodra@gmail.com>
1264
1265 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1266 or obj_coff_keep_strings here.
1267 (coff_get_normalized_symtab): Free external syms directly.
1268 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1269 on error exit path.
1270
1271 2020-01-27 Jim Wilson <jimw@sifive.com>
1272
1273 * cpu-riscv.c (riscv_scan): New.
1274 (N): Change bfd_default_scan to riscv_scan.
1275
1276 2020-01-27 Andreas Schwab <schwab@suse.de>
1277
1278 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1279 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1280 * Makefile.in: Regenerate.
1281 * cpu-plugin.c: Remove.
1282 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1283 (bfd_plugin_arch): Remove declaration.
1284 * bfd-in2.h: Regenerate.
1285 * po/SRC-POTFILES.in: Regenerate.
1286
1287 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1288 Alan Modra <amodra@gmail.com>
1289
1290 PR ld/25458
1291 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1292
1293 2020-01-24 Jim Wilson <jimw@sifive.com>
1294
1295 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1296 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1297 avoid over long line.
1298
1299 2020-01-24 Nick Clifton <nickc@redhat.com>
1300
1301 PR 25447
1302 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1303 syms and keep strings flags as these may have been set in order to
1304 prevent a bogus call to free.
1305
1306 2020-01-23 Nick Clifton <nickc@redhat.com>
1307
1308 * po/fr.po: Updated French translation.
1309
1310 2020-01-23 Alan Modra <amodra@gmail.com>
1311
1312 PR 25444
1313 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1314 by zero when p_align is zero.
1315
1316 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1317
1318 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1319 (riscv_prefix_cmp): Likewise.
1320 (riscv_non_std_ext_p): Deleted.
1321 (riscv_std_sv_ext_p): Likewise.
1322 (riscv_non_std_sv_ext_p): Likewise.
1323 (riscv_merge_non_std_and_sv_ext): Rename to...
1324 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1325 (riscv_merge_arch_attr_info): Replace 3 calls to
1326 riscv_merge_non_std_and_sv_ext with single call to
1327 riscv_merge_multi_letter_ext.
1328 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1329 encounter a 'z' prefix.
1330 (riscv_get_prefix_class): New function, return prefix class based
1331 on first few characters of input string.
1332 (riscv_parse_config): New structure to factor out minor differences
1333 in extension class parsing behaviour.
1334 (riscv_parse_sv_or_non_std_ext): Rename to...
1335 (riscv_parse_prefixed_ext): and parameterise with
1336 riscv_parse_config.
1337 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
1338 (riscv_multi_letter_ext_valid_p): New.
1339 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
1340 (riscv_parse_subset): Delegate all non-single-letter parsing work
1341 to riscv_parse_prefixed_ext.
1342 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
1343 (riscv_get_prefix_class): Declare.
1344
1345 2020-01-22 Alan Modra <amodra@gmail.com>
1346
1347 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
1348 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
1349 __tls_get_addr_desc.
1350 (ppc64_elf_size_stubs): Add section for linker generated
1351 __tls_get_addr_desc wrapper function. Loop at least once if
1352 generating this function.
1353 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
1354 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
1355
1356 2020-01-22 Alan Modra <amodra@gmail.com>
1357
1358 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
1359 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
1360 tga_desc_fd.
1361 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
1362 (STDU_R1_0R1, ADDI_R1_R1): Define.
1363 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
1364 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
1365 tga_desc_fd to opt_fd, and tga_desc to opt. Set
1366 no_tls_get_addr_regsave.
1367 (branch_reloc_hash_match): Add hash3 and hash4.
1368 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
1369 (ppc64_elf_size_dynamic_sections): Likewise.
1370 (ppc64_elf_relocate_section): Likewise.
1371 (plt_stub_size, build_plt_stub): Likewise. Size regsave
1372 __tls_get_addr stub.
1373 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
1374 eh_frame.
1375 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1376 eh_frame for regsave __tls_get_addr.
1377
1378 2020-01-22 Alan Modra <amodra@gmail.com>
1379
1380 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1381 which __tls_get_addr calls will be eliminated.
1382
1383 2020-01-20 Nick Clifton <nickc@redhat.com>
1384
1385 * po/pt.po: Updates Portuguese translation.
1386 * po/ru.po: Updated Russian translation.
1387 * po/uk.po: Updated Ukranian translation.
1388
1389 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
1390
1391 PR ld/25416
1392 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
1393 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
1394 X32 mode.
1395 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
1396 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
1397 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
1398 "rex leal x@tlsdesc(%rip), %reg" to
1399 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
1400 "call *(%eax)" to "nopl (%rax)".
1401
1402 2020-01-20 Alan Modra <amodra@gmail.com>
1403
1404 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
1405 (MTLR_R11): Don't define.
1406 (LD_R0_0R3, CMPDI_R0_0): Define.
1407 (build_tls_get_addr_stub): Don't use r11 in stub.
1408
1409 2020-01-20 Alan Modra <amodra@gmail.com>
1410
1411 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1412 (defined_sym_val, is_tls_get_addr): Likewise.
1413
1414 2020-01-18 Nick Clifton <nickc@redhat.com>
1415
1416 * version.m4 (BFD_VERSION): Set to 2.34.50.
1417 * configure: Regenerate.
1418 * po/bfd.pot: Regenerate.
1419
1420 2020-01-18 Nick Clifton <nickc@redhat.com>
1421
1422 Binutils 2.34 branch created.
1423
1424 2020-01-17 Christian Biesinger <cbiesinger@google.com>
1425
1426 * coff-arm.c: Fix spelling error (seperate).
1427 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1428 error (seperate).
1429 * sysdep.h (strnlen): Fix spelling error (seperate).
1430
1431 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
1432
1433 PR 20694
1434 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1435
1436 2020-01-15 Alan Modra <amodra@gmail.com>
1437
1438 PR 25384
1439 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
1440 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
1441 of function symbols unless dot symbols are present. Do warn
1442 whenever one is created, regardles of whether a PLT entry is
1443 also emitted for the function symbol.
1444
1445 2020-01-14 Alan Modra <amodra@gmail.com>
1446
1447 * som.c (som_bfd_count_ar_symbols): Error when file position
1448 of symbols on chains is not strictly increasing.
1449
1450 2020-01-14 Alan Modra <amodra@gmail.com>
1451
1452 * vms.h (VMS_DEBUG): Define as 0.
1453 * vms-alpha.c (image_write): Move debug output after bounds check.
1454 Tidy bounds check.
1455 (_bfd_vms_slurp_eihd): Warning fix.
1456 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1457
1458 2020-01-13 Alan Modra <amodra@gmail.com>
1459
1460 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1461 for "ignored" records.
1462
1463 2020-01-13 Alan Modra <amodra@gmail.com>
1464
1465 * wasm-module.c (wasm_scan_name_function_section): Formatting.
1466 Delete asect name check. Move asect NULL check to wasm_object_p.
1467 Correct bounds check of sizes against end. Replace uses of
1468 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
1469 just one bfd_release.
1470 (wasm_scan): Don't use malloc/strdup for section names,
1471 bfd_alloc instead. Simplify code prefixing section name.
1472 Formatting. Don't attempt to free memory here..
1473 (wasm_object_p): ..do so here.
1474
1475 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1476
1477 PR ld/22269
1478 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1479 UNDEFWEAK_NO_DYNAMIC_RELOC.
1480 (allocate_dynrelocs_for_symbol): Likewise.
1481
1482 2020-01-10 Tamar Christina <tamar.christina@arm.com>
1483
1484 PR 25210
1485 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1486
1487 2020-01-10 Alan Modra <amodra@gmail.com>
1488
1489 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1490
1491 2020-01-09 Nick Clifton <nickc@redhat.com>
1492
1493 PR 25221
1494 * bfd.c (bfd_convert_section_contents): Check for a compress
1495 header size that is larger than the actual section size.
1496
1497 2020-01-08 Alan Modra <amodra@gmail.com>
1498
1499 PR 25351
1500 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1501 after removing sections.
1502
1503 2020-01-06 Jim Wilson <jimw@sifive.com>
1504
1505 PR 25205
1506 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
1507 check for !bfd_link_pic (info).
1508 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
1509 <R_RISCV_JAL>: Add comment.
1510 (_bfd_riscv_relax_section): For plt.offset check, add check for
1511 bfd_link_pic (info). Add comment.
1512
1513 2020-01-06 Alan Modra <amodra@gmail.com>
1514
1515 * format.c (bfd_check_format_matches): Ignore bfd_error on target
1516 match failures. Don't init to bfd_error_wrong_format before
1517 calling _bfd_check_format.
1518
1519 2020-01-06 Alan Modra <amodra@gmail.com>
1520
1521 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
1522 status rather than exiting on stack overflow or underflow.
1523 (_bfd_vms_slurp_etir): Adjust to suit.
1524
1525 2020-01-06 Alan Modra <amodra@gmail.com>
1526
1527 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
1528
1529 2020-01-06 Alan Modra <amodra@gmail.com>
1530
1531 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
1532 command. Check name offset is within command.
1533 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
1534 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
1535 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
1536 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
1537 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
1538 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
1539 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
1540 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
1541 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
1542 (bfd_mach_o_read_segment): Similarly.
1543 (bfd_mach_o_read_thread): Properly bound check thread struct.
1544 Don't repeat checks on second loop.
1545 (bfd_mach_o_read_command): Fail on invalid command length.
1546
1547 2020-01-04 Alan Modra <amodra@gmail.com>
1548
1549 * format.c (bfd_check_format_matches): Add preserve_match.
1550 Save initial bfd state in "preserve", matched bfd state in
1551 "preserve_match". Save just the first match. Release
1552 bfd_alloc memory. Restore and finish preserved state as
1553 appropriate on all function exit paths.
1554
1555 2020-01-04 Alan Modra <amodra@gmail.com>
1556
1557 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
1558
1559 2020-01-04 Alan Modra <amodra@gmail.com>
1560
1561 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
1562 match too.
1563
1564 2020-01-03 Nick Clifton <nickc@redhat.com>
1565
1566 PR 25307
1567 (bfd_pef_parse_function_stubs): Correct the test that ensures that
1568 there is enough data remaining in the code buffer before
1569 attempting to read a function stub.
1570
1571 2020-01-03 Nick Clifton <nickc@redhat.com>
1572
1573 PR 25308
1574 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
1575 return value from bfd_malloc.
1576 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1577 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
1578 (elf32_arm_filter_cmse_symbols): Likewise.
1579 (elf32_arm_write_section): Likewise.
1580 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1581 (bfd_mach_o_follow_dsym): Likewise.
1582 * pef.c (bfd_pef_print_loader_section): Likewise.
1583 (bfd_pef_scan_start_address): Likewise.
1584 (bfd_pef_parse_function_stubs): Likewise.
1585 (bfd_pef_parse_symbols): Likewise.
1586
1587 2020-01-03 Sergei Trofimovich <siarheit@google.com>
1588
1589 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
1590 on binary inputs ld/PR25316.
1591 (is_ia64_elf): new helper to filter on ia64 objects.
1592
1593 2020-01-03 Jan Beulich <jbeulich@suse.com>
1594
1595 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
1596 in parameter names.
1597 (bfd_mach_o_scan): Insert underscore in two variable names.
1598
1599 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
1600
1601 * Makefile.am: Add z80-elf target support.
1602 * configure.ac: Likewise.
1603 * targets.c: Likewise.
1604 * Makefile.in: Regenerate.
1605 * configure: Regenerate.
1606 * config.bfd: Add z80-elf target support and new arches: ez80 and
1607 z180.
1608 * elf32-z80.c: New file.
1609 * archures.c: Add new z80 architectures: eZ80 and Z180.
1610 * coffcode.h: Likewise.
1611 * cpu-z80.c: Likewise.
1612 * coff-z80.c: Add new relocations for Z80 target and local label
1613 check.
1614 * reloc.c: Add new relocs.
1615 * bfd-in2.h: Regenerate.
1616 * libbfd.h: Regenerate.
1617
1618 2020-01-02 Tamar Christina <tamar.christina@arm.com>
1619
1620 PR 25210
1621 PR 24753
1622 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
1623
1624 2020-01-01 Alan Modra <amodra@gmail.com>
1625
1626 Update year range in copyright notice of all files.
1627
1628 For older changes see ChangeLog-2019
1629 \f
1630 Copyright (C) 2020 Free Software Foundation, Inc.
1631
1632 Copying and distribution of this file, with or without modification,
1633 are permitted in any medium without royalty provided the copyright
1634 notice and this notice are preserved.
1635
1636 Local Variables:
1637 mode: change-log
1638 left-margin: 8
1639 fill-column: 74
1640 version-control: never
1641 End:
This page took 0.094214 seconds and 5 git commands to generate.