1 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
3 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
5 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
7 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
9 2020-04-21 Nick Clifton <nickc@redhat.com>
11 * po/sr.po: Updated Serbian translation.
13 2020-04-21 Alan Modra <amodra@gmail.com>
15 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
18 2020-04-20 Stephen Casner <casner@acm.org>
20 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
21 causing globals from linker script to be treated as debug symbols.
22 (translate_symbol_table): Don't sign-extend symbol values from 16
23 to 64 bits in nm output.
25 2020-04-20 Alan Modra <amodra@gmail.com>
27 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
29 2020-04-18 Alan Modra <amodra@gmail.com>
31 * section.c (bfd_is_const_section): Correct test for special
33 * bfd-in2.h: Regenerate.
35 2020-04-17 Alan Modra <amodra@gmail.com>
38 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
41 2020-04-16 Nick Clifton <nickc@redhat.com>
44 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
45 abort with a more helpful error message.
47 2020-04-16 Alan Modra <amodra@gmail.com>
50 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
53 2020-04-15 Fangrui Song <maskray@google.com>
56 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
57 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
58 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
59 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
60 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
61 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
62 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
63 * elf32-sh.c (sh_elf_relocate_section): Likewise.
64 * elf32-spu.c (spu_elf_relocate_section): Likewise.
65 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
66 * elflink.c (elf_link_output_extsym): Likewise.
67 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
69 2020-04-15 Alan Modra <amodra@gmail.com>
72 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
73 pointer into strings that may be freed for section name, always
74 allocate a new string.
76 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
77 Jan W. Jagersma <jwjagersma@gmail.com>
79 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
80 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
81 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
82 (_bfd_go32_mkobject): New functions.
83 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
84 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
85 (go32exe_mkobject): Call _bfd_go32_mkobject.
86 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
87 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
89 (coff_write_relocs): Enable extended reloc counter code if
90 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
91 (coff_write_object_contents): Likewise. Pad section headers
92 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
93 instead of coff_swap_scnhdr_out.
94 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
95 enable extended reloc counter.
96 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
97 Declare with ATTRIBUTE_UNUSED.
98 * libcoff-in.h: (struct coff_tdata): New field go32.
100 * libcoff.h: Regenerate.
102 2020-04-14 Fangrui Song <maskray@google.com>
105 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
108 2020-04-14 Stephen Casner <casner@acm.org>
111 * pdp11.c: Add implementation of --imagic option.
112 (adjust_o_magic): Fix objcopy --extract-symbol test.
113 * libaout.h (enum aout_magic): Add i_magic.
115 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
116 Nick Clifton <nickc@redhat.com>
118 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
120 <default>: Error rather than abort.
122 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
125 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
126 relocation section from section group.
128 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
130 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
131 bfd->origin to file offset.
132 * bfdwin.c (bfd_get_file_window): Likewise.
133 * bfd.c: Clarify the use of the bfd->origin field.
134 * bfd-in2.h: Regenerate.
135 * coff-i386.c: Don't include go32exe.h. Allow overriding
136 coff_write_object_contents via COFF_WRITE_CONTENTS.
137 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
138 (go32exe_write_object_contents): New functions.
139 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
140 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
141 (create_go32_stub): Remove check for 2k size limit. Read stub
142 from go32exe_temp_stub if present.
143 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
144 copy variable-length stub.
145 (go32_check_format): Read stub to go32exe_temp_stub, set
146 origin, return go32exe_cleanup.
147 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
148 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
149 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
150 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
151 Remove functions and their associated #defines.
152 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
153 * libcoff-in.h: (struct coff_tdata): New field stub_size.
154 Rename field go32stub to stub.
155 * libcoff.h: Regenerate.
156 * coff-stgo32.c (go32_check_format): Rename to...
157 (go32exe_check_format): ...this.
158 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
159 (go32exe_copy_private_bfd_data): ...this.
160 (stub_bytes): Rename to...
161 (go32exe_default_stub): ...this.
162 (create_go32_stub): Rename to...
163 (go32exe_create_stub): ...this.
164 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
167 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
171 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
172 relocation to R_386_32 for relocation against non-preemptible
174 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
175 allocate dynamic relocation for non-preemptible absolute symbol.
176 (elf_i386_relocate_section): Pass sec to
177 GENERATE_DYNAMIC_RELOCATION_P.
178 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
179 (elf_x86_64_convert_load_reloc): Covert load relocation to
180 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
181 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
182 for non-preemptible absolute symbol if they overflow.
183 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
184 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
185 symbol. Don't allocate dynamic relocation for non-preemptible
187 (elf_x86_64_relocate_section): Don't generate relative relocation
188 for GOTPCREL relocations aganst local absolute symbol. Pass sec
189 to GENERATE_DYNAMIC_RELOCATION_P.
190 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
191 against non-preemptible absolute symbol.
192 (_bfd_elf_x86_valid_reloc_p): New function.
193 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
195 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
196 argument. Don't generate dynamic relocation against
197 non-preemptible absolute symbol.
199 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
200 against non-preemptible absolute symbol.
202 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
203 (_bfd_elf_x86_valid_reloc_p): New.
205 2020-04-01 Tamar Christina <tamar.christina@arm.com>
208 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
209 address in the GOT if in thumb only mode.
211 2020-04-01 Tamar Christina <tamar.christina@arm.com>
213 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
215 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
217 * mmo.c (mmo_scan): Create .text section only when needed, not
220 2020-03-31 Alan Modra <amodra@gmail.com>
222 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
225 2020-03-31 Alan Modra <amodra@gmail.com>
227 * vms-alpha.c (image_write): Check bounds for sections without
228 contents too. Error on non-zero write to section without
230 (_bfd_vms_slurp_etir): Check return of image_write* functions.
232 2020-03-31 Alan Modra <amodra@gmail.com>
234 * tekhex.c (pass_over): Check is_eof before reading buffer.
236 2020-03-30 Nick Clifton <nickc@redhat.com>
239 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
240 field to timestamp and make it an integer.
241 * libcoff.h: Regenerate.
242 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
243 field in the pe_data structure rather than the insert_timestamp
246 2020-03-30 Alan Modra <amodra@gmail.com>
249 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
252 2020-03-26 Nick Clifton <nickc@redhat.com>
254 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
255 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
257 * libbfd.h: Regenerate.
259 2020-03-26 Alan Modra <amodra@gmail.com>
261 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
263 2020-03-26 Alan Modra <amodra@gmail.com>
265 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
267 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
269 2020-03-25 Nick Clifton <nickc@redhat.com>
271 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
273 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
274 * libbfd.h: Regenerate.
276 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
278 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
279 correct field name in the output string.
281 2020-03-25 Alan Modra <amodra@gmail.com>
284 * elf.c (assign_file_positions_for_load_sections): Adjust offset
285 for SHT_NOBITS section if first in segment.
287 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
290 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
291 (_bfd_elf_get_symbol_version_string): This.
292 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
293 (_bfd_elf_get_symbol_version_string): This.
294 (bfd_elf_print_symbol): Pass TRUE to
295 _bfd_elf_get_symbol_version_string.
296 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
297 bfd_boolean argument.
298 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
299 * targets.c (_bfd_get_symbol_version_string): Likewise.
300 (bfd_get_symbol_version_string): Likewise.
301 * bfd-in2.h: Regenerated.
303 2020-03-24 Nick Clifton <nickc@redhat.com>
304 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
307 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
310 2020-03-24 Nick Clifton <nickc@redhat.com>
313 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
314 segment to use for PT_GNU_RELRO, ignore empty sections in a
315 segment's current list.
317 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
320 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
322 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
325 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
326 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
327 on the previous _bfd_elf_get_symbol_version_string.
328 (_bfd_elf_get_symbol_version_string): Use it.
330 2020-03-24 Alan Modra <amodra@gmail.com>
332 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
333 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
336 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
338 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
340 2020-03-23 Alan Modra <amodra@gmail.com>
342 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
343 symbol count. Allocate an extra byte to ensure name strings
344 are terminated. Sanity check name offsets. Release memory on
347 2020-03-23 Alan Modra <amodra@gmail.com>
349 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
350 field hasn't been read. Remove unnecessary casts.
352 2020-03-22 Alan Modra <amodra@gmail.com>
354 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
355 enough to read number of symbols.
357 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
359 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
360 (EXECUTABLE_SUFFIX): Likewise.
361 * config.in: Regenerated.
362 * configure: Likewise.
363 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
364 _bfd_generic_close_and_cleanup.
365 (plugin_list_entry): Remove resolution_file, resolution_option,
366 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
367 lto_wrapper, gcc_env and initialized,
368 (need_lto_wrapper_p): Removed.
369 (get_lto_wrapper): Likewise.
370 (setup_lto_wrapper_env): Likewise.
371 (register_all_symbols_read): Likewise.
372 (egister_cleanup): Likewise.
373 (get_symbols): Likewise.
374 (add_input_file): Likewise.
375 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
376 (add_symbols): Updated.
377 (try_claim): Likewise.
378 (try_load_plugin): Likewise.
379 (bfd_plugin_canonicalize_symtab): Likewise.
380 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
381 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
383 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
386 * plugin.c (plugin_list_entry): Add has_symbol_type.
387 (add_symbols_v2): New function.
388 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
389 provides symbol type.
390 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
391 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
394 2020-03-20 Alan Modra <amodra@gmail.com>
396 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
397 enough to read number of symbols.
399 2020-03-20 Alan Modra <amodra@gmail.com>
401 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
402 backend functions for NULL before calling.
403 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
404 (bfd_section_from_shdr, assign_section_numbers): Likewise.
405 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
406 * elfnn-ia64.c (ignore_errors): New function.
407 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
409 2020-03-19 Nick Clifton <nickc@redhat.com>
412 * dwarf2.c (struct varinfo): Add unit_offset field to record the
413 location of the varinfo in the unit's debug info data. Change the
414 type of the stack field to a boolean.
415 (lookup_var_by_offset): New function. Returns the varinfo
416 structure for the variable described at the given offset in the
418 (scan_unit_for_symbols): Add support for variables which have the
419 DW_AT_specification attribute.
421 2020-03-19 Nick Clifton <nickc@redhat.com>
424 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
427 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
429 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
431 2020-03-18 Nick Clifton <nickc@redhat.com>
434 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
435 memory access when processing a corrupt secondary reloc section.
437 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
439 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
440 instead of calling abort.
441 * elf32-csky.c (csky_build_one_stub): Likewise.
442 * elf32-hppa.c (hppa_build_one_stub): Likewise.
443 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
444 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
445 * elf32-metag.c (metag_build_one_stub): Likewise.
446 * elf32-nios2.c (nios2_build_one_stub): Likewise.
447 * elf64-ppc.c (ppc_build_one_stub): Likewise.
448 (ppc_size_one_stub): Likewise.
449 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
451 2020-03-17 Nick Clifton <nickc@redhat.com>
454 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
457 2020-03-17 Nick Clifton <nickc@redhat.com>
460 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
461 free. Add free on another failure path.
463 2020-03-16 Alan Modra <amodra@gmail.com>
466 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
467 we have a non-zero section count. Do lma comparison in octets.
469 2020-03-16 Alan Modra <amodra@gmail.com>
471 * vms-alpha.c (dst_restore_location): Validate index into
472 dst_ptr_offsets array before accessing. Return status.
473 (dst_retrieve_location): Similarly, making "loc" parameter a
474 pointer to return value.
475 (_bfd_vms_slurp_etir): Update calls to above functions.
477 2020-03-14 Kamil Rytarowski <n54@gmx.com>
479 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
481 * configure: Regenerated.
483 2020-03-14 Alan Modra <amodra@gmail.com>
485 * section.c (BFD_FAKE_SECTIONS): Formatting.
486 * bfd-in2.h: Regenerate.
488 2020-03-13 Kamil Rytarowski <n54@gmx.com>
490 * elf.c (elfcore_grok_netbsd_note): Add support for
491 NT_NETBSDCORE_LWPSTATUS notes.
493 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
495 * bfd-in2.h: Regenerate.
496 * section.c (asection): Add already_assigned field.
497 (BFD_FAKE_SECTION): Add default initializer for it.
498 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
499 * elf32-arm.c (arm_build_one_stub): Add support for
500 non_contiguous_regions.
501 * elf32-csky.c (csky_build_one_stub): Likewise.
502 * elf32-hppa.c (hppa_build_one_stub): Likewise.
503 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
504 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
505 * elf32-metag.c (metag_build_one_stub): Likewise.
506 * elf32-nios2.c (nios2_build_one_stub): Likewise.
507 * elf64-ppc.c (ppc_build_one_stub): Likewise.
508 (ppc_size_one_stub): Likewise.
509 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
510 * elflink.c (elf_link_input_bfd): Likewise.
512 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
515 * elf-linker-x86.h (elf_linker_x86_params): Add
516 static_before_all_inputs and has_dynamic_linker.
517 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
518 dynamic input objects if -static is passed at command-line
519 before all input files without --dynamic-linker unless
520 --no-dynamic-linker is used.
522 2020-03-13 Kamil Rytarowski <n54@gmx.com>
524 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
526 2020-03-13 Christian Eggers <ceggers@gmx.de>
528 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
530 * elfcode.h (bfd_from_remote_memory): Add units to several
531 parameters. New local "opb". Fix usage of p_align. Fix
532 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
533 call of target_read_memory.
534 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
535 calculation of "offset" and "output_offset".
536 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
537 from "offset" and fix calculation of "end" from "vma+size". Fix
538 comparison between "sh_addr" and "vma"/"output_offset".
539 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
540 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
542 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
543 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
544 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
545 assignment of p_paddr from phdr_lma. Fix comparison between
546 "lma+size" and "next->lma".
547 (elf_sort_segments): Fix assignment from p_paddr to lma.
548 (assign_file_positions_for_load_sections): Add unit (bytes) to
549 local "align". Fix calculation of local "off_adjust". Fix
550 calculation of local "filehdr_vaddr".
551 (assign_file_positions_for_non_load_sections): New local "opb".
552 Fix calculation of "end" from "p_size". Fix comparison between
553 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
554 from "end" and "p_vaddr".
555 (rewrite_elf_program_header): Fix comparison between p_vaddr and
556 vma. Fix assignment to p_paddr from lma. Fix comparison between
557 p_paddr and lma. Fix assignment to p_paddr from lma.
558 * merge.c (sec_merge_emit): New local "opb". Convert
559 "alignment_power" to octets.
560 (_bfd_add_merge_section): New locals "alignment_power" and
561 "opb". Fix comparison between "alignment_power" and
563 (_bfd_merge_sections): New local "opb". Divide size by opb
564 before checking align mask.
566 2020-03-13 Christian Eggers <ceggers@gmx.de>
568 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
569 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
571 (_bfd_elf_make_section_from_phdr): Similarly.
572 (elf_fake_sections): Fix calculation of
573 Elf_Internal_shdr::sh_addr from section VMA.
574 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
576 (assign_file_positions_for_load_sections): Fix calculations of
577 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
578 comparison between program header address and section LMA.
579 (assign_file_positions_for_non_load_sections): Likewise.
580 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
581 (IS_CONTAINED_BY_VMA): Add parameter opb.
582 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
583 INCLUDE_SECTION_IN_SEGMENT): Likewise.
584 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
585 Fix calculations of p_addr_valid and p_vaddr_offset.
586 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
587 with octets per byte when comparing against p_vaddr.
589 2020-03-11 Alan Modra <amodra@gmail.com>
591 * som.c (setup_sections): Sanity check subspace.name.
593 2020-03-11 Alan Modra <amodra@gmail.com>
595 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
597 2020-03-10 Alan Modra <amodra@gmail.com>
600 * ihex.c (ihex_write_object_contents): Don't assume ordering of
603 2020-03-09 Alan Modra <amodra@gmail.com>
605 * wasm-module.c (wasm_scan): Sanity check file name length
606 before allocating memory. Move common section setup code. Do
607 without bfd_tell to calculate section size.
609 2020-03-06 Nick Clifton <nickc@redhat.com>
611 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
612 with error messages and failure return values.
614 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
616 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
617 relocation sections for any removed reference to a dynamic symbol.
619 2020-03-05 Nick Clifton <nickc@redhat.com>
621 * elf-bfd.h (struct elf_backend_data): Add new fields:
622 init_secondary_reloc_section, slurp_secondary_reloc_section,
623 write_secondary_reloc_section.
624 (_bfd_elf_init_secondary_reloc_section): Prototype.
625 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
626 (_bfd_elf_write_secondary_reloc_section): Prototype.
627 * elf.c ( bfd_section_from_shdr): Invoke the new
628 init_secondary_reloc_section backend function, if defined, when a
629 second reloc section is encountered.
630 (swap_out_syms): Invoke the new symbol_section_index function, if
631 defined, when computing the section index of an OS/PROC specific
633 (_bfd_elf_init_secondary_reloc_section): New function.
634 (_bfd_elf_slurp_secondary_reloc_section): New function.
635 (_bfd_elf_write_secondary_reloc_section): New function.
636 (_bfd_elf_copy_special_section_fields): New function.
637 * elfcode.h (elf_write_relocs): Invoke the new
638 write_secondary_relocs function, if defined, in order to emit
640 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
641 function, if defined, in order to read in secondary relocs.
642 * elfxx-target.h (elf_backend_copy_special_section_fields):
643 Provide a non-NULL default definition.
644 (elf_backend_init_secondary_reloc_section): Likewise.
645 (elf_backend_slurp_secondary_reloc_section): Likewise.
646 (elf_backend_write_secondary_reloc_section): Likewise.
647 (struct elf_backend_data elfNN_bed): Add initialisers for the new
649 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
650 * configure: Regenerate.
652 2020-03-05 Alan Modra <amodra@gmail.com>
654 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
655 against file size before allocating memory. Use bfd_alloc rather
656 than bfd_zalloc for carsym/strings memory.
658 2020-03-04 Alan Modra <amodra@gmail.com>
660 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
661 sh_addr mod sh_addalign is zero.
663 2020-03-04 Alan Modra <amodra@gmail.com>
665 * format.c (bfd_check_format_matches): Call cleanup on error exit.
667 2020-03-03 Alan Modra <amodra@gmail.com>
669 * format.c (struct bfd_preserve): Add cleanup field.
670 (bfd_preserve_save): Add cleanup param and save.
671 (bfd_preserve_restore): Return cleanup.
672 (bfd_preserve_finish): Call the cleanup for the discarded match.
673 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
674 and clear when preserving a match. Restore cleanup too when
675 restoring that match.
677 2020-03-02 Alan Modra <amodra@gmail.com>
679 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
680 * hpux-core.c (hpux_core_core_file_p): Update prototype.
681 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
682 (core_sco5_vec): Correct initialisers.
684 2020-03-02 Alan Modra <amodra@gmail.com>
686 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
687 * aix5ppc-core.c (xcoff64_core_p): Likewise.
688 * cisco-core.c (cisco_core_file_validate): Likewise.
689 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
690 * hpux-core.c (hpux_core_core_file_p): Likewise.
691 * irix-core.c (irix_core_core_file_p): Likewise.
692 * lynx-core.c (lynx_core_file_p): Likewise.
693 * netbsd-core.c (netbsd_core_file_p): Likewise.
694 * osf-core.c (osf_core_core_file_p): Likewise.
695 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
696 * sco5-core.c (sco5_core_file_p): Likewise.
698 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
700 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
702 2020-03-02 Alan Modra <amodra@gmail.com>
704 * targets.c (bfd_cleanup): New typedef.
705 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
706 * libbfd-in.h (_bfd_no_cleanup): Define.
707 * format.c (bfd_reinit): Add cleanup parameter, call it.
708 (bfd_check_format_matches): Set cleanup from _bfd_check_format
709 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
710 * aout-target.h (callback, object_p): Return bfd_cleanup.
711 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
712 * archive.c (bfd_generic_archive_p): Likewise.
713 * binary.c (binary_object_p): Likewise.
714 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
715 * coff-ia64.c (ia64coff_object_p): Likewise.
716 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
717 * coff-sh.c (coff_small_object_p): Likewise.
718 * coff-stgo32.c (go32_check_format): Likewise.
719 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
720 (xcoff64_core_p): Likewise.
721 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
722 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
723 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
724 * elfcode.h (elf_object_p): Likewise.
725 * elfcore.h (elf_core_file_p): Likewise.
726 * i386msdos.c (msdos_object_p): Likewise.
727 * ihex.c (ihex_object_p): Likewise.
728 * libaout.h (some_aout_object_p): Likewise.
729 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
730 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
731 * libbfd.c (_bfd_dummy_target): Likewise.
732 * libcoff-in.h (coff_object_p): Likewise.
733 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
734 (bfd_mach_o_arm64_core_p): Likewise.
735 * mach-o-arm.c (bfd_mach_o_arm_object_p),
736 (bfd_mach_o_arm_core_p): Likewise.
737 * mach-o-i386.c (bfd_mach_o_i386_object_p),
738 (bfd_mach_o_i386_core_p): Likewise.
739 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
740 (bfd_mach_o_x86_64_core_p): Likewise.
741 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
742 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
743 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
744 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
745 * mmo.c (mmo_object_p): Likewise.
746 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
747 * peicode.h (coff_real_object_p, pe_ILF_object_p),
748 (pe_bfd_object_p): Likewise.
749 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
750 * ppcboot.c (ppcboot_object_p): Likewise.
751 * rs6000-core.c (rs6000coff_core_p): Likewise.
752 * som.c (som_object_setup, som_object_p): Likewise.
753 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
754 * tekhex.c (tekhex_object_p): Likewise.
755 * vms-alpha.c (alpha_vms_object_p): Likewise.
756 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
757 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
758 * wasm-module.c (wasm_object_p): Likewise.
759 * xsym.c (bfd_sym_object_p): Likewise.
760 * xsym.h (bfd_sym_object_p): Likewise.
761 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
763 * pdp11.c (some_aout_object_p): Likewise.
764 * plugin.c (register_ld_plugin_object_p): Update object_p
766 * plugin.h (register_ld_plugin_object_p): Likewise.
767 * bfd-in2.h: Regenerate.
768 * libbfd.h: Regenerate.
769 * libcoff.h: Regenerate.
771 2020-03-02 Alan Modra <amodra@gmail.com>
773 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
774 applicable section flags.
775 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
776 (mips_ecoff_bele_vec): Likewise.
777 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
779 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
780 (_bfd_ecoff_styp_to_sec_flags): Likewise.
782 2020-03-02 Alan Modra <amodra@gmail.com>
784 * elf32-m32r.c (m32r_elf_section_flags): New function.
785 (elf_backend_section_flags): Define.
786 * elf32-nds32.c (nds32_elf_section_flags): New function.
787 (elf_backend_section_flags): Define.
788 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
789 .sbss and .sdata sections.
790 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
791 for SHF_V850_GPREL sections.
792 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
794 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
795 for SHF_PARISC_SHORT sections.
796 * elf64-ppc.c (ppc64_elf_section_flags): New function.
797 (elf_backend_section_flags): Define.
798 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
799 for SHF_MIPS_GPREL sections. Delete FIXME.
801 2020-03-02 Alan Modra <amodra@gmail.com>
803 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
804 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
805 calling elf_backend_section_flags with adjusted params. Use
806 newsect->flags past that point.
807 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
809 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
810 to have their type overridden, and all sh_flags but processor and
812 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
813 * elf32-mep.c (mep_elf_section_flags): Likewise.
814 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
815 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
816 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
817 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
818 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
819 stub BFD and non-aarch64 input files when scanning for stubs.
821 2020-03-02 Alan Modra <amodra@gmail.com>
823 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
824 limit to decompressed element size.
826 2020-03-02 Alan Modra <amodra@gmail.com>
828 * vms-lib.c (vms_traverse_index): Add recur_count param and
829 update calls. Fail on excessive recursion.
831 2020-03-02 Alan Modra <amodra@gmail.com>
833 * vms-alpha.c (vms_get_remaining_object_record): Use
834 bfd_realloc_or_free rather than bfd_realloc.
835 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
836 (dst_define_location, parse_module): Likewise, and check realloc
837 return status before using memory. Return status from function
838 adjusting all callers.
840 2020-02-28 Alan Modra <amodra@gmail.com>
842 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
844 2020-02-28 Alan Modra <amodra@gmail.com>
846 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
847 Remove duplicate undersize check.
849 2020-02-27 Alan Modra <amodra@gmail.com>
852 * mmo.c (mmo_scan): Set SEC_DATA for .data.
854 2020-02-27 Alan Modra <amodra@gmail.com>
857 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
858 (coff_section_type): Adjust comment.
859 (decode_section_type): Likewise. Call coff_section_type before
861 (bfd_decode_symclass): Use 'c' for common sections other than
864 2020-02-27 Alan Modra <amodra@gmail.com>
866 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
869 2020-02-27 Alan Modra <amodra@gmail.com>
871 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
872 if file is an archive element.
873 * bfd-in2.h: Regenerate.
875 2020-02-26 Alan Modra <amodra@gmail.com>
877 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
878 bfd_set_error on failing test. Don't bother changing bfd_error on
879 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
880 Check sym name is within string buffer. Use size_t for some vars.
881 (do_slurp_coff_armap): Use size_t for some variables, fix size of
882 int_buf. Don't change bfd_error on file read error. Use
883 _bfd_mul_overflow when calculating carsym buffer size. Reorder
884 calculations to catch overflows before they occur. malloc and
885 free raw armap rather than using bfd_alloc. Read raw armap before
886 allocating carsym+strings buffer.
887 (_bfd_slurp_extended_name_table): Localize variables. Check
888 name size against file size.
890 2020-02-26 Alan Modra <amodra@gmail.com>
892 * vms-lib.c (vms_lib_read_index): Release correct buffer.
894 2020-02-26 Alan Modra <amodra@gmail.com>
896 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
897 malloc. Check for NULL return from bfd_malloc.
898 (rx_table_find, rx_table_map): Likewise.
899 (rx_set_section_contents): Check bfd_alloc return.
900 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
902 2020-02-26 Alan Modra <amodra@gmail.com>
904 * aoutx.h: Indent labels correctly. Format error strings.
905 * archive.c: Likewise.
906 * archive64.c: Likewise.
907 * coff-arm.c: Likewise.
908 * coff-rs6000.c: Likewise.
909 * coff-stgo32.c: Likewise.
910 * cpu-arm.c: Likewise.
911 * dwarf2.c: Likewise.
912 * elf-ifunc.c: Likewise.
913 * elf-properties.c: Likewise.
914 * elf-s390-common.c: Likewise.
915 * elf-strtab.c: Likewise.
917 * elf32-arm.c: Likewise.
918 * elf32-bfin.c: Likewise.
919 * elf32-cr16.c: Likewise.
920 * elf32-csky.c: Likewise.
921 * elf32-i386.c: Likewise.
922 * elf32-m68k.c: Likewise.
923 * elf32-msp430.c: Likewise.
924 * elf32-nds32.c: Likewise.
925 * elf32-nios2.c: Likewise.
926 * elf32-pru.c: Likewise.
927 * elf32-xtensa.c: Likewise.
928 * elf64-ia64-vms.c: Likewise.
929 * elf64-x86-64.c: Likewise.
930 * elfcode.h: Likewise.
931 * elfcore.h: Likewise.
932 * elflink.c: Likewise.
933 * elfnn-aarch64.c: Likewise.
934 * elfnn-ia64.c: Likewise.
935 * elfnn-riscv.c: Likewise.
936 * elfxx-mips.c: Likewise.
937 * elfxx-sparc.c: Likewise.
938 * elfxx-x86.c: Likewise.
939 * i386lynx.c: Likewise.
942 * plugin.c: Likewise.
945 2020-02-26 Alan Modra <amodra@gmail.com>
948 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
950 (bfd_elf_add_dt_needed_tag): Declare.
951 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
952 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
953 from elf_add_dt_needed_tag. Remove soname and doit param.
954 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
955 to see whether as-needed lib is already loaded, use dyn_loaded
956 list instead. When saving and restoring around as-needed lib
957 handle possibility that dynstr has not been initialised. Don't
958 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
959 Mark libs loaded via DT_NEEDED entries of other libs with
960 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
962 (elf_link_check_versioned_symbol): Remove now unneccesary
963 DYNAMIC check when traversing dyn_loaded list.
965 2020-02-26 Alan Modra <amodra@gmail.com>
967 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
969 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
972 * plugin.c (need_lto_wrapper_p): New.
973 (bfd_plugin_set_program_name): Add an int argument to set
975 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
977 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
979 2020-02-24 Alan Modra <amodra@gmail.com>
981 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
983 2020-02-24 Alan Modra <amodra@gmail.com>
985 * vms-lib.c (struct carsym_mem): Add limit.
986 (vms_add_index): Heed limit.
987 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
988 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
989 Always return actual number read.
990 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
991 assertion with error exit.
993 2020-02-22 Alan Modra <amodra@gmail.com>
996 * elf.c (assign_file_positions_for_load_sections): Continue linking
997 on "PHDR segment not covered by LOAD segment" errors.
999 2020-02-21 Alan Modra <amodra@gmail.com>
1001 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1003 (bfd_mach_o_canonicalize_reloc): Likewise.
1004 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1005 counts and offsets against file size.
1006 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1007 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1008 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1009 against file size. Delete symbol table error message.
1010 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1012 (bfd_mach_o_read_symtab): Likewise.
1013 (bfd_mach_o_read_command): Pass file size.
1014 (bfd_mach_o_scan): Sanity check command count against file size.
1016 2020-02-21 Alan Modra <amodra@gmail.com>
1019 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1020 "text", "data" and "bss" section pointer vars. Don't update
1021 section size, just exec header sizes.
1022 (adjust_sizes_and_vmas): Don't update text section size. Set
1023 initial exec header a_text. Print exec headers sizes.
1024 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1025 (adjust_sizes_and_vmas): Similarly. Formatting.
1026 (final_link): Correct final file extension.
1028 2020-02-20 Nick Clifton <nickc@redhat.com>
1030 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1032 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1034 (elfNN_bed): Initialise the symbol_section_index field.
1035 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1036 OS and PROC specific section indicies. Warn if converting other
1037 reserved incidies to SHN_ABS.
1039 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1042 * cpu-z80.c: Add machine type compatibility checking.
1044 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1047 * plugin.c (plugin_list_entry): Remove handle.
1048 (try_load_plugin): Call dlclose before return.
1050 2020-02-19 Alan Modra <amodra@gmail.com>
1052 * libbfd-in.h (_bfd_constant_p): Define.
1053 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1054 file size before allocating memory.
1055 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1056 * elf.c (bfd_elf_get_str_section): Likewise.
1057 (_bfd_elf_slurp_version_tables): Likewise.
1058 * libbfd.h: Regenerate.
1060 2020-02-19 Alan Modra <amodra@gmail.com>
1062 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1063 * aoutx.h (aout_get_external_symbols): Replace calls to
1064 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1065 (slurp_reloc_table): Likewise.
1066 * archive.c (do_slurp_bsd_armap): Likewise.
1067 (do_slurp_coff_armap): Likewise.
1068 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1069 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1070 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1071 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1072 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1073 (_bfd_coff_get_external_symbols): Likewise.
1074 * ecoff.c (ecoff_slurp_symbolic_header),
1075 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1076 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1077 (ecoff_indirect_link_order): Likewise.
1078 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1079 (_bfd_elf_slurp_version_tables): Likewise.
1080 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1081 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1082 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1083 * elf64-alpha.c (READ): Likewise.
1084 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1085 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1086 * elfcode.h (elf_slurp_symbol_table),
1087 (elf_slurp_reloc_table_from_section): Likewise.
1088 * elflink.c (elf_link_add_object_symbols),
1089 (elf_link_check_versioned_symbol): Likewise.
1090 * elfxx-mips.c (READ): Likewise.
1091 * i386lynx.c (slurp_reloc_table): Likewise.
1092 * lynx-core.c (lynx_core_file_p): Likewise.
1093 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1094 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1095 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1096 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1097 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1098 (bfd_pef_parse_symbols): Likewise.
1099 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1100 * som.c (setup_sections, som_slurp_string_table),
1101 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1102 (som_bfd_fill_in_ar_symbols): Likewise.
1103 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1104 (evax_bfd_print_image): Likewise.
1105 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1106 * wasm-module.c (wasm_scan): Likewise.
1107 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1108 * xsym.c (bfd_sym_read_name_table),
1109 (bfd_sym_print_type_information_table_entry): Likewise.
1110 * libbfd.h: Regenerate.
1112 2020-02-19 Alan Modra <amodra@gmail.com>
1114 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1115 reading external relocs.
1116 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1117 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1119 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1121 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1122 (m32c_elf_relax_section): Likewise.
1123 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1124 (rl78_elf_relax_section): Likewise.
1125 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1126 (elf32_rx_relax_section): Likewise.
1127 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1128 parameter types and use..
1129 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1130 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1131 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1132 being read from file, just the extra.
1133 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1134 after reading external syms. Free on failure.
1136 2020-02-19 Alan Modra <amodra@gmail.com>
1138 * coffcode.h (buy_and_read, coff_slurp_line_table),
1139 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1140 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1141 corresponding bfd_alloc call. Adjust variables to suit.
1142 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1143 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1144 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1145 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1146 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1147 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1148 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1149 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1150 * elf64-alpha.c (READ): Likewise.
1151 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1152 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1153 (bfd_from_remote_memory): Likewise.
1154 * elfcore.h (core_find_build_id): Likewise.
1155 * elfxx-mips.c (READ): Likewise.
1156 * mach-o.c (bfd_mach_o_mangle_sections),
1157 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1158 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1159 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1160 * som.c (setup_sections, som_prep_for_fixups)
1161 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1162 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1163 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1164 (som_bfd_ar_write_symbol_stuff): Likewise.
1165 * vms-alpha.c (vector_grow1): Likewise.
1166 * vms-lib.c (vms_add_index): Likewise.
1167 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1168 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1169 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1170 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1171 (bfd_alloc2, bfd_zalloc2): Delete.
1172 (_bfd_mul_overflow): Define.
1173 * libbfd.h: Regenerate.
1175 2020-02-19 Alan Modra <amodra@gmail.com>
1177 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1179 (assign_section_numbers): Likewise.
1180 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1181 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1182 bfd_malloc2, size_t amt, and unsigned tls_count.
1183 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1184 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1185 (elf_output_implib): Use bfd_alloc.
1187 2020-02-19 Alan Modra <amodra@gmail.com>
1189 * bfd.c (struct bfd): Move format and direction to other
1190 bitfields. Add "size".
1191 * bfdio.c (bfd_get_size): Cache size when not writing file.
1192 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1193 returning zero, ie. unknown.
1194 (bfd_get_alt_debug_link_info): Likewise.
1195 * bfd-in2.h: Regenerate.
1197 2020-02-19 Alan Modra <amodra@gmail.com>
1199 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1200 bfd_get_file_size twice.
1201 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1202 zero, ie. unknown, return.
1203 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1204 * elfcode.h (elf_swap_shdr_in): Likewise.
1205 (elf_object_p): Don't call bfd_get_file_size twice and correct
1208 2020-02-19 Alan Modra <amodra@gmail.com>
1210 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1211 FALSE if memory alloc fails. Adjust calls.
1212 * som.c (som_prep_for_fixups): Likewise.
1213 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1214 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1215 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1216 * som.c (som_build_and_write_symbol_table): Return via error_return
1218 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1219 (VEC_APPEND_EL): Delete.
1220 (vector_grow1): Return pointer to element. Catch overflow.
1221 Return NULL on memory allocation failure.
1222 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1223 (alpha_vms_add_fixup_ca): Likewise.
1224 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1226 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1228 2020-02-19 Alan Modra <amodra@gmail.com>
1230 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1231 * aout-target.h (object_p): Likewise.
1232 * aout-tic30.c (tic30_aout_object_p): Likewise.
1233 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1234 (emit_stringtab, write_syms, link_hash_table_create),
1235 (aout_link_write_other_symbol): Likewise.
1236 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1237 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1238 (_bfd_compute_and_write_armap): Likewise.
1239 * archures.c (bfd_arch_list): Likewise.
1240 * bfd.c (bfd_record_phdr): Likewise.
1241 * binary.c (binary_canonicalize_symtab): Likewise.
1242 * cisco-core.c (cisco_core_file_validate): Likewise.
1243 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1244 (find_arm_glue, record_arm_to_thumb_glue),
1245 (record_thumb_to_arm_glue): Likewise.
1246 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1247 (ppc_allocate_toc_section): Likewise.
1248 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1249 * coff-sh.c (sh_relax_section): Likewise.
1250 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1251 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1252 (coff_set_alignment_hook, coff_mkobject),
1253 (coff_compute_section_file_positions): Likewise.
1254 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1255 (coff_find_nearest_line_with_names),
1256 ( bfd_coff_set_symbol_class): Likewise.
1257 * cofflink.c (_bfd_coff_link_hash_table_create),
1258 (_bfd_coff_link_input_bfd): Likewise.
1259 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1260 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1261 (build_line_info_table, sort_line_sequences),
1262 (line_info_add_include_dir, line_info_add_file_name),
1263 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1264 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1265 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1266 (_bfd_ecoff_find_nearest_line),
1267 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1268 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1269 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1270 * elf-m10300.c (mn10300_elf_relax_section),
1271 (elf32_mn10300_link_hash_table_create): Likewise.
1272 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1273 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1274 * elf32-arm.c (elf32_arm_link_hash_table_create),
1275 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1276 (elf32_arm_new_section_hook): Likewise.
1277 * elf32-avr.c (elf_avr_new_section_hook),
1278 (elf32_avr_link_hash_table_create, get_local_syms),
1279 (elf32_avr_setup_section_lists): Likewise.
1280 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1281 (bfin_link_hash_table_create): Likewise.
1282 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1283 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1284 * elf32-csky.c (csky_elf_link_hash_table_create),
1285 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1286 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1287 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1288 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1289 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1290 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1291 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1292 (m32r_elf_check_relocs): Likewise.
1293 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1294 (elf32_m68hc11_setup_section_lists),
1295 (elf32_m68hc11_size_stubs): Likewise.
1296 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1297 * elf32-metag.c (elf_metag_link_hash_table_create),
1298 (elf_metag_setup_section_lists): Likewise.
1299 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1300 (microblaze_elf_check_relocs): Likewise.
1301 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1302 (nds32_elf_check_relocs): Likewise.
1303 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1304 (get_local_syms, nios2_elf32_check_relocs),
1305 (nios2_elf32_link_hash_table_create): Likewise.
1306 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1307 (or1k_elf_check_relocs): Likewise.
1308 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1309 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1310 * elf32-s390.c (elf_s390_link_hash_table_create),
1311 (elf_s390_check_relocs): Likewise.
1312 * elf32-score.c (score_elf_create_got_section),
1313 (s3_elf32_score_new_section_hook),
1314 (elf32_score_link_hash_table_create): Likewise.
1315 * elf32-score7.c (score_elf_create_got_section),
1316 (s7_elf32_score_new_section_hook): Likewise.
1317 * elf32-sh.c (sh_elf_link_hash_table_create),
1318 (sh_elf_check_relocs): Likewise.
1319 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1320 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1321 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1322 (tilepro_elf_check_relocs): Likewise.
1323 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1324 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1325 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1326 (elf_xtensa_new_section_hook): Likewise.
1327 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1328 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1329 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1330 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1331 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1332 * elf64-ppc.c (ppc64_elf_new_section_hook),
1333 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1334 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1335 * elf64-s390.c (elf_s390_link_hash_table_create),
1336 (elf_s390_check_relocs): Likewise.
1337 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1338 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1339 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1340 (elf_link_add_archive_symbols, compute_bucket_count),
1341 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1342 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1343 (bfd_elf_final_link): Likewise.
1344 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1345 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1346 (elfNN_aarch64_new_section_hook): Likewise.
1347 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1348 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1349 (riscv_elf_check_relocs): Likewise.
1350 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1351 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1352 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1353 (_bfd_mips_elf_link_hash_table_create): Likewise.
1354 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1355 (_bfd_sparc_elf_check_relocs),
1356 (_bfd_sparc_elf_new_section_hook): Likewise.
1357 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1358 (tilegx_elf_check_relocs): Likewise.
1359 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1360 * format.c (bfd_check_format_matches): Likewise.
1361 * hash.c (_bfd_stringtab_init): Likewise.
1362 * ihex.c (ihex_scan): Likewise.
1363 * irix-core.c (irix_core_core_file_p): Likewise.
1364 * linker.c (bfd_wrapped_link_hash_lookup),
1365 (_bfd_generic_link_hash_table_create),
1366 (_bfd_generic_reloc_link_order): Likewise.
1367 * lynx-core.c (lynx_core_file_p): Likewise.
1368 * netbsd-core.c (netbsd_core_file_p): Likewise.
1369 * osf-core.c (osf_core_core_file_p): Likewise.
1370 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1371 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1372 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1373 * peicode.h (pe_mkobject): Likewise.
1374 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1375 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1376 * sco5-core.c (read_uarea): Likewise.
1377 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1378 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1379 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1380 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1381 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1382 * srec.c (srec_scan): Likewise.
1383 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1384 * targets.c (bfd_target_list): Likewise.
1385 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1386 * trad-core.c (trad_unix_core_file_p): Likewise.
1387 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1388 (vms_new_section_hook): Likewise.
1389 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1390 * xcofflink.c (xcoff_get_section_contents),
1391 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1392 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1393 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1395 2020-02-19 Alan Modra <amodra@gmail.com>
1397 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1399 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1401 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1402 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1403 a build_list_p argument. Don't search plugin_list. Short circuit
1404 when building the plugin list.
1405 (has_plugin): Renamed to has_plugin_list.
1406 (bfd_plugin_set_plugin): Don't set has_plugin.
1407 (bfd_plugin_specified_p): Check plugin_list instead.
1408 (build_plugin_list): New function.
1409 (load_plugin): Call build_plugin_list and use plugin_list.
1411 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1414 * plugin.c (try_claim): Always clean up for LTO wrapper.
1415 (try_load_plugin): Treat each object as independent. Create a
1416 copy for plugin name.
1418 2020-02-11 Nick Clifton <nickc@redhat.com>
1420 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1421 for addresses in print statements.
1422 (msp430_elf_relax_delete_bytes): Likewise.
1423 (msp430_elf_relax_add_words): Likewise.
1424 (msp430_elf_relax_section): Likewise.
1426 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1428 * plugin.c (add_symbols): Clear plugin_data memory.
1430 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1433 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1434 (EXECUTABLE_SUFFIX): Likewise.
1435 * config.in: Regenerated.
1436 * configure: Likewise.
1437 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1438 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1439 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1440 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1441 (get_lto_wrapper): New.
1442 (setup_lto_wrapper_env): Likewise.
1443 (current_plugin): Likewise.
1444 (register_all_symbols_read): Likewise.
1445 (register_cleanup): Likewise.
1446 (get_symbols): Likewise.
1447 (add_input_file): Likewise.
1448 (bfd_plugin_close_and_cleanup): Likewise.
1449 (claim_file): Removed.
1450 (register_claim_file): Set current_plugin->claim_file.
1451 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1452 lto_syms in current_plugin.
1453 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1454 all_symbols_read handler. Copy real symbols to plugin_data.
1455 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1456 (try_load_plugin): Don't reuse the previous plugin for LTO
1457 wrapper. Set up GCC LTO wrapper if possible. Don't set
1458 plugin_list_iter->claim_file.
1459 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1461 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1464 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1466 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1467 check if previous instruction matches a conditional jump inserted
1468 earlier. Invert conditional jump and delete branch in this case.
1470 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1472 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1473 msp430_elf_relax_add_words. Support insertion of either one or two
1475 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1476 needs to be grown. Handle insertion of branch instruction to replace
1479 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1481 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1482 debugging relocations.
1483 (msp430_elf_relax_delete_bytes): Likewise.
1484 (msp430_elf_relax_add_two_words): Likewise.
1485 (msp430_elf_relax_section): Likewise.
1487 2020-02-10 Alan Modra <amodra@gmail.com>
1489 * archures.c: Wrap overlong z80 comments.
1490 * bfd-in2.h: Regenerate.
1492 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1495 * archures.c: Add GBZ80 and Z80N machine values.
1496 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1497 * coff-z80.c: Add support for new reloc.
1498 * coffcode.h: Add support for new machine values.
1499 * cpu-z80.c: Add support for new machine names.
1500 * elf32-z80.c: Add support for new reloc.
1501 * bfd-in2.h: Regenerate.
1502 * libbfd.h: Regenerate.
1504 2020-02-07 Nick Clifton <nickc@redhat.com>
1507 * elf.c (rewrite_elf_program_header): Do not complain if no
1508 sections are mapped to a segment.
1510 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1513 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1514 for garbage collection on __patchable_function_entries section
1515 without linked-to section.
1517 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1520 * bfd-in2.h: Regenerated.
1521 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1522 on section if gc_mark of any of its linked-to sections is set
1523 and don't set gc_mark again.
1524 * section.c (asection): Add linked_to_symbol_name to map_head
1527 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
1529 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1530 reporting an unrecognized instruction with R_V850_LONGJUMP.
1532 2020-02-05 Alan Modra <amodra@gmail.com>
1534 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1536 2020-02-04 Alan Modra <amodra@gmail.com>
1538 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1539 R_PPC_VLE_ADDR20, goto copy_reloc.
1541 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1543 * bfd-in2.h: Regenerated.
1544 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1546 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1549 * bfd-in2.h: Regenerated.
1550 * ecoff.c (bfd_debug_section): Add section_id.
1551 * section.c (bfd_section): Add section_id.
1552 (SEC_ASSEMBLER_SECTION_ID): New.
1553 (BFD_FAKE_SECTION): Add section_id.
1555 2020-02-01 Nick Clifton <nickc@redhat.com>
1557 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1560 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1562 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1563 encodings are relative to the GOT on nios2, too.
1565 2020-01-31 Alan Modra <amodra@gmail.com>
1567 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1568 file. Use $< and $@ in rules.
1569 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1570 (elf32-ia64.c, elf64-ia64.c): Likewise.
1571 (elf32-riscv.c, elf64-riscv.c): Likewise.
1572 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1573 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1574 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1575 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1576 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1577 * Makefile.in: Regenerate.
1579 2020-01-31 Alan Modra <amodra@gmail.com>
1582 * elf.c (setup_group): Don't clear entire section contents,
1583 just the padding after group flags. Release alloc'd memory
1584 after a seek or read failure.
1586 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1588 * peXXigen.c (pe_is_repro): New function.
1589 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1590 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1592 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1594 * peXXigen.c (debug_type_names): Add names for new debug data type
1597 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1599 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1600 inner loop. Fix a memory leak.
1602 2020-01-30 Alan Modra <amodra@gmail.com>
1604 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1605 or obj_coff_keep_strings here.
1606 (coff_get_normalized_symtab): Free external syms directly.
1607 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1610 2020-01-27 Jim Wilson <jimw@sifive.com>
1612 * cpu-riscv.c (riscv_scan): New.
1613 (N): Change bfd_default_scan to riscv_scan.
1615 2020-01-27 Andreas Schwab <schwab@suse.de>
1617 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1618 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1619 * Makefile.in: Regenerate.
1620 * cpu-plugin.c: Remove.
1621 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1622 (bfd_plugin_arch): Remove declaration.
1623 * bfd-in2.h: Regenerate.
1624 * po/SRC-POTFILES.in: Regenerate.
1626 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1627 Alan Modra <amodra@gmail.com>
1630 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1632 2020-01-24 Jim Wilson <jimw@sifive.com>
1634 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1635 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1636 avoid over long line.
1638 2020-01-24 Nick Clifton <nickc@redhat.com>
1641 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1642 syms and keep strings flags as these may have been set in order to
1643 prevent a bogus call to free.
1645 2020-01-23 Nick Clifton <nickc@redhat.com>
1647 * po/fr.po: Updated French translation.
1649 2020-01-23 Alan Modra <amodra@gmail.com>
1652 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1653 by zero when p_align is zero.
1655 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1657 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1658 (riscv_prefix_cmp): Likewise.
1659 (riscv_non_std_ext_p): Deleted.
1660 (riscv_std_sv_ext_p): Likewise.
1661 (riscv_non_std_sv_ext_p): Likewise.
1662 (riscv_merge_non_std_and_sv_ext): Rename to...
1663 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1664 (riscv_merge_arch_attr_info): Replace 3 calls to
1665 riscv_merge_non_std_and_sv_ext with single call to
1666 riscv_merge_multi_letter_ext.
1667 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1668 encounter a 'z' prefix.
1669 (riscv_get_prefix_class): New function, return prefix class based
1670 on first few characters of input string.
1671 (riscv_parse_config): New structure to factor out minor differences
1672 in extension class parsing behaviour.
1673 (riscv_parse_sv_or_non_std_ext): Rename to...
1674 (riscv_parse_prefixed_ext): and parameterise with
1676 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
1677 (riscv_multi_letter_ext_valid_p): New.
1678 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
1679 (riscv_parse_subset): Delegate all non-single-letter parsing work
1680 to riscv_parse_prefixed_ext.
1681 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
1682 (riscv_get_prefix_class): Declare.
1684 2020-01-22 Alan Modra <amodra@gmail.com>
1686 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
1687 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
1688 __tls_get_addr_desc.
1689 (ppc64_elf_size_stubs): Add section for linker generated
1690 __tls_get_addr_desc wrapper function. Loop at least once if
1691 generating this function.
1692 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
1693 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
1695 2020-01-22 Alan Modra <amodra@gmail.com>
1697 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
1698 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
1700 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
1701 (STDU_R1_0R1, ADDI_R1_R1): Define.
1702 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
1703 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
1704 tga_desc_fd to opt_fd, and tga_desc to opt. Set
1705 no_tls_get_addr_regsave.
1706 (branch_reloc_hash_match): Add hash3 and hash4.
1707 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
1708 (ppc64_elf_size_dynamic_sections): Likewise.
1709 (ppc64_elf_relocate_section): Likewise.
1710 (plt_stub_size, build_plt_stub): Likewise. Size regsave
1711 __tls_get_addr stub.
1712 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
1714 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1715 eh_frame for regsave __tls_get_addr.
1717 2020-01-22 Alan Modra <amodra@gmail.com>
1719 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1720 which __tls_get_addr calls will be eliminated.
1722 2020-01-20 Nick Clifton <nickc@redhat.com>
1724 * po/pt.po: Updates Portuguese translation.
1725 * po/ru.po: Updated Russian translation.
1726 * po/uk.po: Updated Ukranian translation.
1728 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
1731 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
1732 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
1734 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
1735 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
1736 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
1737 "rex leal x@tlsdesc(%rip), %reg" to
1738 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
1739 "call *(%eax)" to "nopl (%rax)".
1741 2020-01-20 Alan Modra <amodra@gmail.com>
1743 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
1744 (MTLR_R11): Don't define.
1745 (LD_R0_0R3, CMPDI_R0_0): Define.
1746 (build_tls_get_addr_stub): Don't use r11 in stub.
1748 2020-01-20 Alan Modra <amodra@gmail.com>
1750 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1751 (defined_sym_val, is_tls_get_addr): Likewise.
1753 2020-01-18 Nick Clifton <nickc@redhat.com>
1755 * version.m4 (BFD_VERSION): Set to 2.34.50.
1756 * configure: Regenerate.
1757 * po/bfd.pot: Regenerate.
1759 2020-01-18 Nick Clifton <nickc@redhat.com>
1761 Binutils 2.34 branch created.
1763 2020-01-17 Christian Biesinger <cbiesinger@google.com>
1765 * coff-arm.c: Fix spelling error (seperate).
1766 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1768 * sysdep.h (strnlen): Fix spelling error (seperate).
1770 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
1773 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1775 2020-01-15 Alan Modra <amodra@gmail.com>
1778 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
1779 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
1780 of function symbols unless dot symbols are present. Do warn
1781 whenever one is created, regardles of whether a PLT entry is
1782 also emitted for the function symbol.
1784 2020-01-14 Alan Modra <amodra@gmail.com>
1786 * som.c (som_bfd_count_ar_symbols): Error when file position
1787 of symbols on chains is not strictly increasing.
1789 2020-01-14 Alan Modra <amodra@gmail.com>
1791 * vms.h (VMS_DEBUG): Define as 0.
1792 * vms-alpha.c (image_write): Move debug output after bounds check.
1794 (_bfd_vms_slurp_eihd): Warning fix.
1795 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1797 2020-01-13 Alan Modra <amodra@gmail.com>
1799 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1800 for "ignored" records.
1802 2020-01-13 Alan Modra <amodra@gmail.com>
1804 * wasm-module.c (wasm_scan_name_function_section): Formatting.
1805 Delete asect name check. Move asect NULL check to wasm_object_p.
1806 Correct bounds check of sizes against end. Replace uses of
1807 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
1808 just one bfd_release.
1809 (wasm_scan): Don't use malloc/strdup for section names,
1810 bfd_alloc instead. Simplify code prefixing section name.
1811 Formatting. Don't attempt to free memory here..
1812 (wasm_object_p): ..do so here.
1814 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1817 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1818 UNDEFWEAK_NO_DYNAMIC_RELOC.
1819 (allocate_dynrelocs_for_symbol): Likewise.
1821 2020-01-10 Tamar Christina <tamar.christina@arm.com>
1824 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1826 2020-01-10 Alan Modra <amodra@gmail.com>
1828 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1830 2020-01-09 Nick Clifton <nickc@redhat.com>
1833 * bfd.c (bfd_convert_section_contents): Check for a compress
1834 header size that is larger than the actual section size.
1836 2020-01-08 Alan Modra <amodra@gmail.com>
1839 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1840 after removing sections.
1842 2020-01-06 Jim Wilson <jimw@sifive.com>
1845 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
1846 check for !bfd_link_pic (info).
1847 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
1848 <R_RISCV_JAL>: Add comment.
1849 (_bfd_riscv_relax_section): For plt.offset check, add check for
1850 bfd_link_pic (info). Add comment.
1852 2020-01-06 Alan Modra <amodra@gmail.com>
1854 * format.c (bfd_check_format_matches): Ignore bfd_error on target
1855 match failures. Don't init to bfd_error_wrong_format before
1856 calling _bfd_check_format.
1858 2020-01-06 Alan Modra <amodra@gmail.com>
1860 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
1861 status rather than exiting on stack overflow or underflow.
1862 (_bfd_vms_slurp_etir): Adjust to suit.
1864 2020-01-06 Alan Modra <amodra@gmail.com>
1866 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
1868 2020-01-06 Alan Modra <amodra@gmail.com>
1870 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
1871 command. Check name offset is within command.
1872 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
1873 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
1874 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
1875 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
1876 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
1877 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
1878 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
1879 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
1880 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
1881 (bfd_mach_o_read_segment): Similarly.
1882 (bfd_mach_o_read_thread): Properly bound check thread struct.
1883 Don't repeat checks on second loop.
1884 (bfd_mach_o_read_command): Fail on invalid command length.
1886 2020-01-04 Alan Modra <amodra@gmail.com>
1888 * format.c (bfd_check_format_matches): Add preserve_match.
1889 Save initial bfd state in "preserve", matched bfd state in
1890 "preserve_match". Save just the first match. Release
1891 bfd_alloc memory. Restore and finish preserved state as
1892 appropriate on all function exit paths.
1894 2020-01-04 Alan Modra <amodra@gmail.com>
1896 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
1898 2020-01-04 Alan Modra <amodra@gmail.com>
1900 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
1903 2020-01-03 Nick Clifton <nickc@redhat.com>
1906 (bfd_pef_parse_function_stubs): Correct the test that ensures that
1907 there is enough data remaining in the code buffer before
1908 attempting to read a function stub.
1910 2020-01-03 Nick Clifton <nickc@redhat.com>
1913 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
1914 return value from bfd_malloc.
1915 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1916 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
1917 (elf32_arm_filter_cmse_symbols): Likewise.
1918 (elf32_arm_write_section): Likewise.
1919 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1920 (bfd_mach_o_follow_dsym): Likewise.
1921 * pef.c (bfd_pef_print_loader_section): Likewise.
1922 (bfd_pef_scan_start_address): Likewise.
1923 (bfd_pef_parse_function_stubs): Likewise.
1924 (bfd_pef_parse_symbols): Likewise.
1926 2020-01-03 Sergei Trofimovich <siarheit@google.com>
1928 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
1929 on binary inputs ld/PR25316.
1930 (is_ia64_elf): new helper to filter on ia64 objects.
1932 2020-01-03 Jan Beulich <jbeulich@suse.com>
1934 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
1936 (bfd_mach_o_scan): Insert underscore in two variable names.
1938 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
1940 * Makefile.am: Add z80-elf target support.
1941 * configure.ac: Likewise.
1942 * targets.c: Likewise.
1943 * Makefile.in: Regenerate.
1944 * configure: Regenerate.
1945 * config.bfd: Add z80-elf target support and new arches: ez80 and
1947 * elf32-z80.c: New file.
1948 * archures.c: Add new z80 architectures: eZ80 and Z180.
1949 * coffcode.h: Likewise.
1950 * cpu-z80.c: Likewise.
1951 * coff-z80.c: Add new relocations for Z80 target and local label
1953 * reloc.c: Add new relocs.
1954 * bfd-in2.h: Regenerate.
1955 * libbfd.h: Regenerate.
1957 2020-01-02 Tamar Christina <tamar.christina@arm.com>
1961 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
1963 2020-01-01 Alan Modra <amodra@gmail.com>
1965 Update year range in copyright notice of all files.
1967 For older changes see ChangeLog-2019
1969 Copyright (C) 2020 Free Software Foundation, Inc.
1971 Copying and distribution of this file, with or without modification,
1972 are permitted in any medium without royalty provided the copyright
1973 notice and this notice are preserved.
1979 version-control: never