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