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