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