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