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