diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2010-10-30 23:02:32 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2010-10-30 23:02:32 +0000 |
commit | b3cded65e92ba4d9b5e5a33fb95c4d551bda9c1b (patch) | |
tree | 69d40fbef2c0c4ee32fe97b7a28b510f2e3c2dbc /binutils | |
parent | 7a815afd9b5121ee0f65dc1e1de1c0de6de97679 (diff) |
Notes
Diffstat (limited to 'binutils')
155 files changed, 23332 insertions, 39494 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 2f6520f44207..574f1839e378 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,267 +1,696 @@ -2006-08-15 Nick Clifton <nickc@redhat.com> +2007-07-02 Alan Modra <amodra@bigpond.net.au> - PR binutils/3039 - * wrstabs.c (stab_tag_type): Initialize 'size'. + PR 4716 + * objcopy.c (filter_symbols): Correct relocatable file test. -2006-06-07 Joseph S. Myers <joseph@codesourcery.com> +2007-07-02 Alan Modra <amodra@bigpond.net.au> - * po/Make-in (pdf, ps): New dummy targets. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + * po/binutils.pot: Regenerate. -2006-06-02 Joseph S. Myers <joseph@codesourcery.com> +2007-06-30 H.J. Lu <hongjiu.lu@intel.com> - * doc/Makefile.am (TEXI2DVI): Define. - * doc/Makefile.in: Regenerate. + * aclocal.m4: Regenerated. + * doc/Makefile.in: Likewise. + * Makefile.in: Likewise. -2006-06-01 Daniel Jacobowitz <dan@codesourcery.com> - - Backport: - 2006-05-19 Andreas Schwab <schwab@suse.de> - * doc/Makefile.am (addr2line.1): Depend on $(binutils_TEXINFOS). - (ar.1): Likewise. - (dlltool.1): Likewise. - (nlmconv.1): Likewise. - (nm.1): Likewise. - (objcopy.1): Likewise. - (objdump.1): Likewise. - (ranlib.1): Likewise. - (readelf.1): Likewise. - (size.1): Likewise. - (strings.1): Likewise. - (strip.1): Likewise. - (windres.1): Likewise. - (cxxfilt.man): Likewise. - * doc/Makefile.in: Regenerated. +2007-06-29 Joseph Myers <joseph@codesourcery.com> + + * readelf.c (display_power_gnu_attribute, process_power_specific): + New. + (process_arch_specific): Call process_power_specific. + +2007-06-29 Joseph Myers <joseph@codesourcery.com> + + * readelf.c (display_mips_gnu_attribute): New. + (process_mips_specific): Call process_attributes. + +2007-06-29 Joseph Myers <joseph@codesourcery.com> + + * readelf.c (display_gnu_attribute): New. + (process_arm_specific): Rearrange as process_attributes. + (process_arm_specific): Replace by wrapper of process_attributes. + +2007-06-28 Roland McGrath <roland@frob.com> + + * objcopy.c (setup_section): Don't reset ELF section type to + SHT_NOBITS when it is SHT_NOTE. + * doc/binutils.texi (objcopy, strip): Mention under --only-keep-debug. + +2007-06-27 Alan Modra <amodra@bigpond.net.au> + + * ar.c: Rename uses of bfd.next to bfd.archive_next throughout. + * arsup.c: Likewise. + * binemul.c: Likewise. + * objcopy.c: Likewise. + * dlltool.c: Likewise. + +2007-06-26 Shantonu Sen <ssen@apple.com> + + PR binutils/4693 + * Makefile.am (windres_DEPENDENCIES, windmc_DEPENDENCIES): Move + dependency on $(LIBICONV) to ... + (windres_LDADD, windmc_LDADD) ... here. + * Makefile.in: Regenerate. + +2007-06-21 Alan Modra <amodra@bigpond.net.au> + + * embedspu.sh (relas): Correct sh_info parsing. + +2007-06-19 Danny Smith <dannysmith@users.sourceforge.net> + + * objdump.c: Include sys/stat.h. + +2007-06-19 Kai Tietz <kai.tietz@onevision.com> + + * Makefile.am: Add windmc tool. + * Makefile.in: Regenerate. + * configure.in: Add windmc tool. + * configure: Regenerate. + * mclex.c: New. + * mcparse.y: New. + * windmc.c: New. + * windmc.h: New. + * doc/Makefile.am: Add windmc tool. + * doc/Makefile.in: Regenerate. + * doc/binutils.texi: Add windmc documentation. + * NEWS: Mention new tool. + +2007-06-18 Andi Kleen <ak@suse.de> + + * objdump.c: Include sys/mman.h + (print_file_list): Remove f, add map, mapsize, linemap, maxline, + last_line, first fields. + (slurp_file): Add. + (index_file): Add. + (print_file_open): Call slurp_file and index_file. Initialize new + fields. + (skip_to_line): Rename to print_line and write only single line. + (dump_line): Add. + (show_line): Change to new algorithm. + +2007-06-18 Thomas Weidenmueller <w3seek@reactos.org> + + * resres.c (probe_binary): Fix test for badly formatted headers. + +2007-06-18 Kai Tietz <Kai.Tietz@onevision.com> + + * rclex.c: (cpp_line): Add code_page pragma support. + * windres.c: (usage, long_options, main): Add new option + --codepage or -c. + * winduni.c: (wind_default_codepage, wind_current_codepage): New. + (unicode_from_ascii, ascii_from_unicode): Use + wind_current_codepage as codepage parameter. + (unicode_print): Print 4 characters for hexadecimal values in + unicode strings. + * winduni.h: (wind_default_codepage, wind_current_codepage): + Export. + * doc/binutils.texi: Document new option. + * NEWS: Mention new features of windres. + +2007-06-18 Brian D. Watt <bwatt@us.ibm.com> + + * embedspu.sh: Parse _SPUEAR_ symbol values as hex. + +2007-06-14 H.J. Lu <hongjiu.lu@intel.com> -2006-05-30 Nick Clifton <nickc@redhat.com> + * Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd. - * po/es.po: Updated Spanish translation. + * acinclude.m4: Removed. -2006-05-24 Nick Clifton <nickc@redhat.com> + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. - * po/fr.po: Updated French translation. +2007-06-11 Nathan Sidwell <nathan@codesourcery.com> -2006-05-23 Nick Clifton <nickc@redhat.com> + * dwarf.c (decode_location_expression): Add DW_OP_form_tls_address. - * po/vi.po: Updated Vietnamese translation. +2007-06-06 Kai Tietz <Kai.Tietz@onevision.com> -2006-05-22 Daniel Jacobowitz <dan@codesourcery.com> + PR binutils/4356 binutils/591 + * resrc.c (filename_need_quotes): New function. + (look_for_default): If filename_need_quotes is true then quote the + filename in the command line being created. + (read_rc_file): Likewise. - * po/ru.po: Updated translation. +2007-06-06 Ben Elliston <bje@au.ibm.com> -2006-05-02 Daniel Jacobowitz <dan@codesourcery.com> + * doc/binutils.texi (objdump): Fix capitalisation of "PowerPC". - * doc/Makefile.am (AM_MAKEINFOFLAGS): New. - (TEXI2POD): Use AM_MAKEINFOFLAGS. - (config.texi): Don't set top_srcdir. - * doc/binutils.texi: Don't use top_srcdir. - * aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. +2007-06-05 Kai Tietz <Kai.Tietz@onevision.com> -2006-04-12 Nick Clifton <nickc@redhat.com> + * Makefile.am: Add LIBICONV to windres. + * acinclude.m4: Added missing "lib-*.m4" and "lt*.m4" files. + * configure.in: Add AC_CHECK_HEADER for iconv.h and use AM_ICONV. + * config.in: Add ICONV defines. + * aclocal.m4: Regenerate. + * confugure: Regenerate. + * winduni.c: (local_iconv_map codepages, wind_language_t, + languages, unicode_is_valid_codepage, wind_find_language_by_id, + wind_find_language_by_codepage, wind_find_codepage_info, + unicode_from_codepage, codepage_from_unicode, iconv_onechar, + wind_iconv_cp, wind_MultiByteToWideChar wind_WideCharToMultiByte): + New. + (ascii_from_unicode): Use codepage_from_unicode. + (ascii_from_unicode): Use unicode_from_codepage. + Use for cygwin windows API for unicode transformation. + * winduni.h: (CP_ACP, CP_UTF7, CP_UTF8, CP_OEM, CP_UTF16): New + macros. + (wind_language_t, local_iconv_map): New types. + (wind_find_language_by_id, wind_find_language_by_codepage, + unicode_is_valid_codepage, wind_find_codepage_info, + unicode_from_codepage, codepage_from_unicode): New + prototypes. + +2007-06-05 Alan Modra <amodra@bigpond.net.au> + + * embedspu.sh: Handle R_SPU_PPU* relocs with no symbol. + +2007-05-30 Alan Modra <amodra@bigpond.net.au> - * objdump.c (objdump_symbol_at_address): Fix typo in comment. + * objcopy.c (copy_object): Revert 2007-05-11 change. Don't + avoid calling bfd_copy_private_bfd_data for ELF STRIP_NONDEBUG. + (setup_section): Don't modify flags, and don't avoid calling + bfd_copy_private_section_data for ELF STRIP_NONDEBUG. + * readelf.c (process_program_headers): Ignore .dynamic of type + SHT_NOBITS. -2006-04-10 Ben Elliston <bje@gnu.org> +2007-05-29 Alan Modra <amodra@bigpond.net.au> - * MAINTAINERS (CGEN Maintainers): Remove myself. + * embedspu.sh: Emit SPU ELF image to .data.rel.ro.speelf if + pic or pie and image needs relocs. -2006-04-06 Carlos O'Donell <carlos@codesourcery.com> +2007-05-24 Steve Ellcey <sje@cup.hp.com> - * po/Make-in: Add install-html target. - * Makefile.am: Add install-html and install-html-recursive targets. * Makefile.in: Regenerate. - * configure.in: AC_SUBST datarootdir, docdir and htmldir. * configure: Regenerate. - * doc/Makefile.am: Add install-html and install-html-am targets. + * aclocal.m4: Regenerate. * doc/Makefile.in: Regenerate. -2006-04-05 Eric Botcazou <ebotcazou@adacore.com> +2007-05-24 Kai Tietz <Kai.Tietz@onevision.com> - * addr2line.c (long_options): Add new option 'section'. - (usage): Document new -j/--section option. - (find_offset_in_section): New function. - (translate_addresses): Add 'section' parameter. - If it is non-null, call find_offset_in_section on it. - (process_file): Add 'section_name' parameter. - If it is non-null, look for the section in the BFD object. - Pass the section to translate_addresses. - (main): Handle new -j option. - Pass the section name to process_file. - * doc/binutils.texi (addr2line): Document new -j/--section option. + * rcparse.y: Join strings for elements having no side-effects in + "rc"-grammar. -2006-03-29 Ben Elliston <bje@au.ibm.com> +2007-05-23 Kai Tietz <Kai.Tietz@onevision.com> - * resbin.c: Avoid duplicating constants in calls to reswr_alloc. + * rclex.c: New file replacing rclex.l. + * rclex.l: Removed. + * windint.h: New file holding common structure and type + definitions. + * Makefile.am: Added new header windint.h and exchanged rclex.l by + rclex.c. + * Makefile.in: Regenerate. + * rcparse.y: Renamed some structures. + Use in internal representation always bfd_vma instead of long or + int. + Removed from %union unused stringtable. + Added to %union suni structure for unicode strings. + Added new tokens for ANICURSOR, ANIICON, DLGINCLUDE, + DLGINIT, FONTDIR, HTML, MANIFEST, PLUGPLAY, VXD, + TOOLBAR, BUTTON, QUOTEDUNISTRING, and SIZEDUNISTRING. + Added support for these new rc file tokens. + * resbin.c: Rewrote using bfd and binary structures, and support + new resource types. + * rescoff.c: Likewise. + * resres.c: Likewise. + * resrc.c: Likewise. Dumps as RC are now recompilable. + * windres.c: As above. Using bfd for res and provide target + specific endianess support. + * windres.h: Use windint.h as include. Additionally removed K&R + syntax. + * winduni.c: New printing and unichar support routines. + * winduni.h: Prototypes for new unichar helpers. + * windint.h: New file. -2006-03-20 Nathan Sidwell <nathan@codesourcery.com> +2007-05-22 Paul Brook <paul@codesourcery.com> - * BRANCHES: Remove binutils-csl-arm-2006q1-branch. Document - binutils-csl-2_17-branch instead. + * objdump.c (find_symbol_for_address): Merge section and target + specific filtering code. -2006-03-20 Paul Brook <paul@codesourcery.com> +2007-05-22 Nick Clifton <nickc@redhat.com> - * BRANCHES: Mention binutils-csl-arm-2006q1-branch. + * doc/binutils.texi: Use @copying around the copyright notice. -2006-03-16 Alan Modra <amodra@bigpond.net.au> +2007-05-21 Richard Sandiford <richard@codesourcery.com> - PR 2434 - * ieee.c (write_ieee_debugging_info): Adjust bfd_hash_table_init calls. - * wrstabs.c (write_stabs_in_sections_debugging_info): Likewise. + * objdump.c (disassemble_bytes): Ignore disassembler_needs_relocs + for executables and shared libraries. -2006-03-13 Ben Elliston <bje@au.ibm.com> +2007-05-18 Nathan Sidwell <nathan@codesourcery.com> - * bucomm.c (display_target_list): Make local variable `a' to be of - type enum bfd_architecture. Thus no need to cast enums to int. - (display_info_table): Likewise. + * objcopy.c (strip_main): Detect identical input and output file + names. + (copy_main): Refactor tempname detection and use. -2006-03-10 Paul Brook <paul@codesourcery.com> +2007-05-17 Nick Clifton <nickc@redhat.com> - * readelf.c (decode_ARM_machine_flags): Handle EABIv5. + * objdump.c (load_debug_section): Select bias for DWARF debug + addresses based on the flavour of the bfd. -2006-03-10 Alan Modra <amodra@bigpond.net.au> +2007-05-11 Alan Modra <amodra@bigpond.net.au> - * dwarf.c (process_extended_line_op): Remove pointer_size param. - Use length instead to determine address size. - (get_pointer_size_and_offset_of_comp_unit): Delete. - (display_debug_lines): Adjust for above. - (display_debug_aranges): Don't stop on finding two zeros. - (display_debug_frames): For warning, print offset not pointer. + PR 4479 + * objcopy.c (copy_object): Don't copy ELF program headers for + --only-keep-debug. -2006-03-09 Danny Smith <dannysmith@users.sourceforge.net> +2007-05-11 Alan Modra <amodra@bigpond.net.au> - * dlltool.c: Update copyright year. - * doc/binutils.texi: Likewise. + * embedspu.sh (find_prog): Prefer prog in same dir as embedspu + over one found on the users path. + (main): Generate .reloc for each R_SPU_PPU* reloc. -2006-03-09 Danny Smith <dannysmith@users.sourceforge.net> +2007-04-28 Alan Modra <amodra@bigpond.net.au> - * dlltool.c (add_stdcall_underscore): New flag. - (xlate): Also add underscore to stdcall symbol if - add_stdcall_underscore set. - (usage): Document --add-stdcall-underscore option. - (OPTION_ADD_STDCALL_UNDERSCORE): New define. - (long_options): Use it for --add-stdcall-underscore option. - (main): Handle it. - * doc/binutils.texi: Document --add-stdcall-underscore option - and differentiate from --add-underscore. + * prdbg.c (tg_variable): Adjust for changed demangler. + (tg_start_function): Likewise. -2006-03-06 Nathan Sidwell <nathan@codesourcery.com> +2007-04-27 Alan Modra <amodra@bigpond.net.au> - * readelf.c (get_machine_flags): Adjust. + * bucumm.h: Split off host dependencies to.. + * sysdep.h: ..here. + Many files: Include sysdep.h. Remove duplicate headers and reorder. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. -2006-03-03 Jakub Jelinek <jakub@redhat.com> +2007-04-24 Nick Clifton <nickc@redhat.com> - * dwarf.c (frame_display_row, display_debug_frames): Handle - DW_CFA_val_offset, DW_CFA_val_offset_sf and DW_CFA_val_expression. + * srconv.c (walk_tree_type_1): Initialise dpt.dunno. -2006-02-28 Nick Clifton <nickc@redhat.com> +2007-04-24 Nathan Froyd <froydnj@codesourcery.com> + Phil Edwards <phil@codesourcery.com> - * objcopy.c (use_alt_mach_code): Change type to unsigned long. - (copy_object): If bfd_alt_mach_code fails emit a more helpful - message and if the target architecture is ELF use the alternative - as replacement value for the e_machine number. - (copy_main): Use strtoul to parse the number provided with the - --alt-mach-code switch. - * doc/binutils.texi (--alt-mach-code): Document that this switch - can now set the absolute e_machine value. + * objcopy.c (filter_symbols): Explicitly stripping a symbol + used in relocations is an error. + Retype 'keep' to bfd_boolean. -2006-02-27 Carlos O'Donell <carlos@codesourcery.com> +2007-04-24 Alan Modra <amodra@bigpond.net.au> - * po/Make-in: Add html target. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. -2006-02-17 Nick Hudson <nick.hudson@dsl.pipex.com> +2007-04-20 Nathan Froyd <froydnj@codesourcery.com> + Phil Edwards <phil@codesourcery.com> + Thomas de Lellis <tdel@windriver.com> - * readelf.c (get_machine_flags): Add logic for missing EF_SH flags. + * objcopy.c (reverse_bytes): New variable. + (command_line_switch, copy_main): Add OPTION_REVERSE_ENDIAN. + (copy_options, copy_usage): Add "reverse-bytes" entry. + (copy_section): Reverse bytes within output sections. + * doc/binutils.texi: Document new objcopy option. -2006-02-14 Jakub Jelinek <jakub@redhat.com> +2007-04-20 Nick Clifton <nickc@redhat.com> - * config.in: Rebuilt. + * rclex.l: Allow underscores at the start of identifiers. -2006-02-10 H.J. Lu <hongjiu.lu@intel.com> +2007-04-19 Alan Modra <amodra@bigpond.net.au> - PR binutils/2258 - * readelf.c (process_program_headers): Use - ELF_IS_SECTION_IN_SEGMENT_MEMORY. + * budemang.c: Delete. + * budemang.h: Delete. + * addr2line.c (translate_addresses): Call bfd_demangle rather than + demangle. + * nm.c (print_symname): Likewise. + * objdump.c (objdump_print_symname, dump_symbols): Likewise. + (dump_bfd): Likewise. + * prdbg.c (struct pr_handle <demangler>): Add int param. + (tg_variable, tg_start_function): Adjust demangler calls. + * Makefile.am: Remove mention of budemang.[ch]. Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. -2006-02-09 Eric Botcazou <ebotcazou@libertysurf.fr> +2007-04-14 Steve Ellcey <sje@cup.hp.com> - * configure.in (CHECK_DECLS): Add snprintf and vsnprintf. + * Makefile.am: Add ACLOCAL_AMFLAGS. + * configure.in: Change macro call order. + * Makefile.in: Regenerate. * configure: Regenerate. - * objdump.c (fprintf): Remove declaration. - * bucomm.h (fprintf): Declare if not already declared. - (snprintf): Likewise. - (vsnprintf): Likewise. -2006-02-08 H.J. Lu <hongjiu.lu@intel.com> +2007-04-13 Nathan Sidwell <nathan@codesourcery.com> + + * Makefile.am (TOOL_PROGS): Add objcopy. + * Makefile.in: Rebuilt. + +2007-04-12 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/4348 + * objcopy.c (copy_object): Don't stop when there are no + sections to be copied. + +2007-04-10 Vladimir Prus <vladimir@codesourcery.com> + + * NEWS: Mention disjoint histograms support in + gprof. + +2007-04-09 Daniel Jacobowitz <dan@codesourcery.com> + + * dwarf.c (process_debug_info): Do not require DW_AT_frame_base for + DW_TAG_inlined_subroutine. + +2007-04-06 Matt Thomas <matt@netbsd.org> + + * MAINTAINERS: Add myself as VAX and NetBSD support maintainer. + +2007-04-05 Alan Modra <amodra@bigpond.net.au> + + PR binutils/4292 + * nm.c (print_value): Cast bfd_vma to unsigned long to suit + value_format_32bit. + +2007-04-02 Nick Clifton <nickc@redhat.com> + + PR binutils/4292 + * nm.c (value_format): Replace with value_format_32bit and + value_format_64bit. + (set_radix): Update setting of value_format. + (set_print_width): New function. Compute the address size of a + given bfd and set the print_width global appropriately. + (display_archive): Use set_print_width. + (display_file): Likewise, + (print_object_filename_sysv): Update use of print_width. + (print_archive_member_sysv): Likewise. + (print_symbol_filename_posix): Likewise. + (print_sumbol_info_bfd, print_symbol_info_sysv): Likewise. + +2007-03-28 Richard Sandiford <richard@codesourcery.com> + Phil Edwards <phil@codesourcery.com> + + * doc/binutils.texi: Put the contents after the title page rather + than at the end of the document. + +2007-03-28 Nick Clifton <nickc@redhat.com> + + * readelf.c (slurp_rela_relocs): Add newline to end of error + messages. + (slurp_rel_relocs, request_dump, request_dump_byname, + process_program_headers, process_dynamic_section, + process_symbol_table, process_mips_specific, main): Likewise. + +2007-03-28 Alan Modra <amodra@bigpond.net.au> + + * MAINTAINERS: Update mailing list addresses. Add myself + as PPC maintainer. + +2007-03-27 Alan Modra <amodra@bigpond.net.au> + + * embedspu.sh: Correct toe_addr quoting. + +2007-03-27 Alan Modra <amodra@bigpond.net.au> + + * embedspu.sh: Combine "_EAR_" and "_EAR_*" patterns. Tighten + .toe section and .toe address checks. Use .reloc for _EAR* + symbols defined in non-BSS sections. Build table for _SPUEAR_ + symbols. + +2007-03-23 Kaz Kojima <kkojima@rr.iij4u.or.jp> - * readelf.c (process_program_headers): Match PT_TLS segment - only with SHT_TLS sections. + PR gas/3811 + * readelf.c (debug_apply_rela_addends): Do nothing for SH. -2006-02-07 Nathan Sidwell <nathan@codesourcery.com> +2007-03-22 Joseph Myers <joseph@codesourcery.com> - * readelf.c (get_machine_flags): Add logic for EF_M68K flags. + * doc/binutils.texi: Include VERSION_PACKAGE when reporting + version. -2006-02-02 H.J. Lu <hongjiu.lu@intel.com> +2007-03-16 Kai Tietz <Kai.Tietz@onevision.com> - * readelf.c (process_program_headers): Undo the last change. + * dlltool.c (make_one_lib_file): Use pc-relative relocation + instead of an absolute relocation for x86_64-pc-mingw32 target. -2006-02-02 H.J. Lu <hongjiu.lu@intel.com> +2007-03-15 H.J. Lu <hongjiu.lu@intel.com> - * readelf.c (process_program_headers): Undo the change made on - 2004-09-22. Match PT_DYNAMIC segment only with SHT_DYNAMIC - sections. + * Makefile.am (REPORT_BUGS_TO): Removed. + (INCLUDES): Remove -DREPORT_BUGS_TO. + * Makefile.in: Regenerated. -2006-01-30 Nick Clifton <nickc@redhat.com> + * bucomm.c: Don't include bfdver.h. + * objdump.c: Likewise. + * version.c: Likewise. - * objcopy.c (copy_object): Catch the case where an attempt is made - to add a section that already exists and produce a more helpful - warning message. + * bucomm.h: Include bfdver.h. -2006-01-26 Nick Clifton <nickc@redhat.com> + * configure.in (--with-bugurl): Removed. + * configure: Regenerated. - * po/vi.po: New Vietnamese translation. - * configure.in (ALL_LINGUAS): Add vi. + * doc/Makefile.am (binutils_TEXINFOS): Removed. + (AM_MAKEINFOFLAGS): Add -I ../../bfd/doc. + (TEXI2DVI): Likewise. + (config.texi): Removed. + (MOSTLYCLEANFILES): Remove config.texi. + * doc/Makefile.in: Regenerated. + + * doc/binutils.texi: Include bfdver.texi instead of + config.texi. + +2007-03-13 Nick Clifton <nickc@redhat.com> + + * readelf.c (dump_section): Also test for SHT_REL sections when + producing the warning about unapplied relocs. + +2007-03-07 Joseph Myers <joseph@codesourcery.com> + + * configure.in (REPORT_BUGS_TEXI): Define to Texinfo version of + bug-reporting URL. + * doc/Makefile.am (config.texi): Define BUGURL. + * doc/binutils.texi: Use BUGURL. Remove text about large files + and uuencoding. + * Makefile.in, configure, doc/Makefile.in: Regenerate. + +2007-03-01 Phil Edwards <phil@codesourcery.com> + Richard Sandiford <richard@codesourcery.com> + + * NEWS: Mention addition of --extract-symbol. + * doc/binutils.texi: Document it. + * objcopy.c (extract_symbol): New variable. + (OPTION_EXTRACT_SYMBOLS): New command_line_switch. + (copy_options): Add an entry for --extract-symbol. + (copy_usage): Mention --extract-symbol. + (copy_object): Set the start address to zero for --extract-symbol. + Do not copy private BFD data in that case. + (setup_section): Set the size, LMA and VMA to zero for + --extract-symbol. Do not copy private BFD data in that case. + (copy_section): Do not copy section contents if --extract-symbol + is passed. + (copy_main): Set extract_symbol to TRUE if --extract-symbol + is passed. + +2007-03-01 Paul Brook <paul@codesourcery.com> + + * MAINTAINERS: Update my entry. + +2007-03-01 Joseph Myers <joseph@codesourcery.com> + + * version.c: Update copyright date. + +2007-03-01 Daniel Jacobowitz <dan@codesourcery.com> + + * Makefile.am (install-exec-local): Depend on $(noinst_PROGRAMS). + Adjust $(EXEEXT) handling for $(RENAMED_PROGS). + * Makefile.in, doc/Makefile.in: Regenerate. + +2007-03-01 Alan Modra <amodra@bigpond.net.au> + + * embedspu.sh: Set type and size of global program handle symbol. + +2007-02-28 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (PROGS): Delete. + (RENAMED_PROGS): Define. Extracted from.. + (noinst_PROGRAMS): ..here. Add BUILD_MISC. + (install-exec-local): Adjust. + * Makefile.in: Regenerate. + +2007-02-28 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (PROGS): Add BUILD_INSTALL_MISC. + (bin_PROGRAMS): Replace BUILD_MISC with BUILD_INSTALL_MISC. + (EXTRA_PROGRAMS): Remove bin2c. + (bin2c$(EXEEXT_FOR_BUILD)): New rule. + (bin2c_SOURCES): Delete. + (DISTCLEANFILES): Remove sysinfo. + (MOSTLYCLEANFILES): Add sysinfo$(EXEEXT_FOR_BUILD) and + bin2c$(EXEEXT_FOR_BUILD). + * configure.in (BUILD_MISC): Add $(EXEEXT_FOR_BUILD) to bin2c. + Move embedspu to.. + (BUILD_INSTALL_MISC): ..here. + * Makefile.in: Regenerate. * configure: Regenerate. -2006-01-18 Alexandre Oliva <aoliva@redhat.com> +2007-02-27 Alan Modra <amodra@bigpond.net.au> - Introduce TLS descriptors for i386 and x86_64. - * readelf.c (get_dynamic_type): Handle DT_TLSDESC_GOT and - DT_TLSDESC_PLT. + * bin2c.c: New file. + * Makefile.am (EXTRA_PROGRAMS): Add bin2c. + (CFILES): Add bin2c.c. + (bin2c_SOURCES): Define. + (bin2c.o): Dependencies from "make dep-am". + * configure.in (BUILD_MISC): Add bin2c. + * version.c: Update year. + * po/POTFILES.in: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. -2006-01-18 Nick Clifton <nickc@redhat.com> +2007-02-17 Mark Mitchell <mark@codesourcery.com> + Nathan Sidwell <nathan@codesourcery.com> + Vladimir Prus <vladimir@codesourcery.com + Joseph Myers <joseph@codesourcery.com> - PR binutils/1391 - * objcopy.c (copy_object): For PE format targets set the VMA of a - newly created gnu_debuglink section to a non-zero, aligned, - contiguous value. - * Makefile.am (objcopy.c): Add a dependency upon libbfd.h. + * configure.in (--with-bugurl): New option. + * configure: Regenerate. + * Makefile.am (REPORT_BUGS_TO): Define. + (INCLUDES): Define REPORT_BUGS_TO. + Regenerate dependencies. * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * bucomm.h: Remove include of bin-bugs.h. + * addr2line.c (usage): Don't print empty REPORT_BUGS_TO. + * ar.c (usage): Pass s to list_supported_targets. Don't print + empty REPORT_BUGS_TO. + * coffdump.c (show_usage): Don't print empty REPORT_BUGS_TO. + * cxxfilt.c (usage): Print bug url when giving help. + * dlltool.c (usage): Likewise. + * dllwrap.c (usage): Likewise. + * nlmconv.c (show_usage): Don't print empty REPORT_BUGS_TO. + * nm.c (usage): Likewise. + * objcopy.c (copy_usage, strip_usage): Likewise. + * objdump.c (usage): Likewise. + * readelf.c ((usage): Likewise. Add STREAM argument. Adjust + callers. + * size.c (usage): Don't print empty REPORT_BUGS_TO. + * srconv.c (show_usage): Likewise. + * strings.c (usage): Likewise. + * sysdymp.c (show_usage): Likewise. + * windres.c (usage): Likewise. + +2007-02-13 Alan Modra <amodra@bigpond.net.au> + + * embedspu.sh: Add -W to readelf invocation. + +2007-02-06 Dave Brolley <brolley@redhat.com> + + * MAINTAINERS: Add myself as the maintainer of the MeP port. + +2007-02-06 Nick Clifton <nickc@redhat.com> -2006-01-17 Andreas Schwab <schwab@suse.de> + PR gas/3800 + * readelf.c: Include elf/h8.h twice. The first time in order to + get the reloc numbers, the second time in order to get the reloc + decoder function. + (dump_section): Tell the user if the section being displayed has + unprocessed relocs associated with it. + (get_reloc_size): New function - returns the size of a reloc. + (debug_apply_rela_addends): Use get_reloc_size(). + * dwarf.c (read_and_display_attr_value): Extend number of + languages known for the DW_AT_language attribute. + (process_debug_info): Display the attribute offset before decoding + the attribute, in case there are problems. - PR binutils/1486 - * configure.in: Don't define DISASSEMBLER_NEEDS_RELOCS. +2007-02-05 Dave Brolley <brolley@redhat.com> + + * readelf.c (dump_relocations): Don't check for + (rtype == NULL && type == R_RELC). + +2007-02-05 Dave Brolley <brolley@redhat.com> + + * Makefile.am (readelf.o): Depends on $(INCDIR)/elf/mep.h. + * Makefile.in: Regenerated. + * Contribute the following changes: + 2003-10-29 Dave Brolley <brolley@redhat.com> + + * configure.in: Define SKIP_ZEROES and SKIP_ZEROES_AT_END for mep. + * configure: Regenerated. + + 2001-04-03 Ben Elliston <bje@redhat.com> + + * readelf.c: Include "elf/mep.h". + (guess_is_rela): Handle EM_CYGNUS_MEP. + (get_machine_name): Ditto. + (dump_relocations): Ditto. + +2007-02-02 H.J. Lu <hongjiu.lu@intel.com> + + * MAINTAINERS: Add a space between H.J. and Lu. + +2007-02-02 H.J. Lu <hongjiu.lu@intel.com> + + * doc/binutils.texi (objdump): Document the new addr64 option + for i386 disassembler. + +2007-02-02 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/3945 + * configure.in (DLLTOOL_DEFAULT): New. Defined for the first PE + target. + (DLLTOOL_DEFS): Add $DLLTOOL_DEFAULT. + * configure: Regenerated. + + * dlltool.c (mname): Defined with DLLTOOL_DEFAULT_XXX. + +2007-02-02 Nick Clifton <nickc@redhat.com> + + * doc/binutils.texi (objdump): Document support for disassembling + the 440 PowerPC architecture. + +2007-01-31 Nathan Sidwell <nathan@codesourcery.com> + + * dwarf.c (process_debug_info): Protect against bogus length and + abbrev offsets. + +2007-01-25 Kazu Hirata <kazu@codesourcery.com> + + * ar.c (print_contents, extract_file): Cast the return value + of fwrite to size_t. + +2007-01-12 Alan Modra <amodra@bigpond.net.au> + + * ar.c (open_inarch): Check fwrite return. Use size_t. + (extract_file): Likewise. Remove test for "negative" file size. + * readelf.c (process_program_headers): Check fscanf return. + +2007-01-11 H.J. Lu <hongjiu.lu@intel.com> + + * bucomm.c (template_in_dir): Fix typo. + +2007-01-11 Alan Modra <amodra@bigpond.net.au> + + * embedspu.sh: New file. + * Makefile.am (embedspu): Add rule. + * configure.in (BUILD_MISC): Add embedspu for powerpc-linux. + * Makefile.in: Regenerate. * configure: Regenerate. - * objdump.c (struct objdump_disasm_info): Don't check for - DISASSEMBLER_NEEDS_RELOCS. - (objdump_print_addr): Likewise. - (disassemble_bytes): Check disassembler_needs_relocs from - disassemble_info at run-time instead of DISASSEMBLER_NEEDS_RELOCS - at compile-time. - (disassemble_section): Likewise. - (disassemble_data): Initialize it. -2006-01-11 Alan Modra <amodra@bigpond.net.au> +2007-01-11 Alan Modra <amodra@bigpond.net.au> + + * bucomm.h (make_tempdir): Declare independently of HAVE_MKDTEMP. + * bucomm.c (template_in_dir): New function, split out from.. + (make_tempname): ..here. Open the file with O_EXCL if !HAVE_MKSTEMP. + (make_tempdir): Use template_in_dir. Handle directory creation + when !HAVE_MKDTEMP. + * objcopy.c (MKDIR): Don't define. + (copy_archive): Use make_tempdir when !HAVE_MKDTEMP too. Fix + error message. + +2007-01-08 Kazu Hirata <kazu@codesourcery.com> + + * readelf.c (get_machine_flags): Treat Fido as an architecture + by itself. - * objcopy.c (copy_object): Fix thinko. +2007-01-08 Kai Tietz <kai.tietz@onevision.com> - * objcopy.c (copy_object): Set isympp and osympp to NULL after free. + * configure.in: Renamed target x86_64-*-mingw64 to + x86_64-*-mingw*. + * configure: Regenerated. -2006-01-09 Mike Frysinger <vapier@gentoo.org>: +2007-01-05 Alan Modra <amodra@bigpond.net.au> - * readelf.c (guess_is_rela): Add case for Nios/Nios II. - (get_machine_name): Likewise. + * readelf.c (dump_section): Don't print 32-bit values, which + were done incorrectly for little-endian. Instead print bytes. -For older changes see ChangeLog-2005 +For older changes see ChangeLog-2006 Local Variables: mode: change-log diff --git a/binutils/ChangeLog-2006 b/binutils/ChangeLog-2006 new file mode 100644 index 000000000000..9961063afd29 --- /dev/null +++ b/binutils/ChangeLog-2006 @@ -0,0 +1,599 @@ +2006-12-25 Kazu Hirata <kazu@codesourcery.com> + + * readelf.c (get_machine_flags): Handle EF_M68K_CPU32_FIDO_A. + +2006-12-11 J"orn Rennecke <joern.rennecke@arc.com> + + MAINTAINERS (SH): Remove my entry. + +2006-12-11 Daniel Jacobowitz <dan@codesourcery.com> + + * configure.in: Define GENINSRC_NEVER. + * doc/Makefile.am (MAINTAINERCLEANFILES): Add info file. + (DISTCLEANFILES): Pretend to add info file. + * po/Make-in (.po.gmo): Put gmo files in objdir. + * configure, Makefile.in, doc/Makefile.in: Regenerated. + +2006-12-07 Kazu Hirata <kazu@codesourcery.com> + + * readelf.c: Update uses of EF_M68K_*. + +2006-10-30 Paul Brook <paul@codesourcery.com> + + * objdump.c (disassemble_section): Set info->symtab_pos. + (disassemble_data): Set info->symtab and info->symtab_size. + +2006-10-29 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/3384 + * configure.in (AC_CHECK_HEADERS): Add limits.h and sys/param.h. + * configure: Regenerated. + * config.in: Likewise. + + * readelf.c: Include <limits.h> and <sys/param.h> for PATH_MAX. + (program_interpreter): Allocate PATH_MAX bytes instead of 64. + (process_program_headers): Don't assume that program interpreter + is shorter than 64 characters. + +2006-10-25 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com> + Yukishige Shibata <shibata@rd.scei.sony.co.jp> + Nobuhisa Fujinami <fnami@rd.scei.sony.co.jp> + Takeaki Fukuoka <fukuoka@rd.scei.sony.co.jp> + Alan Modra <amodra@bigpond.net.au> + + * readelf.c: Add SPU support. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-10-13 Robert Connolly <robert@linuxfromscratch.org> + + PR binutils/2876 + * configure.in: Check for the mkstemp and mkdtemp functions. + * configure: Regenerate. + * config.in (HAVE_MKDTEMP): New potential define. + (MAKE_MKSTEMP): Likewise. + * bucomm.c (make_tempname): Use mkstemp if it is available. + (make_tempdir): New function: Create a temporary directory using + mkdtemp, if it is available. + * bucomm.h (make_tempdir): New prototype. + * objcopy.c (copy_archive): Use make_tempdir if it is available. + (strip_main): Produce an warning message if a temporary file could + not be created. + (copy_main): Likewise. + * ar.c (write_archive): Likewise. + +2006-10-10 Andreas Schwab <schwab@suse.de> + + * dwarf.c (display_debug_loc): Don't dereference loc_offsets when + there are no location lists. + (display_debug_ranges): Similar for range_lists. + +2006-10-04 H.J. Lu <hongjiu.lu@intel.com> + + * readelf.c (debug_apply_rela_addends): Don't ignore relocation + against symbols without type. + +2006-09-25 Pedro Alves <pedro_alves@portugalmail.pt> + + * nlmconv.c (main) : Use LITMEMCPY. + * prdbg.c (tg_class_static_member) : Use LITSTRCPY. + +2006-09-26 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/3257 + * strings.c (main): Handle "-T format". + +2006-09-26 Nick Clifton <nickc@redhat.com> + + * MAINTAINERS: Add Mei Ligang as maintainer of the Score port. + +2006-09-26 Thiemo Seufer <ths@networkno.de> + + * configure.in: Remove broken changequote lines. + +2006-09-20 Kai Tietz <Kai.Tietz@onevision.com> + + * configure.in: Add new target x86_64-pc-mingw64. + * configure: Regenerate. + * dlltool.c: Adjust include for this target. + (DLLTOOL_MX86_64): Added macro to handle target specific code. + (mname): Added default target static as "i386:x86-64". + (MX86): Added macro for target ident. + (mtable): Added target specific definitions. + (rvaafter): Add handling of MX86. + (rvabefore): Add handling of MX86. + (asmprefix): Add handling of MX86. + +2006-09-17 Mei Ligang <ligang@sunnorth.com.cn> + + * readelf.c: Add support for Score binaries. + * Makefile.am: Update readelf's dependencies. + * Makefile.in: Regenerate. + +2006-09-16 Nick Clifton <nickc@redhat.com> + Pedro Alves <pedro_alves@portugalmail.pt> + + * ar.c: Make use of new STRING_COMMA_LEN and CONST_STRNEQ + macros defined in bfd.h. + * dlltool.c: Likewise. + * emul_aix.c: Likewise. + * nlmconv.c: Likewise. + * objdump.c: Likewise. + * prdbg.c: Likewise. + * stabs.c: Likewise. + * readelf.c (const_strneq): New macro. + (process_section_headers, slurp_ia64_unwind_table, + slurp_hppa_unwind_table, display_debug_section, process_notes, + process_archive): Use the new macro. + +2006-09-14 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/3181 + * objcopy.c (group_signature): Return proper group signature. + +2006-09-14 Alan Modra <amodra@bigpond.net.au> + + PR 3181 + * objcopy.c (group_signature): New function, split out from.. + (setup_section): ..here. + (is_strip_section): Return true for SHT_GROUP sections that are + going to lose their group signature symbol. + +2006-09-14 Alan Modra <amodra@bigpond.net.au> + + PR 3181 + * objcopy.c (copy_object): Load symbols earlier. + (setup_section): Mark group signature symbols with BSF_KEEP. + +2006-09-09 Nick Clifton <nickc@redhat.com> + + PR binutils/3110 + * objcopy.c (copy_archive): Add new parameter: + force_output_target. If not true, then perserve the file formats + of each copied archive element, otherwise force them to be one + specific file format. + (copy_file): Compute force_output_target parameter to pass to + copy_archive. + +2006-09-05 Nick Clifton <nickc@redhat.com> + + PR binutils/3166 + * objcopy.c (is_strip_section): Do not treat group sections as + debugging sections. + * doc/binutils.texi (--only-keep-debug): Document that this switch + is only intended for use on fully linked files. + +2006-09-01 Nick Clifton <nickc@redhat.com> + + PR binutils/3146 + * readelf.c (dump_relocations): Check for a NULL value in rtype + before using it. + +2006-08-21 Pedro Alves <pedro_alves@portugalmail.pt> + + * configure.in: Split arm-pe and arm-wince-pe. Build dlltool + with -DDLLTOOL_ARM_WINCE for Windows CE case. + * configure: Regenerate. + * dlltool.c: Add support for arm-wince. + +2006-08-15 Nick Clifton <nickc@redhat.com> + + PR binutils/3039 + * wrstabs.c (stab_tag_type): Initialize 'size'. + +2006-08-10 J"orn Rennecke <joern.rennecke@st.com> + + PR binutils/3017 + * doc/Makefile.am: Use single quotes inside backquotes for + date command while generating config.texi. + * doc/Makefile.in: Regenerate. + +2006-08-08 Nick Clifton <nickc@redhat.com> + + PR binutils/2768 + * dwarf.c (display_debug_aranges): When the address size is + greater than 4 display addresses and lengths as 16 hex digits, + otherwise use 8 hex digits. + +2006-08-06 Nick Clifton <nickc@redhat.com> + + PR binutils/3001 + * addr2line.c (process_file): Change function from void to + returning an int. Return 0 upon success, 1 otherwise. + (main): Use return value from process_file as the exit value. + * ar.c (ranlib_only): Change function from void to returning an + int. Return 0 upon success, 1 otherwise. + (ranlib_touch): Likewise. + (main): Use return value from ranlib functions as exit value. + * objcopy.c (add_specific_symbol): Set status to 1 if get_file_size + fails. + (copy_file): Likewise. + (strip_main): Likewise. + (copy_main): Likewise. + * objdump.c (display_file): Set exit_status to 1 if get_file_size + fails. + * size.c (display_file): Set return_code to 1 if get_file_size + fails. + +2006-08-02 Thiemo Seufer <ths@mips.com> + Nigel Stephens <nigel@mips.com> + + * readelf.c (dump_relocations): Handle MIPS-specific + SHN_MIPS_SCOMMON and SHN_MIPS_SUNDEFINED. + (get_symbol_index_type): Similarly. + +2006-07-24 Ralk Wildenhues <Ralf.Wildenhues@gmx.de> + + * doc/binutils.texinfo: Fix spelling mistakes. + +2006-07-10 Jakub Jelinek <jakub@redhat.com> + + * readelf.c (get_dynamic_type): Handle DT_GNU_HASH. + (get_section_type_name): Handle SHT_GNU_HASH. + (dynamic_info_DT_GNU_HASH): New variable. + (process_dynamic_section): Handle DT_GNU_HASH. + (process_symbol_table): Print also DT_GNU_HASH histogram. + +2006-07-06 Mohammed AdnÚne Trojette <adn@diwi.org> + + PR binutils/2879 + * doc/binutils.texi (Strings): Document -T shorthand for --target + switch. + * strings.c: Update comment to include -T option. + + PR binutils/2875 + * doc/binutils.texi (readelf): Fix spelling typo. + +2006-06-30 Nick Clifton <nickc@redhat.com> + + * dwarf.c (display_debug_frames): Catch a corrupt length field + generating an end of block address that is beyond the end of the + section. + When encountering a corrupt CIE pointer do not reset the start + pointer as more data still has to be read. + Do not warn about user defined call frame instructions. + +2006-06-29 DJ Delorie <dj@redhat.com> + + * readelf.c (process_section_headers): Add H8/300 support. + +2006-06-23 Richard Sandiford <richard@codesourcery.com> + + * objcopy.c (localize_hidden): New variable. + (OPTION_LOCALIZE_HIDDEN): New command_line_switch value. + (copy_options): Add --localize-hidden. + (copy_usage): Mention --localize-hidden. + (is_hidden_symbol): New function. + (filter_symbols): Handle localize_hidden. + (copy_object): Call filter_symbols if localize_hidden. + (copy_main): Handle OPTION_LOCALIZE_HIDDEN. + * doc/binutils.texi (--localize-hidden): Document new option. + +2006-06-23 Daniel Jacobowitz <dan@codesourcery.com> + + * Makefile.am (ar_DEPENDENCIES, ranlib_DEPENDENCIES) + (dlltool_DEPENDENCIES, windres_DEPENDENCIES): Remove @LEXLIB@. + * Makefile.in: Regenerate. + +2006-06-23 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (*_DEPENDENCIES): Add missing dependencies. + * Makefile.in: Regenerate. + +2006-06-07 Joseph S. Myers <joseph@codesourcery.com> + + * po/Make-in (pdf, ps): New dummy targets. + +2006-06-05 Daniel Jacobowitz <dan@codesourcery.com> + + * po/Make-in (top_builddir): Define. + +2006-06-05 Alan Modra <amodra@bigpond.net.au> + + * config.in: Regenerate. + +2006-06-02 Joseph S. Myers <joseph@codesourcery.com> + + * doc/Makefile.am (TEXI2DVI): Define. + * doc/Makefile.in: Regenerate. + +2006-05-31 Daniel Jacobowitz <dan@codesourcery.com> + + * Makefile.am: Replace INTLLIBS with LIBINTL everywhere. Add + DEPENDENCIES variables for every program. + (INTLLIBS): Remove. + (INCLUDES): Use @INCINTL@. + * acinclude.m4: Include new gettext macros. + * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS. + Remove local code for po/Makefile. + * Makefile.in, configure, doc/Makefile.in: Regenerated. + +2006-05-30 Nick Clifton <nickc@redhat.com> + + * po/es.po: Updated Spanish translation. + +2006-05-25 J"orn Rennecke <joern.rennecke@st.com> + + * MAINTAINERS: Update my email address. + +2006-05-24 Nick Clifton <nickc@redhat.com> + + * po/fr.po: Updated French translation. + +2006-05-23 Nick Clifton <nickc@redhat.com> + + * po/vi.po: Updated Vietnamese translation. + +2006-05-22 Daniel Jacobowitz <dan@codesourcery.com> + + * po/ru.po: Updated translation. + +2006-05-19 Andreas Schwab <schwab@suse.de> + + * doc/Makefile.am (addr2line.1): Depend on $(binutils_TEXINFOS). + (ar.1): Likewise. + (dlltool.1): Likewise. + (nlmconv.1): Likewise. + (nm.1): Likewise. + (objcopy.1): Likewise. + (objdump.1): Likewise. + (ranlib.1): Likewise. + (readelf.1): Likewise. + (size.1): Likewise. + (strings.1): Likewise. + (strip.1): Likewise. + (windres.1): Likewise. + (cxxfilt.man): Likewise. + * doc/Makefile.in: Regenerated. + +2006-05-17 Carlos O'Donell <carlos@codesourcery.com> + + * doc/binutils.texi: Use "Binutils Index" for index name. + +2006-05-15 H.J. Lu <hongjiu.lu@intel.com> + + * dwarf.c (display_debug_frames): Don't return on ZERO + terminator. + +2006-05-02 Daniel Jacobowitz <dan@codesourcery.com> + + * doc/Makefile.am (AM_MAKEINFOFLAGS): New. + (TEXI2POD): Use AM_MAKEINFOFLAGS. + (config.texi): Don't set top_srcdir. + * doc/binutils.texi: Don't use top_srcdir. + * aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. + +2006-04-26 Julian Brown <julian@codesourcery.com> + + * readelf.c (arm_attr_tag_VFP_arch): Add VFPv3. + +2006-04-19 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-04-19 Alan Modra <amodra@bigpond.net.au> + + * configure: Regenerate. + +2006-04-18 Nick Clifton <nickc@redhat.com> + + PR 2257 + * readelf.c (SECTION_NAME): Cope with a missing string table. + (process_file_header): Cope with a corrupt e_shstrndx field. + (process_section_headers): Correctly handle an e_shstrndx value of + SHF_UNDEF. + +2006-04-12 Nick Clifton <nickc@redhat.com> + + * objdump.c (objdump_symbol_at_address): Fix typo in comment. + +2006-04-10 Ben Elliston <bje@gnu.org> + + * MAINTAINERS (CGEN Maintainers): Remove myself. + +2006-04-06 Carlos O'Donell <carlos@codesourcery.com> + + * po/Make-in: Add install-html target. + * Makefile.am: Add install-html and install-html-recursive targets. + * Makefile.in: Regenerate. + * configure.in: AC_SUBST datarootdir, docdir and htmldir. + * configure: Regenerate. + * doc/Makefile.am: Add install-html and install-html-am targets. + * doc/Makefile.in: Regenerate. + +2006-04-05 Eric Botcazou <ebotcazou@adacore.com> + + * addr2line.c (long_options): Add new option 'section'. + (usage): Document new -j/--section option. + (find_offset_in_section): New function. + (translate_addresses): Add 'section' parameter. + If it is non-null, call find_offset_in_section on it. + (process_file): Add 'section_name' parameter. + If it is non-null, look for the section in the BFD object. + Pass the section to translate_addresses. + (main): Handle new -j option. + Pass the section name to process_file. + * doc/binutils.texi (addr2line): Document new -j/--section option. + +2006-03-29 Ben Elliston <bje@au.ibm.com> + + * resbin.c: Avoid duplicating constants in calls to reswr_alloc. + +2006-03-20 Nathan Sidwell <nathan@codesourcery.com> + + * BRANCHES: Remove binutils-csl-arm-2006q1-branch. Document + binutils-csl-2_17-branch instead. + +2006-03-20 Paul Brook <paul@codesourcery.com> + + * BRANCHES: Mention binutils-csl-arm-2006q1-branch. + +2006-03-16 Alan Modra <amodra@bigpond.net.au> + + PR 2434 + * ieee.c (write_ieee_debugging_info): Adjust bfd_hash_table_init calls. + * wrstabs.c (write_stabs_in_sections_debugging_info): Likewise. + +2006-03-13 Ben Elliston <bje@au.ibm.com> + + * bucomm.c (display_target_list): Make local variable `a' to be of + type enum bfd_architecture. Thus no need to cast enums to int. + (display_info_table): Likewise. + +2006-03-10 Paul Brook <paul@codesourcery.com> + + * readelf.c (decode_ARM_machine_flags): Handle EABIv5. + +2006-03-10 Alan Modra <amodra@bigpond.net.au> + + * dwarf.c (process_extended_line_op): Remove pointer_size param. + Use length instead to determine address size. + (get_pointer_size_and_offset_of_comp_unit): Delete. + (display_debug_lines): Adjust for above. + (display_debug_aranges): Don't stop on finding two zeros. + (display_debug_frames): For warning, print offset not pointer. + +2006-03-09 Danny Smith <dannysmith@users.sourceforge.net> + + * dlltool.c: Update copyright year. + * doc/binutils.texi: Likewise. + +2006-03-09 Danny Smith <dannysmith@users.sourceforge.net> + + * dlltool.c (add_stdcall_underscore): New flag. + (xlate): Also add underscore to stdcall symbol if + add_stdcall_underscore set. + (usage): Document --add-stdcall-underscore option. + (OPTION_ADD_STDCALL_UNDERSCORE): New define. + (long_options): Use it for --add-stdcall-underscore option. + (main): Handle it. + * doc/binutils.texi: Document --add-stdcall-underscore option + and differentiate from --add-underscore. + +2006-03-06 Nathan Sidwell <nathan@codesourcery.com> + + * readelf.c (get_machine_flags): Adjust. + +2006-03-03 Jakub Jelinek <jakub@redhat.com> + + * dwarf.c (frame_display_row, display_debug_frames): Handle + DW_CFA_val_offset, DW_CFA_val_offset_sf and DW_CFA_val_expression. + +2006-02-28 Nick Clifton <nickc@redhat.com> + + * objcopy.c (use_alt_mach_code): Change type to unsigned long. + (copy_object): If bfd_alt_mach_code fails emit a more helpful + message and if the target architecture is ELF use the alternative + as replacement value for the e_machine number. + (copy_main): Use strtoul to parse the number provided with the + --alt-mach-code switch. + * doc/binutils.texi (--alt-mach-code): Document that this switch + can now set the absolute e_machine value. + +2006-02-27 Carlos O'Donell <carlos@codesourcery.com> + + * po/Make-in: Add html target. + +2006-02-17 Nick Hudson <nick.hudson@dsl.pipex.com> + + * readelf.c (get_machine_flags): Add logic for missing EF_SH flags. + +2006-02-14 Jakub Jelinek <jakub@redhat.com> + + * config.in: Rebuilt. + +2006-02-10 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/2258 + * readelf.c (process_program_headers): Use + ELF_IS_SECTION_IN_SEGMENT_MEMORY. + +2006-02-09 Eric Botcazou <ebotcazou@libertysurf.fr> + + * configure.in (CHECK_DECLS): Add snprintf and vsnprintf. + * configure: Regenerate. + * objdump.c (fprintf): Remove declaration. + * bucomm.h (fprintf): Declare if not already declared. + (snprintf): Likewise. + (vsnprintf): Likewise. + +2006-02-08 H.J. Lu <hongjiu.lu@intel.com> + + * readelf.c (process_program_headers): Match PT_TLS segment + only with SHT_TLS sections. + +2006-02-07 Nathan Sidwell <nathan@codesourcery.com> + + * readelf.c (get_machine_flags): Add logic for EF_M68K flags. + +2006-02-02 H.J. Lu <hongjiu.lu@intel.com> + + * readelf.c (process_program_headers): Undo the last change. + +2006-02-02 H.J. Lu <hongjiu.lu@intel.com> + + * readelf.c (process_program_headers): Undo the change made on + 2004-09-22. Match PT_DYNAMIC segment only with SHT_DYNAMIC + sections. + +2006-01-30 Nick Clifton <nickc@redhat.com> + + * objcopy.c (copy_object): Catch the case where an attempt is made + to add a section that already exists and produce a more helpful + warning message. + +2006-01-26 Nick Clifton <nickc@redhat.com> + + * po/vi.po: New Vietnamese translation. + * configure.in (ALL_LINGUAS): Add vi. + * configure: Regenerate. + +2006-01-18 Alexandre Oliva <aoliva@redhat.com> + + Introduce TLS descriptors for i386 and x86_64. + * readelf.c (get_dynamic_type): Handle DT_TLSDESC_GOT and + DT_TLSDESC_PLT. + +2006-01-18 Nick Clifton <nickc@redhat.com> + + PR binutils/1391 + * objcopy.c (copy_object): For PE format targets set the VMA of a + newly created gnu_debuglink section to a non-zero, aligned, + contiguous value. + * Makefile.am (objcopy.c): Add a dependency upon libbfd.h. + * Makefile.in: Regenerate. + +2006-01-17 Andreas Schwab <schwab@suse.de> + + PR binutils/1486 + * configure.in: Don't define DISASSEMBLER_NEEDS_RELOCS. + * configure: Regenerate. + * objdump.c (struct objdump_disasm_info): Don't check for + DISASSEMBLER_NEEDS_RELOCS. + (objdump_print_addr): Likewise. + (disassemble_bytes): Check disassembler_needs_relocs from + disassemble_info at run-time instead of DISASSEMBLER_NEEDS_RELOCS + at compile-time. + (disassemble_section): Likewise. + (disassemble_data): Initialize it. + +2006-01-11 Alan Modra <amodra@bigpond.net.au> + + * objcopy.c (copy_object): Fix thinko. + + * objcopy.c (copy_object): Set isympp and osympp to NULL after free. + +2006-01-09 Mike Frysinger <vapier@gentoo.org>: + + * readelf.c (guess_is_rela): Add case for Nios/Nios II. + (get_machine_name): Likewise. + +For older changes see ChangeLog-2005 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/binutils/MAINTAINERS b/binutils/MAINTAINERS index f5beb0343b48..a3fdce306051 100644 --- a/binutils/MAINTAINERS +++ b/binutils/MAINTAINERS @@ -5,7 +5,7 @@ of the GNU Binary Utilities project. This includes the linker (ld), the assembler (gas), the profiler (gprof), a whole suite of other programs (binutils) and the libraries that they use (bfd and opcodes). This project shares a common set of header files with the -GCC and GDB projects (include), so maintainership of those files is +GCC and GDB projects (include), so maintainership of those files is shared amoungst the projects. The home page for binutils is: @@ -14,8 +14,8 @@ The home page for binutils is: and patches should be sent to: - bug-binutils@gnu.org or binutils@sources.redhat.com - + binutils@sourceware.org + with "[Patch]" as part of the subject line. Note - patches to the top level config.guess and config.sub scripts should be sent to: @@ -25,13 +25,13 @@ and not to the binutils lists. Patches to the other top level configure files (configure, configure.in, config-ml.in) should be sent to the binutils lists, and copied to the gcc and gdb lists as well (gcc-patches@gcc.gnu.org and -gdb-patches@sources.redhat.com). +gdb-patches@sourceware.org). --------- Blanket Write Privs --------- The following people have permission to check patches into the repository without obtaining approval first: - + Nick Clifton <nickc@redhat.com> (head maintainer) Richard Henderson <rth@redhat.com> Ian Lance Taylor <ian@airs.com> @@ -58,7 +58,7 @@ responsibility among the other maintainers. ALPHA Richard Henderson <rth@redhat.com> ARM Nick Clifton <nickc@redhat.com> ARM Richard Earnshaw <rearnsha@arm.com> - ARM (Symbian) Paul Brook <paul@codesourcery.com> + ARM Paul Brook <paul@codesourcery.com> ARM (Symbian) Mark Mitchell <mark@codesourcery.com> AVR Denis Chertykov <denisc@overta.ru> AVR Marek Michalkiewicz <marekm@amelek.gda.pl> @@ -73,7 +73,7 @@ responsibility among the other maintainers. FR30 Dave Brolley <brolley@redhat.com> FRV Dave Brolley <brolley@redhat.com> FRV Alexandre Oliva <aoliva@redhat.com> - H8300 Anil Paranjpe <anilp1@kpitcummins.com> + H8300 Anil Paranjpe <anilp1@kpitcummins.com> HPPA Dave Anglin <dave.anglin@nrc.ca> HPPA elf32 Alan Modra <amodra@bigpond.net.au> HPPA elf64 Jeff Law <law@redhat.com> [Basic maintainance only] @@ -83,33 +83,36 @@ responsibility among the other maintainers. ix86 Alan Modra <amodra@bigpond.net.au> ix86 PE Christopher Faylor <cgf@redhat.com> ix86 COFF DJ Delorie <dj@redhat.com> - ix86 H.J.Lu <hjl@gnu.org> + ix86 H.J. Lu <hjl@gnu.org> ix86 INTEL MODE Jan Beulich <jbeulich@novell.com> M68HC11 M68HC12 Stephane Carrez <stcarrez@nerim.fr> M68k Ben Elliston <bje@gnu.org> M88k Mark Kettenis <kettenis@gnu.org> MAXQ Inderpreet Singh <inderpreetb@noida.hcltech.com> + MEP Dave Brolley <brolley@redhat.com> MIPS Eric Christopher <echristo@apple.com> MIPS Thiemo Seufer <ths@networkno.de> MMIX Hans-Peter Nilsson <hp@bitrange.com> MN10300 Eric Christopher <echristo@apple.com> MN10300 Alexandre Oliva <aoliva@redhat.com> MSP430 Dmitry Diky <diwil@spec.ru> + NetBSD support Matt Thomas <matt@netbsd.org> PPC Geoff Keating <geoffk@geoffk.org> + PPC Alan Modra <amodra@bigpond.net.au> PPC vector ext Aldy Hernandez <aldyh@redhat.com> s390, s390x Martin Schwidefsky <schwidefsky@de.ibm.com> - SH Jörn Rennecke <joern.rennecke@superh.com> + SCORE Mei Ligang <ligang@sunnorth.com.cn> SH Alexandre Oliva <aoliva@redhat.com> SH Kaz Kojima <kkojima@rr.iij4u.or.jp> SPARC Jakub Jelinek <jakub@redhat.com> TESTSUITES Ben Elliston <bje@gnu.org> TIC4X Svein Seldal <svein@dev.seldal.com> TIC54X Timothy Wall <twall@alum.mit.edu> - VAX Jason R Thorpe <thorpej@netbsd.org> + VAX Matt Thomas <matt@netbsd.org> VAX Jan-Benedict Glaw <jbglaw@lug-owl.de> x86_64 Jan Hubicka <jh@suse.cz> x86_64 Andreas Jaeger <aj@suse.de> - x86_64 H.J.Lu <hjl@gnu.org> + x86_64 H.J. Lu <hjl@gnu.org> Xtensa Bob Wilson <bob.wilson@acm.org> z80 Arnold Metselaar <arnold.metselaar@planet.nl> z8k Christian Groessler <chris@groessler.org> @@ -121,11 +124,11 @@ CGEN is a tool for building, amongst other things, assemblers, disassemblers and simulators from a single description of a CPU. It creates files in several of the binutils directories, but it is mentioned here since there is a single group that maintains -CGEN and the files that it creates. +CGEN and the files that it creates. If you have CGEN related problems you can send email to; - cgen@sources.redhat.com + cgen@sourceware.org The current CGEN maintainers are: @@ -158,7 +161,7 @@ If a patch is approved for check in to the mainline sources, it can also be checked into the current release branch. Normally however only bug fixes should be applied to the branch. New features, new ports, etc, should be restricted to the mainline. (Otherwise the -burden of maintaining the branch in sync with the mainline becomes too +burden of maintaining the branch in sync with the mainline becomes too great). If you are uncertain as to whether a patch is appropriate for the branch, ask the branch maintainer. This is: @@ -194,7 +197,7 @@ to contributions on a branch. Before creating the branch, you should select a name for the branch of the form: - binutils-<org>-<name> + binutils-<org>-<name> where "org" is the initials of your organization, or your own initials if you are acting as an individual. For example, for a branch created @@ -238,7 +241,7 @@ Having selected the branch name, create the branch as follows: 3. Create the branch: cvs rtag -b -r binutils-<org>-<name>-branchpoint \ - binutils-<org>-<name>-branch + binutils-<org>-<name>-branch 4. Document the branch: diff --git a/binutils/Makefile.am b/binutils/Makefile.am index 1b4e85adb8a7..34c03ce6831e 100644 --- a/binutils/Makefile.am +++ b/binutils/Makefile.am @@ -1,9 +1,7 @@ ## Process this file with automake to generate Makefile.in -## FIXME: Work around apparent bug in automake. -INTLLIBS = @INTLLIBS@ - AUTOMAKE_OPTIONS = cygnus dejagnu +ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd SUBDIRS = doc po @@ -22,6 +20,7 @@ LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` WARN_CFLAGS = @WARN_CFLAGS@ NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) +LIBICONV = @LIBICONV@ # these two are almost the same program AR_PROG=ar @@ -49,22 +48,22 @@ ADDR2LINE_PROG=addr2line NLMCONV_PROG=nlmconv DLLTOOL_PROG=dlltool WINDRES_PROG=windres +WINDMC_PROG=windmc DLLWRAP_PROG=dllwrap -SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) - -PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ +SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ +bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ @BUILD_WINDMC@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@ ## We need a special rule to install the programs which are built with ## -new, and to rename cxxfilt to c++filt. -noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) +RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) +noinst_PROGRAMS = $(RENAMED_PROGS) @BUILD_MISC@ -EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG) +EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) # Stuff that goes in tooldir/ if appropriate. -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump +TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd @@ -75,33 +74,35 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE \ -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \ @HDEFINES@ \ - -I$(srcdir)/../intl -I../intl \ + @INCINTL@ \ -DLOCALEDIR="\"$(datadir)/locale\"" \ -Dbin_dummy_emulation=$(EMULATION_VECTOR) HFILES = \ - arsup.h binemul.h bucomm.h budbg.h budemang.h \ + arsup.h binemul.h bucomm.h budbg.h \ coffgrok.h debug.h dlltool.h nlmconv.h \ - windres.h winduni.h + windres.h winduni.h windint.h \ + windmc.h -GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h +GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h CFILES = \ - addr2line.c ar.c arsup.c binemul.c bucomm.c budemang.c \ + addr2line.c ar.c arsup.c bin2c.c binemul.c bucomm.c \ coffdump.c coffgrok.c cxxfilt.c \ dwarf.c debug.c dlltool.c dllwrap.c \ emul_aix.c emul_vanilla.c filemode.c \ ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \ nlmconv.c nm.c not-ranlib.c not-strip.c \ objcopy.c objdump.c prdbg.c \ - rdcoff.c rddbg.c readelf.c rename.c \ + rclex.c rdcoff.c rddbg.c readelf.c rename.c \ resbin.c rescoff.c resrc.c resres.c \ size.c srconv.c stabs.c strings.c sysdump.c version.c \ - windres.c winduni.c wrstabs.c + windres.c winduni.c wrstabs.c \ + windmc.c mclex.c GENERATED_CFILES = \ arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ - defparse.c deflex.c nlmheader.c rcparse.c rclex.c + defparse.c deflex.c nlmheader.c rcparse.c mcparse.c DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c @@ -117,8 +118,8 @@ LIBIBERTY = ../libiberty/libiberty.a .PHONY: install-html install-html-am install-html-recursive -install-html: install-html-recursive - +install-html: install-html-recursive + install-html-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ @@ -182,7 +183,30 @@ check-DEJAGNU: site.exp installcheck: /bin/sh $(srcdir)/sanity.sh $(bindir) -LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) +# There's no global DEPENDENCIES. So, we must explicitly list everything +# which depends on libintl, since we don't know whether LIBINTL_DEP will be +# non-empty until configure time. Ugh! +size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) +nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) +dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) + +LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) size_SOURCES = size.c $(BULIBS) @@ -191,14 +215,14 @@ objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) strings_SOURCES = strings.c $(BULIBS) readelf_SOURCES = readelf.c version.c unwind-ia64.c dwarf.c -readelf_LDADD = $(INTLLIBS) $(LIBIBERTY) +readelf_LDADD = $(LIBINTL) $(LIBIBERTY) strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) -nm_new_SOURCES = nm.c budemang.c $(BULIBS) +nm_new_SOURCES = nm.c $(BULIBS) -objdump_SOURCES = objdump.c dwarf.c budemang.c prdbg.c $(DEBUG_SRCS) $(BULIBS) -objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) +objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) +objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) objdump.o:objdump.c $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c @@ -207,13 +231,13 @@ cxxfilt_SOURCES = cxxfilt.c $(BULIBS) ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) -ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \ binemul.c emul_$(EMULATION).c $(BULIBS) -ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) -addr2line_SOURCES = addr2line.c budemang.c $(BULIBS) +addr2line_SOURCES = addr2line.c $(BULIBS) # The following is commented out for the conversion to automake. # This rule creates a single binary that switches between ar and ranlib @@ -233,7 +257,7 @@ addr2line_SOURCES = addr2line.c budemang.c $(BULIBS) # -rm -f $(STRIP_PROG) # -ln $(OBJCOPY_PROG) $(STRIP_PROG) -sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info +sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -g <$(srcdir)/sysroff.info >>sysroff.c @@ -258,15 +282,23 @@ sysinfo.o: $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c -Wno-error ; \ fi +bin2c$(EXEEXT_FOR_BUILD): + $(CC_FOR_BUILD) -o $@ $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) $(srcdir)/bin2c.c $(srcdir)/version.c + +embedspu: embedspu.sh + sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@ + chmod a+x $@ + # We need these for parallel make. arparse.h: arparse.c defparse.h: defparse.c nlmheader.h: nlmheader.c rcparse.h: rcparse.c +mcparse.h: mcparse.c sysinfo.h: sysinfo.c # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. arparse.o: $(COMPILE) -c $< $(NO_WERROR) arlex.o: @@ -281,13 +313,17 @@ nlmheader.o: $(COMPILE) -c $< $(NO_WERROR) rcparse.o: $(COMPILE) -c $< $(NO_WERROR) +mcparse.o: + $(COMPILE) -c $< $(NO_WERROR) rclex.o: $(COMPILE) -c $< $(NO_WERROR) +mclex.o: + $(COMPILE) -c $< $(NO_WERROR) srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) -dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) dlltool.o: $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c @@ -307,22 +343,26 @@ nlmconv.o: nlmconv.c $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS) -windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ +windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \ winduni.c resres.c $(BULIBS) -windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) + +windmc_SOURCES = windmc.c mcparse.y mclex.c \ + winduni.c $(BULIBS) +windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) dllwrap_SOURCES = dllwrap.c version.c -dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) +dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL) EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ - syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c + syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \ + mcparse.h mcparse.c diststuff: $(EXTRA_DIST) info all: info -DISTCLEANFILES = sysinfo sysroff.c sysroff.h \ - site.exp site.bak +DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak # Targets to rebuild dependencies in this Makefile. # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). @@ -371,7 +411,8 @@ dep-am: DEP ### -MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh* +MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \ + binutils.log binutils.sum abcdefgh* mostlyclean-local: -rm -rf tmpdir @@ -380,10 +421,10 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 .PHONY: install-exec-local install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + @list='$(RENAMED_PROGS)'; for p in $$list; do \ + if test -f $$p$(EXEEXT); then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin @@ -404,208 +445,250 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -addr2line.o: addr2line.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ - $(INCDIR)/demangle.h bucomm.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h budemang.h -ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/libiberty.h $(INCDIR)/progress.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - arsup.h $(INCDIR)/filenames.h binemul.h -arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h arsup.h $(INCDIR)/libiberty.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h -binemul.o: binemul.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/libiberty.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -budemang.o: budemang.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - budemang.h -coffdump.o: coffdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h coffgrok.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -coffgrok.o: coffgrok.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h coffgrok.h -cxxfilt.o: cxxfilt.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/demangle.h $(INCDIR)/safe-ctype.h -dwarf.o: dwarf.c dwarf.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/elf/dwarf2.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h -debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h -dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h \ - $(INCDIR)/dyn-string.h dlltool.h $(INCDIR)/safe-ctype.h -dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h -emul_aix.o: emul_aix.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h $(BFDDIR)/libxcoff.h -emul_vanilla.o: emul_vanilla.c binemul.h ../bfd/bfd.h \ - $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/ieee.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ - budbg.h $(INCDIR)/filenames.h +addr2line.o: addr2line.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + bucomm.h +ar.o: ar.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/progress.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h bucomm.h arsup.h $(INCDIR)/filenames.h \ + binemul.h +arsup.o: arsup.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h bucomm.h arsup.h +bin2c.o: bin2c.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h +binemul.o: binemul.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +bucomm.o: bucomm.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ + bucomm.h +coffdump.o: coffdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h coffgrok.h +coffgrok.o: coffgrok.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h bucomm.h coffgrok.h +cxxfilt.o: cxxfilt.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h bucomm.h +dwarf.o: dwarf.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/elf/dwarf2.h \ + dwarf.h +debug.o: debug.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + debug.h +dlltool.o: dlltool.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/dyn-string.h bucomm.h dlltool.h $(INCDIR)/safe-ctype.h +dllwrap.o: dllwrap.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h bucomm.h +emul_aix.o: emul_aix.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(BFDDIR)/libxcoff.h +emul_vanilla.o: emul_vanilla.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +filemode.o: filemode.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +ieee.o: ieee.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/ieee.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h debug.h budbg.h $(INCDIR)/filenames.h is-ranlib.o: is-ranlib.c is-strip.o: is-strip.c maybe-ranlib.o: maybe-ranlib.c maybe-strip.o: maybe-strip.c -nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ - $(BFDDIR)/libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h nlmconv.h -nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h budemang.h $(INCDIR)/aout/stab_gnu.h \ +nlmconv.o: nlmconv.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(BFDDIR)/libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \ + nlmconv.h bucomm.h +nm.o: nm.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/progress.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h \ - $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/common.h \ + bucomm.h not-ranlib.o: not-ranlib.c not-strip.o: not-strip.c -objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ +objcopy.o: objcopy.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \ budbg.h $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h -objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/progress.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - dwarf.h $(INCDIR)/elf/dwarf2.h budemang.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/dis-asm.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - debug.h budbg.h $(INCDIR)/aout/aout64.h -prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ + $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +objdump.o: objdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ + bucomm.h dwarf.h $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h \ + ../bfd/bfd.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h debug.h \ + budbg.h $(INCDIR)/aout/aout64.h +prdbg.o: prdbg.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h debug.h \ budbg.h -rdcoff.o: rdcoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h budbg.h $(BFDDIR)/libcoff.h \ +rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windres.h $(INCDIR)/ansidecl.h \ + winduni.h windint.h rcparse.h +rdcoff.o: rdcoff.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h debug.h budbg.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ - budbg.h -readelf.o: readelf.c dwarf.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/alpha.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h \ - $(INCDIR)/elf/avr.h $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cris.h \ +rddbg.o: rddbg.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + bucomm.h debug.h budbg.h +readelf.o: readelf.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h dwarf.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/avr.h \ + $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/crx.h \ $(INCDIR)/elf/d10v.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/dlx.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/h8.h \ - $(INCDIR)/elf/hppa.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h \ - $(INCDIR)/elf/i860.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/m32c.h $(INCDIR)/elf/m32r.h \ + $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/i860.h \ + $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/ip2k.h \ + $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/m32c.h $(INCDIR)/elf/m32r.h \ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/mcore.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/mn10200.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/msp430.h \ - $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h \ - $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/crx.h \ - $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/xtensa.h $(INCDIR)/aout/ar.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h unwind-ia64.h -rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -resbin.o: resbin.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h -rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - windres.h winduni.h -resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h -size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h -srconv.o: srconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - sysroff.c -stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/filenames.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h -sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h \ - sysroff.h sysroff.c -version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -windres.o: windres.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - windres.h winduni.h -winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h winduni.h $(INCDIR)/safe-ctype.h -wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/elf/mep.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h \ + $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/mt.h \ + $(INCDIR)/elf/msp430.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h \ + $(INCDIR)/elf/score.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/spu.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/xtensa.h \ + $(INCDIR)/aout/ar.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + unwind-ia64.h +rename.o: rename.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h +resbin.o: resbin.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + windres.h winduni.h windint.h +rescoff.o: rescoff.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +resrc.o: resrc.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windres.h winduni.h windint.h +resres.o: resres.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + windres.h winduni.h windint.h +size.o: size.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + bucomm.h +srconv.o: srconv.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h sysroff.c +stabs.o: stabs.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + debug.h budbg.h $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +strings.o: strings.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h +sysdump.o: sysdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \ + sysroff.h sysroff.c $(INCDIR)/ansidecl.h +version.o: version.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +windres.o: windres.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + windres.h winduni.h windint.h +winduni.o: winduni.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h winduni.h $(INCDIR)/safe-ctype.h +wrstabs.o: wrstabs.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h \ debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h arsup.h +windmc.o: windmc.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h windmc.h \ + winduni.h windint.h +mclex.o: mclex.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windmc.h winduni.h mcparse.h +arparse.o: arparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arsup.h arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - arparse.h + $(INCDIR)/ansidecl.h arparse.h sysroff.o: sysroff.c sysinfo.o: sysinfo.c syslex.o: syslex.c config.h sysinfo.h -defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h dlltool.h +defparse.o: defparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h dlltool.h deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - defparse.h dlltool.h -nlmheader.o: nlmheader.c $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \ - ../bfd/bfd.h $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ + defparse.h dlltool.h $(INCDIR)/ansidecl.h +nlmheader.o: nlmheader.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ + ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h bucomm.h \ nlmconv.h -rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h $(INCDIR)/safe-ctype.h -rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - windres.h winduni.h rcparse.h +rcparse.o: rcparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \ + $(INCDIR)/safe-ctype.h +mcparse.o: mcparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windmc.h winduni.h $(INCDIR)/safe-ctype.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/binutils/Makefile.in b/binutils/Makefile.in index 8b5ab820548f..9cf28fdc7796 100644 --- a/binutils/Makefile.in +++ b/binutils/Makefile.in @@ -37,30 +37,40 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -bin_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ - $(am__EXEEXT_8) $(am__EXEEXT_9) $(am__EXEEXT_10) \ +bin_PROGRAMS = $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8) \ + $(am__EXEEXT_9) $(am__EXEEXT_10) $(am__EXEEXT_11) \ @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \ - $(am__EXEEXT_11) $(am__EXEEXT_12) @BUILD_DLLWRAP@ @BUILD_MISC@ -noinst_PROGRAMS = $(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) + @BUILD_WINDMC@ $(am__EXEEXT_12) $(am__EXEEXT_13) \ + @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@ $(am__empty) +noinst_PROGRAMS = $(am__EXEEXT_17) @BUILD_MISC@ EXTRA_PROGRAMS = $(am__EXEEXT_1) srconv$(EXEEXT) sysdump$(EXEEXT) \ coffdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \ - $(am__EXEEXT_4) + $(am__EXEEXT_4) $(am__EXEEXT_5) DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \ README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.in $(srcdir)/../mkinstalldirs \ $(top_srcdir)/po/Make-in arparse.h arparse.c arlex.c \ defparse.h defparse.c deflex.c nlmheader.h nlmheader.c \ - arparse.h arparse.c arlex.c rcparse.h rcparse.c rclex.c \ - $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \ + arparse.h arparse.c arlex.c mcparse.h mcparse.c rcparse.h \ + rcparse.c $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \ $(srcdir)/../config.guess $(srcdir)/../config.sub subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../bfd/acinclude.m4 \ - $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ - $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../bfd/warning.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/iconv.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/lib-ld.m4 \ + $(top_srcdir)/../config/lib-link.m4 \ + $(top_srcdir)/../config/lib-prefix.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -71,67 +81,53 @@ CONFIG_CLEAN_FILES = po/Makefile.in am__EXEEXT_1 = nlmconv$(EXEEXT) am__EXEEXT_2 = dlltool$(EXEEXT) am__EXEEXT_3 = windres$(EXEEXT) -am__EXEEXT_4 = dllwrap$(EXEEXT) -am__EXEEXT_5 = size$(EXEEXT) -am__EXEEXT_6 = objdump$(EXEEXT) -am__EXEEXT_7 = ar$(EXEEXT) -am__EXEEXT_8 = strings$(EXEEXT) -am__EXEEXT_9 = ranlib$(EXEEXT) -am__EXEEXT_10 = objcopy$(EXEEXT) -am__EXEEXT_11 = addr2line$(EXEEXT) -am__EXEEXT_12 = readelf$(EXEEXT) +am__EXEEXT_4 = windmc$(EXEEXT) +am__EXEEXT_5 = dllwrap$(EXEEXT) +am__EXEEXT_6 = size$(EXEEXT) +am__EXEEXT_7 = objdump$(EXEEXT) +am__EXEEXT_8 = ar$(EXEEXT) +am__EXEEXT_9 = strings$(EXEEXT) +am__EXEEXT_10 = ranlib$(EXEEXT) +am__EXEEXT_11 = objcopy$(EXEEXT) +am__EXEEXT_12 = addr2line$(EXEEXT) +am__EXEEXT_13 = readelf$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -am__EXEEXT_13 = nm-new$(EXEEXT) -am__EXEEXT_14 = strip-new$(EXEEXT) -am__EXEEXT_15 = cxxfilt$(EXEEXT) +am__EXEEXT_14 = nm-new$(EXEEXT) +am__EXEEXT_15 = strip-new$(EXEEXT) +am__EXEEXT_16 = cxxfilt$(EXEEXT) +am__EXEEXT_17 = $(am__EXEEXT_14) $(am__EXEEXT_15) $(am__EXEEXT_16) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) -am_addr2line_OBJECTS = addr2line.$(OBJEXT) budemang.$(OBJEXT) \ - $(am__objects_1) +am_addr2line_OBJECTS = addr2line.$(OBJEXT) $(am__objects_1) addr2line_OBJECTS = $(am_addr2line_OBJECTS) addr2line_LDADD = $(LDADD) am__DEPENDENCIES_1 = ../bfd/libbfd.la am__DEPENDENCIES_2 = ../libiberty/libiberty.a am__DEPENDENCIES_3 = -addr2line_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \ not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \ binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1) ar_OBJECTS = $(am_ar_OBJECTS) -ar_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \ $(am__objects_1) coffdump_OBJECTS = $(am_coffdump_OBJECTS) coffdump_LDADD = $(LDADD) -coffdump_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_cxxfilt_OBJECTS = cxxfilt.$(OBJEXT) $(am__objects_1) cxxfilt_OBJECTS = $(am_cxxfilt_OBJECTS) cxxfilt_LDADD = $(LDADD) -cxxfilt_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_dlltool_OBJECTS = dlltool.$(OBJEXT) defparse.$(OBJEXT) \ deflex.$(OBJEXT) $(am__objects_1) dlltool_OBJECTS = $(am_dlltool_OBJECTS) -dlltool_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_dllwrap_OBJECTS = dllwrap.$(OBJEXT) version.$(OBJEXT) dllwrap_OBJECTS = $(am_dllwrap_OBJECTS) -dllwrap_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) am_nlmconv_OBJECTS = nlmconv.$(OBJEXT) nlmheader.$(OBJEXT) \ $(am__objects_1) nlmconv_OBJECTS = $(am_nlmconv_OBJECTS) nlmconv_LDADD = $(LDADD) -nlmconv_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) -am_nm_new_OBJECTS = nm.$(OBJEXT) budemang.$(OBJEXT) $(am__objects_1) +am_nm_new_OBJECTS = nm.$(OBJEXT) $(am__objects_1) nm_new_OBJECTS = $(am_nm_new_OBJECTS) nm_new_LDADD = $(LDADD) -nm_new_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am__objects_2 = rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \ ieee.$(OBJEXT) rdcoff.$(OBJEXT) am__objects_3 = $(am__objects_2) wrstabs.$(OBJEXT) @@ -139,69 +135,52 @@ am_objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \ rename.$(OBJEXT) $(am__objects_3) $(am__objects_1) objcopy_OBJECTS = $(am_objcopy_OBJECTS) objcopy_LDADD = $(LDADD) -objcopy_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) -am_objdump_OBJECTS = objdump.$(OBJEXT) dwarf.$(OBJEXT) \ - budemang.$(OBJEXT) prdbg.$(OBJEXT) $(am__objects_2) \ - $(am__objects_1) +am_objdump_OBJECTS = objdump.$(OBJEXT) dwarf.$(OBJEXT) prdbg.$(OBJEXT) \ + $(am__objects_2) $(am__objects_1) objdump_OBJECTS = $(am_objdump_OBJECTS) am__DEPENDENCIES_4 = ../opcodes/libopcodes.la -objdump_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) am_ranlib_OBJECTS = ar.$(OBJEXT) is-ranlib.$(OBJEXT) arparse.$(OBJEXT) \ arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \ binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1) ranlib_OBJECTS = $(am_ranlib_OBJECTS) -ranlib_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_readelf_OBJECTS = readelf.$(OBJEXT) version.$(OBJEXT) \ unwind-ia64.$(OBJEXT) dwarf.$(OBJEXT) readelf_OBJECTS = $(am_readelf_OBJECTS) -readelf_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) am_size_OBJECTS = size.$(OBJEXT) $(am__objects_1) size_OBJECTS = $(am_size_OBJECTS) size_LDADD = $(LDADD) -size_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_srconv_OBJECTS = srconv.$(OBJEXT) coffgrok.$(OBJEXT) \ $(am__objects_1) srconv_OBJECTS = $(am_srconv_OBJECTS) srconv_LDADD = $(LDADD) -srconv_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_strings_OBJECTS = strings.$(OBJEXT) $(am__objects_1) strings_OBJECTS = $(am_strings_OBJECTS) strings_LDADD = $(LDADD) -strings_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_strip_new_OBJECTS = objcopy.$(OBJEXT) is-strip.$(OBJEXT) \ rename.$(OBJEXT) $(am__objects_3) $(am__objects_1) strip_new_OBJECTS = $(am_strip_new_OBJECTS) strip_new_LDADD = $(LDADD) -strip_new_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_sysdump_OBJECTS = sysdump.$(OBJEXT) $(am__objects_1) sysdump_OBJECTS = $(am_sysdump_OBJECTS) sysdump_LDADD = $(LDADD) -sysdump_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) +am_windmc_OBJECTS = windmc.$(OBJEXT) mcparse.$(OBJEXT) mclex.$(OBJEXT) \ + winduni.$(OBJEXT) $(am__objects_1) +windmc_OBJECTS = $(am_windmc_OBJECTS) am_windres_OBJECTS = windres.$(OBJEXT) resrc.$(OBJEXT) \ rescoff.$(OBJEXT) resbin.$(OBJEXT) rcparse.$(OBJEXT) \ rclex.$(OBJEXT) winduni.$(OBJEXT) resres.$(OBJEXT) \ $(am__objects_1) windres_OBJECTS = $(am_windres_OBJECTS) -windres_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) @@ -214,7 +193,8 @@ SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(coffdump_SOURCES) \ $(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) \ $(objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \ $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \ - $(strip_new_SOURCES) $(sysdump_SOURCES) $(windres_SOURCES) + $(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \ + $(windres_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -238,9 +218,11 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_DLLTOOL = @BUILD_DLLTOOL@ BUILD_DLLWRAP = @BUILD_DLLWRAP@ +BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@ BUILD_MISC = @BUILD_MISC@ BUILD_NLMCONV = @BUILD_NLMCONV@ BUILD_SRCONV = @BUILD_SRCONV@ +BUILD_WINDMC = @BUILD_WINDMC@ BUILD_WINDRES = @BUILD_WINDRES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ @@ -256,6 +238,7 @@ DEFS = @DEFS@ DEMANGLER_NAME = @DEMANGLER_NAME@ DEPDIR = @DEPDIR@ DLLTOOL_DEFS = @DLLTOOL_DEFS@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -264,28 +247,32 @@ EMULATION = @EMULATION@ EMULATION_VECTOR = @EMULATION_VECTOR@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GMOFILES = @GMOFILES@ +FGREP = @FGREP@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ +GREP = @GREP@ HDEFINES = @HDEFINES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INCINTL = @INCINTL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -293,7 +280,9 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ NLMCONV_DEFS = @NLMCONV_DEFS@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJDUMP_DEFS = @OBJDUMP_DEFS@ OBJEXT = @OBJEXT@ @@ -304,19 +293,20 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ XGETTEXT = @XGETTEXT@ YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ @@ -345,10 +335,10 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -363,6 +353,7 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AUTOMAKE_OPTIONS = cygnus dejagnu +ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd SUBDIRS = doc po tooldir = $(exec_prefix)/$(target_alias) YFLAGS = -d @@ -390,12 +381,13 @@ ADDR2LINE_PROG = addr2line NLMCONV_PROG = nlmconv DLLTOOL_PROG = dlltool WINDRES_PROG = windres +WINDMC_PROG = windmc DLLWRAP_PROG = dllwrap -SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ +SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) +RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) # Stuff that goes in tooldir/ if appropriate. -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump +TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include @@ -403,32 +395,34 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE \ -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \ @HDEFINES@ \ - -I$(srcdir)/../intl -I../intl \ + @INCINTL@ \ -DLOCALEDIR="\"$(datadir)/locale\"" \ -Dbin_dummy_emulation=$(EMULATION_VECTOR) HFILES = \ - arsup.h binemul.h bucomm.h budbg.h budemang.h \ + arsup.h binemul.h bucomm.h budbg.h \ coffgrok.h debug.h dlltool.h nlmconv.h \ - windres.h winduni.h + windres.h winduni.h windint.h \ + windmc.h -GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h +GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h CFILES = \ - addr2line.c ar.c arsup.c binemul.c bucomm.c budemang.c \ + addr2line.c ar.c arsup.c bin2c.c binemul.c bucomm.c \ coffdump.c coffgrok.c cxxfilt.c \ dwarf.c debug.c dlltool.c dllwrap.c \ emul_aix.c emul_vanilla.c filemode.c \ ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \ nlmconv.c nm.c not-ranlib.c not-strip.c \ objcopy.c objdump.c prdbg.c \ - rdcoff.c rddbg.c readelf.c rename.c \ + rclex.c rdcoff.c rddbg.c readelf.c rename.c \ resbin.c rescoff.c resrc.c resres.c \ size.c srconv.c stabs.c strings.c sysdump.c version.c \ - windres.c winduni.c wrstabs.c + windres.c winduni.c wrstabs.c \ + windmc.c mclex.c GENERATED_CFILES = \ arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ - defparse.c deflex.c nlmheader.c rcparse.c rclex.c + defparse.c deflex.c nlmheader.c rcparse.c mcparse.c DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c @@ -456,47 +450,75 @@ CC_FOR_TARGET = ` \ fi; \ fi` -LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) + +# There's no global DEPENDENCIES. So, we must explicitly list everything +# which depends on libintl, since we don't know whether LIBINTL_DEP will be +# non-empty until configure time. Ugh! +size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) +nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) +dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) +LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) size_SOURCES = size.c $(BULIBS) objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) strings_SOURCES = strings.c $(BULIBS) readelf_SOURCES = readelf.c version.c unwind-ia64.c dwarf.c -readelf_LDADD = $(INTLLIBS) $(LIBIBERTY) +readelf_LDADD = $(LIBINTL) $(LIBIBERTY) strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) -nm_new_SOURCES = nm.c budemang.c $(BULIBS) -objdump_SOURCES = objdump.c dwarf.c budemang.c prdbg.c $(DEBUG_SRCS) $(BULIBS) -objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) +nm_new_SOURCES = nm.c $(BULIBS) +objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) +objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) cxxfilt_SOURCES = cxxfilt.c $(BULIBS) ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) -ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \ binemul.c emul_$(EMULATION).c $(BULIBS) -ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) -addr2line_SOURCES = addr2line.c budemang.c $(BULIBS) +ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) +addr2line_SOURCES = addr2line.c $(BULIBS) srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) -dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS) sysdump_SOURCES = sysdump.c $(BULIBS) nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS) -windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ +windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \ winduni.c resres.c $(BULIBS) -windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) +windmc_SOURCES = windmc.c mcparse.y mclex.c \ + winduni.c $(BULIBS) + +windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) dllwrap_SOURCES = dllwrap.c version.c -dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) +dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL) EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ - syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c - -DISTCLEANFILES = sysinfo sysroff.c sysroff.h \ - site.exp site.bak + syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \ + mcparse.h mcparse.c +DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak ### -MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh* +MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \ + binutils.log binutils.sum abcdefgh* + CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -509,15 +531,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \ + cd $(srcdir) && $(AUTOMAKE) --cygnus \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + $(AUTOMAKE) --cygnus Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -641,6 +663,9 @@ strip-new$(EXEEXT): $(strip_new_OBJECTS) $(strip_new_DEPENDENCIES) sysdump$(EXEEXT): $(sysdump_OBJECTS) $(sysdump_DEPENDENCIES) @rm -f sysdump$(EXEEXT) $(LINK) $(sysdump_LDFLAGS) $(sysdump_OBJECTS) $(sysdump_LDADD) $(LIBS) +windmc$(EXEEXT): $(windmc_OBJECTS) $(windmc_DEPENDENCIES) + @rm -f windmc$(EXEEXT) + $(LINK) $(windmc_LDFLAGS) $(windmc_OBJECTS) $(windmc_LDADD) $(LIBS) windres$(EXEEXT): $(windres_OBJECTS) $(windres_DEPENDENCIES) @rm -f windres$(EXEEXT) $(LINK) $(windres_LDFLAGS) $(windres_OBJECTS) $(windres_LDADD) $(LIBS) @@ -872,9 +897,10 @@ maintainer-clean-generic: -rm -f deflex.c -rm -f defparse.c -rm -f defparse.h + -rm -f mcparse.c + -rm -f mcparse.h -rm -f nlmheader.c -rm -f nlmheader.h - -rm -f rclex.c -rm -f rcparse.c -rm -f rcparse.h clean: clean-recursive @@ -951,7 +977,7 @@ uninstall-info: uninstall-info-recursive .PHONY: install-html install-html-am install-html-recursive -install-html: install-html-recursive +install-html: install-html-recursive install-html-recursive: @failcom='exit 1'; \ @@ -1017,7 +1043,7 @@ objdump.o:objdump.c # -rm -f $(STRIP_PROG) # -ln $(OBJCOPY_PROG) $(STRIP_PROG) -sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info +sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -g <$(srcdir)/sysroff.info >>sysroff.c @@ -1042,15 +1068,23 @@ sysinfo.o: $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c -Wno-error ; \ fi +bin2c$(EXEEXT_FOR_BUILD): + $(CC_FOR_BUILD) -o $@ $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) $(srcdir)/bin2c.c $(srcdir)/version.c + +embedspu: embedspu.sh + sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@ + chmod a+x $@ + # We need these for parallel make. arparse.h: arparse.c defparse.h: defparse.c nlmheader.h: nlmheader.c rcparse.h: rcparse.c +mcparse.h: mcparse.c sysinfo.h: sysinfo.c # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. arparse.o: $(COMPILE) -c $< $(NO_WERROR) arlex.o: @@ -1065,8 +1099,12 @@ nlmheader.o: $(COMPILE) -c $< $(NO_WERROR) rcparse.o: $(COMPILE) -c $< $(NO_WERROR) +mcparse.o: + $(COMPILE) -c $< $(NO_WERROR) rclex.o: $(COMPILE) -c $< $(NO_WERROR) +mclex.o: + $(COMPILE) -c $< $(NO_WERROR) dlltool.o: $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c @@ -1133,10 +1171,10 @@ mostlyclean-local: .PHONY: install-exec-local install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + @list='$(RENAMED_PROGS)'; for p in $$list; do \ + if test -f $$p$(EXEEXT); then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin @@ -1157,210 +1195,252 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -addr2line.o: addr2line.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ - $(INCDIR)/demangle.h bucomm.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h budemang.h -ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/libiberty.h $(INCDIR)/progress.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - arsup.h $(INCDIR)/filenames.h binemul.h -arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h arsup.h $(INCDIR)/libiberty.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h -binemul.o: binemul.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/libiberty.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -budemang.o: budemang.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - budemang.h -coffdump.o: coffdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h coffgrok.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -coffgrok.o: coffgrok.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h coffgrok.h -cxxfilt.o: cxxfilt.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/demangle.h $(INCDIR)/safe-ctype.h -dwarf.o: dwarf.c dwarf.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/elf/dwarf2.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h -debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h -dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h \ - $(INCDIR)/dyn-string.h dlltool.h $(INCDIR)/safe-ctype.h -dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h -emul_aix.o: emul_aix.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h $(BFDDIR)/libxcoff.h -emul_vanilla.o: emul_vanilla.c binemul.h ../bfd/bfd.h \ - $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/ieee.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ - budbg.h $(INCDIR)/filenames.h +addr2line.o: addr2line.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + bucomm.h +ar.o: ar.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/progress.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h bucomm.h arsup.h $(INCDIR)/filenames.h \ + binemul.h +arsup.o: arsup.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h bucomm.h arsup.h +bin2c.o: bin2c.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h +binemul.o: binemul.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +bucomm.o: bucomm.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ + bucomm.h +coffdump.o: coffdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h coffgrok.h +coffgrok.o: coffgrok.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h bucomm.h coffgrok.h +cxxfilt.o: cxxfilt.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h bucomm.h +dwarf.o: dwarf.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/elf/dwarf2.h \ + dwarf.h +debug.o: debug.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + debug.h +dlltool.o: dlltool.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/dyn-string.h bucomm.h dlltool.h $(INCDIR)/safe-ctype.h +dllwrap.o: dllwrap.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h bucomm.h +emul_aix.o: emul_aix.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(BFDDIR)/libxcoff.h +emul_vanilla.o: emul_vanilla.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +filemode.o: filemode.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +ieee.o: ieee.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/ieee.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h debug.h budbg.h $(INCDIR)/filenames.h is-ranlib.o: is-ranlib.c is-strip.o: is-strip.c maybe-ranlib.o: maybe-ranlib.c maybe-strip.o: maybe-strip.c -nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ - $(BFDDIR)/libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h nlmconv.h -nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h budemang.h $(INCDIR)/aout/stab_gnu.h \ +nlmconv.o: nlmconv.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(BFDDIR)/libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \ + nlmconv.h bucomm.h +nm.o: nm.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/progress.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h \ - $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/common.h \ + bucomm.h not-ranlib.o: not-ranlib.c not-strip.o: not-strip.c -objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ +objcopy.o: objcopy.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \ budbg.h $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h -objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/progress.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - dwarf.h $(INCDIR)/elf/dwarf2.h budemang.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/dis-asm.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - debug.h budbg.h $(INCDIR)/aout/aout64.h -prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ + $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +objdump.o: objdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ + bucomm.h dwarf.h $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h \ + ../bfd/bfd.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h debug.h \ + budbg.h $(INCDIR)/aout/aout64.h +prdbg.o: prdbg.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h debug.h \ budbg.h -rdcoff.o: rdcoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h budbg.h $(BFDDIR)/libcoff.h \ +rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windres.h $(INCDIR)/ansidecl.h \ + winduni.h windint.h rcparse.h +rdcoff.o: rdcoff.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h debug.h budbg.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ - budbg.h -readelf.o: readelf.c dwarf.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/alpha.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h \ - $(INCDIR)/elf/avr.h $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cris.h \ +rddbg.o: rddbg.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + bucomm.h debug.h budbg.h +readelf.o: readelf.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h dwarf.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/avr.h \ + $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/crx.h \ $(INCDIR)/elf/d10v.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/dlx.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/h8.h \ - $(INCDIR)/elf/hppa.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h \ - $(INCDIR)/elf/i860.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/m32c.h $(INCDIR)/elf/m32r.h \ + $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/i860.h \ + $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/ip2k.h \ + $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/m32c.h $(INCDIR)/elf/m32r.h \ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/mcore.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/mn10200.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/msp430.h \ - $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h \ - $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/crx.h \ - $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/xtensa.h $(INCDIR)/aout/ar.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h unwind-ia64.h -rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -resbin.o: resbin.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h -rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - windres.h winduni.h -resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h -size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h -srconv.o: srconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - sysroff.c -stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/filenames.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h -sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h \ - sysroff.h sysroff.c -version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -windres.o: windres.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - windres.h winduni.h -winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h winduni.h $(INCDIR)/safe-ctype.h -wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/elf/mep.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h \ + $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/mt.h \ + $(INCDIR)/elf/msp430.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h \ + $(INCDIR)/elf/score.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/spu.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/xtensa.h \ + $(INCDIR)/aout/ar.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + unwind-ia64.h +rename.o: rename.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h +resbin.o: resbin.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + windres.h winduni.h windint.h +rescoff.o: rescoff.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +resrc.o: resrc.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windres.h winduni.h windint.h +resres.o: resres.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + windres.h winduni.h windint.h +size.o: size.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + bucomm.h +srconv.o: srconv.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h sysroff.c +stabs.o: stabs.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + debug.h budbg.h $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +strings.o: strings.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h +sysdump.o: sysdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \ + sysroff.h sysroff.c $(INCDIR)/ansidecl.h +version.o: version.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +windres.o: windres.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + windres.h winduni.h windint.h +winduni.o: winduni.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h winduni.h $(INCDIR)/safe-ctype.h +wrstabs.o: wrstabs.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h \ debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h arsup.h +windmc.o: windmc.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h windmc.h \ + winduni.h windint.h +mclex.o: mclex.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windmc.h winduni.h mcparse.h +arparse.o: arparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arsup.h arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - arparse.h + $(INCDIR)/ansidecl.h arparse.h sysroff.o: sysroff.c sysinfo.o: sysinfo.c syslex.o: syslex.c config.h sysinfo.h -defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h dlltool.h +defparse.o: defparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h dlltool.h deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - defparse.h dlltool.h -nlmheader.o: nlmheader.c $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \ - ../bfd/bfd.h $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ + defparse.h dlltool.h $(INCDIR)/ansidecl.h +nlmheader.o: nlmheader.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ + ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h bucomm.h \ nlmconv.h -rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h $(INCDIR)/safe-ctype.h -rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - windres.h winduni.h rcparse.h +rcparse.o: rcparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \ + $(INCDIR)/safe-ctype.h +mcparse.o: mcparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windmc.h winduni.h $(INCDIR)/safe-ctype.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/binutils/NEWS b/binutils/NEWS index d12450e38925..ad6058f75b22 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -1,5 +1,20 @@ -*- text -*- +* A new tool "windmc" has been added for some targets. This is a message + compiler which attempts to be compatible with the MS version. + +* Add codepage support to the windres tool. It now supports many new + resource types (e.g. MANIFEST, TOOLBAR, etc). The output generation + for binary files is done now via bfd itself. The endianess problems + for different hosts are solved. Dumps of .res files can now be + re-compiled by windres without lossing resources or compilation errors. + Some problems on dialog resource translations are corrected. + +* Add --extract-symbol command line option to objcopy, which will + strip everything out of an ordinary object file or executable except + for its symbol table. Files containing just symbols can be useful + to some OSes. + * Add "-x NAME" to readelf in addition to "-x NUMBER". * Add -i and -t switches to cxxfilt. -i disables the display of implementation @@ -30,6 +45,9 @@ * Add "--globalize-symbol <name>" and "--globalize-symbols <filename>" switches to objcopy to convert local symbols into global symbols. + +* gprof now allows input files to have histogram records for + several memory ranges, provided those ranges are disjoint. Changes in 2.16: diff --git a/binutils/acinclude.m4 b/binutils/acinclude.m4 deleted file mode 100644 index 71b09b9f6ac7..000000000000 --- a/binutils/acinclude.m4 +++ /dev/null @@ -1 +0,0 @@ -sinclude(../bfd/acinclude.m4) diff --git a/binutils/aclocal.m4 b/binutils/aclocal.m4 index cd4267338b72..29676eafab96 100644 --- a/binutils/aclocal.m4 +++ b/binutils/aclocal.m4 @@ -480,27 +480,6 @@ AC_DEFUN([AM_PROG_INSTALL_SH], install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # @@ -910,4 +889,19 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([acinclude.m4]) +m4_include([../bfd/acinclude.m4]) +m4_include([../bfd/warning.m4]) +m4_include([../config/depstand.m4]) +m4_include([../config/gettext-sister.m4]) +m4_include([../config/iconv.m4]) +m4_include([../config/lead-dot.m4]) +m4_include([../config/lib-ld.m4]) +m4_include([../config/lib-link.m4]) +m4_include([../config/lib-prefix.m4]) +m4_include([../config/nls.m4]) +m4_include([../config/po.m4]) +m4_include([../config/progtest.m4]) +m4_include([../libtool.m4]) +m4_include([../ltoptions.m4]) +m4_include([../ltsugar.m4]) +m4_include([../ltversion.m4]) diff --git a/binutils/addr2line.c b/binutils/addr2line.c index 7cd67bc0a1b0..a7c365ae7417 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -1,5 +1,5 @@ /* addr2line.c -- convert addresses to line number and function name - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Contributed by Ulrich Lauther <Ulrich.Lauther@mchp.siemens.de> @@ -29,15 +29,12 @@ both forms write results to stdout, the second form reads addresses to be converted from stdin. */ -#include "config.h" -#include <string.h> - +#include "sysdep.h" #include "bfd.h" #include "getopt.h" #include "libiberty.h" #include "demangle.h" #include "bucomm.h" -#include "budemang.h" static bfd_boolean unwind_inlines; /* -i, unwind inlined functions. */ static bfd_boolean with_functions; /* -f, show function names. */ @@ -68,7 +65,6 @@ static void slurp_symtab (bfd *); static void find_address_in_section (bfd *, asection *, void *); static void find_offset_in_section (bfd *, asection *); static void translate_addresses (bfd *, asection *); -static void process_file (const char *, const char *, const char *); /* Print a usage message to STREAM and exit with STATUS. */ @@ -92,7 +88,7 @@ usage (FILE *stream, int status) \n")); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } @@ -225,8 +221,9 @@ translate_addresses (bfd *abfd, asection *section) name = "??"; else if (do_demangle) { - alloc = demangle (abfd, name); - name = alloc; + alloc = bfd_demangle (abfd, name, DMGL_ANSI | DMGL_PARAMS); + if (alloc != NULL) + name = alloc; } printf ("%s\n", name); @@ -261,9 +258,9 @@ translate_addresses (bfd *abfd, asection *section) } } -/* Process a file. */ +/* Process a file. Returns an exit value for main(). */ -static void +static int process_file (const char *file_name, const char *section_name, const char *target) { @@ -272,7 +269,7 @@ process_file (const char *file_name, const char *section_name, char **matching; if (get_file_size (file_name) < 1) - return; + return 1; abfd = bfd_openr (file_name, target); if (abfd == NULL) @@ -312,6 +309,8 @@ process_file (const char *file_name, const char *section_name, } bfd_close (abfd); + + return 0; } int @@ -401,7 +400,5 @@ main (int argc, char **argv) addr = argv + optind; naddr = argc - optind; - process_file (file_name, section_name, target); - - return 0; + return process_file (file_name, section_name, target); } diff --git a/binutils/ar.c b/binutils/ar.c index fe1c6402222d..8313df5bf39a 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -1,6 +1,6 @@ /* ar.c - Archive modify and extract. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,12 +26,13 @@ when name truncated. No way to specify pos_end. Error messages should be more consistent. */ +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" #include "progress.h" -#include "bucomm.h" #include "aout/ar.h" #include "libbfd.h" +#include "bucomm.h" #include "arsup.h" #include "filenames.h" #include "binemul.h" @@ -68,8 +69,8 @@ static void replace_members (bfd *, char **files_to_replace, bfd_boolean quick); static void print_descr (bfd * abfd); static void write_archive (bfd *); -static void ranlib_only (const char *archname); -static void ranlib_touch (const char *archname); +static int ranlib_only (const char *archname); +static int ranlib_touch (const char *archname); static void usage (int); /** Globals and flags */ @@ -153,7 +154,7 @@ map_over_members (bfd *arch, void (*function)(bfd *), char **files, int count) if (count == 0) { - for (head = arch->next; head; head = head->next) + for (head = arch->archive_next; head; head = head->archive_next) { PROGRESS (1); function (head); @@ -172,7 +173,7 @@ map_over_members (bfd *arch, void (*function)(bfd *), char **files, int count) bfd_boolean found = FALSE; match_count = 0; - for (head = arch->next; head; head = head->next) + for (head = arch->archive_next; head; head = head->archive_next) { PROGRESS (1); if (head->filename == NULL) @@ -257,9 +258,9 @@ usage (int help) -V --version Print version information\n")); } - list_supported_targets (program_name, stderr); + list_supported_targets (program_name, s); - if (help) + if (REPORT_BUGS_TO[0] && help) fprintf (s, _("Report bugs to %s\n"), REPORT_BUGS_TO); xexit (help ? 0 : 1); @@ -420,6 +421,7 @@ main (int argc, char **argv) if (is_ranlib) { + int status = 0; bfd_boolean touch = FALSE; if (argc < 2 @@ -429,7 +431,7 @@ main (int argc, char **argv) usage (0); if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "-v") == 0 - || strncmp (argv[1], "--v", 3) == 0) + || CONST_STRNEQ (argv[1], "--v")) print_version ("ranlib"); arg_index = 1; if (strcmp (argv[1], "-t") == 0) @@ -440,12 +442,12 @@ main (int argc, char **argv) while (arg_index < argc) { if (! touch) - ranlib_only (argv[arg_index]); + status |= ranlib_only (argv[arg_index]); else - ranlib_touch (argv[arg_index]); + status |= ranlib_touch (argv[arg_index]); ++arg_index; } - xexit (0); + xexit (status); } if (argc == 2 && strcmp (argv[1], "-M") == 0) @@ -597,10 +599,7 @@ main (int argc, char **argv) if ((operation == none || operation == print_table) && write_armap == 1) - { - ranlib_only (argv[arg_index]); - xexit (0); - } + xexit (ranlib_only (argv[arg_index])); if (operation == none) fatal (_("no operation specified")); @@ -760,7 +759,7 @@ open_inarch (const char *archive_filename, const char *file) xexit (1); } - last_one = &(arch->next); + last_one = &(arch->archive_next); /* Read all the contents right away, regardless. */ for (next_one = bfd_openr_next_archived_file (arch, NULL); next_one; @@ -768,7 +767,7 @@ open_inarch (const char *archive_filename, const char *file) { PROGRESS (1); *last_one = next_one; - last_one = &next_one->next; + last_one = &next_one->archive_next; } *last_one = (bfd *) NULL; if (bfd_get_error () != bfd_error_no_more_archived_files) @@ -779,10 +778,10 @@ open_inarch (const char *archive_filename, const char *file) static void print_contents (bfd *abfd) { - int ncopied = 0; + size_t ncopied = 0; char *cbuf = xmalloc (BUFSIZE); struct stat buf; - long size; + size_t size; if (bfd_stat_arch_elt (abfd, &buf) != 0) /* xgettext:c-format */ fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); @@ -797,8 +796,8 @@ print_contents (bfd *abfd) while (ncopied < size) { - int nread; - int tocopy = size - ncopied; + size_t nread; + size_t tocopy = size - ncopied; if (tocopy > BUFSIZE) tocopy = BUFSIZE; @@ -807,7 +806,12 @@ print_contents (bfd *abfd) /* xgettext:c-format */ fatal (_("%s is not a valid archive"), bfd_get_filename (bfd_my_archive (abfd))); - fwrite (cbuf, 1, nread, stdout); + + /* fwrite in mingw32 may return int instead of size_t. Cast the + return value to size_t to avoid comparison between signed and + unsigned values. */ + if ((size_t) fwrite (cbuf, 1, nread, stdout) != nread) + fatal ("stdout: %s", strerror (errno)); ncopied += tocopy; } free (cbuf); @@ -828,9 +832,9 @@ extract_file (bfd *abfd) { FILE *ostream; char *cbuf = xmalloc (BUFSIZE); - int nread, tocopy; - long ncopied = 0; - long size; + size_t nread, tocopy; + size_t ncopied = 0; + size_t size; struct stat buf; if (bfd_stat_arch_elt (abfd, &buf) != 0) @@ -838,10 +842,6 @@ extract_file (bfd *abfd) fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); size = buf.st_size; - if (size < 0) - /* xgettext:c-format */ - fatal (_("stat returns negative size for %s"), bfd_get_filename (abfd)); - if (verbose) printf ("x - %s\n", bfd_get_filename (abfd)); @@ -890,7 +890,12 @@ extract_file (bfd *abfd) output_file = ostream; } - fwrite (cbuf, 1, nread, ostream); + + /* fwrite in mingw32 may return int instead of size_t. Cast + the return value to size_t to avoid comparison between + signed and unsigned values. */ + if ((size_t) fwrite (cbuf, 1, nread, ostream) != nread) + fatal ("%s: %s", output_filename, strerror (errno)); ncopied += tocopy; } @@ -918,12 +923,15 @@ write_archive (bfd *iarch) { bfd *obfd; char *old_name, *new_name; - bfd *contents_head = iarch->next; + bfd *contents_head = iarch->archive_next; old_name = xmalloc (strlen (bfd_get_filename (iarch)) + 1); strcpy (old_name, bfd_get_filename (iarch)); new_name = make_tempname (old_name); + if (new_name == NULL) + bfd_fatal ("could not create temporary file whilst writing archive"); + output_filename = new_name; obfd = bfd_openw (new_name, bfd_get_target (iarch)); @@ -987,15 +995,15 @@ get_pos_bfd (bfd **contents, enum pos default_pos, const char *default_posname) if (realpos == pos_end) { while (*after_bfd) - after_bfd = &((*after_bfd)->next); + after_bfd = &((*after_bfd)->archive_next); } else { - for (; *after_bfd; after_bfd = &(*after_bfd)->next) + for (; *after_bfd; after_bfd = &(*after_bfd)->archive_next) if (FILENAME_CMP ((*after_bfd)->filename, realposname) == 0) { if (realpos == pos_after) - after_bfd = &(*after_bfd)->next; + after_bfd = &(*after_bfd)->archive_next; break; } } @@ -1027,7 +1035,7 @@ delete_members (bfd *arch, char **files_to_delete) found = FALSE; match_count = 0; - current_ptr_ptr = &(arch->next); + current_ptr_ptr = &(arch->archive_next); while (*current_ptr_ptr) { if (FILENAME_CMP (normalize (*files_to_delete, arch), @@ -1047,12 +1055,12 @@ delete_members (bfd *arch, char **files_to_delete) if (verbose) printf ("d - %s\n", *files_to_delete); - *current_ptr_ptr = ((*current_ptr_ptr)->next); + *current_ptr_ptr = ((*current_ptr_ptr)->archive_next); goto next_file; } } - current_ptr_ptr = &((*current_ptr_ptr)->next); + current_ptr_ptr = &((*current_ptr_ptr)->archive_next); } if (verbose && !found) @@ -1081,7 +1089,7 @@ move_members (bfd *arch, char **files_to_move) for (; *files_to_move; ++files_to_move) { - current_ptr_ptr = &(arch->next); + current_ptr_ptr = &(arch->archive_next); while (*current_ptr_ptr) { bfd *current_ptr = *current_ptr_ptr; @@ -1091,13 +1099,13 @@ move_members (bfd *arch, char **files_to_move) /* Move this file to the end of the list - first cut from where it is. */ bfd *link; - *current_ptr_ptr = current_ptr->next; + *current_ptr_ptr = current_ptr->archive_next; /* Now glue to end */ - after_bfd = get_pos_bfd (&arch->next, pos_end, NULL); + after_bfd = get_pos_bfd (&arch->archive_next, pos_end, NULL); link = *after_bfd; *after_bfd = current_ptr; - current_ptr->next = link; + current_ptr->archive_next = link; if (verbose) printf ("m - %s\n", *files_to_move); @@ -1105,7 +1113,7 @@ move_members (bfd *arch, char **files_to_move) goto next_file; } - current_ptr_ptr = &((*current_ptr_ptr)->next); + current_ptr_ptr = &((*current_ptr_ptr)->archive_next); } /* xgettext:c-format */ fatal (_("no entry %s in archive %s!"), *files_to_move, arch->filename); @@ -1130,7 +1138,7 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick) { if (! quick) { - current_ptr = &arch->next; + current_ptr = &arch->archive_next; while (*current_ptr) { current = *current_ptr; @@ -1160,24 +1168,24 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick) goto next_file; } - after_bfd = get_pos_bfd (&arch->next, pos_after, + after_bfd = get_pos_bfd (&arch->archive_next, pos_after, current->filename); if (ar_emul_replace (after_bfd, *files_to_move, verbose)) { /* Snip out this entry from the chain. */ - *current_ptr = (*current_ptr)->next; + *current_ptr = (*current_ptr)->archive_next; changed = TRUE; } goto next_file; } - current_ptr = &(current->next); + current_ptr = &(current->archive_next); } } /* Add to the end of the archive. */ - after_bfd = get_pos_bfd (&arch->next, pos_end, NULL); + after_bfd = get_pos_bfd (&arch->archive_next, pos_end, NULL); if (ar_emul_append (after_bfd, *files_to_move, verbose)) changed = TRUE; @@ -1193,23 +1201,24 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick) output_filename = NULL; } -static void +static int ranlib_only (const char *archname) { bfd *arch; if (get_file_size (archname) < 1) - return; + return 1; write_armap = 1; arch = open_inarch (archname, (char *) NULL); if (arch == NULL) xexit (1); write_archive (arch); + return 0; } /* Update the timestamp of the symbol map of an archive. */ -static void +static int ranlib_touch (const char *archname) { #ifdef __GO32__ @@ -1221,7 +1230,7 @@ ranlib_touch (const char *archname) char **matching; if (get_file_size (archname) < 1) - return; + return 1; f = open (archname, O_RDWR | O_BINARY, 0); if (f < 0) { @@ -1252,6 +1261,7 @@ ranlib_touch (const char *archname) if (! bfd_close (arch)) bfd_fatal (archname); #endif + return 0; } /* Things which are interesting to map over all or some of the files: */ diff --git a/binutils/arlex.c b/binutils/arlex.c deleted file mode 100644 index cd9bd52d080d..000000000000 --- a/binutils/arlex.c +++ /dev/null @@ -1,1856 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/arlex.c,v 1.1.16.1 2006/04/16 18:36:40 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include <stdio.h> -#include <errno.h> - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include <stdlib.h> -#ifndef _WIN32 -#include <unistd.h> -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include <io.h> -#include <stdlib.h> -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 40 -#define YY_END_OF_BUFFER 41 -static yyconst short int yy_accept[177] = - { 0, - 0, 0, 41, 40, 39, 38, 35, 32, 33, 36, - 40, 34, 37, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 36, 31, 37, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 7, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 22, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - - 35, 35, 35, 10, 11, 12, 35, 15, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 25, 26, 27, - 35, 30, 35, 35, 35, 3, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 18, 35, 35, 35, 35, - 35, 35, 35, 1, 2, 4, 5, 35, 35, 35, - 35, 35, 16, 17, 19, 20, 35, 35, 35, 35, - 35, 35, 8, 9, 13, 14, 35, 23, 24, 28, - 29, 35, 35, 6, 21, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 1, 4, 1, 1, 1, 5, - 6, 7, 8, 9, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 10, 1, - 1, 1, 1, 1, 11, 12, 13, 14, 15, 16, - 4, 17, 18, 4, 4, 19, 20, 21, 22, 23, - 4, 24, 25, 26, 27, 28, 4, 29, 30, 4, - 1, 4, 1, 1, 4, 1, 31, 32, 33, 34, - - 35, 36, 4, 37, 38, 4, 4, 39, 40, 41, - 42, 43, 4, 44, 45, 46, 47, 48, 4, 49, - 50, 4, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[51] = - { 0, - 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 - } ; - -static yyconst short int yy_base[180] = - { 0, - 0, 0, 193, 194, 194, 194, 0, 194, 194, 0, - 190, 194, 0, 177, 32, 37, 32, 163, 174, 170, - 164, 171, 174, 169, 149, 15, 22, 17, 135, 146, - 142, 136, 143, 146, 141, 0, 0, 194, 0, 161, - 159, 158, 153, 147, 156, 143, 149, 148, 141, 150, - 141, 135, 138, 127, 125, 124, 119, 113, 122, 109, - 115, 114, 107, 116, 107, 101, 104, 43, 136, 135, - 130, 129, 0, 119, 123, 118, 114, 118, 119, 122, - 124, 25, 104, 103, 98, 97, 0, 87, 91, 86, - 82, 86, 87, 90, 92, 105, 100, 97, 94, 93, - - 105, 106, 102, 0, 0, 0, 104, 0, 92, 75, - 70, 67, 64, 63, 75, 76, 72, 0, 0, 0, - 74, 0, 62, 91, 88, 0, 86, 85, 73, 85, - 79, 83, 70, 62, 59, 0, 57, 56, 44, 56, - 50, 54, 41, 0, 0, 0, 0, 63, 58, 59, - 67, 66, 0, 0, 0, 0, 38, 33, 34, 42, - 41, 51, 0, 0, 0, 0, 30, 0, 0, 0, - 0, 43, 21, 0, 0, 194, 65, 66, 69 - } ; - -static yyconst short int yy_def[180] = - { 0, - 176, 1, 176, 176, 176, 176, 177, 176, 176, 178, - 176, 176, 179, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 178, 176, 179, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 0, 176, 176, 176 - } ; - -static yyconst short int yy_nxt[245] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 7, 15, 16, 17, 18, 19, 7, 20, 7, - 7, 21, 7, 22, 23, 7, 7, 24, 7, 7, - 25, 7, 26, 27, 28, 29, 30, 7, 31, 7, - 7, 32, 7, 33, 34, 7, 7, 35, 7, 7, - 41, 43, 45, 55, 44, 42, 57, 59, 56, 58, - 46, 96, 97, 110, 111, 60, 37, 36, 37, 39, - 175, 39, 174, 173, 172, 171, 170, 169, 168, 167, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, - 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, - 116, 115, 114, 113, 112, 109, 108, 107, 106, 105, - 104, 103, 102, 101, 100, 99, 98, 95, 94, 93, - 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, - 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, - 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, - 62, 61, 54, 53, 52, 51, 50, 49, 48, 47, - 40, 38, 176, 3, 176, 176, 176, 176, 176, 176, - - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176 - } ; - -static yyconst short int yy_chk[245] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 15, 16, 17, 26, 16, 15, 27, 28, 26, 27, - 17, 68, 68, 82, 82, 28, 178, 177, 178, 179, - 173, 179, 172, 167, 162, 161, 160, 159, 158, 157, - 152, 151, 150, 149, 148, 143, 142, 141, 140, 139, - 138, 137, 135, 134, 133, 132, 131, 130, 129, 128, - - 127, 125, 124, 123, 121, 117, 116, 115, 114, 113, - 112, 111, 110, 109, 107, 103, 102, 101, 100, 99, - 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, - 88, 86, 85, 84, 83, 81, 80, 79, 78, 77, - 76, 75, 74, 72, 71, 70, 69, 67, 66, 65, - 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, - 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, - 44, 43, 42, 41, 40, 35, 34, 33, 32, 31, - 30, 29, 25, 24, 23, 22, 21, 20, 19, 18, - 14, 11, 3, 176, 176, 176, 176, 176, 176, 176, - - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "arlex.l" -#define INITIAL 0 -#line 2 "arlex.l" -/* arlex.l - Strange script language lexer */ - -/* Copyright 1992, 1997, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. - -This file is part of GNU Binutils. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - - -/* Contributed by Steve Chamberlain <sac@cygnus.com>. */ - -#define DONTDECLARE_MALLOC -#include "ansidecl.h" -#include "libiberty.h" -#include "arparse.h" - -#define YY_NO_UNPUT - -extern int yylex (void); - -int linenumber; -#line 511 "arlex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 41 "arlex.l" - - -#line 676 "arlex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 194 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 43 "arlex.l" -{ return ADDLIB; } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 44 "arlex.l" -{ return ADDMOD; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 45 "arlex.l" -{ return CLEAR; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 46 "arlex.l" -{ return CREATE; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 47 "arlex.l" -{ return DELETE; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 48 "arlex.l" -{ return DIRECTORY; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 49 "arlex.l" -{ return END; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 50 "arlex.l" -{ return EXTRACT; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 51 "arlex.l" -{ return FULLDIR; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 52 "arlex.l" -{ return HELP; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 53 "arlex.l" -{ return LIST; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 54 "arlex.l" -{ return OPEN; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 55 "arlex.l" -{ return REPLACE; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 56 "arlex.l" -{ return VERBOSE; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 57 "arlex.l" -{ return SAVE; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 58 "arlex.l" -{ return ADDLIB; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 59 "arlex.l" -{ return ADDMOD; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 60 "arlex.l" -{ return CLEAR; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 61 "arlex.l" -{ return CREATE; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 62 "arlex.l" -{ return DELETE; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 63 "arlex.l" -{ return DIRECTORY; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 64 "arlex.l" -{ return END; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 65 "arlex.l" -{ return EXTRACT; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 66 "arlex.l" -{ return FULLDIR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 67 "arlex.l" -{ return HELP; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 68 "arlex.l" -{ return LIST; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 69 "arlex.l" -{ return OPEN; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 70 "arlex.l" -{ return REPLACE; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 71 "arlex.l" -{ return VERBOSE; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 72 "arlex.l" -{ return SAVE; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 73 "arlex.l" -{ linenumber ++; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 74 "arlex.l" -{ return '('; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 75 "arlex.l" -{ return ')'; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 76 "arlex.l" -{ return ','; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 77 "arlex.l" -{ - yylval.name = xstrdup (yytext); - return FILENAME; - } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 81 "arlex.l" -{ } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 82 "arlex.l" -{ } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 83 "arlex.l" -{ } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 84 "arlex.l" -{ linenumber ++; return NEWLINE; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 86 "arlex.l" -ECHO; - YY_BREAK -#line 962 "arlex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 176); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include <unistd.h> -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 86 "arlex.l" - -#ifndef yywrap -/* Needed for lex, though not flex. */ -int yywrap(void) { return 1; } -#endif diff --git a/binutils/arparse.c b/binutils/arparse.c deleted file mode 100644 index 21fa13a44b08..000000000000 --- a/binutils/arparse.c +++ /dev/null @@ -1,1605 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NEWLINE = 258, - VERBOSE = 259, - FILENAME = 260, - ADDLIB = 261, - LIST = 262, - ADDMOD = 263, - CLEAR = 264, - CREATE = 265, - DELETE = 266, - DIRECTORY = 267, - END = 268, - EXTRACT = 269, - FULLDIR = 270, - HELP = 271, - QUIT = 272, - REPLACE = 273, - SAVE = 274, - OPEN = 275 - }; -#endif -/* Tokens. */ -#define NEWLINE 258 -#define VERBOSE 259 -#define FILENAME 260 -#define ADDLIB 261 -#define LIST 262 -#define ADDMOD 263 -#define CLEAR 264 -#define CREATE 265 -#define DELETE 266 -#define DIRECTORY 267 -#define END 268 -#define EXTRACT 269 -#define FULLDIR 270 -#define HELP 271 -#define QUIT 272 -#define REPLACE 273 -#define SAVE 274 -#define OPEN 275 - - - - -/* Copy the first part of user declarations. */ -#line 1 "arparse.y" - -/* arparse.y - Stange script language parser */ - -/* Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003 - Free Software Foundation, Inc. - -This file is part of GNU Binutils. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - - -/* Contributed by Steve Chamberlain - sac@cygnus.com - -*/ -#define DONTDECLARE_MALLOC -#include "bfd.h" -#include "bucomm.h" -#include "arsup.h" -extern int verbose; -extern int yylex (void); -static int yyerror (const char *); - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 37 "arparse.y" -typedef union YYSTYPE { - char *name; -struct list *list ; - -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 167 "arparse.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 179 "arparse.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 34 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 24 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 22 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 42 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 53 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 275 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 21, 22, 2, 2, 23, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 11, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 45, 48, 51, 53, 56, 59, 61, - 63, 66, 69, 73, 78, 80, 81, 85, 86, 90, - 91, 93, 94 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 25, 0, -1, -1, 26, 27, -1, 27, 28, -1, - -1, 29, 3, -1, 37, -1, 38, -1, 45, -1, - 40, -1, 39, -1, 32, -1, 34, -1, 36, -1, - 30, -1, 31, -1, 33, -1, 35, -1, 13, -1, - 1, -1, 5, -1, -1, 14, 43, -1, 18, 43, - -1, 9, -1, 11, 43, -1, 8, 43, -1, 7, - -1, 19, -1, 20, 5, -1, 10, 5, -1, 6, - 5, 42, -1, 12, 5, 42, 41, -1, 5, -1, - -1, 21, 43, 22, -1, -1, 43, 44, 5, -1, - -1, 23, -1, -1, 4, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned char yyrline[] = -{ - 0, 68, 68, 68, 72, 73, 77, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 101, 106, 111, 116, 120, 125, 130, - 137, 142, 148, 152, 159, 161, 165, 168, 172, 178, - 183, 184, 189 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NEWLINE", "VERBOSE", "FILENAME", - "ADDLIB", "LIST", "ADDMOD", "CLEAR", "CREATE", "DELETE", "DIRECTORY", - "END", "EXTRACT", "FULLDIR", "HELP", "QUIT", "REPLACE", "SAVE", "OPEN", - "'('", "')'", "','", "$accept", "start", "@1", "session", "command_line", - "command", "extract_command", "replace_command", "clear_command", - "delete_command", "addmod_command", "list_command", "save_command", - "open_command", "create_command", "addlib_command", "directory_command", - "optional_filename", "modulelist", "modulename", "optcomma", - "verbose_command", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 40, 41, 44 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 24, 26, 25, 27, 27, 28, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 41, 42, 42, 43, 43, - 44, 44, 45 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 0, 2, 2, 0, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 2, 2, 1, 2, 2, 1, 1, - 2, 2, 3, 4, 1, 0, 3, 0, 3, 0, - 1, 0, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 2, 0, 5, 1, 0, 20, 42, 21, 0, 28, - 39, 25, 0, 39, 0, 19, 39, 39, 29, 0, - 4, 0, 15, 16, 12, 17, 13, 18, 14, 7, - 8, 11, 10, 9, 37, 27, 31, 26, 37, 23, - 24, 30, 6, 39, 32, 40, 0, 35, 41, 38, - 34, 33, 36 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 1, 2, 4, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 51, 44, 35, - 46, 33 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -14 -static const yysigned_char yypact[] = -{ - -14, 1, -14, -14, 5, -14, -14, -14, 2, -14, - -14, -14, 21, -14, 22, -14, -14, -14, -14, 23, - -14, 26, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, 10, -3, -14, -3, 10, -3, - -3, -14, -14, -14, -14, -14, 27, 28, -1, -14, - -14, -14, -14 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -4, -13, - -14, -14 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -42 -static const yysigned_char yytable[] = -{ - 37, 3, -41, 39, 40, -3, 5, 34, -22, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 45, 52, 45, 17, 18, 19, 36, 38, 41, 42, - 48, 43, 49, 50, 47 -}; - -static const unsigned char yycheck[] = -{ - 13, 0, 5, 16, 17, 0, 1, 5, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 23, 22, 23, 18, 19, 20, 5, 5, 5, 3, - 43, 21, 5, 5, 38 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 25, 26, 0, 27, 1, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 18, 19, 20, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 45, 5, 43, 5, 43, 5, 43, - 43, 5, 3, 21, 42, 23, 44, 42, 43, 5, - 5, 41, 22 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 68 "arparse.y" - { prompt(); } - break; - - case 6: -#line 77 "arparse.y" - { prompt(); } - break; - - case 19: -#line 93 "arparse.y" - { ar_end(); return 0; } - break; - - case 21: -#line 95 "arparse.y" - { yyerror("foo"); } - break; - - case 23: -#line 102 "arparse.y" - { ar_extract((yyvsp[0].list)); } - break; - - case 24: -#line 107 "arparse.y" - { ar_replace((yyvsp[0].list)); } - break; - - case 25: -#line 112 "arparse.y" - { ar_clear(); } - break; - - case 26: -#line 117 "arparse.y" - { ar_delete((yyvsp[0].list)); } - break; - - case 27: -#line 121 "arparse.y" - { ar_addmod((yyvsp[0].list)); } - break; - - case 28: -#line 126 "arparse.y" - { ar_list(); } - break; - - case 29: -#line 131 "arparse.y" - { ar_save(); } - break; - - case 30: -#line 138 "arparse.y" - { ar_open((yyvsp[0].name),0); } - break; - - case 31: -#line 143 "arparse.y" - { ar_open((yyvsp[0].name),1); } - break; - - case 32: -#line 149 "arparse.y" - { ar_addlib((yyvsp[-1].name),(yyvsp[0].list)); } - break; - - case 33: -#line 153 "arparse.y" - { ar_directory((yyvsp[-2].name), (yyvsp[-1].list), (yyvsp[0].name)); } - break; - - case 34: -#line 160 "arparse.y" - { (yyval.name) = (yyvsp[0].name); } - break; - - case 35: -#line 161 "arparse.y" - { (yyval.name) = 0; } - break; - - case 36: -#line 166 "arparse.y" - { (yyval.list) = (yyvsp[-1].list); } - break; - - case 37: -#line 168 "arparse.y" - { (yyval.list) = 0; } - break; - - case 38: -#line 173 "arparse.y" - { struct list *n = (struct list *) malloc(sizeof(struct list)); - n->next = (yyvsp[-2].list); - n->name = (yyvsp[0].name); - (yyval.list) = n; - } - break; - - case 39: -#line 178 "arparse.y" - { (yyval.list) = 0; } - break; - - case 42: -#line 190 "arparse.y" - { verbose = !verbose; } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 1327 "arparse.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 194 "arparse.y" - - -static int -yyerror (const char *x ATTRIBUTE_UNUSED) -{ - extern int linenumber; - - printf (_("Syntax error in archive script, line %d\n"), linenumber + 1); - return 0; -} - diff --git a/binutils/arparse.h b/binutils/arparse.h deleted file mode 100644 index 41044396e199..000000000000 --- a/binutils/arparse.h +++ /dev/null @@ -1,92 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NEWLINE = 258, - VERBOSE = 259, - FILENAME = 260, - ADDLIB = 261, - LIST = 262, - ADDMOD = 263, - CLEAR = 264, - CREATE = 265, - DELETE = 266, - DIRECTORY = 267, - END = 268, - EXTRACT = 269, - FULLDIR = 270, - HELP = 271, - QUIT = 272, - REPLACE = 273, - SAVE = 274, - OPEN = 275 - }; -#endif -/* Tokens. */ -#define NEWLINE 258 -#define VERBOSE 259 -#define FILENAME 260 -#define ADDLIB 261 -#define LIST 262 -#define ADDMOD 263 -#define CLEAR 264 -#define CREATE 265 -#define DELETE 266 -#define DIRECTORY 267 -#define END 268 -#define EXTRACT 269 -#define FULLDIR 270 -#define HELP 271 -#define QUIT 272 -#define REPLACE 273 -#define SAVE 274 -#define OPEN 275 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 37 "arparse.y" -typedef union YYSTYPE { - char *name; -struct list *list ; - -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 84 "arparse.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/arparse.y b/binutils/arparse.y index a7ea0157f411..2453b65a02e7 100644 --- a/binutils/arparse.y +++ b/binutils/arparse.y @@ -1,7 +1,7 @@ %{ /* arparse.y - Stange script language parser */ -/* Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003 +/* Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,8 +26,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define DONTDECLARE_MALLOC +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "arsup.h" extern int verbose; extern int yylex (void); diff --git a/binutils/arsup.c b/binutils/arsup.c index 189490b307b6..98f93a637e52 100644 --- a/binutils/arsup.c +++ b/binutils/arsup.c @@ -1,6 +1,6 @@ /* arsup.c - Archive support for MRI compatibility Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, - 2004 Free Software Foundation, Inc. + 2004, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -25,11 +25,12 @@ This file looks after requests from arparse.y, to provide the MRI style librarian command syntax + 1 word LIST. */ +#include "sysdep.h" #include "bfd.h" -#include "arsup.h" #include "libiberty.h" -#include "bucomm.h" #include "filenames.h" +#include "bucomm.h" +#include "arsup.h" static void map_over_list (bfd *, void (*function) (bfd *, bfd *), struct list *); @@ -51,10 +52,10 @@ map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list) { bfd *next; - head = arch->next; + head = arch->archive_next; while (head != NULL) { - next = head->next; + next = head->archive_next; function (head, (bfd *) NULL); head = next; } @@ -73,7 +74,7 @@ map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list) bfd_boolean found = FALSE; bfd *prev = arch; - for (head = arch->next; head; head = head->next) + for (head = arch->archive_next; head; head = head->archive_next) { if (head->filename != NULL && FILENAME_CMP (ptr->name, head->filename) == 0) @@ -197,7 +198,7 @@ ar_open (char *name, int t) while (element) { *ptr = element; - ptr = &element->next; + ptr = &element->archive_next; element = bfd_openr_next_archived_file (ibfd, element); } } @@ -213,9 +214,9 @@ ar_addlib_doer (bfd *abfd, bfd *prev) { /* Add this module to the output bfd. */ if (prev != NULL) - prev->next = abfd->next; + prev->archive_next = abfd->archive_next; - abfd->next = obfd->archive_head; + abfd->archive_next = obfd->archive_head; obfd->archive_head = abfd; } @@ -261,7 +262,7 @@ ar_addmod (struct list *list) } else { - abfd->next = obfd->archive_head; + abfd->archive_next = obfd->archive_head; obfd->archive_head = abfd; } list = list->next; @@ -298,13 +299,13 @@ ar_delete (struct list *list) { if (FILENAME_CMP(member->filename, list->name) == 0) { - *prev = member->next; + *prev = member->archive_next; found = 1; } else - prev = &(member->next); + prev = &(member->archive_next); - member = member->next; + member = member->archive_next; } if (!found) @@ -372,15 +373,15 @@ ar_replace (struct list *list) else { *prev = abfd; - abfd->next = member->next; + abfd->archive_next = member->archive_next; found = 1; } } else { - prev = &(member->next); + prev = &(member->archive_next); } - member = member->next; + member = member->archive_next; } if (!found) @@ -423,7 +424,7 @@ ar_list (void) for (abfd = obfd->archive_head; abfd != (bfd *)NULL; - abfd = abfd->next) + abfd = abfd->archive_next) ar_directory_doer (abfd, (bfd *) NULL); } } @@ -462,7 +463,7 @@ ar_extract (struct list *list) found = 1; } - member = member->next; + member = member->archive_next; } if (!found) diff --git a/binutils/bin2c.c b/binutils/bin2c.c new file mode 100644 index 000000000000..b83f02d3c98e --- /dev/null +++ b/binutils/bin2c.c @@ -0,0 +1,105 @@ +/* bin2c.c -- dump binary file in hex format + Copyright 2007 Free Software Foundation, Inc. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "sysdep.h" +#include "bfd.h" +#include "bucomm.h" + +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif + +#ifdef __BEOS__ + /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif + +#if O_BINARY +# ifndef __DJGPP__ +# define setmode _setmode +# define fileno(_fp) _fileno (_fp) +# endif /* not DJGPP */ +# define SET_BINARY(_f) \ + do { if (!isatty (_f)) setmode (_f, O_BINARY); } while (0) +#else +# define SET_BINARY(f) (void) 0 +# define O_BINARY 0 +# define O_TEXT 0 +#endif /* O_BINARY */ + +int +main (int argc, char *argv[]) +{ + int c; + int i; + +#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) + setlocale (LC_MESSAGES, ""); +#endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + if (argc != 1) + { + int ishelp = 0; + int isvers = 0; + FILE *stream; + + if (argc == 2 && argv[1][0] == '-') + { + const char *opt = &argv[1][1]; + if (*opt == '-') + ++opt; + ishelp = *opt == 'h' || *opt == 'H'; + isvers = *opt == 'v' || *opt == 'V'; + } + + if (isvers) + print_version ("bin2c"); + + stream = ishelp ? stdout : stderr; + fprintf (stream, _("Usage: %s < input_file > output_file\n"), argv[0]); + fprintf (stream, _("Prints bytes from stdin in hex format.\n")); + exit (!ishelp); + } + + SET_BINARY (fileno (stdin)); + + i = 0; + while ((c = getc (stdin)) != EOF) + { + printf ("0x%02x,", c); + if (++i == 16) + { + printf ("\n"); + i = 0; + } + } + if (i != 0) + printf ("\n"); + + exit (0); +} diff --git a/binutils/binemul.c b/binutils/binemul.c index 7dac32dd1153..83740d0d6ac2 100644 --- a/binutils/binemul.c +++ b/binutils/binemul.c @@ -58,7 +58,7 @@ ar_emul_default_append (bfd **after_bfd, char *file_name, AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name); AR_EMUL_APPEND_PRINT_VERBOSE (verbose, file_name); - (*after_bfd)->next = temp; + (*after_bfd)->archive_next = temp; return TRUE; } @@ -84,7 +84,7 @@ ar_emul_default_replace (bfd **after_bfd, char *file_name, AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name); AR_EMUL_REPLACE_PRINT_VERBOSE (verbose, file_name); - (*after_bfd)->next = temp; + (*after_bfd)->archive_next = temp; return TRUE; } diff --git a/binutils/binemul.h b/binutils/binemul.h index 53bbbd2de204..c5d8c78f7fb8 100644 --- a/binutils/binemul.h +++ b/binutils/binemul.h @@ -1,5 +1,5 @@ /* Binutils emulation layer. - Copyright 2002, 2003 Free Software Foundation, Inc. + Copyright 2002, 2003, 2007 Free Software Foundation, Inc. Written by Tom Rix, Red Hat Inc. This file is part of GNU Binutils. @@ -21,6 +21,7 @@ #ifndef BINEMUL_H #define BINEMUL_H +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" diff --git a/binutils/bucomm.c b/binutils/bucomm.c index 03a4d2873e2a..a4c11f0cfa0d 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -1,5 +1,6 @@ /* bucomm.c -- Bin Utils COMmon code. - Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003 + Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002, + 2003, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -22,16 +23,16 @@ /* We might put this in a library someday so it could be dynamically loaded, but for now it's not necessary. */ +#include "sysdep.h" #include "bfd.h" -#include "bfdver.h" #include "libiberty.h" -#include "bucomm.h" #include "filenames.h" #include "libbfd.h" #include <sys/stat.h> #include <time.h> /* ctime, maybe time_t */ #include <assert.h> +#include "bucomm.h" #ifndef HAVE_TIME_T_IN_TIME_H #ifndef HAVE_TIME_T_IN_TYPES_H @@ -386,55 +387,103 @@ print_arelt_descr (FILE *file, bfd *abfd, bfd_boolean verbose) fprintf (file, "%s\n", bfd_get_filename (abfd)); } -/* Return the name of a temporary file in the same directory as FILENAME. */ +/* Return a path for a new temporary file in the same directory + as file PATH. */ -char * -make_tempname (char *filename) +static char * +template_in_dir (const char *path) { - static char template[] = "stXXXXXX"; +#define template "stXXXXXX" + const char *slash = strrchr (path, '/'); char *tmpname; - char *slash = strrchr (filename, '/'); + size_t len; #ifdef HAVE_DOS_BASED_FILE_SYSTEM { /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ - char *bslash = strrchr (filename, '\\'); + char *bslash = strrchr (path, '\\'); + if (slash == NULL || (bslash != NULL && bslash > slash)) slash = bslash; - if (slash == NULL && filename[0] != '\0' && filename[1] == ':') - slash = filename + 1; + if (slash == NULL && path[0] != '\0' && path[1] == ':') + slash = path + 1; } #endif if (slash != (char *) NULL) { - char c; + len = slash - path; + tmpname = xmalloc (len + sizeof (template) + 2); + memcpy (tmpname, path, len); - c = *slash; - *slash = 0; - tmpname = xmalloc (strlen (filename) + sizeof (template) + 2); - strcpy (tmpname, filename); #ifdef HAVE_DOS_BASED_FILE_SYSTEM /* If tmpname is "X:", appending a slash will make it a root directory on drive X, which is NOT the same as the current directory on drive X. */ - if (tmpname[1] == ':' && tmpname[2] == '\0') - strcat (tmpname, "."); + if (len == 2 && tmpname[1] == ':') + tmpname[len++] = '.'; #endif - strcat (tmpname, "/"); - strcat (tmpname, template); - mktemp (tmpname); - *slash = c; + tmpname[len++] = '/'; } else { tmpname = xmalloc (sizeof (template)); - strcpy (tmpname, template); - mktemp (tmpname); + len = 0; } + + memcpy (tmpname + len, template, sizeof (template)); + return tmpname; +#undef template +} + +/* Return the name of a created temporary file in the same directory + as FILENAME. */ + +char * +make_tempname (char *filename) +{ + char *tmpname = template_in_dir (filename); + int fd; + +#ifdef HAVE_MKSTEMP + fd = mkstemp (tmpname); +#else + tmpname = mktemp (tmpname); + if (tmpname == NULL) + return NULL; + fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600); +#endif + if (fd == -1) + return NULL; + close (fd); return tmpname; } +/* Return the name of a created temporary directory inside the + directory containing FILENAME. */ + +char * +make_tempdir (char *filename) +{ + char *tmpname = template_in_dir (filename); + +#ifdef HAVE_MKDTEMP + return mkdtemp (tmpname); +#else + tmpname = mktemp (tmpname); + if (tmpname == NULL) + return NULL; +#if defined (_WIN32) && !defined (__CYGWIN32__) + if (mkdir (tmpname) != 0) + return NULL; +#else + if (mkdir (tmpname, 0700) != 0) + return NULL; +#endif + return tmpname; +#endif +} + /* Parse a string into a VMA, with a fatal error if it can't be parsed. */ diff --git a/binutils/bucomm.h b/binutils/bucomm.h index 9f914adeb58c..95ed2ec2c3a7 100644 --- a/binutils/bucomm.h +++ b/binutils/bucomm.h @@ -1,6 +1,6 @@ /* bucomm.h -- binutils common include file. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,159 +21,6 @@ #ifndef _BUCOMM_H #define _BUCOMM_H -#include "ansidecl.h" -#include <stdio.h> -#include <sys/types.h> - -#include "config.h" -#include "bin-bugs.h" - -#include <stdarg.h> - -#ifdef USE_BINARY_FOPEN -#include "fopen-bin.h" -#else -#include "fopen-same.h" -#endif - -#include <errno.h> -#ifndef errno -extern int errno; -#endif - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - -#ifdef HAVE_STRING_H -#include <string.h> -#else -#ifdef HAVE_STRINGS_H -#include <strings.h> -#else -extern char *strchr (); -extern char *strrchr (); -#endif -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#ifdef HAVE_FCNTL_H -#include <fcntl.h> -#else -#ifdef HAVE_SYS_FILE_H -#include <sys/file.h> -#endif -#endif - -#if !HAVE_DECL_STPCPY -extern char *stpcpy (char *, const char *); -#endif - -#if !HAVE_DECL_STRSTR -extern char *strstr (); -#endif - -#ifdef HAVE_SBRK -#if !HAVE_DECL_SBRK -extern char *sbrk (); -#endif -#endif - -#if !HAVE_DECL_GETENV -extern char *getenv (); -#endif - -#if !HAVE_DECL_ENVIRON -extern char **environ; -#endif - -#if !HAVE_DECL_FPRINTF -extern int fprintf (FILE *, const char *, ...); -#endif - -#if !HAVE_DECL_SNPRINTF -extern int snprintf(char *, size_t, const char *, ...); -#endif - -#if !HAVE_DECL_VSNPRINTF -extern int vsnprintf(char *, size_t, const char *, va_list); -#endif - -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif - -#ifndef O_RDWR -#define O_RDWR 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#if defined(__GNUC__) && !defined(C_ALLOCA) -# undef alloca -# define alloca __builtin_alloca -#else -# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA) -# include <alloca.h> -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -# if !defined (__STDC__) && !defined (__hpux) -char *alloca (); -# else -void *alloca (); -# endif /* __STDC__, __hpux */ -# endif /* alloca */ -# endif /* HAVE_ALLOCA_H */ -#endif - - -#ifdef HAVE_LOCALE_H -# ifndef ENABLE_NLS - /* The Solaris version of locale.h always includes libintl.h. If we have - been configured with --disable-nls then ENABLE_NLS will not be defined - and the dummy definitions of bindtextdomain (et al) below will conflict - with the defintions in libintl.h. So we define these values to prevent - the bogus inclusion of libintl.h. */ -# define _LIBINTL_H -# define _LIBGETTEXT_H -# endif -# include <locale.h> -#endif - -#ifdef ENABLE_NLS -# include <libintl.h> -# define _(String) gettext (String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define gettext(Msgid) (Msgid) -# define dgettext(Domainname, Msgid) (Msgid) -# define dcgettext(Domainname, Msgid, Category) (Msgid) -# define textdomain(Domainname) while (0) /* nothing */ -# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ -# define _(String) (String) -# define N_(String) (String) -#endif - -/* Used by ar.c and objcopy.c. */ -#define BUFSIZE 8192 - -/* bucomm.c */ - /* Return the filename in a static buffer. */ const char *bfd_get_archive_filename (bfd *); @@ -200,6 +47,7 @@ int display_info (void); void print_arelt_descr (FILE *, bfd *, bfd_boolean); char *make_tempname (char *); +char *make_tempdir (char *); bfd_vma parse_vma (const char *, const char *); diff --git a/binutils/budemang.c b/binutils/budemang.c deleted file mode 100644 index 55f10b785daf..000000000000 --- a/binutils/budemang.c +++ /dev/null @@ -1,100 +0,0 @@ -/* demangle.c -- A wrapper calling libiberty cplus_demangle - Copyright 2002, 2003, 2004 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "config.h" -#include <stdlib.h> -#ifdef HAVE_STRING_H -#include <string.h> -#else -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif -#endif -#include "bfd.h" -#include "libiberty.h" -#include "demangle.h" -#include "budemang.h" - -/* Wrapper around cplus_demangle. Strips leading underscores and - other such chars that would otherwise confuse the demangler. */ - -char * -demangle (bfd *abfd, const char *name) -{ - char *res, *alloc; - const char *pre, *suf; - size_t pre_len; - - if (abfd != NULL && bfd_get_symbol_leading_char (abfd) == name[0]) - ++name; - - /* This is a hack for better error reporting on XCOFF, PowerPC64-ELF - or the MS PE format. These formats have a number of leading '.'s - on at least some symbols, so we remove all dots to avoid - confusing the demangler. */ - pre = name; - while (*name == '.') - ++name; - pre_len = name - pre; - - alloc = NULL; - suf = strchr (name, '@'); - if (suf != NULL) - { - alloc = xmalloc (suf - name + 1); - memcpy (alloc, name, suf - name); - alloc[suf - name] = '\0'; - name = alloc; - } - - res = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS); - if (res != NULL) - { - /* Now put back any suffix, or stripped dots. */ - if (pre_len != 0 || suf != NULL) - { - size_t len; - size_t suf_len; - char *final; - - if (alloc != NULL) - free (alloc); - - len = strlen (res); - if (suf == NULL) - suf = res + len; - suf_len = strlen (suf) + 1; - final = xmalloc (pre_len + len + suf_len); - - memcpy (final, pre, pre_len); - memcpy (final + pre_len, res, len); - memcpy (final + pre_len + len, suf, suf_len); - free (res); - res = final; - } - - return res; - } - - if (alloc != NULL) - free (alloc); - - return xstrdup (pre); -} diff --git a/binutils/budemang.h b/binutils/budemang.h deleted file mode 100644 index 17df9f55ea7a..000000000000 --- a/binutils/budemang.h +++ /dev/null @@ -1,25 +0,0 @@ -/* demangle.h -- A wrapper calling libiberty cplus_demangle - Copyright 2002, 2003 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ -#ifndef BUDEMANG_H -#define BUDEMANG_H - -char *demangle (bfd *, const char *); - -#endif diff --git a/binutils/coffdump.c b/binutils/coffdump.c index 5ec23b43f62d..7b6ead4af388 100644 --- a/binutils/coffdump.c +++ b/binutils/coffdump.c @@ -1,5 +1,5 @@ /* Coff file dumper. - Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -23,11 +23,12 @@ This module reads a type tree generated by coffgrok and prints it out so we can test the grokker. */ +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" +#include "bucomm.h" #include "coffgrok.h" -#include "bucomm.h" #include "getopt.h" static int atnl; @@ -462,7 +463,7 @@ show_usage (FILE *file, int status) -v --version Display the program's version\n\ \n")); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); diff --git a/binutils/coffgrok.c b/binutils/coffgrok.c index a6c05b14d2ab..a1e89e1298ce 100644 --- a/binutils/coffgrok.c +++ b/binutils/coffgrok.c @@ -1,5 +1,5 @@ /* coffgrok.c - Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004 + Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,13 +26,15 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" -#include "bucomm.h" #include "coff/internal.h" #include "../bfd/libcoff.h" +#include "bucomm.h" #include "coffgrok.h" + static int lofile = 1; static struct coff_scope *top_scope; static struct coff_scope *file_scope; diff --git a/binutils/config.in b/binutils/config.in index 93d8e9528379..6183c3782e1f 100644 --- a/binutils/config.in +++ b/binutils/config.in @@ -8,7 +8,8 @@ /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA -/* Define to 1 if NLS is requested */ +/* Define to 1 if translation of program messages to the user's native + language is requested. */ #undef ENABLE_NLS /* Suffix used for executables, if any. */ @@ -21,12 +22,6 @@ */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the <argz.h> header file. */ -#undef HAVE_ARGZ_H - -/* Define to 1 if you have the `dcgettext' function. */ -#undef HAVE_DCGETTEXT - /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #undef HAVE_DECL_ENVIRON @@ -66,6 +61,9 @@ don't. */ #undef HAVE_DECL_VSNPRINTF +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + /* Does the platform use an executable suffix? */ #undef HAVE_EXECUTABLE_SUFFIX @@ -75,60 +73,33 @@ /* Is fopen64 available? */ #undef HAVE_FOPEN64 -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - /* Define to 1 if you have the `getc_unlocked' function. */ #undef HAVE_GETC_UNLOCKED -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT - /* Does <utime.h> define struct utimbuf? */ #undef HAVE_GOOD_UTIME_H +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES - /* Define to 1 if you have the <limits.h> header file. */ #undef HAVE_LIMITS_H -/* Define to 1 if you have the <locale.h> header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP +/* Define to 1 if you have the `mkdtemp' function. */ +#undef HAVE_MKDTEMP -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if you have the <nl_types.h> header file. */ -#undef HAVE_NL_TYPES_H - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP /* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - /* Define to 1 if you have the `setmode' function. */ #undef HAVE_SETMODE @@ -141,15 +112,6 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H -/* Define if you have the stpcpy function */ -#undef HAVE_STPCPY - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - /* Define to 1 if you have the `strcoll' function. */ #undef HAVE_STRCOLL @@ -186,17 +148,12 @@ /* Define to 1 if you have the `utimes' function. */ #undef HAVE_UTIMES -/* Define to 1 if you have the <values.h> header file. */ -#undef HAVE_VALUES_H - -/* Define to 1 if you have the `__argz_count' function. */ -#undef HAVE___ARGZ_COUNT - -/* Define to 1 if you have the `__argz_next' function. */ -#undef HAVE___ARGZ_NEXT +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST -/* Define to 1 if you have the `__argz_stringify' function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR /* Name of package */ #undef PACKAGE @@ -250,18 +207,3 @@ /* Enable LFS */ #undef _LARGEFILE64_SOURCE - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to `long' if <sys/types.h> does not define. */ -#undef off_t - -/* Define to `unsigned' if <sys/types.h> does not define. */ -#undef size_t diff --git a/binutils/configure b/binutils/configure index 2d8e0cb970cd..a10a8adcc054 100755 --- a/binutils/configure +++ b/binutils/configure @@ -241,6 +241,155 @@ IFS=" $as_nl" $as_unset CDPATH + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. @@ -309,7 +458,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES AR CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_DLLWRAP BUILD_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR datarootdir docdir htmldir LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO CPP WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE HDEFINES CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME ALLOCA LIBICONV LTLIBICONV NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_WINDMC BUILD_DLLWRAP BUILD_MISC BUILD_INSTALL_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR datarootdir docdir htmldir LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -852,24 +1001,31 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared=PKGS build shared libraries default=yes - --enable-static=PKGS build static libraries default=yes - --enable-fast-install=PKGS optimize for fast installation default=yes + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-targets alternative target configurations --enable-commonbfdlib build shared BFD/opcodes/libiberty library - --enable-werror treat compile warnings as errors - --enable-build-warnings Enable build-time compiler warnings + --enable-werror treat compile warnings as errors + --enable-build-warnings enable build-time compiler warnings --disable-nls do not use Native Language Support --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer + --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-pic try to use only PIC/non-PIC objects default=use both - --with-included-gettext use the GNU gettext library included here + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir Some influential environment variables: CC C compiler command @@ -3072,1178 +3228,6 @@ fi -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_shared=yes -fi; -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_static=yes -fi; -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_fast_install=yes -fi; - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then - lt_cv_prog_gnu_ld=yes -else - lt_cv_prog_gnu_ld=no -fi -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" - -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" - break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi - -NM="$lt_cv_path_NM" -echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 - -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 -echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [regex]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* |pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - # this will be overwritten by pass_all, but leave it in just in case - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.012) - lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | kfreebsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - case $host_cpu in - hppa*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - esac - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' - fi - ;; - -newsos6) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[78]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - esac - ;; -esac - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method - - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for *BSD - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - esac - -fi - -if test -n "$lt_cv_sys_max_cmd_len" ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -fi - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <<EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <<EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STRIP=$ac_ct_STRIP -else - STRIP="$ac_cv_prog_STRIP" -fi - - -# Check for any special flags to pass to ltconfig. -libtool_flags="--cache-file=$cache_file" -test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" -test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" -test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" - - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" -test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 3870 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -lt_cv_cc_needs_belf=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - - -esac - - -# Save cache, so that ltconfig can load it -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ -AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ -objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ -deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ -|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5 -echo "$as_me: error: libtool configure failed" >&2;} - { (exit 1); exit 1; }; } - -# Reload cache, that may have been modified by ltconfig -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log - - - - - - - -# Check whether --enable-targets or --disable-targets was given. -if test "${enable_targets+set}" = set; then - enableval="$enable_targets" - case "${enableval}" in - yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 -echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} - { (exit 1); exit 1; }; } - ;; - no) enable_targets= ;; - *) enable_targets=$enableval ;; -esac -fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. -if test "${enable_commonbfdlib+set}" = set; then - enableval="$enable_commonbfdlib" - case "${enableval}" in - yes) commonbfdlib=true ;; - no) commonbfdlib=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 -echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -fi; - -GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - -# Check whether --enable-werror or --disable-werror was given. -if test "${enable_werror+set}" = set; then - enableval="$enable_werror" - case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 -echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} - { (exit 1); exit 1; }; } ;; - esac -fi; - -# Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - ERROR_ON_WARNING=yes -fi - -NO_WERROR= -if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" - NO_WERROR="-Wno-error" -fi - -if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -fi - -# Check whether --enable-build-warnings or --disable-build-warnings was given. -if test "${enable_build_warnings+set}" = set; then - enableval="$enable_build_warnings" - case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -fi; - -if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then - echo "Setting warning flags = $WARN_CFLAGS" 6>&1 -fi - - - - - - ac_config_headers="$ac_config_headers config.h:config.in" - - -if test -z "$target" ; then - { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5 -echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "$host" ; then - { { echo "$as_me:$LINENO: error: Unrecognized host system type; please check config.sub." >&5 -echo "$as_me: error: Unrecognized host system type; please check config.sub." >&2;} - { (exit 1); exit 1; }; } -fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4980,17 +3964,444 @@ _ACEOF -for ac_prog in 'bison -y' byacc + +macro_version='2.1a' +macro_revision='1.2435' + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Set options + +enable_dlopen=no + + +enable_win32_dll=no + + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi; + + + + + + + + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi; + + + + + + + + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; + +test -z "$pic_mode" && pic_mode=default + + + + + + + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + + + + + + + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for fgrep" >&5 +echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 +if test "${ac_cv_prog_fgrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1 + then ac_cv_prog_fgrep='grep -F' + else ac_cv_prog_fgrep='fgrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_fgrep" >&5 +echo "${ECHO_T}$ac_cv_prog_fgrep" >&6 + FGREP=$ac_cv_prog_fgrep + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$lt_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$lt_cv_path_LD" +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + + +echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_YACC+set}" = set; then +if test "${ac_cv_prog_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4999,7 +4410,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_YACC="$ac_prog" + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5008,30 +4419,31 @@ done fi fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6 +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +echo "${ECHO_T}$DUMPBIN" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi - test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" - -for ac_prog in flex lex + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_LEX+set}" = set; then +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5040,7 +4452,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LEX="$ac_prog" + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5049,257 +4461,681 @@ done fi fi -LEX=$ac_cv_prog_LEX -if test -n "$LEX"; then - echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +echo "${ECHO_T}$ac_ct_DUMPBIN" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi - test -n "$LEX" && break + test -n "$ac_ct_DUMPBIN" && break done -test -n "$LEX" || LEX=":" +test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" -if test -z "$LEXLIB" -then - echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 -echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 -if test "${ac_cv_lib_fl_yywrap+set}" = set; then + DUMPBIN=$ac_ct_DUMPBIN +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6 +if test "${lt_cv_nm_interface+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); -int -main () -{ -yywrap (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:4499: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_fl_yywrap=yes + (eval echo "\"\$as_me:4502: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:4505: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +echo "${ECHO_T}$lt_cv_nm_interface" >&6 + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`getconf ARG_MAX 2> /dev/null` + if test -n $lt_cv_sys_max_cmd_len; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac -ac_cv_lib_fl_yywrap=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 -if test $ac_cv_lib_fl_yywrap = yes; then - LEXLIB="-lfl" +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6 +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, ) >/dev/null 2>&1 \ + && xsi_shell=yes +echo "$as_me:$LINENO: result: $xsi_shell" >&5 +echo "${ECHO_T}$xsi_shell" >&6 + + +echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6 +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +echo "${ECHO_T}$lt_shell_append" >&6 + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset else - echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 -echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 -if test "${ac_cv_lib_l_yywrap+set}" = set; then + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ll $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); -int -main () -{ -yywrap (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_l_yywrap=yes + + + + + + + + + +echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac -ac_cv_lib_l_yywrap=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi -echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 -if test $ac_cv_lib_l_yywrap = yes; then - LEXLIB="-ll" +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -if test "x$LEX" != "x:"; then - echo "$as_me:$LINENO: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_root+set}" = set; then + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # The minimal lex program is just a single line: %%. But some broken lexes -# (Solaris, I think it was) want two %% lines, so accommodate them. -cat >conftest.l <<_ACEOF -%% -%% -_ACEOF -{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 - (eval $LEX conftest.l) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else - { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} - { (exit 1); exit 1; }; } +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 -rm -f conftest.l -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS=$LIBS -LIBS="$LIBS $LEXLIB" -cat >conftest.$ac_ext <<_ACEOF -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_lex_yytext_pointer=yes + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_save_LIBS -rm -f "${LEX_OUTPUT_ROOT}.c" + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 -if test $ac_cv_prog_lex_yytext_pointer = yes; then -cat >>confdefs.h <<\_ACEOF -#define YYTEXT_POINTER 1 -_ACEOF +test -z "$STRIP" && STRIP=: + + + -fi -fi -if test "$LEX" = :; then - LEX=${am_missing_run}flex -fi -ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -5380,6 +5216,533 @@ else RANLIB="$ac_cv_prog_RANLIB" fi +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 5560 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5615,21 +5978,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -5796,132 +6144,34 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_const=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF -fi -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 -if test "${ac_cv_c_inline+set}" = set; then + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif +$ac_includes_default +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -5945,47 +6195,29 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done - fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 - - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - ;; -esac - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - +fi +done -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h +for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -6046,98 +6278,1364 @@ fi done -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; - ; - return 0; -} + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_off_t=yes + + + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 -ac_cv_type_off_t=no +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then - : + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac fi -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6660: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6664: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + fi + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6982: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6986: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $RM conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7087: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7091: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + + + + + + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7142: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7146: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + fi + + # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + int main () { -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6151,51 +7649,55 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned -_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 -if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <alloca.h> + int main () { -char *p = (char *) alloca (2 * sizeof (int)); + ; return 0; } @@ -6222,65 +7724,277 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_working_alloca_h=yes + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_working_alloca_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 -if test $ac_cv_working_alloca_h = yes; then +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF + amigaos*) + if test "$host_cpu" = m68k; then + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + fi + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; -fi + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 -if test "${ac_cv_func_alloca_works+set}" = set; then + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + if test "${lt_cv_apple_cc_single_mod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include <malloc.h> -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include <alloca.h> -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi-module to the + # link flags. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm libconftest.dylib + fi + rm conftest.$ac_ext + fi +fi -int -main () -{ -char *p = (char *) alloca (1); - ; - return 0; -} + output_verbose_link_cmd=echo + if test "X$lt_cv_apple_cc_single_mod" = Xyes ; then + archive_cmds='$CC -dynamiclib $single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $single_module -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + module_expsym_cmds='sed -e "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd=echo + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`$ECHO $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -6304,122 +8018,933 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_alloca_works=yes + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_alloca_works=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; -if test $ac_cv_func_alloca_works = yes; then + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. + *nto* | *qnx*) + ;; -ALLOCA=alloca.$ac_objext + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; -fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +withGCC=$GCC +if test "$withGCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $withGCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; + ; return 0; } @@ -6446,126 +8971,425 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir"; then + shlibpath_overrides_runpath=yes +fi + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; - break -fi +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; - done -fi +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 -if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac else - return (&dummy > addr) ? 1 : -1; -} + shlibpath_overrides_runpath=yes + fi + ;; -int -main () -{ - exit (find_stack_direction () < 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; -( exit $ac_status ) -ac_cv_c_stack_direction=-1 +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF -fi -for ac_header in stdlib.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6579,122 +9403,41 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no +ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes fi -done - + ;; -for ac_func in getpagesize -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6703,12 +9446,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. +/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. + which can conflict with char shl_load (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ @@ -6718,7 +9461,7 @@ cat >>conftest.$ac_ext <<_ACEOF # include <assert.h> #endif -#undef $ac_func +#undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -6727,14 +9470,14 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); +char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else -char (*f) () = $ac_func; +char (*f) () = shl_load; #endif #ifdef __cplusplus } @@ -6743,7 +9486,7 @@ char (*f) () = $ac_func; int main () { -return f != $ac_func; +return f != shl_load; ; return 0; } @@ -6770,239 +9513,53 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include <fcntl.h> -#include <sys/mman.h> - -#if !STDC_HEADERS && !HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# if !HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# if HAVE_SYS_PARAM_H -# include <sys/param.h> -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); int main () { - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - exit (1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - exit (1); - if (write (fd, data, pagesize) != pagesize) - exit (1); - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - exit (1); - data2 = (char *) malloc (2 * pagesize); - if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit (1); - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - exit (1); - if (read (fd, data3, pagesize) != pagesize) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit (1); - close (fd); - exit (0); +shl_load (); + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 -if test $ac_cv_func_mmap_fixed_mapped = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 -_ACEOF - -fi -rm -f conftest.mmap - - - - - - - - - - - -for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7016,132 +9573,31 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no +ac_cv_lib_dld_shl_load=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - - - -for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7150,12 +9606,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. +/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. + which can conflict with char dlopen (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ @@ -7165,7 +9621,7 @@ cat >>conftest.$ac_ext <<_ACEOF # include <assert.h> #endif -#undef $ac_func +#undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -7174,14 +9630,14 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); +char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else -char (*f) () = $ac_func; +char (*f) () = dlopen; #endif #ifdef __cplusplus } @@ -7190,7 +9646,7 @@ char (*f) () = $ac_func; int main () { -return f != $ac_func; +return f != dlopen; ; return 0; } @@ -7217,84 +9673,46 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - -for ac_func in stpcpy -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" -{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +char dlopen (); int main () { -return f != $ac_func; +dlopen (); ; return 0; } @@ -7321,52 +9739,47 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STPCPY 1 -_ACEOF - - fi - - if test $ac_cv_header_locale_h = yes; then - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 -echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 -if test "${am_cv_val_LC_MESSAGES+set}" = set; then +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <locale.h> + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); int main () { -return LC_MESSAGES +dlopen (); ; return 0; } @@ -7393,85 +9806,54 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - am_cv_val_LC_MESSAGES=yes + ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_val_LC_MESSAGES=no +ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 -echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 - if test $am_cv_val_LC_MESSAGES = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LC_MESSAGES 1 -_ACEOF - - fi - fi - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. -if test "${enable_nls+set}" = set; then - enableval="$enable_nls" - USE_NLS=$enableval -else - USE_NLS=yes -fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6 - - - USE_INCLUDED_LIBINTL=no - - if test "$USE_NLS" = "yes"; then - echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 -echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 - -# Check whether --with-included-gettext or --without-included-gettext was given. -if test "${with_included_gettext+set}" = set; then - withval="$with_included_gettext" - nls_cv_force_use_gnu_gettext=$withval +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - nls_cv_force_use_gnu_gettext=no -fi; - echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 -echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT= - - if test "${ac_cv_header_libintl_h+set}" = set; then - echo "$as_me:$LINENO: checking for libintl.h" >&5 -echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 -if test "${ac_cv_header_libintl_h+set}" = set; then + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 -echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking libintl.h usability" >&5 -echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <libintl.h> + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7485,170 +9867,588 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking libintl.h presence" >&5 -echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <libintl.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes else - ac_cpp_err= + enable_dlopen=no fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cpp_err=yes + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 9939 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10039 "configure" +#include "confdefs.h" - ac_header_preproc=no +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +rm -fr conftest* -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + + echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + + echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Check whether --enable-targets or --disable-targets was given. +if test "${enable_targets+set}" = set; then + enableval="$enable_targets" + case "${enableval}" in + yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 +echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} + { (exit 1); exit 1; }; } + ;; + no) enable_targets= ;; + *) enable_targets=$enableval ;; +esac +fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +if test "${enable_commonbfdlib+set}" = set; then + enableval="$enable_commonbfdlib" + case "${enableval}" in + yes) commonbfdlib=true ;; + no) commonbfdlib=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 +echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} + { (exit 1); exit 1; }; } ;; esac -echo "$as_me:$LINENO: checking for libintl.h" >&5 -echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 -if test "${ac_cv_header_libintl_h+set}" = set; then +fi; + +GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +# Check whether --enable-werror or --disable-werror was given. +if test "${enable_werror+set}" = set; then + enableval="$enable_werror" + case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} + { (exit 1); exit 1; }; } ;; + esac +fi; + +# Enable -Werror by default when using gcc +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then + ERROR_ON_WARNING=yes +fi + +NO_WERROR= +if test "${ERROR_ON_WARNING}" = yes ; then + GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + NO_WERROR="-Wno-error" +fi + +if test "${GCC}" = yes ; then + WARN_CFLAGS="${GCC_WARN_CFLAGS}" +fi + +# Check whether --enable-build-warnings or --disable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then + enableval="$enable_build_warnings" + case "${enableval}" in + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + no) if test "${GCC}" = yes ; then + WARN_CFLAGS="-w" + fi;; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +fi; + +if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then + echo "Setting warning flags = $WARN_CFLAGS" 6>&1 +fi + + + + + + ac_config_headers="$ac_config_headers config.h:config.in" + + +if test -z "$target" ; then + { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "$host" ; then + { { echo "$as_me:$LINENO: error: Unrecognized host system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized host system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } +fi + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_libintl_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 -echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done fi -if test $ac_cv_header_libintl_h = yes; then - echo "$as_me:$LINENO: checking for gettext in libc" >&5 -echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6 -if test "${gt_cv_func_gettext_libc+set}" = set; then +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <libintl.h> -int -main () -{ -return (int) gettext ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gettext_libc=yes + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -gt_cv_func_gettext_libc=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6 +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" - if test "$gt_cv_func_gettext_libc" != "yes"; then - echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 -echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6 -if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then +if test -z "$LEXLIB" +then + echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 +if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" +LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7662,11 +10462,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char bindtextdomain (); +char yywrap (); int main () { -bindtextdomain (); +yywrap (); ; return 0; } @@ -7693,36 +10493,47 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_intl_bindtextdomain=yes + ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_intl_bindtextdomain=no +ac_cv_lib_fl_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6 -if test $ac_cv_lib_intl_bindtextdomain = yes; then - echo "$as_me:$LINENO: checking for gettext in libintl" >&5 -echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6 -if test "${gt_cv_func_gettext_libintl+set}" = set; then +echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +if test $ac_cv_lib_fl_yywrap = yes; then + LEXLIB="-lfl" +else + echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 +if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ll $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); int main () { -return (int) gettext ("") +yywrap (); ; return 0; } @@ -7749,124 +10560,73 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gt_cv_func_gettext_libintl=yes + ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gt_cv_func_gettext_libintl=no +ac_cv_lib_l_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 +echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +if test $ac_cv_lib_l_yywrap = yes; then + LEXLIB="-ll" fi - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then +fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF +fi - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MSGFMT+set}" = set; then +if test "x$LEX" != "x:"; then + echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then - echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6 + # The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. +cat >conftest.l <<_ACEOF +%% +%% +_ACEOF +{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 + (eval $LEX conftest.l) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } fi - if test "$MSGFMT" != "no"; then +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +rm -f conftest.l +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -for ac_func in dcgettext -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS=$LIBS +LIBS="$LIBS $LEXLIB" +cat >conftest.$ac_ext <<_ACEOF +`cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -7890,170 +10650,166 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS +rm -f "${LEX_OUTPUT_ROOT}.c" + fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +cat >>confdefs.h <<\_ACEOF +#define YYTEXT_POINTER 1 _ACEOF fi -done - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GMSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GMSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac fi -GMSGFMT=$ac_cv_path_GMSGFMT +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi -if test -n "$GMSGFMT"; then - echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 -else +ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi" +# If we haven't got the data from the intl directory, +# assume NLS is disabled. +USE_NLS=no +LIBINTL= +LIBINTL_DEP= +INCINTL= +XGETTEXT= +GMSGFMT= +POSUB= + +if test -f ../intl/config.intl; then + . ../intl/config.intl +fi +echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 +if test x"$USE_NLS" != xyes; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 -fi - - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XGETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + # Look for .po and .gmo files in the source directory. + CATALOGS= + XLINGUAS= + for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do + # If there aren't any .gmo files the shell will give us the + # literal string "../path/to/srcdir/po/*.gmo" which has to be + # weeded out. + case "$cat" in *\**) + continue;; + esac + # The quadruple backslash is collapsed to a double backslash + # by the backticks, then collapsed again by the double quotes, + # leaving us with one backslash in the sed expression (right + # before the dot that mustn't act as a wildcard). + cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e "s!\\\\.gmo!!"` + # The user is allowed to set LINGUAS to a list of languages to + # install catalogs for. If it's empty that means "all of them." + if test "x$LINGUAS" = x; then + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + else + case "$LINGUAS" in *$lang*) + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + ;; + esac fi done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + LINGUAS="$XLINGUAS" + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ -extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + CATOBJEXT=.gmo - DATADIRNAME=share -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -CATOBJEXT=.mo - DATADIRNAME=lib fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - INSTOBJEXT=.mo - fi - fi -fi + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval +else + USE_NLS=yes +fi; + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 - if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then - # Neither gettext nor catgets in included in the C library. - # Fall back on GNU gettext library (assuming it is present). - nls_cv_use_gnu_gettext=yes - fi - fi - if test "$nls_cv_use_gnu_gettext" = "yes"; then - INTLOBJS="\$(GETTOBJS)" - # Extract the first word of "msgfmt", so it can be a program name with args. + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -8061,27 +10817,31 @@ if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" - ;; + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then +if test "$MSGFMT" != ":"; then echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6 else @@ -8089,7 +10849,7 @@ else echo "${ECHO_T}no" >&6 fi - # Extract the first word of "gmsgfmt", so it can be a program name with args. + # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -8129,7 +10889,37 @@ else echo "${ECHO_T}no" >&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -8137,27 +10927,31 @@ if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; + ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then +if test "$XGETTEXT" != ":"; then echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6 else @@ -8165,282 +10959,103 @@ else echo "${ECHO_T}no" >&6 fi + rm -f messages.po - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - echo "$as_me:$LINENO: result: found xgettext programs is not GNU xgettext; ignore it" >&5 -echo "${ECHO_T}found xgettext programs is not GNU xgettext; ignore it" >&6 - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - - - - - - - - - - - - - if test "x$CATOBJEXT" != "x"; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_NLS 1 -_ACEOF - - fi - - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 -echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - echo "$as_me:$LINENO: result: $LINGUAS" >&5 -echo "${ECHO_T}$LINGUAS" >&6 - fi - - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include <locale.h>" - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header <locale.h>. Take care yourself. */" - fi - - - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - if test "${ac_cv_header_linux_version_h+set}" = set; then - echo "$as_me:$LINENO: checking for linux/version.h" >&5 -echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 -if test "${ac_cv_header_linux_version_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking linux/version.h usability" >&5 -echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <linux/version.h> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking linux/version.h presence" >&5 -echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <linux/version.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - ac_cpp_err= + PATH_SEPARATOR=: fi -else - ac_cpp_err=yes + rm -f conf$$.sh fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +rm -f conf$$.file -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: linux/version.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: linux/version.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: linux/version.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac -echo "$as_me:$LINENO: checking for linux/version.h" >&5 -echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 -if test "${ac_cv_header_linux_version_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_linux_version_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 - fi -if test $ac_cv_header_linux_version_h = yes; then - msgformat=linux +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6 else - msgformat=xopen + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + GMSGFMT=":" + fi + fi - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi - - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi - - - - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - - - l= + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT=":" + fi + rm -f messages.po + fi + ac_config_commands="$ac_config_commands default-1" - if test -f $srcdir/po/POTFILES.in; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - fi echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 @@ -8468,6 +11083,16 @@ fi + +if false; then + GENINSRC_NEVER_TRUE= + GENINSRC_NEVER_FALSE='#' +else + GENINSRC_NEVER_TRUE='#' + GENINSRC_NEVER_FALSE= +fi + + if test -n "$EXEEXT"; then cat >>confdefs.h <<\_ACEOF @@ -8701,7 +11326,9 @@ esac -for ac_header in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h + + +for ac_header in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -9386,6 +12013,202 @@ _ACEOF fi done +echo "$as_me:$LINENO: checking for mkstemp" >&5 +echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 +if test "${ac_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mkstemp to an innocuous variant, in case <limits.h> declares mkstemp. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define mkstemp innocuous_mkstemp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkstemp (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef mkstemp + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mkstemp (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mkstemp) || defined (__stub___mkstemp) +choke me +#else +char (*f) () = mkstemp; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != mkstemp; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mkstemp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_mkstemp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mkstemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 +if test $ac_cv_func_mkstemp = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MKSTEMP 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for mkdtemp" >&5 +echo $ECHO_N "checking for mkdtemp... $ECHO_C" >&6 +if test "${ac_cv_func_mkdtemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mkdtemp to an innocuous variant, in case <limits.h> declares mkdtemp. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define mkdtemp innocuous_mkdtemp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkdtemp (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef mkdtemp + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mkdtemp (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mkdtemp) || defined (__stub___mkdtemp) +choke me +#else +char (*f) () = mkdtemp; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != mkdtemp; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mkdtemp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_mkdtemp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mkdtemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkdtemp" >&6 +if test $ac_cv_func_mkdtemp = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MKDTEMP 1 +_ACEOF + +fi + # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE # needs to be defined for it @@ -10660,15 +13483,944 @@ if test -n "$enable_targets"; then done fi +if test "${ac_cv_header_iconv_h+set}" = set; then + echo "$as_me:$LINENO: checking for iconv.h" >&5 +echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6 +if test "${ac_cv_header_iconv_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5 +echo "${ECHO_T}$ac_cv_header_iconv_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking iconv.h usability" >&5 +echo $ECHO_N "checking iconv.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <iconv.h> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking iconv.h presence" >&5 +echo $ECHO_N "checking iconv.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <iconv.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: iconv.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: iconv.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: iconv.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: iconv.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: iconv.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: iconv.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for iconv.h" >&5 +echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6 +if test "${ac_cv_header_iconv_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_iconv_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5 +echo "${ECHO_T}$ac_cv_header_iconv_h" >&6 + +fi + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${acl_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${acl_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + acl_cv_prog_gnu_ld=yes +else + acl_cv_prog_gnu_ld=no +fi +fi +echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 +if test "${acl_cv_rpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6 + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + : +else + enable_rpath=yes +fi; + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi; + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6 +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <iconv.h> +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <iconv.h> +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6 + if test "$am_cv_func_iconv" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF + + fi + if test "$am_cv_lib_iconv" = yes; then + echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6 + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + if test "${am_cv_proto_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_proto_iconv_arg1="" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_proto_iconv_arg1="const" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + echo "$as_me:$LINENO: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +echo "${ECHO_T}${ac_t:- + }$am_cv_proto_iconv" >&6 + +cat >>confdefs.h <<_ACEOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +_ACEOF + + fi + + all_targets=false BUILD_NLMCONV= NLMCONV_DEFS= BUILD_SRCONV= BUILD_DLLTOOL= DLLTOOL_DEFS= +DLLTOOL_DEFAULT= BUILD_WINDRES= +BUILD_WINDMC= BUILD_DLLWRAP= BUILD_MISC= +BUILD_INSTALL_MISC= OBJDUMP_DEFS= for targ in $target $canon_targets @@ -10678,6 +14430,7 @@ do BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' BUILD_SRCONV='$(SRCONV_PROG)' NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" + BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)' else case $targ in i[3-7]86*-*-netware*) @@ -10703,27 +14456,65 @@ do case $targ in arm-epoc-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + arm-wince-pe* | arm-*-wince) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE" + fi + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; - arm-*-pe* | arm-*-wince) + arm-*-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; thumb-*-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + x86_64-*-mingw*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64" + fi + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; i[3-7]86-*-interix) BUILD_DLLTOOL='$(DLLTOOL_PROG)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" ;; powerpc*-aix5.[01]) @@ -10733,36 +14524,72 @@ do ;; powerpc*-*-pe* | powerpc*-*-cygwin*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + powerpc*-*-linux* | powerpc*-*-elf*) + BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu" ;; sh*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + spu-*-*) + BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)' ;; mips*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; mcore-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; mcore-*-elf) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF" ;; + mep-*) + OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0" + ;; esac fi done +DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT" + if test "${with_windres+set}" = set; then BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' fi +if test "${with_windmc+set}" = set; then + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' +fi + + + @@ -10818,7 +14645,6 @@ done ac_config_files="$ac_config_files Makefile doc/Makefile po/Makefile.in:po/Make-in" - ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -10931,6 +14757,13 @@ echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${GENINSRC_NEVER_TRUE}" && test -z "${GENINSRC_NEVER_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"GENINSRC_NEVER\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"GENINSRC_NEVER\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -11366,6 +15199,254 @@ cat >>$CONFIG_STATUS <<_ACEOF AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + _ACEOF @@ -11379,7 +15460,8 @@ do "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -11516,55 +15598,65 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@SED@,$SED,;t t +s,@EGREP@,$EGREP,;t t +s,@FGREP@,$FGREP,;t t +s,@GREP@,$GREP,;t t +s,@LD@,$LD,;t t +s,@DUMPBIN@,$DUMPBIN,;t t +s,@ac_ct_DUMPBIN@,$ac_ct_DUMPBIN,;t t +s,@NM@,$NM,;t t s,@LN_S@,$LN_S,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@LIBTOOL@,$LIBTOOL,;t t +s,@lt_ECHO@,$lt_ECHO,;t t +s,@CPP@,$CPP,;t t s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t s,@NO_WERROR@,$NO_WERROR,;t t s,@YACC@,$YACC,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@ALLOCA@,$ALLOCA,;t t s,@USE_NLS@,$USE_NLS,;t t -s,@MSGFMT@,$MSGFMT,;t t -s,@GMSGFMT@,$GMSGFMT,;t t +s,@LIBINTL@,$LIBINTL,;t t +s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t +s,@INCINTL@,$INCINTL,;t t s,@XGETTEXT@,$XGETTEXT,;t t -s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@POSUB@,$POSUB,;t t s,@CATALOGS@,$CATALOGS,;t t -s,@CATOBJEXT@,$CATOBJEXT,;t t s,@DATADIRNAME@,$DATADIRNAME,;t t -s,@GMOFILES@,$GMOFILES,;t t s,@INSTOBJEXT@,$INSTOBJEXT,;t t -s,@INTLDEPS@,$INTLDEPS,;t t -s,@INTLLIBS@,$INTLLIBS,;t t -s,@INTLOBJS@,$INTLOBJS,;t t -s,@POFILES@,$POFILES,;t t -s,@POSUB@,$POSUB,;t t -s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t -s,@GT_NO@,$GT_NO,;t t -s,@GT_YES@,$GT_YES,;t t +s,@GENCAT@,$GENCAT,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -s,@l@,$l,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@MSGMERGE@,$MSGMERGE,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t +s,@GENINSRC_NEVER_TRUE@,$GENINSRC_NEVER_TRUE,;t t +s,@GENINSRC_NEVER_FALSE@,$GENINSRC_NEVER_FALSE,;t t s,@HDEFINES@,$HDEFINES,;t t -s,@AR@,$AR,;t t s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t s,@EXEEXT_FOR_BUILD@,$EXEEXT_FOR_BUILD,;t t s,@DEMANGLER_NAME@,$DEMANGLER_NAME,;t t +s,@ALLOCA@,$ALLOCA,;t t +s,@LIBICONV@,$LIBICONV,;t t +s,@LTLIBICONV@,$LTLIBICONV,;t t s,@NLMCONV_DEFS@,$NLMCONV_DEFS,;t t s,@BUILD_NLMCONV@,$BUILD_NLMCONV,;t t s,@BUILD_SRCONV@,$BUILD_SRCONV,;t t s,@BUILD_DLLTOOL@,$BUILD_DLLTOOL,;t t s,@DLLTOOL_DEFS@,$DLLTOOL_DEFS,;t t s,@BUILD_WINDRES@,$BUILD_WINDRES,;t t +s,@BUILD_WINDMC@,$BUILD_WINDMC,;t t s,@BUILD_DLLWRAP@,$BUILD_DLLWRAP,;t t s,@BUILD_MISC@,$BUILD_MISC,;t t +s,@BUILD_INSTALL_MISC@,$BUILD_INSTALL_MISC,;t t s,@OBJDUMP_DEFS@,$OBJDUMP_DEFS,;t t s,@EMULATION@,$EMULATION,;t t s,@EMULATION_VECTOR@,$EMULATION_VECTOR,;t t @@ -12255,11 +16347,656 @@ echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} done done ;; - default ) -case "x$CONFIG_FILES" in -*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; + libtool ) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me (GNU $PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007 Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, a copy can be downloaded from +# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} +_LT_EOF esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + ;; + default-1 ) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; esac done _ACEOF diff --git a/binutils/configure.in b/binutils/configure.in index 10afc5374411..19aaabc8678d 100644 --- a/binutils/configure.in +++ b/binutils/configure.in @@ -11,7 +11,9 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ changequote([,])dnl AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION}) -AM_PROG_LIBTOOL +AC_PROG_CC +AC_GNU_SOURCE +AC_PROG_LIBTOOL AC_ARG_ENABLE(targets, [ --enable-targets alternative target configurations], @@ -40,16 +42,15 @@ if test -z "$host" ; then AC_MSG_ERROR(Unrecognized host system type; please check config.sub.) fi -AC_PROG_CC -AC_GNU_SOURCE - AC_PROG_YACC AM_PROG_LEX ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi" -CY_GNU_GETTEXT +ZW_GNU_GETTEXT_SISTER_DIR +AM_PO_SUBDIRS AM_MAINTAINER_MODE +AM_CONDITIONAL(GENINSRC_NEVER, false) AC_EXEEXT if test -n "$EXEEXT"; then AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1, @@ -79,10 +80,16 @@ case "${host}" in esac AC_SUBST(DEMANGLER_NAME) -AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h) +AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h) AC_HEADER_SYS_WAIT AC_FUNC_ALLOCA AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll) +AC_CHECK_FUNC([mkstemp], + AC_DEFINE([HAVE_MKSTEMP], 1, + [Define to 1 if you have the `mkstemp' function.])) +AC_CHECK_FUNC([mkdtemp], + AC_DEFINE([HAVE_MKDTEMP], 1, + [Define to 1 if you have the `mkdtemp' function.])) # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE # needs to be defined for it @@ -193,15 +200,21 @@ if test -n "$enable_targets"; then done fi +AC_CHECK_HEADER(iconv.h) +AM_ICONV + all_targets=false BUILD_NLMCONV= NLMCONV_DEFS= BUILD_SRCONV= BUILD_DLLTOOL= DLLTOOL_DEFS= +DLLTOOL_DEFAULT= BUILD_WINDRES= +BUILD_WINDMC= BUILD_DLLWRAP= BUILD_MISC= +BUILD_INSTALL_MISC= OBJDUMP_DEFS= for targ in $target $canon_targets @@ -211,6 +224,7 @@ do BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' BUILD_SRCONV='$(SRCONV_PROG)' NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" + BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)' else case $targ in changequote(,)dnl @@ -238,31 +252,69 @@ changequote([,])dnl case $targ in arm-epoc-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; - arm-*-pe* | arm-*-wince) + arm-wince-pe* | arm-*-wince) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE" + fi + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + arm-*-pe*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; thumb-*-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + x86_64-*-mingw*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64" + fi + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; changequote(,)dnl i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) changequote([,])dnl BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; changequote(,)dnl i[3-7]86-*-interix) changequote([,])dnl BUILD_DLLTOOL='$(DLLTOOL_PROG)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" ;; changequote(,)dnl @@ -274,44 +326,80 @@ changequote([,])dnl ;; powerpc*-*-pe* | powerpc*-*-cygwin*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + powerpc*-*-linux* | powerpc*-*-elf*) + BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu" ;; sh*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + spu-*-*) + BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)' ;; mips*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; mcore-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; mcore-*-elf) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF" ;; + mep-*) + OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0" + ;; esac fi done +DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT" + if test "${with_windres+set}" = set; then BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' fi +if test "${with_windmc+set}" = set; then + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' +fi + AC_SUBST(NLMCONV_DEFS) AC_SUBST(BUILD_NLMCONV) AC_SUBST(BUILD_SRCONV) AC_SUBST(BUILD_DLLTOOL) AC_SUBST(DLLTOOL_DEFS) AC_SUBST(BUILD_WINDRES) +AC_SUBST(BUILD_WINDMC) AC_SUBST(BUILD_DLLWRAP) AC_SUBST(BUILD_MISC) +AC_SUBST(BUILD_INSTALL_MISC) AC_SUBST(OBJDUMP_DEFS) AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.]) @@ -351,9 +439,4 @@ AC_SUBST(datarootdir) AC_SUBST(docdir) AC_SUBST(htmldir) -AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in, -[ -case "x$CONFIG_FILES" in -*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; -esac -]) +AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in) diff --git a/binutils/cxxfilt.c b/binutils/cxxfilt.c index a8ec43ba1180..bed0537e477e 100644 --- a/binutils/cxxfilt.c +++ b/binutils/cxxfilt.c @@ -1,6 +1,6 @@ /* Demangler for GNU C++ - main program Copyright 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.uucp) Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling Modified by Satish Pai (pai@apollo.hp.com) for HP demangling @@ -22,13 +22,13 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "config.h" +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "demangle.h" #include "getopt.h" #include "safe-ctype.h" +#include "bucomm.h" static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE; static int strip_underscore = TARGET_PREPENDS_UNDERSCORE; @@ -115,6 +115,8 @@ Options are:\n\ Demangled names are displayed to stdout.\n\ If a name cannot be demangled it is just echoed to stdout.\n\ If no names are provided on the command line, stdin is read.\n"); + if (REPORT_BUGS_TO[0] && status == 0) + fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/debug.c b/binutils/debug.c index 07d38acfe402..1cc518e6295d 100644 --- a/binutils/debug.c +++ b/binutils/debug.c @@ -1,5 +1,5 @@ /* debug.c -- Handle generic debugging information. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. @@ -26,11 +26,9 @@ this was writing a converter from stabs to HP IEEE-695 debugging format. */ -#include <stdio.h> +#include "sysdep.h" #include <assert.h> - #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "debug.h" diff --git a/binutils/deflex.c b/binutils/deflex.c deleted file mode 100644 index 9051c907b592..000000000000 --- a/binutils/deflex.c +++ /dev/null @@ -1,1881 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/deflex.c,v 1.1.16.1 2006/04/16 18:36:40 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include <stdio.h> -#include <errno.h> - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include <stdlib.h> -#ifndef _WIN32 -#include <unistd.h> -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include <io.h> -#include <stdlib.h> -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 41 -#define YY_END_OF_BUFFER 42 -static yyconst short int yy_accept[198] = - { 0, - 0, 0, 42, 41, 34, 36, 35, 33, 41, 28, - 41, 31, 40, 38, 27, 32, 37, 39, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 0, 29, 28, 0, 30, 31, 27, - 32, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 12, 6, 28, 7, - 28, 28, 28, 28, 28, 28, 28, 28, 1, 28, - - 28, 28, 16, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 17, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 14, 28, 28, 28, 19, 21, 28, 28, 28, - 28, 28, 28, 18, 9, 28, 10, 28, 28, 2, - 28, 28, 15, 28, 28, 28, 28, 11, 13, 28, - 5, 28, 28, 22, 28, 8, 28, 28, 28, 28, - 28, 28, 20, 4, 28, 28, 28, 24, 28, 26, - 28, 3, 28, 28, 23, 25, 0 - - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 1, 7, 1, 1, 8, 1, - 1, 9, 1, 10, 7, 11, 12, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 7, 14, 1, - 15, 1, 7, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 7, 26, 27, 28, 29, 30, 31, - 7, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 1, 1, 1, 1, 7, 1, 22, 22, 22, 22, - - 22, 22, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 22, - 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[41] = - { 0, - 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, - 1, 4, 5, 1, 1, 4, 6, 6, 6, 6, - 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 - } ; - -static yyconst short int yy_base[205] = - { 0, - 0, 0, 229, 230, 230, 230, 230, 230, 222, 0, - 219, 0, 230, 230, 0, 0, 230, 0, 209, 195, - 24, 186, 202, 14, 197, 186, 27, 188, 198, 25, - 197, 196, 184, 209, 230, 0, 206, 230, 0, 0, - 0, 0, 180, 27, 178, 178, 27, 193, 178, 183, - 189, 179, 177, 175, 178, 185, 182, 183, 170, 181, - 165, 164, 170, 173, 172, 159, 174, 171, 170, 158, - 156, 156, 151, 152, 149, 161, 34, 145, 160, 145, - 146, 154, 157, 147, 141, 139, 0, 0, 138, 0, - 139, 135, 137, 135, 135, 29, 149, 140, 0, 136, - - 139, 145, 0, 136, 139, 132, 132, 30, 132, 135, - 138, 129, 119, 118, 126, 116, 122, 119, 115, 115, - 124, 127, 109, 112, 121, 119, 106, 111, 108, 106, - 0, 106, 103, 112, 99, 91, 97, 99, 95, 88, - 99, 0, 93, 103, 94, 0, 0, 97, 91, 87, - 90, 84, 83, 0, 0, 95, 0, 97, 80, 0, - 92, 91, 0, 78, 70, 91, 74, 0, 0, 82, - 0, 89, 88, 0, 84, 0, 82, 85, 83, 69, - 66, 56, 0, 0, 39, 36, 35, 0, 44, 0, - 43, 0, 40, 39, 0, 0, 230, 67, 71, 77, - - 83, 85, 91, 95 - } ; - -static yyconst short int yy_def[205] = - { 0, - 197, 1, 197, 197, 197, 197, 197, 197, 198, 199, - 200, 201, 197, 197, 202, 203, 197, 204, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 198, 197, 199, 200, 197, 201, 202, - 203, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 0, 197, 197, 197, - - 197, 197, 197, 197 - } ; - -static yyconst short int yy_nxt[271] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 4, 15, 16, 17, 18, 10, 19, 20, 21, - 22, 10, 10, 23, 24, 10, 25, 26, 27, 10, - 28, 29, 30, 31, 10, 32, 33, 10, 10, 10, - 45, 49, 50, 53, 46, 57, 65, 69, 58, 59, - 100, 117, 128, 118, 129, 66, 54, 70, 60, 196, - 195, 194, 193, 192, 191, 190, 101, 34, 34, 34, - 34, 34, 34, 36, 36, 36, 36, 37, 37, 37, - 37, 37, 37, 39, 189, 39, 39, 39, 39, 40, - 40, 41, 188, 41, 41, 41, 41, 42, 187, 186, - - 42, 185, 184, 183, 182, 181, 180, 179, 178, 177, - 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 127, 126, 125, - 124, 123, 122, 121, 120, 119, 116, 115, 114, 113, - 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, - 102, 99, 98, 97, 96, 95, 94, 93, 92, 91, - 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, - - 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, - 68, 67, 64, 38, 35, 63, 62, 61, 56, 55, - 52, 51, 48, 47, 44, 43, 38, 35, 197, 3, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197 - } ; - -static yyconst short int yy_chk[271] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 21, 24, 24, 27, 21, 30, 44, 47, 30, 30, - 77, 96, 108, 96, 108, 44, 27, 47, 30, 194, - 193, 191, 189, 187, 186, 185, 77, 198, 198, 198, - 198, 198, 198, 199, 199, 199, 199, 200, 200, 200, - 200, 200, 200, 201, 182, 201, 201, 201, 201, 202, - 202, 203, 181, 203, 203, 203, 203, 204, 180, 179, - - 204, 178, 177, 175, 173, 172, 170, 167, 166, 165, - 164, 162, 161, 159, 158, 156, 153, 152, 151, 150, - 149, 148, 145, 144, 143, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 130, 129, 128, 127, 126, - 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, - 115, 114, 113, 112, 111, 110, 109, 107, 106, 105, - 104, 102, 101, 100, 98, 97, 95, 94, 93, 92, - 91, 89, 86, 85, 84, 83, 82, 81, 80, 79, - 78, 76, 75, 74, 73, 72, 71, 70, 69, 68, - 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, - - 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, - 46, 45, 43, 37, 34, 33, 32, 31, 29, 28, - 26, 25, 23, 22, 20, 19, 11, 9, 3, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "deflex.l" -#define INITIAL 0 -#line 2 "deflex.l" - -/* Copyright 1995, 1997, 1998, 1999, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - - -/* Contributed by Steve Chamberlain: sac@cygnus.com */ - -#define DONTDECLARE_MALLOC -#include "libiberty.h" -#include "defparse.h" -#include "dlltool.h" - -#define YY_NO_UNPUT - -int linenumber; - -#line 523 "deflex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 35 "deflex.l" - -#line 687 "deflex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 198 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 230 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 36 "deflex.l" -{ return NAME;} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 37 "deflex.l" -{ return LIBRARY;} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 38 "deflex.l" -{ return DESCRIPTION;} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 39 "deflex.l" -{ return STACKSIZE;} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 40 "deflex.l" -{ return HEAPSIZE;} - YY_BREAK -case 6: -YY_RULE_SETUP -#line 41 "deflex.l" -{ return CODE;} - YY_BREAK -case 7: -YY_RULE_SETUP -#line 42 "deflex.l" -{ return DATA;} - YY_BREAK -case 8: -YY_RULE_SETUP -#line 43 "deflex.l" -{ return SECTIONS;} - YY_BREAK -case 9: -YY_RULE_SETUP -#line 44 "deflex.l" -{ return EXPORTS;} - YY_BREAK -case 10: -YY_RULE_SETUP -#line 45 "deflex.l" -{ return IMPORTS;} - YY_BREAK -case 11: -YY_RULE_SETUP -#line 46 "deflex.l" -{ return VERSIONK;} - YY_BREAK -case 12: -YY_RULE_SETUP -#line 47 "deflex.l" -{ return BASE;} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 48 "deflex.l" -{ return CONSTANT; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 49 "deflex.l" -{ return NONAME; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 50 "deflex.l" -{ return PRIVATE; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 51 "deflex.l" -{ return READ;} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 52 "deflex.l" -{ return WRITE;} - YY_BREAK -case 18: -YY_RULE_SETUP -#line 53 "deflex.l" -{ return EXECUTE;} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 54 "deflex.l" -{ return SHARED;} - YY_BREAK -case 20: -YY_RULE_SETUP -#line 55 "deflex.l" -{ return NONSHARED;} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 56 "deflex.l" -{ return SINGLE;} - YY_BREAK -case 22: -YY_RULE_SETUP -#line 57 "deflex.l" -{ return MULTIPLE;} - YY_BREAK -case 23: -YY_RULE_SETUP -#line 58 "deflex.l" -{ return INITINSTANCE;} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 59 "deflex.l" -{ return INITGLOBAL;} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 60 "deflex.l" -{ return TERMINSTANCE;} - YY_BREAK -case 26: -YY_RULE_SETUP -#line 61 "deflex.l" -{ return TERMGLOBAL;} - YY_BREAK -case 27: -YY_RULE_SETUP -#line 63 "deflex.l" -{ yylval.number = strtol (yytext,0,0); - return NUMBER; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 66 "deflex.l" -{ - yylval.id = xstrdup (yytext); - return ID; - } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 71 "deflex.l" -{ - yylval.id = xstrdup (yytext+1); - yylval.id[yyleng-2] = 0; - return ID; - } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 77 "deflex.l" -{ - yylval.id = xstrdup (yytext+1); - yylval.id[yyleng-2] = 0; - return ID; - } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 82 "deflex.l" -{ } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 83 "deflex.l" -{ } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 84 "deflex.l" -{ } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 85 "deflex.l" -{ } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 86 "deflex.l" -{ } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 87 "deflex.l" -{ linenumber ++ ;} - YY_BREAK -case 37: -YY_RULE_SETUP -#line 88 "deflex.l" -{ return '=';} - YY_BREAK -case 38: -YY_RULE_SETUP -#line 89 "deflex.l" -{ return '.';} - YY_BREAK -case 39: -YY_RULE_SETUP -#line 90 "deflex.l" -{ return '@';} - YY_BREAK -case 40: -YY_RULE_SETUP -#line 91 "deflex.l" -{ return ',';} - YY_BREAK -case 41: -YY_RULE_SETUP -#line 92 "deflex.l" -ECHO; - YY_BREAK -#line 987 "deflex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 198 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 198 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 197); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include <unistd.h> -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 92 "deflex.l" - -#ifndef yywrap -/* Needed for lex, though not flex. */ -int yywrap(void) { return 1; } -#endif diff --git a/binutils/defparse.c b/binutils/defparse.c deleted file mode 100644 index de34ae0cfc1f..000000000000 --- a/binutils/defparse.c +++ /dev/null @@ -1,1777 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - LIBRARY = 259, - DESCRIPTION = 260, - STACKSIZE = 261, - HEAPSIZE = 262, - CODE = 263, - DATA = 264, - SECTIONS = 265, - EXPORTS = 266, - IMPORTS = 267, - VERSIONK = 268, - BASE = 269, - CONSTANT = 270, - READ = 271, - WRITE = 272, - EXECUTE = 273, - SHARED = 274, - NONSHARED = 275, - NONAME = 276, - PRIVATE = 277, - SINGLE = 278, - MULTIPLE = 279, - INITINSTANCE = 280, - INITGLOBAL = 281, - TERMINSTANCE = 282, - TERMGLOBAL = 283, - ID = 284, - NUMBER = 285 - }; -#endif -/* Tokens. */ -#define NAME 258 -#define LIBRARY 259 -#define DESCRIPTION 260 -#define STACKSIZE 261 -#define HEAPSIZE 262 -#define CODE 263 -#define DATA 264 -#define SECTIONS 265 -#define EXPORTS 266 -#define IMPORTS 267 -#define VERSIONK 268 -#define BASE 269 -#define CONSTANT 270 -#define READ 271 -#define WRITE 272 -#define EXECUTE 273 -#define SHARED 274 -#define NONSHARED 275 -#define NONAME 276 -#define PRIVATE 277 -#define SINGLE 278 -#define MULTIPLE 279 -#define INITINSTANCE 280 -#define INITGLOBAL 281 -#define TERMINSTANCE 282 -#define TERMGLOBAL 283 -#define ID 284 -#define NUMBER 285 - - - - -/* Copy the first part of user declarations. */ -#line 1 "defparse.y" - /* defparse.y - parser for .def files */ - -/* Copyright 1995, 1997, 1998, 1999, 2001, 2004 - Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include "bfd.h" -#include "bucomm.h" -#include "dlltool.h" - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 27 "defparse.y" -typedef union YYSTYPE { - char *id; - int number; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 176 "defparse.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 188 "defparse.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 38 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 114 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 35 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 23 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 68 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 98 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 285 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 33, 2, 31, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 32, 2, 2, 34, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 6, 8, 12, 17, 20, 23, 27, - 31, 34, 37, 40, 43, 46, 51, 52, 55, 63, - 66, 68, 76, 84, 90, 96, 102, 108, 112, 116, - 119, 121, 124, 128, 130, 132, 133, 136, 137, 139, - 141, 143, 145, 147, 149, 151, 153, 154, 156, 157, - 159, 160, 162, 163, 165, 169, 170, 173, 174, 177, - 182, 183, 187, 188, 189, 193, 195, 197, 199 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 36, 0, -1, 36, 37, -1, 37, -1, 3, 52, - 55, -1, 4, 52, 55, 56, -1, 11, 38, -1, - 5, 29, -1, 6, 30, 46, -1, 7, 30, 46, - -1, 8, 44, -1, 9, 44, -1, 10, 42, -1, - 12, 40, -1, 13, 30, -1, 13, 30, 31, 30, - -1, -1, 38, 39, -1, 29, 54, 53, 49, 48, - 50, 51, -1, 40, 41, -1, 41, -1, 29, 32, - 29, 31, 29, 31, 29, -1, 29, 32, 29, 31, - 29, 31, 30, -1, 29, 32, 29, 31, 29, -1, - 29, 32, 29, 31, 30, -1, 29, 31, 29, 31, - 29, -1, 29, 31, 29, 31, 30, -1, 29, 31, - 29, -1, 29, 31, 30, -1, 42, 43, -1, 43, - -1, 29, 44, -1, 44, 45, 47, -1, 47, -1, - 33, -1, -1, 33, 30, -1, -1, 16, -1, 17, - -1, 18, -1, 19, -1, 20, -1, 23, -1, 24, - -1, 15, -1, -1, 21, -1, -1, 9, -1, -1, - 22, -1, -1, 29, -1, 29, 31, 29, -1, -1, - 34, 30, -1, -1, 32, 29, -1, 32, 29, 31, - 29, -1, -1, 14, 32, 30, -1, -1, -1, 56, - 45, 57, -1, 25, -1, 26, -1, 27, -1, 28, - -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned char yyrline[] = -{ - 0, 44, 44, 45, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 64, 66, 70, 74, - 75, 79, 80, 81, 82, 83, 84, 85, 86, 90, - 91, 95, 99, 100, 104, 105, 107, 108, 112, 113, - 114, 115, 116, 117, 118, 122, 123, 127, 128, 132, - 133, 137, 138, 141, 142, 148, 152, 153, 157, 158, - 164, 167, 168, 171, 173, 177, 178, 179, 180 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NAME", "LIBRARY", "DESCRIPTION", - "STACKSIZE", "HEAPSIZE", "CODE", "DATA", "SECTIONS", "EXPORTS", - "IMPORTS", "VERSIONK", "BASE", "CONSTANT", "READ", "WRITE", "EXECUTE", - "SHARED", "NONSHARED", "NONAME", "PRIVATE", "SINGLE", "MULTIPLE", - "INITINSTANCE", "INITGLOBAL", "TERMINSTANCE", "TERMGLOBAL", "ID", - "NUMBER", "'.'", "'='", "','", "'@'", "$accept", "start", "command", - "explist", "expline", "implist", "impline", "seclist", "secline", - "attr_list", "opt_comma", "opt_number", "attr", "opt_CONSTANT", - "opt_NONAME", "opt_DATA", "opt_PRIVATE", "opt_name", "opt_ordinal", - "opt_equal_name", "opt_base", "option_list", "option", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 46, 61, 44, 64 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 35, 36, 36, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 38, 38, 39, 40, - 40, 41, 41, 41, 41, 41, 41, 41, 41, 42, - 42, 43, 44, 44, 45, 45, 46, 46, 47, 47, - 47, 47, 47, 47, 47, 48, 48, 49, 49, 50, - 50, 51, 51, 52, 52, 52, 53, 53, 54, 54, - 54, 55, 55, 56, 56, 57, 57, 57, 57 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 2, 1, 3, 4, 2, 2, 3, 3, - 2, 2, 2, 2, 2, 4, 0, 2, 7, 2, - 1, 7, 7, 5, 5, 5, 5, 3, 3, 2, - 1, 2, 3, 1, 1, 0, 2, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 3, 0, 2, 0, 2, 4, - 0, 3, 0, 0, 3, 1, 1, 1, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 0, 55, 55, 0, 0, 0, 0, 0, 0, 16, - 0, 0, 0, 3, 53, 62, 62, 7, 37, 37, - 38, 39, 40, 41, 42, 43, 44, 10, 33, 11, - 0, 12, 30, 6, 0, 13, 20, 14, 1, 2, - 0, 0, 4, 63, 0, 8, 9, 34, 0, 31, - 29, 60, 17, 0, 0, 19, 0, 54, 0, 5, - 36, 32, 0, 57, 27, 28, 0, 15, 61, 0, - 58, 0, 48, 0, 0, 65, 66, 67, 68, 64, - 0, 56, 47, 46, 25, 26, 23, 24, 59, 45, - 50, 0, 49, 52, 21, 22, 51, 18 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 12, 13, 33, 52, 35, 36, 31, 32, 27, - 48, 45, 28, 90, 83, 93, 97, 15, 72, 63, - 42, 59, 79 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -26 -static const yysigned_char yypact[] = -{ - 32, -12, -12, 17, -8, 33, -4, -4, 35, -26, - 36, 37, 21, -26, 38, 48, 48, -26, 39, 39, - -26, -26, -26, -26, -26, -26, -26, -15, -26, -15, - -4, 35, -26, 41, -25, 36, -26, 40, -26, -26, - 44, 34, -26, -26, 45, -26, -26, -26, -4, -15, - -26, 42, -26, -19, 47, -26, 49, -26, 50, 22, - -26, -26, 52, 43, 51, -26, 53, -26, -26, 26, - 54, 56, 57, 27, 29, -26, -26, -26, -26, -26, - 58, -26, -26, 68, -26, -26, 59, -26, -26, -26, - 79, 31, -26, 46, -26, -26, -26, -26 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -26, -26, 77, -26, -26, -26, 60, -26, 61, -7, - 55, 72, 62, -26, -26, -26, -26, 91, -26, -26, - 78, -26, -26 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -36 -static const yysigned_char yytable[] = -{ - 29, -35, -35, -35, -35, -35, 53, 54, -35, -35, - 64, 65, 20, 21, 22, 23, 24, 14, 47, 25, - 26, 38, 18, 49, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 17, -35, -35, -35, - -35, 75, 76, 77, 78, 47, 84, 85, 86, 87, - 94, 95, 41, 19, 30, 34, 58, 37, 96, 40, - 51, 56, 44, 57, 62, 60, 66, 71, 82, 67, - 68, 70, 73, 89, 74, 80, 81, 88, 92, 39, - 91, 46, 50, 16, 43, 55, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 0, 0, 0, 69 -}; - -static const yysigned_char yycheck[] = -{ - 7, 16, 17, 18, 19, 20, 31, 32, 23, 24, - 29, 30, 16, 17, 18, 19, 20, 29, 33, 23, - 24, 0, 30, 30, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 29, 25, 26, 27, - 28, 25, 26, 27, 28, 33, 29, 30, 29, 30, - 29, 30, 14, 30, 29, 29, 32, 30, 22, 31, - 29, 31, 33, 29, 32, 30, 29, 34, 21, 30, - 30, 29, 31, 15, 31, 31, 30, 29, 9, 12, - 31, 19, 31, 2, 16, 35, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 48, -1, -1, -1, 59 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 36, 37, 29, 52, 52, 29, 30, 30, - 16, 17, 18, 19, 20, 23, 24, 44, 47, 44, - 29, 42, 43, 38, 29, 40, 41, 30, 0, 37, - 31, 14, 55, 55, 33, 46, 46, 33, 45, 44, - 43, 29, 39, 31, 32, 41, 31, 29, 32, 56, - 30, 47, 32, 54, 29, 30, 29, 30, 30, 45, - 29, 34, 53, 31, 31, 25, 26, 27, 28, 57, - 31, 30, 21, 49, 29, 30, 29, 30, 29, 15, - 48, 31, 9, 50, 29, 30, 22, 51 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 4: -#line 49 "defparse.y" - { def_name ((yyvsp[-1].id), (yyvsp[0].number)); } - break; - - case 5: -#line 50 "defparse.y" - { def_library ((yyvsp[-2].id), (yyvsp[-1].number)); } - break; - - case 7: -#line 52 "defparse.y" - { def_description ((yyvsp[0].id));} - break; - - case 8: -#line 53 "defparse.y" - { def_stacksize ((yyvsp[-1].number), (yyvsp[0].number));} - break; - - case 9: -#line 54 "defparse.y" - { def_heapsize ((yyvsp[-1].number), (yyvsp[0].number));} - break; - - case 10: -#line 55 "defparse.y" - { def_code ((yyvsp[0].number));} - break; - - case 11: -#line 56 "defparse.y" - { def_data ((yyvsp[0].number));} - break; - - case 14: -#line 59 "defparse.y" - { def_version ((yyvsp[0].number),0);} - break; - - case 15: -#line 60 "defparse.y" - { def_version ((yyvsp[-2].number),(yyvsp[0].number));} - break; - - case 18: -#line 71 "defparse.y" - { def_exports ((yyvsp[-6].id), (yyvsp[-5].id), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].number), (yyvsp[-1].number), (yyvsp[0].number));} - break; - - case 21: -#line 79 "defparse.y" - { def_import ((yyvsp[-6].id),(yyvsp[-4].id),(yyvsp[-2].id),(yyvsp[0].id), 0); } - break; - - case 22: -#line 80 "defparse.y" - { def_import ((yyvsp[-6].id),(yyvsp[-4].id),(yyvsp[-2].id), 0,(yyvsp[0].number)); } - break; - - case 23: -#line 81 "defparse.y" - { def_import ((yyvsp[-4].id),(yyvsp[-2].id), 0,(yyvsp[0].id), 0); } - break; - - case 24: -#line 82 "defparse.y" - { def_import ((yyvsp[-4].id),(yyvsp[-2].id), 0, 0,(yyvsp[0].number)); } - break; - - case 25: -#line 83 "defparse.y" - { def_import ( 0,(yyvsp[-4].id),(yyvsp[-2].id),(yyvsp[0].id), 0); } - break; - - case 26: -#line 84 "defparse.y" - { def_import ( 0,(yyvsp[-4].id),(yyvsp[-2].id), 0,(yyvsp[0].number)); } - break; - - case 27: -#line 85 "defparse.y" - { def_import ( 0,(yyvsp[-2].id), 0,(yyvsp[0].id), 0); } - break; - - case 28: -#line 86 "defparse.y" - { def_import ( 0,(yyvsp[-2].id), 0, 0,(yyvsp[0].number)); } - break; - - case 31: -#line 95 "defparse.y" - { def_section ((yyvsp[-1].id),(yyvsp[0].number));} - break; - - case 36: -#line 107 "defparse.y" - { (yyval.number)=(yyvsp[0].number);} - break; - - case 37: -#line 108 "defparse.y" - { (yyval.number)=-1;} - break; - - case 38: -#line 112 "defparse.y" - { (yyval.number) = 1; } - break; - - case 39: -#line 113 "defparse.y" - { (yyval.number) = 2; } - break; - - case 40: -#line 114 "defparse.y" - { (yyval.number) = 4; } - break; - - case 41: -#line 115 "defparse.y" - { (yyval.number) = 8; } - break; - - case 42: -#line 116 "defparse.y" - { (yyval.number) = 0; } - break; - - case 43: -#line 117 "defparse.y" - { (yyval.number) = 0; } - break; - - case 44: -#line 118 "defparse.y" - { (yyval.number) = 0; } - break; - - case 45: -#line 122 "defparse.y" - {(yyval.number)=1;} - break; - - case 46: -#line 123 "defparse.y" - {(yyval.number)=0;} - break; - - case 47: -#line 127 "defparse.y" - {(yyval.number)=1;} - break; - - case 48: -#line 128 "defparse.y" - {(yyval.number)=0;} - break; - - case 49: -#line 132 "defparse.y" - { (yyval.number) = 1; } - break; - - case 50: -#line 133 "defparse.y" - { (yyval.number) = 0; } - break; - - case 51: -#line 137 "defparse.y" - { (yyval.number) = 1; } - break; - - case 52: -#line 138 "defparse.y" - { (yyval.number) = 0; } - break; - - case 53: -#line 141 "defparse.y" - { (yyval.id) =(yyvsp[0].id); } - break; - - case 54: -#line 143 "defparse.y" - { - char *name = xmalloc (strlen ((yyvsp[-2].id)) + 1 + strlen ((yyvsp[0].id)) + 1); - sprintf (name, "%s.%s", (yyvsp[-2].id), (yyvsp[0].id)); - (yyval.id) = name; - } - break; - - case 55: -#line 148 "defparse.y" - { (yyval.id)=""; } - break; - - case 56: -#line 152 "defparse.y" - { (yyval.number)=(yyvsp[0].number);} - break; - - case 57: -#line 153 "defparse.y" - { (yyval.number)=-1;} - break; - - case 58: -#line 157 "defparse.y" - { (yyval.id) = (yyvsp[0].id); } - break; - - case 59: -#line 159 "defparse.y" - { - char *name = xmalloc (strlen ((yyvsp[-2].id)) + 1 + strlen ((yyvsp[0].id)) + 1); - sprintf (name, "%s.%s", (yyvsp[-2].id), (yyvsp[0].id)); - (yyval.id) = name; - } - break; - - case 60: -#line 164 "defparse.y" - { (yyval.id) = 0; } - break; - - case 61: -#line 167 "defparse.y" - { (yyval.number)= (yyvsp[0].number);} - break; - - case 62: -#line 168 "defparse.y" - { (yyval.number)=-1;} - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 1510 "defparse.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - - diff --git a/binutils/defparse.h b/binutils/defparse.h deleted file mode 100644 index 0eea9b9dcf48..000000000000 --- a/binutils/defparse.h +++ /dev/null @@ -1,111 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - LIBRARY = 259, - DESCRIPTION = 260, - STACKSIZE = 261, - HEAPSIZE = 262, - CODE = 263, - DATA = 264, - SECTIONS = 265, - EXPORTS = 266, - IMPORTS = 267, - VERSIONK = 268, - BASE = 269, - CONSTANT = 270, - READ = 271, - WRITE = 272, - EXECUTE = 273, - SHARED = 274, - NONSHARED = 275, - NONAME = 276, - PRIVATE = 277, - SINGLE = 278, - MULTIPLE = 279, - INITINSTANCE = 280, - INITGLOBAL = 281, - TERMINSTANCE = 282, - TERMGLOBAL = 283, - ID = 284, - NUMBER = 285 - }; -#endif -/* Tokens. */ -#define NAME 258 -#define LIBRARY 259 -#define DESCRIPTION 260 -#define STACKSIZE 261 -#define HEAPSIZE 262 -#define CODE 263 -#define DATA 264 -#define SECTIONS 265 -#define EXPORTS 266 -#define IMPORTS 267 -#define VERSIONK 268 -#define BASE 269 -#define CONSTANT 270 -#define READ 271 -#define WRITE 272 -#define EXECUTE 273 -#define SHARED 274 -#define NONSHARED 275 -#define NONAME 276 -#define PRIVATE 277 -#define SINGLE 278 -#define MULTIPLE 279 -#define INITINSTANCE 280 -#define INITGLOBAL 281 -#define TERMINSTANCE 282 -#define TERMGLOBAL 283 -#define ID 284 -#define NUMBER 285 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 27 "defparse.y" -typedef union YYSTYPE { - char *id; - int number; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 103 "defparse.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/defparse.y b/binutils/defparse.y index 81b4c61ce903..8b870d7c6be6 100644 --- a/binutils/defparse.y +++ b/binutils/defparse.y @@ -1,6 +1,6 @@ %{ /* defparse.y - parser for .def files */ -/* Copyright 1995, 1997, 1998, 1999, 2001, 2004 +/* Copyright 1995, 1997, 1998, 1999, 2001, 2004, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,8 +19,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" +#include "libiberty.h" #include "dlltool.h" %} diff --git a/binutils/dlltool.c b/binutils/dlltool.c index 6c231f69a449..568ad689efae 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -1,6 +1,6 @@ /* dlltool.c -- tool to generate stuff for PE style DLLs Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -243,12 +243,13 @@ #define PAGE_SIZE 4096 #define PAGE_MASK (-PAGE_SIZE) +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" -#include "bucomm.h" #include "getopt.h" #include "demangle.h" #include "dyn-string.h" +#include "bucomm.h" #include "dlltool.h" #include "safe-ctype.h" @@ -261,6 +262,9 @@ #include "coff/arm.h" #include "coff/internal.h" #endif +#ifdef DLLTOOL_MX86_64 +#include "coff/x86_64.h" +#endif /* Forward references. */ static char *look_for_prog (const char *, const char *, int); @@ -384,35 +388,43 @@ static int verbose; static FILE *output_def; static FILE *base_file; -#ifdef DLLTOOL_ARM -#ifdef DLLTOOL_ARM_EPOC -static const char *mname = "arm-epoc"; -#else +#ifdef DLLTOOL_DEFAULT_ARM static const char *mname = "arm"; #endif + +#ifdef DLLTOOL_DEFAULT_ARM_EPOC +static const char *mname = "arm-epoc"; +#endif + +#ifdef DLLTOOL_DEFAULT_ARM_WINCE +static const char *mname = "arm-wince"; #endif -#ifdef DLLTOOL_I386 +#ifdef DLLTOOL_DEFAULT_I386 static const char *mname = "i386"; #endif -#ifdef DLLTOOL_PPC +#ifdef DLLTOOL_DEFAULT_MX86_64 +static const char *mname = "i386:x86-64"; +#endif + +#ifdef DLLTOOL_DEFAULT_PPC static const char *mname = "ppc"; #endif -#ifdef DLLTOOL_SH +#ifdef DLLTOOL_DEFAULT_SH static const char *mname = "sh"; #endif -#ifdef DLLTOOL_MIPS +#ifdef DLLTOOL_DEFAULT_MIPS static const char *mname = "mips"; #endif -#ifdef DLLTOOL_MCORE +#ifdef DLLTOOL_DEFAULT_MCORE static const char * mname = "mcore-le"; #endif -#ifdef DLLTOOL_MCORE_ELF +#ifdef DLLTOOL_DEFAULT_MCORE_ELF static const char * mname = "mcore-elf"; static char * mcore_elf_out_file = NULL; static char * mcore_elf_linker = NULL; @@ -629,6 +641,23 @@ mtable[] = arm_jtab, sizeof (arm_jtab), 8 } , + { +#define MARM_WINCE 10 + "arm-wince", ".byte", ".short", ".long", ".asciz", "@", + "ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long", + ".global", ".space", ".align\t2",".align\t4", "-mapcs-32", + "pe-arm-wince-little", bfd_arch_arm, + arm_jtab, sizeof (arm_jtab), 8 + } + , + { +#define MX86 11 + "i386:x86-64", ".byte", ".short", ".long", ".asciz", "#", + "jmp *", ".global", ".space", ".align\t2",".align\t4", "", + "pe-x86-64",bfd_arch_i386, + i386_jtab, sizeof (i386_jtab), 2 + } + , { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; @@ -752,6 +781,7 @@ rvaafter (int machine) { case MARM: case M386: + case MX86: case MPPC: case MTHUMB: case MARM_INTERWORK: @@ -760,6 +790,7 @@ rvaafter (int machine) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: break; default: /* xgettext:c-format */ @@ -776,6 +807,7 @@ rvabefore (int machine) { case MARM: case M386: + case MX86: case MPPC: case MTHUMB: case MARM_INTERWORK: @@ -784,6 +816,7 @@ rvabefore (int machine) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: return ".rva\t"; default: /* xgettext:c-format */ @@ -807,8 +840,10 @@ asm_prefix (int machine, const char *name) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: break; case M386: + case MX86: /* Symbol names starting with ? do not have a leading underscore. */ if (name && *name == '?') break; @@ -1234,7 +1269,7 @@ scan_drectve_symbols (bfd *abfd) while (p < e) { if (p[0] == '-' - && strncmp (p, "-export:", 8) == 0) + && CONST_STRNEQ (p, "-export:")) { char * name; char * c; @@ -1252,7 +1287,7 @@ scan_drectve_symbols (bfd *abfd) char *tag_start = ++p; while (p < e && *p != ' ' && *p != '-') p++; - if (strncmp (tag_start, "data", 4) == 0) + if (CONST_STRNEQ (tag_start, "data")) flags &= ~BSF_FUNCTION; } @@ -1686,10 +1721,19 @@ generate_idata_ofile (FILE *filvar) for (headptr = import_list; headptr != NULL; headptr = headptr->next) { fprintf (filvar, "listone%d:\n", headindex); - for ( funcindex = 0; funcindex < headptr->nfuncs; funcindex++ ) + for (funcindex = 0; funcindex < headptr->nfuncs; funcindex++) +#ifdef DLLTOOL_MX86_64 + fprintf (filvar, "\t%sfuncptr%d_%d%s\n%s\t0\n", + ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER,ASM_LONG); +#else fprintf (filvar, "\t%sfuncptr%d_%d%s\n", ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER); - fprintf (filvar,"\t%s\t0\n", ASM_LONG); /* NULL terminating list */ +#endif +#ifdef DLLTOOL_MX86_64 + fprintf (filvar, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif headindex++; } @@ -1698,10 +1742,19 @@ generate_idata_ofile (FILE *filvar) for (headptr = import_list; headptr != NULL; headptr = headptr->next) { fprintf (filvar, "listtwo%d:\n", headindex); - for ( funcindex = 0; funcindex < headptr->nfuncs; funcindex++ ) + for (funcindex = 0; funcindex < headptr->nfuncs; funcindex++) +#ifdef DLLTOOL_MX86_64 + fprintf (filvar, "\t%sfuncptr%d_%d%s\n%s\t0\n", + ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER,ASM_LONG); +#else fprintf (filvar, "\t%sfuncptr%d_%d%s\n", ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER); - fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list */ +#endif +#ifdef DLLTOOL_MX86_64 + fprintf (filvar, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif headindex++; } @@ -2344,7 +2397,7 @@ make_one_lib_file (export_type *exp, int i) si->data = xmalloc (HOW_JTAB_SIZE); memcpy (si->data, HOW_JTAB, HOW_JTAB_SIZE); - /* add the reloc into idata$5 */ + /* Add the reloc into idata$5. */ rel = xmalloc (sizeof (arelent)); rpp = xmalloc (sizeof (arelent *) * 2); @@ -2360,6 +2413,12 @@ make_one_lib_file (export_type *exp, int i) BFD_RELOC_16_GOTOFF); rel->sym_ptr_ptr = iname_pp; } + else if (machine == MX86) + { + rel->howto = bfd_reloc_type_lookup (abfd, + BFD_RELOC_32_PCREL); + rel->sym_ptr_ptr = iname_pp; + } else { rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); @@ -2374,6 +2433,36 @@ make_one_lib_file (export_type *exp, int i) /* An idata$4 or idata$5 is one word long, and has an rva to idata$6. */ +#ifdef DLLTOOL_MX86_64 + si->data = xmalloc (8); + si->size = 8; + + if (exp->noname) + { + si->data[0] = exp->ordinal ; + si->data[1] = exp->ordinal >> 8; + si->data[2] = exp->ordinal >> 16; + si->data[3] = exp->ordinal >> 24; + si->data[4] = 0; + si->data[5] = 0; + si->data[6] = 0; + si->data[7] = 0x80; + } + else + { + sec->reloc_count = 1; + memset (si->data, 0, si->size); + rel = xmalloc (sizeof (arelent)); + rpp = xmalloc (sizeof (arelent *) * 2); + rpp[0] = rel; + rpp[1] = 0; + rel->address = 0; + rel->addend = 0; + rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_RVA); + rel->sym_ptr_ptr = secdata[IDATA6].sympp; + sec->orelocation = rpp; + } +#else si->data = xmalloc (4); si->size = 4; @@ -2398,7 +2487,7 @@ make_one_lib_file (export_type *exp, int i) rel->sym_ptr_ptr = secdata[IDATA6].sympp; sec->orelocation = rpp; } - +#endif break; case IDATA6: @@ -2612,14 +2701,17 @@ make_head (void) if (!no_idata5) { fprintf (f, "\t.section\t.idata$5\n"); - fprintf (f, "\t%s\t0\n", ASM_LONG); +#ifdef DLLTOOL_MX86_64 + fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif fprintf (f, "fthunk:\n"); } if (!no_idata4) { fprintf (f, "\t.section\t.idata$4\n"); - fprintf (f, "\t%s\t0\n", ASM_LONG); fprintf (f, "\t.section .idata$4\n"); fprintf (f, "hname:\n"); @@ -2646,13 +2738,21 @@ make_tail (void) if (!no_idata4) { fprintf (f, "\t.section .idata$4\n"); - fprintf (f, "\t%s\t0\n", ASM_LONG); +#ifdef DLLTOOL_MX86_64 + fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif } if (!no_idata5) { fprintf (f, "\t.section .idata$5\n"); - fprintf (f, "\t%s\t0\n", ASM_LONG); +#ifdef DLLTOOL_MX86_64 + fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif } #ifdef DLLTOOL_PPC @@ -2728,7 +2828,7 @@ gen_lib_file (void) if (exp->private) continue; n = make_one_lib_file (exp, i); - n->next = head; + n->archive_next = head; head = n; if (ext_prefix_alias) { @@ -2747,14 +2847,14 @@ gen_lib_file (void) alias_exp.forward = exp->forward; alias_exp.next = exp->next; n = make_one_lib_file (&alias_exp, i + PREFIX_ALIAS_BASE); - n->next = head; + n->archive_next = head; head = n; } } /* Now stick them all into the archive. */ - ar_head->next = head; - ar_tail->next = ar_head; + ar_head->archive_next = head; + ar_tail->archive_next = ar_head; head = ar_tail; if (! bfd_set_archive_head (outarch, head)) @@ -2765,7 +2865,7 @@ gen_lib_file (void) while (head != NULL) { - bfd *n = head->next; + bfd *n = head->archive_next; bfd_close (head); head = n; } @@ -3068,6 +3168,8 @@ usage (FILE *file, int status) fprintf (file, _(" -L --linker <name> Use <name> as the linker.\n")); fprintf (file, _(" -F --linker-flags <flags> Pass <flags> to the linker.\n")); #endif + if (REPORT_BUGS_TO[0] && status == 0) + fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/dllwrap.c b/binutils/dllwrap.c index f93c75d6fb3f..9828a958a73c 100644 --- a/binutils/dllwrap.c +++ b/binutils/dllwrap.c @@ -1,5 +1,6 @@ /* dllwrap.c -- wrapper for DLLTOOL and GCC to generate PE style DLLs - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Contributed by Mumit Khan (khan@xraylith.wisc.edu). This file is part of GNU Binutils. @@ -26,19 +27,15 @@ #endif #endif -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" -#include "bucomm.h" #include "getopt.h" #include "dyn-string.h" +#include "bucomm.h" #include <time.h> #include <sys/stat.h> -#include <stdarg.h> #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> @@ -509,6 +506,8 @@ usage (FILE *file, int status) fprintf (file, _(" --nodelete Keep temp files.\n")); fprintf (file, _(" Rest are passed unmodified to the language driver\n")); fprintf (file, "\n\n"); + if (REPORT_BUGS_TO[0] && status == 0) + fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/doc/Makefile.am b/binutils/doc/Makefile.am index 1d043e7d3f8b..ceeda41b004f 100644 --- a/binutils/doc/Makefile.am +++ b/binutils/doc/Makefile.am @@ -28,20 +28,16 @@ man_MANS = \ strings.1 \ strip.1 \ windres.1 \ + windmc.1 \ $(DEMANGLER_NAME).1 info_TEXINFOS = binutils.texi -binutils_TEXINFOS = config.texi binutils_TEXI = $(srcdir)/binutils.texi -AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" - -config.texi: $(srcdir)/../../bfd/configure $(binutils_TEXI) - rm -f config.texi - eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ - echo "@set VERSION $$VERSION" > $@ - echo "@set UPDATED `date "+%B %Y"`" >> config.texi +AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc +TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc # Man page generation from texinfo addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS) @@ -135,6 +131,13 @@ windres.1: $(binutils_TEXI) $(binutils_TEXINFOS) mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f windres.pod +windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod + -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f windmc.pod + cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS) touch $@ -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod @@ -142,7 +145,6 @@ cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS) mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f $(DEMANGLER_NAME).pod -MAINTAINERCLEANFILES = config.texi MOSTLYCLEANFILES = $(DEMANGLER_NAME).1 $(DEMANGLER_NAME).1: cxxfilt.man Makefile @@ -180,6 +182,15 @@ install-html-am: $(HTMLS) fi; \ done +MAINTAINERCLEANFILES = binutils.info + +# Automake 1.9 will only build info files in the objdir if they are +# mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +# though, so we use a bogus condition. +if GENINSRC_NEVER +DISTCLEANFILES = binutils.info +endif + # Maintenance # We need it for the taz target in ../../Makefile.in. diff --git a/binutils/doc/Makefile.in b/binutils/doc/Makefile.in index ef28ceff8dfb..338c9bad74ea 100644 --- a/binutils/doc/Makefile.in +++ b/binutils/doc/Makefile.in @@ -37,14 +37,22 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(binutils_TEXINFOS) +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../bfd/acinclude.m4 \ - $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ - $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../bfd/warning.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/iconv.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/lib-ld.m4 \ + $(top_srcdir)/../config/lib-link.m4 \ + $(top_srcdir)/../config/lib-prefix.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -53,7 +61,7 @@ CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = -INFO_DEPS = $(srcdir)/binutils.info +INFO_DEPS = binutils.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo DVIS = binutils.dvi @@ -81,9 +89,11 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_DLLTOOL = @BUILD_DLLTOOL@ BUILD_DLLWRAP = @BUILD_DLLWRAP@ +BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@ BUILD_MISC = @BUILD_MISC@ BUILD_NLMCONV = @BUILD_NLMCONV@ BUILD_SRCONV = @BUILD_SRCONV@ +BUILD_WINDMC = @BUILD_WINDMC@ BUILD_WINDRES = @BUILD_WINDRES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ @@ -99,6 +109,7 @@ DEFS = @DEFS@ DEMANGLER_NAME = @DEMANGLER_NAME@ DEPDIR = @DEPDIR@ DLLTOOL_DEFS = @DLLTOOL_DEFS@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -107,28 +118,32 @@ EMULATION = @EMULATION@ EMULATION_VECTOR = @EMULATION_VECTOR@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GMOFILES = @GMOFILES@ +FGREP = @FGREP@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ +GREP = @GREP@ HDEFINES = @HDEFINES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INCINTL = @INCINTL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -136,7 +151,9 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ NLMCONV_DEFS = @NLMCONV_DEFS@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJDUMP_DEFS = @OBJDUMP_DEFS@ OBJEXT = @OBJEXT@ @@ -147,19 +164,20 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ @@ -188,10 +206,10 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -232,20 +250,29 @@ man_MANS = \ strings.1 \ strip.1 \ windres.1 \ + windmc.1 \ $(DEMANGLER_NAME).1 info_TEXINFOS = binutils.texi -binutils_TEXINFOS = config.texi binutils_TEXI = $(srcdir)/binutils.texi -AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -MAINTAINERCLEANFILES = config.texi +AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc + +TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc + MOSTLYCLEANFILES = $(DEMANGLER_NAME).1 html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +MAINTAINERCLEANFILES = binutils.info + +# Automake 1.9 will only build info files in the objdir if they are +# mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +# though, so we use a bogus condition. +@GENINSRC_NEVER_TRUE@DISTCLEANFILES = binutils.info all: all-am .SUFFIXES: -.SUFFIXES: .dvi .html .info .pdf .ps .texi +.SUFFIXES: .dvi .ps $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -255,9 +282,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/Makefile + $(AUTOMAKE) --cygnus doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -285,42 +312,38 @@ clean-libtool: distclean-libtool: -rm -f libtool -.texi.info: +binutils.info: binutils.texi restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ - cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ $<; \ + -o $@ `test -f 'binutils.texi' || echo '$(srcdir)/'`binutils.texi; \ then \ rc=0; \ - cd $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc -.texi.dvi: +binutils.dvi: binutils.texi TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< + $(TEXI2DVI) -o $@ `test -f 'binutils.texi' || echo '$(srcdir)/'`binutils.texi -.texi.pdf: +binutils.pdf: binutils.texi TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) $< + $(TEXI2PDF) -o $@ `test -f 'binutils.texi' || echo '$(srcdir)/'`binutils.texi -.texi.html: +binutils.html: binutils.texi rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) $<; \ + -o $(@:.html=.htp) `test -f 'binutils.texi' || echo '$(srcdir)/'`binutils.texi; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ @@ -330,10 +353,6 @@ distclean-libtool: rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi -$(srcdir)/binutils.info: binutils.texi $(binutils_TEXINFOS) -binutils.dvi: binutils.texi $(binutils_TEXINFOS) -binutils.pdf: binutils.texi $(binutils_TEXINFOS) -binutils.html: binutils.texi $(binutils_TEXINFOS) .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< @@ -469,6 +488,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -569,12 +589,6 @@ uninstall-man: uninstall-man1 uninstall-man uninstall-man1 -config.texi: $(srcdir)/../../bfd/configure $(binutils_TEXI) - rm -f config.texi - eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ - echo "@set VERSION $$VERSION" > $@ - echo "@set UPDATED `date "+%B %Y"`" >> config.texi - # Man page generation from texinfo addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS) touch $@ @@ -667,6 +681,13 @@ windres.1: $(binutils_TEXI) $(binutils_TEXINFOS) mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f windres.pod +windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod + -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f windmc.pod + cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS) touch $@ -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod diff --git a/binutils/doc/addr2line.1 b/binutils/doc/addr2line.1 deleted file mode 100644 index 71d1ea76398d..000000000000 --- a/binutils/doc/addr2line.1 +++ /dev/null @@ -1,265 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "ADDR2LINE 1" -.TH ADDR2LINE 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -addr2line \- convert addresses into file names and line numbers. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -addr2line [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] - [\fB\-e\fR \fIfilename\fR|\fB\-\-exe=\fR\fIfilename\fR] - [\fB\-f\fR|\fB\-\-functions\fR] [\fB\-s\fR|\fB\-\-basename\fR] - [\fB\-i\fR|\fB\-\-inlines\fR] - [\fB\-j\fR|\fB\-\-section=\fR\fIname\fR] - [\fB\-H\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - [addr addr ...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBaddr2line\fR translates addresses into file names and line numbers. -Given an address in an executable or an offset in a section of a relocatable -object, it uses the debugging information to figure out which file name and -line number are associated with it. -.PP -The executable or relocatable object to use is specified with the \fB\-e\fR -option. The default is the file \fIa.out\fR. The section in the relocatable -object to use is specified with the \fB\-j\fR option. -.PP -\&\fBaddr2line\fR has two modes of operation. -.PP -In the first, hexadecimal addresses are specified on the command line, -and \fBaddr2line\fR displays the file name and line number for each -address. -.PP -In the second, \fBaddr2line\fR reads hexadecimal addresses from -standard input, and prints the file name and line number for each -address on standard output. In this mode, \fBaddr2line\fR may be used -in a pipe to convert dynamically chosen addresses. -.PP -The format of the output is \fB\s-1FILENAME:LINENO\s0\fR. The file name and -line number for each address is printed on a separate line. If the -\&\fB\-f\fR option is used, then each \fB\s-1FILENAME:LINENO\s0\fR line is -preceded by a \fB\s-1FUNCTIONNAME\s0\fR line which is the name of the function -containing the address. -.PP -If the file name or function name can not be determined, -\&\fBaddr2line\fR will print two question marks in their place. If the -line number can not be determined, \fBaddr2line\fR will print 0. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. -.IP "\fB\-b\fR \fIbfdname\fR" 4 -.IX Item "-b bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Specify that the object-code format for the object files is -\&\fIbfdname\fR. -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes \*(C+ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. -.IP "\fB\-e\fR \fIfilename\fR" 4 -.IX Item "-e filename" -.PD 0 -.IP "\fB\-\-exe=\fR\fIfilename\fR" 4 -.IX Item "--exe=filename" -.PD -Specify the name of the executable for which addresses should be -translated. The default file is \fIa.out\fR. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-functions\fR" 4 -.IX Item "--functions" -.PD -Display function names as well as file and line number information. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-basenames\fR" 4 -.IX Item "--basenames" -.PD -Display only the base of each file name. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-inlines\fR" 4 -.IX Item "--inlines" -.PD -If the address belongs to a function that was inlined, the source -information for all enclosing scopes back to the first non-inlined -function will also be printed. For example, if \f(CW\*(C`main\*(C'\fR inlines -\&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from -\&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR -will also be printed. -.IP "\fB\-j\fR" 4 -.IX Item "-j" -.PD 0 -.IP "\fB\-\-section\fR" 4 -.IX Item "--section" -.PD -Read offsets relative to the specified section instead of absolute addresses. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/ar.1 b/binutils/doc/ar.1 deleted file mode 100644 index 5985ca15e448..000000000000 --- a/binutils/doc/ar.1 +++ /dev/null @@ -1,390 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "AR 1" -.TH AR 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -ar \- create, modify, and extract from archives -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -ar [\fB\-X32_64\fR] [\fB\-\fR]\fIp\fR[\fImod\fR [\fIrelpos\fR] [\fIcount\fR]] \fIarchive\fR [\fImember\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBar\fR program creates, modifies, and extracts from -archives. An \fIarchive\fR is a single file holding a collection of -other files in a structure that makes it possible to retrieve -the original individual files (called \fImembers\fR of the archive). -.PP -The original files' contents, mode (permissions), timestamp, owner, and -group are preserved in the archive, and can be restored on -extraction. -.PP -\&\s-1GNU\s0 \fBar\fR can maintain archives whose members have names of any -length; however, depending on how \fBar\fR is configured on your -system, a limit on member-name length may be imposed for compatibility -with archive formats maintained with other tools. If it exists, the -limit is often 15 characters (typical of formats related to a.out) or 16 -characters (typical of formats related to coff). -.PP -\&\fBar\fR is considered a binary utility because archives of this sort -are most often used as \fIlibraries\fR holding commonly needed -subroutines. -.PP -\&\fBar\fR creates an index to the symbols defined in relocatable -object modules in the archive when you specify the modifier \fBs\fR. -Once created, this index is updated in the archive whenever \fBar\fR -makes a change to its contents (save for the \fBq\fR update operation). -An archive with such an index speeds up linking to the library, and -allows routines in the library to call each other without regard to -their placement in the archive. -.PP -You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index -table. If an archive lacks the table, another form of \fBar\fR called -\&\fBranlib\fR can be used to add just the table. -.PP -\&\s-1GNU\s0 \fBar\fR is designed to be compatible with two different -facilities. You can control its activity using command-line options, -like the different varieties of \fBar\fR on Unix systems; or, if you -specify the single command-line option \fB\-M\fR, you can control it -with a script supplied via standard input, like the \s-1MRI\s0 \*(L"librarian\*(R" -program. -.SH "OPTIONS" -.IX Header "OPTIONS" -\&\s-1GNU\s0 \fBar\fR allows you to mix the operation code \fIp\fR and modifier -flags \fImod\fR in any order, within the first command-line argument. -.PP -If you wish, you may begin the first command-line argument with a -dash. -.PP -The \fIp\fR keyletter specifies what operation to execute; it may be -any of the following, but you must specify only one of them: -.IP "\fBd\fR" 4 -.IX Item "d" -\&\fIDelete\fR modules from the archive. Specify the names of modules to -be deleted as \fImember\fR...; the archive is untouched if you -specify no files to delete. -.Sp -If you specify the \fBv\fR modifier, \fBar\fR lists each module -as it is deleted. -.IP "\fBm\fR" 4 -.IX Item "m" -Use this operation to \fImove\fR members in an archive. -.Sp -The ordering of members in an archive can make a difference in how -programs are linked using the library, if a symbol is defined in more -than one member. -.Sp -If no modifiers are used with \f(CW\*(C`m\*(C'\fR, any members you name in the -\&\fImember\fR arguments are moved to the \fIend\fR of the archive; -you can use the \fBa\fR, \fBb\fR, or \fBi\fR modifiers to move them to a -specified place instead. -.IP "\fBp\fR" 4 -.IX Item "p" -\&\fIPrint\fR the specified members of the archive, to the standard -output file. If the \fBv\fR modifier is specified, show the member -name before copying its contents to standard output. -.Sp -If you specify no \fImember\fR arguments, all the files in the archive are -printed. -.IP "\fBq\fR" 4 -.IX Item "q" -\&\fIQuick append\fR; Historically, add the files \fImember\fR... to the end of -\&\fIarchive\fR, without checking for replacement. -.Sp -The modifiers \fBa\fR, \fBb\fR, and \fBi\fR do \fInot\fR affect this -operation; new members are always placed at the end of the archive. -.Sp -The modifier \fBv\fR makes \fBar\fR list each file as it is appended. -.Sp -Since the point of this operation is speed, the archive's symbol table -index is not updated, even if it already existed; you can use \fBar s\fR or -\&\fBranlib\fR explicitly to update the symbol table index. -.Sp -However, too many different systems assume quick append rebuilds the -index, so \s-1GNU\s0 \fBar\fR implements \fBq\fR as a synonym for \fBr\fR. -.IP "\fBr\fR" 4 -.IX Item "r" -Insert the files \fImember\fR... into \fIarchive\fR (with -\&\fIreplacement\fR). This operation differs from \fBq\fR in that any -previously existing members are deleted if their names match those being -added. -.Sp -If one of the files named in \fImember\fR... does not exist, \fBar\fR -displays an error message, and leaves undisturbed any existing members -of the archive matching that name. -.Sp -By default, new members are added at the end of the file; but you may -use one of the modifiers \fBa\fR, \fBb\fR, or \fBi\fR to request -placement relative to some existing member. -.Sp -The modifier \fBv\fR used with this operation elicits a line of -output for each file inserted, along with one of the letters \fBa\fR or -\&\fBr\fR to indicate whether the file was appended (no old member -deleted) or replaced. -.IP "\fBt\fR" 4 -.IX Item "t" -Display a \fItable\fR listing the contents of \fIarchive\fR, or those -of the files listed in \fImember\fR... that are present in the -archive. Normally only the member name is shown; if you also want to -see the modes (permissions), timestamp, owner, group, and size, you can -request that by also specifying the \fBv\fR modifier. -.Sp -If you do not specify a \fImember\fR, all files in the archive -are listed. -.Sp -If there is more than one file with the same name (say, \fBfie\fR) in -an archive (say \fBb.a\fR), \fBar t b.a fie\fR lists only the -first instance; to see them all, you must ask for a complete -listing\-\-\-in our example, \fBar t b.a\fR. -.IP "\fBx\fR" 4 -.IX Item "x" -\&\fIExtract\fR members (named \fImember\fR) from the archive. You can -use the \fBv\fR modifier with this operation, to request that -\&\fBar\fR list each name as it extracts it. -.Sp -If you do not specify a \fImember\fR, all files in the archive -are extracted. -.PP -A number of modifiers (\fImod\fR) may immediately follow the \fIp\fR -keyletter, to specify variations on an operation's behavior: -.IP "\fBa\fR" 4 -.IX Item "a" -Add new files \fIafter\fR an existing member of the -archive. If you use the modifier \fBa\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. -.IP "\fBb\fR" 4 -.IX Item "b" -Add new files \fIbefore\fR an existing member of the -archive. If you use the modifier \fBb\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. (same as \fBi\fR). -.IP "\fBc\fR" 4 -.IX Item "c" -\&\fICreate\fR the archive. The specified \fIarchive\fR is always -created if it did not exist, when you request an update. But a warning is -issued unless you specify in advance that you expect to create it, by -using this modifier. -.IP "\fBf\fR" 4 -.IX Item "f" -Truncate names in the archive. \s-1GNU\s0 \fBar\fR will normally permit file -names of any length. This will cause it to create archives which are -not compatible with the native \fBar\fR program on some systems. If -this is a concern, the \fBf\fR modifier may be used to truncate file -names when putting them in the archive. -.IP "\fBi\fR" 4 -.IX Item "i" -Insert new files \fIbefore\fR an existing member of the -archive. If you use the modifier \fBi\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. (same as \fBb\fR). -.IP "\fBl\fR" 4 -.IX Item "l" -This modifier is accepted but not used. -.IP "\fBN\fR" 4 -.IX Item "N" -Uses the \fIcount\fR parameter. This is used if there are multiple -entries in the archive with the same name. Extract or delete instance -\&\fIcount\fR of the given name from the archive. -.IP "\fBo\fR" 4 -.IX Item "o" -Preserve the \fIoriginal\fR dates of members when extracting them. If -you do not specify this modifier, files extracted from the archive -are stamped with the time of extraction. -.IP "\fBP\fR" 4 -.IX Item "P" -Use the full path name when matching names in the archive. \s-1GNU\s0 -\&\fBar\fR can not create an archive with a full path name (such archives -are not \s-1POSIX\s0 complaint), but other archive creators can. This option -will cause \s-1GNU\s0 \fBar\fR to match file names using a complete path -name, which can be convenient when extracting a single file from an -archive created by another tool. -.IP "\fBs\fR" 4 -.IX Item "s" -Write an object-file index into the archive, or update an existing one, -even if no other change is made to the archive. You may use this modifier -flag either with any operation, or alone. Running \fBar s\fR on an -archive is equivalent to running \fBranlib\fR on it. -.IP "\fBS\fR" 4 -.IX Item "S" -Do not generate an archive symbol table. This can speed up building a -large library in several steps. The resulting archive can not be used -with the linker. In order to build a symbol table, you must omit the -\&\fBS\fR modifier on the last execution of \fBar\fR, or you must run -\&\fBranlib\fR on the archive. -.IP "\fBu\fR" 4 -.IX Item "u" -Normally, \fBar r\fR... inserts all files -listed into the archive. If you would like to insert \fIonly\fR those -of the files you list that are newer than existing members of the same -names, use this modifier. The \fBu\fR modifier is allowed only for the -operation \fBr\fR (replace). In particular, the combination \fBqu\fR is -not allowed, since checking the timestamps would lose any speed -advantage from the operation \fBq\fR. -.IP "\fBv\fR" 4 -.IX Item "v" -This modifier requests the \fIverbose\fR version of an operation. Many -operations display additional information, such as filenames processed, -when the modifier \fBv\fR is appended. -.IP "\fBV\fR" 4 -.IX Item "V" -This modifier shows the version number of \fBar\fR. -.PP -\&\fBar\fR ignores an initial option spelt \fB\-X32_64\fR, for -compatibility with \s-1AIX\s0. The behaviour produced by this option is the -default for \s-1GNU\s0 \fBar\fR. \fBar\fR does not support any of the other -\&\fB\-X\fR options; in particular, it does not support \fB\-X32\fR -which is the default for \s-1AIX\s0 \fBar\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fInm\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/binutils.info b/binutils/doc/binutils.info deleted file mode 100644 index dcb79bedfb6f..000000000000 --- a/binutils/doc/binutils.info +++ /dev/null @@ -1,3835 +0,0 @@ -This is ../.././binutils/doc/binutils.info, produced by makeinfo -version 4.8 from ../.././binutils/doc/binutils.texi. - -START-INFO-DIR-ENTRY -* Binutils: (binutils). The GNU binary utilities. -* ar: (binutils)ar. Create, modify, and extract from archives -* nm: (binutils)nm. List symbols from object files -* objcopy: (binutils)objcopy. Copy and translate object files -* objdump: (binutils)objdump. Display information from object files -* ranlib: (binutils)ranlib. Generate index to archive contents -* readelf: (binutils)readelf. Display the contents of ELF format files. -* size: (binutils)size. List section sizes and total size -* strings: (binutils)strings. List printable strings from files -* strip: (binutils)strip. Discard symbols -* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols -* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt -* addr2line: (binutils)addr2line. Convert addresses to file and line -* nlmconv: (binutils)nlmconv. Converts object code into an NLM -* windres: (binutils)windres. Manipulate Windows resources -* dlltool: (binutils)dlltool. Create files needed to build and use DLLs -END-INFO-DIR-ENTRY - - Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with no Front-Cover Texts, and with no Back-Cover -Texts. A copy of the license is included in the section entitled "GNU -Free Documentation License". - - -File: binutils.info, Node: Top, Next: ar, Up: (dir) - -Introduction -************ - -This brief manual contains documentation for the GNU binary utilities -(collectively version 2.17): - - This document is distributed under the terms of the GNU Free -Documentation License. A copy of the license is included in the -section entitled "GNU Free Documentation License". - -* Menu: - -* ar:: Create, modify, and extract from archives -* nm:: List symbols from object files -* objcopy:: Copy and translate object files -* objdump:: Display information from object files -* ranlib:: Generate index to archive contents -* readelf:: Display the contents of ELF format files. -* size:: List section sizes and total size -* strings:: List printable strings from files -* strip:: Discard symbols -* c++filt:: Filter to demangle encoded C++ symbols -* cxxfilt: c++filt. MS-DOS name for c++filt -* addr2line:: Convert addresses to file and line -* nlmconv:: Converts object code into an NLM -* windres:: Manipulate Windows resources -* dlltool:: Create files needed to build and use DLLs -* Common Options:: Command-line options for all utilities -* Selecting The Target System:: How these utilities determine the target. -* Reporting Bugs:: Reporting Bugs -* GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index - - -File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top - -1 ar -**** - - ar [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] - ar -M [ <mri-script ] - - The GNU `ar' program creates, modifies, and extracts from archives. -An "archive" is a single file holding a collection of other files in a -structure that makes it possible to retrieve the original individual -files (called "members" of the archive). - - The original files' contents, mode (permissions), timestamp, owner, -and group are preserved in the archive, and can be restored on -extraction. - - GNU `ar' can maintain archives whose members have names of any -length; however, depending on how `ar' is configured on your system, a -limit on member-name length may be imposed for compatibility with -archive formats maintained with other tools. If it exists, the limit -is often 15 characters (typical of formats related to a.out) or 16 -characters (typical of formats related to coff). - - `ar' is considered a binary utility because archives of this sort -are most often used as "libraries" holding commonly needed subroutines. - - `ar' creates an index to the symbols defined in relocatable object -modules in the archive when you specify the modifier `s'. Once -created, this index is updated in the archive whenever `ar' makes a -change to its contents (save for the `q' update operation). An archive -with such an index speeds up linking to the library, and allows -routines in the library to call each other without regard to their -placement in the archive. - - You may use `nm -s' or `nm --print-armap' to list this index table. -If an archive lacks the table, another form of `ar' called `ranlib' can -be used to add just the table. - - GNU `ar' is designed to be compatible with two different facilities. -You can control its activity using command-line options, like the -different varieties of `ar' on Unix systems; or, if you specify the -single command-line option `-M', you can control it with a script -supplied via standard input, like the MRI "librarian" program. - -* Menu: - -* ar cmdline:: Controlling `ar' on the command line -* ar scripts:: Controlling `ar' with a script - - -File: binutils.info, Node: ar cmdline, Next: ar scripts, Up: ar - -1.1 Controlling `ar' on the Command Line -======================================== - - ar [`-X32_64'] [`-']P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] - - When you use `ar' in the Unix style, `ar' insists on at least two -arguments to execute: one keyletter specifying the _operation_ -(optionally accompanied by other keyletters specifying _modifiers_), -and the archive name to act on. - - Most operations can also accept further MEMBER arguments, specifying -particular files to operate on. - - GNU `ar' allows you to mix the operation code P and modifier flags -MOD in any order, within the first command-line argument. - - If you wish, you may begin the first command-line argument with a -dash. - - The P keyletter specifies what operation to execute; it may be any -of the following, but you must specify only one of them: - -`d' - _Delete_ modules from the archive. Specify the names of modules to - be deleted as MEMBER...; the archive is untouched if you specify - no files to delete. - - If you specify the `v' modifier, `ar' lists each module as it is - deleted. - -`m' - Use this operation to _move_ members in an archive. - - The ordering of members in an archive can make a difference in how - programs are linked using the library, if a symbol is defined in - more than one member. - - If no modifiers are used with `m', any members you name in the - MEMBER arguments are moved to the _end_ of the archive; you can - use the `a', `b', or `i' modifiers to move them to a specified - place instead. - -`p' - _Print_ the specified members of the archive, to the standard - output file. If the `v' modifier is specified, show the member - name before copying its contents to standard output. - - If you specify no MEMBER arguments, all the files in the archive - are printed. - -`q' - _Quick append_; Historically, add the files MEMBER... to the end of - ARCHIVE, without checking for replacement. - - The modifiers `a', `b', and `i' do _not_ affect this operation; - new members are always placed at the end of the archive. - - The modifier `v' makes `ar' list each file as it is appended. - - Since the point of this operation is speed, the archive's symbol - table index is not updated, even if it already existed; you can - use `ar s' or `ranlib' explicitly to update the symbol table index. - - However, too many different systems assume quick append rebuilds - the index, so GNU `ar' implements `q' as a synonym for `r'. - -`r' - Insert the files MEMBER... into ARCHIVE (with _replacement_). This - operation differs from `q' in that any previously existing members - are deleted if their names match those being added. - - If one of the files named in MEMBER... does not exist, `ar' - displays an error message, and leaves undisturbed any existing - members of the archive matching that name. - - By default, new members are added at the end of the file; but you - may use one of the modifiers `a', `b', or `i' to request placement - relative to some existing member. - - The modifier `v' used with this operation elicits a line of output - for each file inserted, along with one of the letters `a' or `r' - to indicate whether the file was appended (no old member deleted) - or replaced. - -`t' - Display a _table_ listing the contents of ARCHIVE, or those of the - files listed in MEMBER... that are present in the archive. - Normally only the member name is shown; if you also want to see - the modes (permissions), timestamp, owner, group, and size, you can - request that by also specifying the `v' modifier. - - If you do not specify a MEMBER, all files in the archive are - listed. - - If there is more than one file with the same name (say, `fie') in - an archive (say `b.a'), `ar t b.a fie' lists only the first - instance; to see them all, you must ask for a complete listing--in - our example, `ar t b.a'. - -`x' - _Extract_ members (named MEMBER) from the archive. You can use - the `v' modifier with this operation, to request that `ar' list - each name as it extracts it. - - If you do not specify a MEMBER, all files in the archive are - extracted. - - - A number of modifiers (MOD) may immediately follow the P keyletter, -to specify variations on an operation's behavior: - -`a' - Add new files _after_ an existing member of the archive. If you - use the modifier `a', the name of an existing archive member must - be present as the RELPOS argument, before the ARCHIVE - specification. - -`b' - Add new files _before_ an existing member of the archive. If you - use the modifier `b', the name of an existing archive member must - be present as the RELPOS argument, before the ARCHIVE - specification. (same as `i'). - -`c' - _Create_ the archive. The specified ARCHIVE is always created if - it did not exist, when you request an update. But a warning is - issued unless you specify in advance that you expect to create it, - by using this modifier. - -`f' - Truncate names in the archive. GNU `ar' will normally permit file - names of any length. This will cause it to create archives which - are not compatible with the native `ar' program on some systems. - If this is a concern, the `f' modifier may be used to truncate file - names when putting them in the archive. - -`i' - Insert new files _before_ an existing member of the archive. If - you use the modifier `i', the name of an existing archive member - must be present as the RELPOS argument, before the ARCHIVE - specification. (same as `b'). - -`l' - This modifier is accepted but not used. - -`N' - Uses the COUNT parameter. This is used if there are multiple - entries in the archive with the same name. Extract or delete - instance COUNT of the given name from the archive. - -`o' - Preserve the _original_ dates of members when extracting them. If - you do not specify this modifier, files extracted from the archive - are stamped with the time of extraction. - -`P' - Use the full path name when matching names in the archive. GNU - `ar' can not create an archive with a full path name (such archives - are not POSIX complaint), but other archive creators can. This - option will cause GNU `ar' to match file names using a complete - path name, which can be convenient when extracting a single file - from an archive created by another tool. - -`s' - Write an object-file index into the archive, or update an existing - one, even if no other change is made to the archive. You may use - this modifier flag either with any operation, or alone. Running - `ar s' on an archive is equivalent to running `ranlib' on it. - -`S' - Do not generate an archive symbol table. This can speed up - building a large library in several steps. The resulting archive - can not be used with the linker. In order to build a symbol - table, you must omit the `S' modifier on the last execution of - `ar', or you must run `ranlib' on the archive. - -`u' - Normally, `ar r'... inserts all files listed into the archive. If - you would like to insert _only_ those of the files you list that - are newer than existing members of the same names, use this - modifier. The `u' modifier is allowed only for the operation `r' - (replace). In particular, the combination `qu' is not allowed, - since checking the timestamps would lose any speed advantage from - the operation `q'. - -`v' - This modifier requests the _verbose_ version of an operation. Many - operations display additional information, such as filenames - processed, when the modifier `v' is appended. - -`V' - This modifier shows the version number of `ar'. - - `ar' ignores an initial option spelt `-X32_64', for compatibility -with AIX. The behaviour produced by this option is the default for GNU -`ar'. `ar' does not support any of the other `-X' options; in -particular, it does not support `-X32' which is the default for AIX -`ar'. - - -File: binutils.info, Node: ar scripts, Prev: ar cmdline, Up: ar - -1.2 Controlling `ar' with a Script -================================== - - ar -M [ <SCRIPT ] - - If you use the single command-line option `-M' with `ar', you can -control its operation with a rudimentary command language. This form -of `ar' operates interactively if standard input is coming directly -from a terminal. During interactive use, `ar' prompts for input (the -prompt is `AR >'), and continues executing even after errors. If you -redirect standard input to a script file, no prompts are issued, and -`ar' abandons execution (with a nonzero exit code) on any error. - - The `ar' command language is _not_ designed to be equivalent to the -command-line options; in fact, it provides somewhat less control over -archives. The only purpose of the command language is to ease the -transition to GNU `ar' for developers who already have scripts written -for the MRI "librarian" program. - - The syntax for the `ar' command language is straightforward: - * commands are recognized in upper or lower case; for example, `LIST' - is the same as `list'. In the following descriptions, commands are - shown in upper case for clarity. - - * a single command may appear on each line; it is the first word on - the line. - - * empty lines are allowed, and have no effect. - - * comments are allowed; text after either of the characters `*' or - `;' is ignored. - - * Whenever you use a list of names as part of the argument to an `ar' - command, you can separate the individual names with either commas - or blanks. Commas are shown in the explanations below, for - clarity. - - * `+' is used as a line continuation character; if `+' appears at - the end of a line, the text on the following line is considered - part of the current command. - - Here are the commands you can use in `ar' scripts, or when using -`ar' interactively. Three of them have special significance: - - `OPEN' or `CREATE' specify a "current archive", which is a temporary -file required for most of the other commands. - - `SAVE' commits the changes so far specified by the script. Prior to -`SAVE', commands affect only the temporary copy of the current archive. - -`ADDLIB ARCHIVE' -`ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)' - Add all the contents of ARCHIVE (or, if specified, each named - MODULE from ARCHIVE) to the current archive. - - Requires prior use of `OPEN' or `CREATE'. - -`ADDMOD MEMBER, MEMBER, ... MEMBER' - Add each named MEMBER as a module in the current archive. - - Requires prior use of `OPEN' or `CREATE'. - -`CLEAR' - Discard the contents of the current archive, canceling the effect - of any operations since the last `SAVE'. May be executed (with no - effect) even if no current archive is specified. - -`CREATE ARCHIVE' - Creates an archive, and makes it the current archive (required for - many other commands). The new archive is created with a temporary - name; it is not actually saved as ARCHIVE until you use `SAVE'. - You can overwrite existing archives; similarly, the contents of any - existing file named ARCHIVE will not be destroyed until `SAVE'. - -`DELETE MODULE, MODULE, ... MODULE' - Delete each listed MODULE from the current archive; equivalent to - `ar -d ARCHIVE MODULE ... MODULE'. - - Requires prior use of `OPEN' or `CREATE'. - -`DIRECTORY ARCHIVE (MODULE, ... MODULE)' -`DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE' - List each named MODULE present in ARCHIVE. The separate command - `VERBOSE' specifies the form of the output: when verbose output is - off, output is like that of `ar -t ARCHIVE MODULE...'. When - verbose output is on, the listing is like `ar -tv ARCHIVE - MODULE...'. - - Output normally goes to the standard output stream; however, if you - specify OUTPUTFILE as a final argument, `ar' directs the output to - that file. - -`END' - Exit from `ar', with a `0' exit code to indicate successful - completion. This command does not save the output file; if you - have changed the current archive since the last `SAVE' command, - those changes are lost. - -`EXTRACT MODULE, MODULE, ... MODULE' - Extract each named MODULE from the current archive, writing them - into the current directory as separate files. Equivalent to `ar -x - ARCHIVE MODULE...'. - - Requires prior use of `OPEN' or `CREATE'. - -`LIST' - Display full contents of the current archive, in "verbose" style - regardless of the state of `VERBOSE'. The effect is like `ar tv - ARCHIVE'. (This single command is a GNU `ar' enhancement, rather - than present for MRI compatibility.) - - Requires prior use of `OPEN' or `CREATE'. - -`OPEN ARCHIVE' - Opens an existing archive for use as the current archive (required - for many other commands). Any changes as the result of subsequent - commands will not actually affect ARCHIVE until you next use - `SAVE'. - -`REPLACE MODULE, MODULE, ... MODULE' - In the current archive, replace each existing MODULE (named in the - `REPLACE' arguments) from files in the current working directory. - To execute this command without errors, both the file, and the - module in the current archive, must exist. - - Requires prior use of `OPEN' or `CREATE'. - -`VERBOSE' - Toggle an internal flag governing the output from `DIRECTORY'. - When the flag is on, `DIRECTORY' output matches output from `ar - -tv '.... - -`SAVE' - Commit your changes to the current archive, and actually save it - as a file with the name specified in the last `CREATE' or `OPEN' - command. - - Requires prior use of `OPEN' or `CREATE'. - - - -File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top - -2 nm -**** - - nm [`-a'|`--debug-syms'] [`-g'|`--extern-only'] - [`-B'] [`-C'|`--demangle'[=STYLE]] [`-D'|`--dynamic'] - [`-S'|`--print-size'] [`-s'|`--print-armap'] - [`-A'|`-o'|`--print-file-name'][`--special-syms'] - [`-n'|`-v'|`--numeric-sort'] [`-p'|`--no-sort'] - [`-r'|`--reverse-sort'] [`--size-sort'] [`-u'|`--undefined-only'] - [`-t' RADIX|`--radix='RADIX] [`-P'|`--portability'] - [`--target='BFDNAME] [`-f'FORMAT|`--format='FORMAT] - [`--defined-only'] [`-l'|`--line-numbers'] [`--no-demangle'] - [`-V'|`--version'] [`-X 32_64'] [`--help'] [OBJFILE...] - - GNU `nm' lists the symbols from object files OBJFILE.... If no -object files are listed as arguments, `nm' assumes the file `a.out'. - - For each symbol, `nm' shows: - - * The symbol value, in the radix selected by options (see below), or - hexadecimal by default. - - * The symbol type. At least the following types are used; others - are, as well, depending on the object file format. If lowercase, - the symbol is local; if uppercase, the symbol is global (external). - - `A' - The symbol's value is absolute, and will not be changed by - further linking. - - `B' - The symbol is in the uninitialized data section (known as - BSS). - - `C' - The symbol is common. Common symbols are uninitialized data. - When linking, multiple common symbols may appear with the - same name. If the symbol is defined anywhere, the common - symbols are treated as undefined references. For more - details on common symbols, see the discussion of -warn-common - in *Note Linker options: (ld.info)Options. - - `D' - The symbol is in the initialized data section. - - `G' - The symbol is in an initialized data section for small - objects. Some object file formats permit more efficient - access to small data objects, such as a global int variable - as opposed to a large global array. - - `I' - The symbol is an indirect reference to another symbol. This - is a GNU extension to the a.out object file format which is - rarely used. - - `N' - The symbol is a debugging symbol. - - `R' - The symbol is in a read only data section. - - `S' - The symbol is in an uninitialized data section for small - objects. - - `T' - The symbol is in the text (code) section. - - `U' - The symbol is undefined. - - `V' - The symbol is a weak object. When a weak defined symbol is - linked with a normal defined symbol, the normal defined - symbol is used with no error. When a weak undefined symbol - is linked and the symbol is not defined, the value of the - weak symbol becomes zero with no error. - - `W' - The symbol is a weak symbol that has not been specifically - tagged as a weak object symbol. When a weak defined symbol - is linked with a normal defined symbol, the normal defined - symbol is used with no error. When a weak undefined symbol - is linked and the symbol is not defined, the value of the - symbol is determined in a system-specific manner without - error. On some systems, uppercase indicates that a default - value has been specified. - - `-' - The symbol is a stabs symbol in an a.out object file. In - this case, the next values printed are the stabs other field, - the stabs desc field, and the stab type. Stabs symbols are - used to hold debugging information. For more information, - see *Note Stabs: (stabs.info)Top. - - `?' - The symbol type is unknown, or object file format specific. - - * The symbol name. - - The long and short forms of options, shown here as alternatives, are -equivalent. - -`-A' -`-o' -`--print-file-name' - Precede each symbol by the name of the input file (or archive - member) in which it was found, rather than identifying the input - file once only, before all of its symbols. - -`-a' -`--debug-syms' - Display all symbols, even debugger-only symbols; normally these - are not listed. - -`-B' - The same as `--format=bsd' (for compatibility with the MIPS `nm'). - -`-C' -`--demangle[=STYLE]' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. Different compilers have - different mangling styles. The optional demangling style argument - can be used to choose an appropriate demangling style for your - compiler. *Note c++filt::, for more information on demangling. - -`--no-demangle' - Do not demangle low-level symbol names. This is the default. - -`-D' -`--dynamic' - Display the dynamic symbols rather than the normal symbols. This - is only meaningful for dynamic objects, such as certain types of - shared libraries. - -`-f FORMAT' -`--format=FORMAT' - Use the output format FORMAT, which can be `bsd', `sysv', or - `posix'. The default is `bsd'. Only the first character of - FORMAT is significant; it can be either upper or lower case. - -`-g' -`--extern-only' - Display only external symbols. - -`-l' -`--line-numbers' - For each symbol, use debugging information to try to find a - filename and line number. For a defined symbol, look for the line - number of the address of the symbol. For an undefined symbol, - look for the line number of a relocation entry which refers to the - symbol. If line number information can be found, print it after - the other symbol information. - -`-n' -`-v' -`--numeric-sort' - Sort symbols numerically by their addresses, rather than - alphabetically by their names. - -`-p' -`--no-sort' - Do not bother to sort the symbols in any order; print them in the - order encountered. - -`-P' -`--portability' - Use the POSIX.2 standard output format instead of the default - format. Equivalent to `-f posix'. - -`-S' -`--print-size' - Print size, not the value, of defined symbols for the `bsd' output - format. - -`-s' -`--print-armap' - When listing symbols from archive members, include the index: a - mapping (stored in the archive by `ar' or `ranlib') of which - modules contain definitions for which names. - -`-r' -`--reverse-sort' - Reverse the order of the sort (whether numeric or alphabetic); let - the last come first. - -`--size-sort' - Sort symbols by size. The size is computed as the difference - between the value of the symbol and the value of the symbol with - the next higher value. If the `bsd' output format is used the - size of the symbol is printed, rather than the value, and `-S' - must be used in order both size and value to be printed. - -`--special-syms' - Display symbols which have a target-specific special meaning. - These symbols are usually used by the target for some special - processing and are not normally helpful when included included in - the normal symbol lists. For example for ARM targets this option - would skip the mapping symbols used to mark transistions between - ARM code, THUMB code and data. - -`-t RADIX' -`--radix=RADIX' - Use RADIX as the radix for printing the symbol values. It must be - `d' for decimal, `o' for octal, or `x' for hexadecimal. - -`--target=BFDNAME' - Specify an object code format other than your system's default - format. *Note Target Selection::, for more information. - -`-u' -`--undefined-only' - Display only undefined symbols (those external to each object - file). - -`--defined-only' - Display only defined symbols for each object file. - -`-V' -`--version' - Show the version number of `nm' and exit. - -`-X' - This option is ignored for compatibility with the AIX version of - `nm'. It takes one parameter which must be the string `32_64'. - The default mode of AIX `nm' corresponds to `-X 32', which is not - supported by GNU `nm'. - -`--help' - Show a summary of the options to `nm' and exit. - - -File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top - -3 objcopy -********* - - objcopy [`-F' BFDNAME|`--target='BFDNAME] - [`-I' BFDNAME|`--input-target='BFDNAME] - [`-O' BFDNAME|`--output-target='BFDNAME] - [`-B' BFDARCH|`--binary-architecture='BFDARCH] - [`-S'|`--strip-all'] - [`-g'|`--strip-debug'] - [`-K' SYMBOLNAME|`--keep-symbol='SYMBOLNAME] - [`-N' SYMBOLNAME|`--strip-symbol='SYMBOLNAME] - [`--strip-unneeded-symbol='SYMBOLNAME] - [`-G' SYMBOLNAME|`--keep-global-symbol='SYMBOLNAME] - [`-L' SYMBOLNAME|`--localize-symbol='SYMBOLNAME] - [`--globalize-symbol='SYMBOLNAME] - [`-W' SYMBOLNAME|`--weaken-symbol='SYMBOLNAME] - [`-w'|`--wildcard'] - [`-x'|`--discard-all'] - [`-X'|`--discard-locals'] - [`-b' BYTE|`--byte='BYTE] - [`-i' INTERLEAVE|`--interleave='INTERLEAVE] - [`-j' SECTIONNAME|`--only-section='SECTIONNAME] - [`-R' SECTIONNAME|`--remove-section='SECTIONNAME] - [`-p'|`--preserve-dates'] - [`--debugging'] - [`--gap-fill='VAL] - [`--pad-to='ADDRESS] - [`--set-start='VAL] - [`--adjust-start='INCR] - [`--change-addresses='INCR] - [`--change-section-address' SECTION{=,+,-}VAL] - [`--change-section-lma' SECTION{=,+,-}VAL] - [`--change-section-vma' SECTION{=,+,-}VAL] - [`--change-warnings'] [`--no-change-warnings'] - [`--set-section-flags' SECTION=FLAGS] - [`--add-section' SECTIONNAME=FILENAME] - [`--rename-section' OLDNAME=NEWNAME[,FLAGS]] - [`--change-leading-char'] [`--remove-leading-char'] - [`--srec-len='IVAL] [`--srec-forceS3'] - [`--redefine-sym' OLD=NEW] - [`--redefine-syms='FILENAME] - [`--weaken'] - [`--keep-symbols='FILENAME] - [`--strip-symbols='FILENAME] - [`--strip-unneeded-symbols='FILENAME] - [`--keep-global-symbols='FILENAME] - [`--localize-symbols='FILENAME] - [`--globalize-symbols='FILENAME] - [`--weaken-symbols='FILENAME] - [`--alt-machine-code='INDEX] - [`--prefix-symbols='STRING] - [`--prefix-sections='STRING] - [`--prefix-alloc-sections='STRING] - [`--add-gnu-debuglink='PATH-TO-FILE] - [`--keep-file-symbols'] - [`--only-keep-debug'] - [`--writable-text'] - [`--readonly-text'] - [`--pure'] - [`--impure'] - [`-v'|`--verbose'] - [`-V'|`--version'] - [`--help'] [`--info'] - INFILE [OUTFILE] - - The GNU `objcopy' utility copies the contents of an object file to -another. `objcopy' uses the GNU BFD Library to read and write the -object files. It can write the destination object file in a format -different from that of the source object file. The exact behavior of -`objcopy' is controlled by command-line options. Note that `objcopy' -should be able to copy a fully linked file between any two formats. -However, copying a relocatable object file between any two formats may -not work as expected. - - `objcopy' creates temporary files to do its translations and deletes -them afterward. `objcopy' uses BFD to do all its translation work; it -has access to all the formats described in BFD and thus is able to -recognize most formats without being told explicitly. *Note BFD: -(ld.info)BFD. - - `objcopy' can be used to generate S-records by using an output -target of `srec' (e.g., use `-O srec'). - - `objcopy' can be used to generate a raw binary file by using an -output target of `binary' (e.g., use `-O binary'). When `objcopy' -generates a raw binary file, it will essentially produce a memory dump -of the contents of the input object file. All symbols and relocation -information will be discarded. The memory dump will start at the load -address of the lowest section copied into the output file. - - When generating an S-record or a raw binary file, it may be helpful -to use `-S' to remove sections containing debugging information. In -some cases `-R' will be useful to remove sections which contain -information that is not needed by the binary file. - - Note--`objcopy' is not able to change the endianness of its input -files. If the input format has an endianness (some formats do not), -`objcopy' can only copy the inputs into file formats that have the same -endianness or which have no endianness (e.g., `srec'). - -`INFILE' -`OUTFILE' - The input and output files, respectively. If you do not specify - OUTFILE, `objcopy' creates a temporary file and destructively - renames the result with the name of INFILE. - -`-I BFDNAME' -`--input-target=BFDNAME' - Consider the source file's object format to be BFDNAME, rather than - attempting to deduce it. *Note Target Selection::, for more - information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Write the output file using the object format BFDNAME. *Note - Target Selection::, for more information. - -`-F BFDNAME' -`--target=BFDNAME' - Use BFDNAME as the object format for both the input and the output - file; i.e., simply transfer data from source to destination with no - translation. *Note Target Selection::, for more information. - -`-B BFDARCH' -`--binary-architecture=BFDARCH' - Useful when transforming a raw binary input file into an object - file. In this case the output architecture can be set to BFDARCH. - This option will be ignored if the input file has a known BFDARCH. - You can access this binary data inside a program by referencing - the special symbols that are created by the conversion process. - These symbols are called _binary_OBJFILE_start, - _binary_OBJFILE_end and _binary_OBJFILE_size. e.g. you can - transform a picture file into an object file and then access it in - your code using these symbols. - -`-j SECTIONNAME' -`--only-section=SECTIONNAME' - Copy only the named section from the input file to the output file. - This option may be given more than once. Note that using this - option inappropriately may make the output file unusable. - -`-R SECTIONNAME' -`--remove-section=SECTIONNAME' - Remove any section named SECTIONNAME from the output file. This - option may be given more than once. Note that using this option - inappropriately may make the output file unusable. - -`-S' -`--strip-all' - Do not copy relocation and symbol information from the source file. - -`-g' -`--strip-debug' - Do not copy debugging symbols or sections from the source file. - -`--strip-unneeded' - Strip all symbols that are not needed for relocation processing. - -`-K SYMBOLNAME' -`--keep-symbol=SYMBOLNAME' - When stripping symbols, keep symbol SYMBOLNAME even if it would - normally be stripped. This option may be given more than once. - -`-N SYMBOLNAME' -`--strip-symbol=SYMBOLNAME' - Do not copy symbol SYMBOLNAME from the source file. This option - may be given more than once. - -`--strip-unneeded-symbol=SYMBOLNAME' - Do not copy symbol SYMBOLNAME from the source file unless it is - needed by a relocation. This option may be given more than once. - -`-G SYMBOLNAME' -`--keep-global-symbol=SYMBOLNAME' - Keep only symbol SYMBOLNAME global. Make all other symbols local - to the file, so that they are not visible externally. This option - may be given more than once. - -`-L SYMBOLNAME' -`--localize-symbol=SYMBOLNAME' - Make symbol SYMBOLNAME local to the file, so that it is not - visible externally. This option may be given more than once. - -`-W SYMBOLNAME' -`--weaken-symbol=SYMBOLNAME' - Make symbol SYMBOLNAME weak. This option may be given more than - once. - -`--globalize-symbol=SYMBOLNAME' - Give symbol SYMBOLNAME global scoping so that it is visible - outside of the file in which it is defined. This option may be - given more than once. - -`-w' -`--wildcard' - Permit regular expressions in SYMBOLNAMEs used in other command - line options. The question mark (?), asterisk (*), backslash (\) - and square brackets ([]) operators can be used anywhere in the - symbol name. If the first character of the symbol name is the - exclamation point (!) then the sense of the switch is reversed for - that symbol. For example: - - -w -W !foo -W fo* - - would cause objcopy to weaken all symbols that start with "fo" - except for the symbol "foo". - -`-x' -`--discard-all' - Do not copy non-global symbols from the source file. - -`-X' -`--discard-locals' - Do not copy compiler-generated local symbols. (These usually - start with `L' or `.'.) - -`-b BYTE' -`--byte=BYTE' - Keep only every BYTEth byte of the input file (header data is not - affected). BYTE can be in the range from 0 to INTERLEAVE-1, where - INTERLEAVE is given by the `-i' or `--interleave' option, or the - default of 4. This option is useful for creating files to program - ROM. It is typically used with an `srec' output target. - -`-i INTERLEAVE' -`--interleave=INTERLEAVE' - Only copy one out of every INTERLEAVE bytes. Select which byte to - copy with the `-b' or `--byte' option. The default is 4. - `objcopy' ignores this option if you do not specify either `-b' or - `--byte'. - -`-p' -`--preserve-dates' - Set the access and modification dates of the output file to be the - same as those of the input file. - -`--debugging' - Convert debugging information, if possible. This is not the - default because only certain debugging formats are supported, and - the conversion process can be time consuming. - -`--gap-fill VAL' - Fill gaps between sections with VAL. This operation applies to - the _load address_ (LMA) of the sections. It is done by increasing - the size of the section with the lower address, and filling in the - extra space created with VAL. - -`--pad-to ADDRESS' - Pad the output file up to the load address ADDRESS. This is done - by increasing the size of the last section. The extra space is - filled in with the value specified by `--gap-fill' (default zero). - -`--set-start VAL' - Set the start address of the new file to VAL. Not all object file - formats support setting the start address. - -`--change-start INCR' -`--adjust-start INCR' - Change the start address by adding INCR. Not all object file - formats support setting the start address. - -`--change-addresses INCR' -`--adjust-vma INCR' - Change the VMA and LMA addresses of all sections, as well as the - start address, by adding INCR. Some object file formats do not - permit section addresses to be changed arbitrarily. Note that - this does not relocate the sections; if the program expects - sections to be loaded at a certain address, and this option is - used to change the sections such that they are loaded at a - different address, the program may fail. - -`--change-section-address SECTION{=,+,-}VAL' -`--adjust-section-vma SECTION{=,+,-}VAL' - Set or change both the VMA address and the LMA address of the named - SECTION. If `=' is used, the section address is set to VAL. - Otherwise, VAL is added to or subtracted from the section address. - See the comments under `--change-addresses', above. If SECTION - does not exist in the input file, a warning will be issued, unless - `--no-change-warnings' is used. - -`--change-section-lma SECTION{=,+,-}VAL' - Set or change the LMA address of the named SECTION. The LMA - address is the address where the section will be loaded into - memory at program load time. Normally this is the same as the VMA - address, which is the address of the section at program run time, - but on some systems, especially those where a program is held in - ROM, the two can be different. If `=' is used, the section - address is set to VAL. Otherwise, VAL is added to or subtracted - from the section address. See the comments under - `--change-addresses', above. If SECTION does not exist in the - input file, a warning will be issued, unless - `--no-change-warnings' is used. - -`--change-section-vma SECTION{=,+,-}VAL' - Set or change the VMA address of the named SECTION. The VMA - address is the address where the section will be located once the - program has started executing. Normally this is the same as the - LMA address, which is the address where the section will be loaded - into memory, but on some systems, especially those where a program - is held in ROM, the two can be different. If `=' is used, the - section address is set to VAL. Otherwise, VAL is added to or - subtracted from the section address. See the comments under - `--change-addresses', above. If SECTION does not exist in the - input file, a warning will be issued, unless - `--no-change-warnings' is used. - -`--change-warnings' -`--adjust-warnings' - If `--change-section-address' or `--change-section-lma' or - `--change-section-vma' is used, and the named section does not - exist, issue a warning. This is the default. - -`--no-change-warnings' -`--no-adjust-warnings' - Do not issue a warning if `--change-section-address' or - `--adjust-section-lma' or `--adjust-section-vma' is used, even if - the named section does not exist. - -`--set-section-flags SECTION=FLAGS' - Set the flags for the named section. The FLAGS argument is a - comma separated string of flag names. The recognized names are - `alloc', `contents', `load', `noload', `readonly', `code', `data', - `rom', `share', and `debug'. You can set the `contents' flag for - a section which does not have contents, but it is not meaningful - to clear the `contents' flag of a section which does have - contents-just remove the section instead. Not all flags are - meaningful for all object file formats. - -`--add-section SECTIONNAME=FILENAME' - Add a new section named SECTIONNAME while copying the file. The - contents of the new section are taken from the file FILENAME. The - size of the section will be the size of the file. This option only - works on file formats which can support sections with arbitrary - names. - -`--rename-section OLDNAME=NEWNAME[,FLAGS]' - Rename a section from OLDNAME to NEWNAME, optionally changing the - section's flags to FLAGS in the process. This has the advantage - over usng a linker script to perform the rename in that the output - stays as an object file and does not become a linked executable. - - This option is particularly helpful when the input format is - binary, since this will always create a section called .data. If - for example, you wanted instead to create a section called .rodata - containing binary data you could use the following command line to - achieve it: - - objcopy -I binary -O <output_format> -B <architecture> \ - --rename-section .data=.rodata,alloc,load,readonly,data,contents \ - <input_binary_file> <output_object_file> - -`--change-leading-char' - Some object file formats use special characters at the start of - symbols. The most common such character is underscore, which - compilers often add before every symbol. This option tells - `objcopy' to change the leading character of every symbol when it - converts between object file formats. If the object file formats - use the same leading character, this option has no effect. - Otherwise, it will add a character, or remove a character, or - change a character, as appropriate. - -`--remove-leading-char' - If the first character of a global symbol is a special symbol - leading character used by the object file format, remove the - character. The most common symbol leading character is - underscore. This option will remove a leading underscore from all - global symbols. This can be useful if you want to link together - objects of different file formats with different conventions for - symbol names. This is different from `--change-leading-char' - because it always changes the symbol name when appropriate, - regardless of the object file format of the output file. - -`--srec-len=IVAL' - Meaningful only for srec output. Set the maximum length of the - Srecords being produced to IVAL. This length covers both address, - data and crc fields. - -`--srec-forceS3' - Meaningful only for srec output. Avoid generation of S1/S2 - records, creating S3-only record format. - -`--redefine-sym OLD=NEW' - Change the name of a symbol OLD, to NEW. This can be useful when - one is trying link two things together for which you have no - source, and there are name collisions. - -`--redefine-syms=FILENAME' - Apply `--redefine-sym' to each symbol pair "OLD NEW" listed in the - file FILENAME. FILENAME is simply a flat file, with one symbol - pair per line. Line comments may be introduced by the hash - character. This option may be given more than once. - -`--weaken' - Change all global symbols in the file to be weak. This can be - useful when building an object which will be linked against other - objects using the `-R' option to the linker. This option is only - effective when using an object file format which supports weak - symbols. - -`--keep-symbols=FILENAME' - Apply `--keep-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--strip-symbols=FILENAME' - Apply `--strip-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--strip-unneeded-symbols=FILENAME' - Apply `--strip-unneeded-symbol' option to each symbol listed in - the file FILENAME. FILENAME is simply a flat file, with one - symbol name per line. Line comments may be introduced by the hash - character. This option may be given more than once. - -`--keep-global-symbols=FILENAME' - Apply `--keep-global-symbol' option to each symbol listed in the - file FILENAME. FILENAME is simply a flat file, with one symbol - name per line. Line comments may be introduced by the hash - character. This option may be given more than once. - -`--localize-symbols=FILENAME' - Apply `--localize-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--globalize-symbols=FILENAME' - Apply `--globalize-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--weaken-symbols=FILENAME' - Apply `--weaken-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--alt-machine-code=INDEX' - If the output architecture has alternate machine codes, use the - INDEXth code instead of the default one. This is useful in case a - machine is assigned an official code and the tool-chain adopts the - new code, but other applications still depend on the original code - being used. For ELF based architectures if the INDEX alternative - does not exist then the value is treated as an absolute number to - be stored in the e_machine field of the ELF header. - -`--writable-text' - Mark the output text as writable. This option isn't meaningful - for all object file formats. - -`--readonly-text' - Make the output text write protected. This option isn't - meaningful for all object file formats. - -`--pure' - Mark the output file as demand paged. This option isn't - meaningful for all object file formats. - -`--impure' - Mark the output file as impure. This option isn't meaningful for - all object file formats. - -`--prefix-symbols=STRING' - Prefix all symbols in the output file with STRING. - -`--prefix-sections=STRING' - Prefix all section names in the output file with STRING. - -`--prefix-alloc-sections=STRING' - Prefix all the names of all allocated sections in the output file - with STRING. - -`--add-gnu-debuglink=PATH-TO-FILE' - Creates a .gnu_debuglink section which contains a reference to - PATH-TO-FILE and adds it to the output file. - -`--keep-file-symbols' - When stripping a file, perhaps with `--strip-debug' or - `--strip-unneeded', retain any symbols specifying source file - names, which would otherwise get stripped. - -`--only-keep-debug' - Strip a file, removing contents of any sections that would not be - stripped by `--strip-debug' and leaving the debugging sections - intact. - - The intention is that this option will be used in conjunction with - `--add-gnu-debuglink' to create a two part executable. One a - stripped binary which will occupy less space in RAM and in a - distribution and the second a debugging information file which is - only needed if debugging abilities are required. The suggested - procedure to create these files is as follows: - - 1. Link the executable as normal. Assuming that is is called - `foo' then... - - 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file - containing the debugging info. - - 3. Run `objcopy --strip-debug foo' to create a stripped - executable. - - 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link - to the debugging info into the stripped executable. - - Note - the choice of `.dbg' as an extension for the debug info - file is arbitrary. Also the `--only-keep-debug' step is optional. - You could instead do this: - - 1. Link the executable as normal. - - 2. Copy `foo' to `foo.full' - - 3. Run `objcopy --strip-debug foo' - - 4. Run `objcopy --add-gnu-debuglink=foo.full foo' - - i.e. the file pointed to by the `--add-gnu-debuglink' can be the - full executable. It does not have to be a file created by the - `--only-keep-debug' switch. - -`-V' -`--version' - Show the version number of `objcopy'. - -`-v' -`--verbose' - Verbose output: list all object files modified. In the case of - archives, `objcopy -V' lists all members of the archive. - -`--help' - Show a summary of the options to `objcopy'. - -`--info' - Display a list showing all architectures and object formats - available. - - -File: binutils.info, Node: objdump, Next: ranlib, Prev: objcopy, Up: Top - -4 objdump -********* - - objdump [`-a'|`--archive-headers'] - [`-b' BFDNAME|`--target=BFDNAME'] - [`-C'|`--demangle'[=STYLE] ] - [`-d'|`--disassemble'] - [`-D'|`--disassemble-all'] - [`-z'|`--disassemble-zeroes'] - [`-EB'|`-EL'|`--endian='{big | little }] - [`-f'|`--file-headers'] - [`--file-start-context'] - [`-g'|`--debugging'] - [`-e'|`--debugging-tags'] - [`-h'|`--section-headers'|`--headers'] - [`-i'|`--info'] - [`-j' SECTION|`--section='SECTION] - [`-l'|`--line-numbers'] - [`-S'|`--source'] - [`-m' MACHINE|`--architecture='MACHINE] - [`-M' OPTIONS|`--disassembler-options='OPTIONS] - [`-p'|`--private-headers'] - [`-r'|`--reloc'] - [`-R'|`--dynamic-reloc'] - [`-s'|`--full-contents'] - [`-W'|`--dwarf'] - [`-G'|`--stabs'] - [`-t'|`--syms'] - [`-T'|`--dynamic-syms'] - [`-x'|`--all-headers'] - [`-w'|`--wide'] - [`--start-address='ADDRESS] - [`--stop-address='ADDRESS] - [`--prefix-addresses'] - [`--[no-]show-raw-insn'] - [`--adjust-vma='OFFSET] - [`--special-syms'] - [`-V'|`--version'] - [`-H'|`--help'] - OBJFILE... - - `objdump' displays information about one or more object files. The -options control what particular information to display. This -information is mostly useful to programmers who are working on the -compilation tools, as opposed to programmers who just want their -program to compile and work. - - OBJFILE... are the object files to be examined. When you specify -archives, `objdump' shows information on each of the member object -files. - - The long and short forms of options, shown here as alternatives, are -equivalent. At least one option from the list -`-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x' must be given. - -`-a' -`--archive-header' - If any of the OBJFILE files are archives, display the archive - header information (in a format similar to `ls -l'). Besides the - information you could list with `ar tv', `objdump -a' shows the - object file format of each archive member. - -`--adjust-vma=OFFSET' - When dumping information, first add OFFSET to all the section - addresses. This is useful if the section addresses do not - correspond to the symbol table, which can happen when putting - sections at particular addresses when using a format which can not - represent section addresses, such as a.out. - -`-b BFDNAME' -`--target=BFDNAME' - Specify that the object-code format for the object files is - BFDNAME. This option may not be necessary; OBJDUMP can - automatically recognize many formats. - - For example, - objdump -b oasys -m vax -h fu.o - displays summary information from the section headers (`-h') of - `fu.o', which is explicitly identified (`-m') as a VAX object file - in the format produced by Oasys compilers. You can list the - formats available with the `-i' option. *Note Target Selection::, - for more information. - -`-C' -`--demangle[=STYLE]' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. Different compilers have - different mangling styles. The optional demangling style argument - can be used to choose an appropriate demangling style for your - compiler. *Note c++filt::, for more information on demangling. - -`-g' -`--debugging' - Display debugging information. This attempts to parse debugging - information stored in the file and print it out using a C like - syntax. Only certain types of debugging information have been - implemented. Some other types are supported by `readelf -w'. - *Note readelf::. - -`-e' -`--debugging-tags' - Like `-g', but the information is generated in a format compatible - with ctags tool. - -`-d' -`--disassemble' - Display the assembler mnemonics for the machine instructions from - OBJFILE. This option only disassembles those sections which are - expected to contain instructions. - -`-D' -`--disassemble-all' - Like `-d', but disassemble the contents of all sections, not just - those expected to contain instructions. - -`--prefix-addresses' - When disassembling, print the complete address on each line. This - is the older disassembly format. - -`-EB' -`-EL' -`--endian={big|little}' - Specify the endianness of the object files. This only affects - disassembly. This can be useful when disassembling a file format - which does not describe endianness information, such as S-records. - -`-f' -`--file-headers' - Display summary information from the overall header of each of the - OBJFILE files. - -`--file-start-context' - Specify that when displaying interlisted source code/disassembly - (assumes `-S') from a file that has not yet been displayed, extend - the context to the start of the file. - -`-h' -`--section-headers' -`--headers' - Display summary information from the section headers of the object - file. - - File segments may be relocated to nonstandard addresses, for - example by using the `-Ttext', `-Tdata', or `-Tbss' options to - `ld'. However, some object file formats, such as a.out, do not - store the starting address of the file segments. In those - situations, although `ld' relocates the sections correctly, using - `objdump -h' to list the file section headers cannot show the - correct addresses. Instead, it shows the usual addresses, which - are implicit for the target. - -`-H' -`--help' - Print a summary of the options to `objdump' and exit. - -`-i' -`--info' - Display a list showing all architectures and object formats - available for specification with `-b' or `-m'. - -`-j NAME' -`--section=NAME' - Display information only for section NAME. - -`-l' -`--line-numbers' - Label the display (using debugging information) with the filename - and source line numbers corresponding to the object code or relocs - shown. Only useful with `-d', `-D', or `-r'. - -`-m MACHINE' -`--architecture=MACHINE' - Specify the architecture to use when disassembling object files. - This can be useful when disassembling object files which do not - describe architecture information, such as S-records. You can - list the available architectures with the `-i' option. - -`-M OPTIONS' -`--disassembler-options=OPTIONS' - Pass target specific information to the disassembler. Only - supported on some targets. If it is necessary to specify more - than one disassembler option then multiple `-M' options can be - used or can be placed together into a comma separated list. - - If the target is an ARM architecture then this switch can be used - to select which register name set is used during disassembler. - Specifying `-M reg-names-std' (the default) will select the - register names as used in ARM's instruction set documentation, but - with register 13 called 'sp', register 14 called 'lr' and register - 15 called 'pc'. Specifying `-M reg-names-apcs' will select the - name set used by the ARM Procedure Call Standard, whilst - specifying `-M reg-names-raw' will just use `r' followed by the - register number. - - There are also two variants on the APCS register naming scheme - enabled by `-M reg-names-atpcs' and `-M reg-names-special-atpcs' - which use the ARM/Thumb Procedure Call Standard naming - conventions. (Either with the normal register names or the - special register names). - - This option can also be used for ARM architectures to force the - disassembler to interpret all instructions as Thumb instructions by - using the switch `--disassembler-options=force-thumb'. This can be - useful when attempting to disassemble thumb code produced by other - compilers. - - For the x86, some of the options duplicate functions of the `-m' - switch, but allow finer grained control. Multiple selections from - the following may be specified as a comma separated string. - `x86-64', `i386' and `i8086' select disassembly for the given - architecture. `intel' and `att' select between intel syntax mode - and AT&T syntax mode. `addr32', `addr16', `data32' and `data16' - specify the default address size and operand size. These four - options will be overridden if `x86-64', `i386' or `i8086' appear - later in the option string. Lastly, `suffix', when in AT&T mode, - instructs the disassembler to print a mnemonic suffix even when the - suffix could be inferred by the operands. - - For PPC, `booke', `booke32' and `booke64' select disassembly of - BookE instructions. `32' and `64' select PowerPC and PowerPC64 - disassembly, respectively. `e300' selects disassembly for the - e300 family. - - For MIPS, this option controls the printing of instruction - mneumonic names and register names in disassembled instructions. - Multiple selections from the following may be specified as a comma - separated string, and invalid options are ignored: - - `no-aliases' - Print the 'raw' instruction mneumonic instead of some pseudo - instruction mneumonic. I.E. print 'daddu' or 'or' instead of - 'move', 'sll' instead of 'nop', etc. - - `gpr-names=ABI' - Print GPR (general-purpose register) names as appropriate for - the specified ABI. By default, GPR names are selected - according to the ABI of the binary being disassembled. - - `fpr-names=ABI' - Print FPR (floating-point register) names as appropriate for - the specified ABI. By default, FPR numbers are printed - rather than names. - - `cp0-names=ARCH' - Print CP0 (system control coprocessor; coprocessor 0) - register names as appropriate for the CPU or architecture - specified by ARCH. By default, CP0 register names are - selected according to the architecture and CPU of the binary - being disassembled. - - `hwr-names=ARCH' - Print HWR (hardware register, used by the `rdhwr' - instruction) names as appropriate for the CPU or architecture - specified by ARCH. By default, HWR names are selected - according to the architecture and CPU of the binary being - disassembled. - - `reg-names=ABI' - Print GPR and FPR names as appropriate for the selected ABI. - - `reg-names=ARCH' - Print CPU-specific register names (CP0 register and HWR names) - as appropriate for the selected CPU or architecture. - - For any of the options listed above, ABI or ARCH may be specified - as `numeric' to have numbers printed rather than names, for the - selected types of registers. You can list the available values of - ABI and ARCH using the `--help' option. - - For VAX, you can specify function entry addresses with `-M - entry:0xf00ba'. You can use this multiple times to properly - disassemble VAX binary files that don't contain symbol tables (like - ROM dumps). In these cases, the function entry mask would - otherwise be decoded as VAX instructions, which would probably - lead the the rest of the function being wrongly disassembled. - -`-p' -`--private-headers' - Print information that is specific to the object file format. The - exact information printed depends upon the object file format. - For some object file formats, no additional information is printed. - -`-r' -`--reloc' - Print the relocation entries of the file. If used with `-d' or - `-D', the relocations are printed interspersed with the - disassembly. - -`-R' -`--dynamic-reloc' - Print the dynamic relocation entries of the file. This is only - meaningful for dynamic objects, such as certain types of shared - libraries. - -`-s' -`--full-contents' - Display the full contents of any sections requested. By default - all non-empty sections are displayed. - -`-S' -`--source' - Display source code intermixed with disassembly, if possible. - Implies `-d'. - -`--show-raw-insn' - When disassembling instructions, print the instruction in hex as - well as in symbolic form. This is the default except when - `--prefix-addresses' is used. - -`--no-show-raw-insn' - When disassembling instructions, do not print the instruction - bytes. This is the default when `--prefix-addresses' is used. - -`-W' -`--dwarf' - Displays the contents of the DWARF debug sections in the file, if - any are present. - -`-G' -`--stabs' - Display the full contents of any sections requested. Display the - contents of the .stab and .stab.index and .stab.excl sections from - an ELF file. This is only useful on systems (such as Solaris 2.0) - in which `.stab' debugging symbol-table entries are carried in an - ELF section. In most other file formats, debugging symbol-table - entries are interleaved with linkage symbols, and are visible in - the `--syms' output. For more information on stabs symbols, see - *Note Stabs: (stabs.info)Top. - -`--start-address=ADDRESS' - Start displaying data at the specified address. This affects the - output of the `-d', `-r' and `-s' options. - -`--stop-address=ADDRESS' - Stop displaying data at the specified address. This affects the - output of the `-d', `-r' and `-s' options. - -`-t' -`--syms' - Print the symbol table entries of the file. This is similar to - the information provided by the `nm' program. - -`-T' -`--dynamic-syms' - Print the dynamic symbol table entries of the file. This is only - meaningful for dynamic objects, such as certain types of shared - libraries. This is similar to the information provided by the `nm' - program when given the `-D' (`--dynamic') option. - -`--special-syms' - When displaying symbols include those which the target considers - to be special in some way and which would not normally be of - interest to the user. - -`-V' -`--version' - Print the version number of `objdump' and exit. - -`-x' -`--all-headers' - Display all available header information, including the symbol - table and relocation entries. Using `-x' is equivalent to - specifying all of `-a -f -h -p -r -t'. - -`-w' -`--wide' - Format some lines for output devices that have more than 80 - columns. Also do not truncate symbol names when they are - displayed. - -`-z' -`--disassemble-zeroes' - Normally the disassembly output will skip blocks of zeroes. This - option directs the disassembler to disassemble those blocks, just - like any other data. - - -File: binutils.info, Node: ranlib, Next: readelf, Prev: objdump, Up: Top - -5 ranlib -******** - - ranlib [`-vV'] ARCHIVE - - `ranlib' generates an index to the contents of an archive and stores -it in the archive. The index lists each symbol defined by a member of -an archive that is a relocatable object file. - - You may use `nm -s' or `nm --print-armap' to list this index. - - An archive with such an index speeds up linking to the library and -allows routines in the library to call each other without regard to -their placement in the archive. - - The GNU `ranlib' program is another form of GNU `ar'; running -`ranlib' is completely equivalent to executing `ar -s'. *Note ar::. - -`-v' -`-V' -`--version' - Show the version number of `ranlib'. - - -File: binutils.info, Node: size, Next: strings, Prev: readelf, Up: Top - -6 size -****** - - size [`-A'|`-B'|`--format='COMPATIBILITY] - [`--help'] - [`-d'|`-o'|`-x'|`--radix='NUMBER] - [`-t'|`--totals'] - [`--target='BFDNAME] [`-V'|`--version'] - [OBJFILE...] - - The GNU `size' utility lists the section sizes--and the total -size--for each of the object or archive files OBJFILE in its argument -list. By default, one line of output is generated for each object file -or each module in an archive. - - OBJFILE... are the object files to be examined. If none are -specified, the file `a.out' will be used. - - The command line options have the following meanings: - -`-A' -`-B' -`--format=COMPATIBILITY' - Using one of these options, you can choose whether the output from - GNU `size' resembles output from System V `size' (using `-A', or - `--format=sysv'), or Berkeley `size' (using `-B', or - `--format=berkeley'). The default is the one-line format similar - to Berkeley's. - - Here is an example of the Berkeley (default) format of output from - `size': - $ size --format=Berkeley ranlib size - text data bss dec hex filename - 294880 81920 11592 388392 5ed28 ranlib - 294880 81920 11888 388688 5ee50 size - - This is the same data, but displayed closer to System V - conventions: - - $ size --format=SysV ranlib size - ranlib : - section size addr - .text 294880 8192 - .data 81920 303104 - .bss 11592 385024 - Total 388392 - - - size : - section size addr - .text 294880 8192 - .data 81920 303104 - .bss 11888 385024 - Total 388688 - -`--help' - Show a summary of acceptable arguments and options. - -`-d' -`-o' -`-x' -`--radix=NUMBER' - Using one of these options, you can control whether the size of - each section is given in decimal (`-d', or `--radix=10'); octal - (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16'). - In `--radix=NUMBER', only the three values (8, 10, 16) are - supported. The total size is always given in two radices; decimal - and hexadecimal for `-d' or `-x' output, or octal and hexadecimal - if you're using `-o'. - -`-t' -`--totals' - Show totals of all objects listed (Berkeley format listing mode - only). - -`--target=BFDNAME' - Specify that the object-code format for OBJFILE is BFDNAME. This - option may not be necessary; `size' can automatically recognize - many formats. *Note Target Selection::, for more information. - -`-V' -`--version' - Display the version number of `size'. - - -File: binutils.info, Node: strings, Next: strip, Prev: size, Up: Top - -7 strings -********* - - strings [`-afov'] [`-'MIN-LEN] - [`-n' MIN-LEN] [`--bytes='MIN-LEN] - [`-t' RADIX] [`--radix='RADIX] - [`-e' ENCODING] [`--encoding='ENCODING] - [`-'] [`--all'] [`--print-file-name'] - [`--target='BFDNAME] - [`--help'] [`--version'] FILE... - - For each FILE given, GNU `strings' prints the printable character -sequences that are at least 4 characters long (or the number given with -the options below) and are followed by an unprintable character. By -default, it only prints the strings from the initialized and loaded -sections of object files; for other types of files, it prints the -strings from the whole file. - - `strings' is mainly useful for determining the contents of non-text -files. - -`-a' -`--all' -`-' - Do not scan only the initialized and loaded sections of object - files; scan the whole files. - -`-f' -`--print-file-name' - Print the name of the file before each string. - -`--help' - Print a summary of the program usage on the standard output and - exit. - -`-MIN-LEN' -`-n MIN-LEN' -`--bytes=MIN-LEN' - Print sequences of characters that are at least MIN-LEN characters - long, instead of the default 4. - -`-o' - Like `-t o'. Some other versions of `strings' have `-o' act like - `-t d' instead. Since we can not be compatible with both ways, we - simply chose one. - -`-t RADIX' -`--radix=RADIX' - Print the offset within the file before each string. The single - character argument specifies the radix of the offset--`o' for - octal, `x' for hexadecimal, or `d' for decimal. - -`-e ENCODING' -`--encoding=ENCODING' - Select the character encoding of the strings that are to be found. - Possible values for ENCODING are: `s' = single-7-bit-byte - characters (ASCII, ISO 8859, etc., default), `S' = - single-8-bit-byte characters, `b' = 16-bit bigendian, `l' = 16-bit - littleendian, `B' = 32-bit bigendian, `L' = 32-bit littleendian. - Useful for finding wide character strings. - -`--target=BFDNAME' - Specify an object code format other than your system's default - format. *Note Target Selection::, for more information. - -`-v' -`--version' - Print the program version number on the standard output and exit. - - -File: binutils.info, Node: strip, Next: c++filt, Prev: strings, Up: Top - -8 strip -******* - - strip [`-F' BFDNAME |`--target='BFDNAME] - [`-I' BFDNAME |`--input-target='BFDNAME] - [`-O' BFDNAME |`--output-target='BFDNAME] - [`-s'|`--strip-all'] - [`-S'|`-g'|`-d'|`--strip-debug'] - [`-K' SYMBOLNAME |`--keep-symbol='SYMBOLNAME] - [`-N' SYMBOLNAME |`--strip-symbol='SYMBOLNAME] - [`-w'|`--wildcard'] - [`-x'|`--discard-all'] [`-X' |`--discard-locals'] - [`-R' SECTIONNAME |`--remove-section='SECTIONNAME] - [`-o' FILE] [`-p'|`--preserve-dates'] - [`--keep-file-symbols'] - [`--only-keep-debug'] - [`-v' |`--verbose'] [`-V'|`--version'] - [`--help'] [`--info'] - OBJFILE... - - GNU `strip' discards all symbols from object files OBJFILE. The -list of object files may include archives. At least one object file -must be given. - - `strip' modifies the files named in its argument, rather than -writing modified copies under different names. - -`-F BFDNAME' -`--target=BFDNAME' - Treat the original OBJFILE as a file with the object code format - BFDNAME, and rewrite it in the same format. *Note Target - Selection::, for more information. - -`--help' - Show a summary of the options to `strip' and exit. - -`--info' - Display a list showing all architectures and object formats - available. - -`-I BFDNAME' -`--input-target=BFDNAME' - Treat the original OBJFILE as a file with the object code format - BFDNAME. *Note Target Selection::, for more information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Replace OBJFILE with a file in the output format BFDNAME. *Note - Target Selection::, for more information. - -`-R SECTIONNAME' -`--remove-section=SECTIONNAME' - Remove any section named SECTIONNAME from the output file. This - option may be given more than once. Note that using this option - inappropriately may make the output file unusable. - -`-s' -`--strip-all' - Remove all symbols. - -`-g' -`-S' -`-d' -`--strip-debug' - Remove debugging symbols only. - -`--strip-unneeded' - Remove all symbols that are not needed for relocation processing. - -`-K SYMBOLNAME' -`--keep-symbol=SYMBOLNAME' - When stripping symbols, keep symbol SYMBOLNAME even if it would - normally be stripped. This option may be given more than once. - -`-N SYMBOLNAME' -`--strip-symbol=SYMBOLNAME' - Remove symbol SYMBOLNAME from the source file. This option may be - given more than once, and may be combined with strip options other - than `-K'. - -`-o FILE' - Put the stripped output in FILE, rather than replacing the - existing file. When this argument is used, only one OBJFILE - argument may be specified. - -`-p' -`--preserve-dates' - Preserve the access and modification dates of the file. - -`-w' -`--wildcard' - Permit regular expressions in SYMBOLNAMEs used in other command - line options. The question mark (?), asterisk (*), backslash (\) - and square brackets ([]) operators can be used anywhere in the - symbol name. If the first character of the symbol name is the - exclamation point (!) then the sense of the switch is reversed for - that symbol. For example: - - -w -K !foo -K fo* - - would cause strip to only keep symbols that start with the letters - "fo", but to discard the symbol "foo". - -`-x' -`--discard-all' - Remove non-global symbols. - -`-X' -`--discard-locals' - Remove compiler-generated local symbols. (These usually start - with `L' or `.'.) - -`--keep-file-symbols' - When stripping a file, perhaps with `--strip-debug' or - `--strip-unneeded', retain any symbols specifying source file - names, which would otherwise get stripped. - -`--only-keep-debug' - Strip a file, removing any sections that would be stripped by - `--strip-debug' and leaving the debugging sections. - - The intention is that this option will be used in conjunction with - `--add-gnu-debuglink' to create a two part executable. One a - stripped binary which will occupy less space in RAM and in a - distribution and the second a debugging information file which is - only needed if debugging abilities are required. The suggested - procedure to create these files is as follows: - - 1. Link the executable as normal. Assuming that is is called - `foo' then... - - 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file - containing the debugging info. - - 3. Run `objcopy --strip-debug foo' to create a stripped - executable. - - 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link - to the debugging info into the stripped executable. - - Note - the choice of `.dbg' as an extension for the debug info - file is arbitrary. Also the `--only-keep-debug' step is optional. - You could instead do this: - - 1. Link the executable as normal. - - 2. Copy `foo' to `foo.full' - - 3. Run `strip --strip-debug foo' - - 4. Run `objcopy --add-gnu-debuglink=foo.full foo' - - ie the file pointed to by the `--add-gnu-debuglink' can be the - full executable. It does not have to be a file created by the - `--only-keep-debug' switch. - -`-V' -`--version' - Show the version number for `strip'. - -`-v' -`--verbose' - Verbose output: list all object files modified. In the case of - archives, `strip -v' lists all members of the archive. - - -File: binutils.info, Node: c++filt, Next: addr2line, Prev: strip, Up: Top - -9 c++filt -********* - - c++filt [`-_'|`--strip-underscores'] - [`-n'|`--no-strip-underscores'] - [`-p'|`--no-params'] - [`-t'|`--types'] - [`-i'|`--no-verbose'] - [`-s' FORMAT|`--format='FORMAT] - [`--help'] [`--version'] [SYMBOL...] - - The C++ and Java languages provide function overloading, which means -that you can write many functions with the same name, providing that -each function takes parameters of different types. In order to be able -to distinguish these similarly named functions C++ and Java encode them -into a low-level assembler name which uniquely identifies each -different version. This process is known as "mangling". The `c++filt' -(1) program does the inverse mapping: it decodes ("demangles") low-level -names into user-level names so that they can be read. - - Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential mangled name. If -the name decodes into a C++ name, the C++ name replaces the low-level -name in the output, otherwise the original word is output. In this way -you can pass an entire assembler source file, containing mangled names, -through `c++filt' and see the same source file containing demangled -names. - - You can also use `c++filt' to decipher individual symbols by passing -them on the command line: - - c++filt SYMBOL - - If no SYMBOL arguments are given, `c++filt' reads symbol names from -the standard input instead. All the results are printed on the -standard output. The difference between reading names from the command -line versus reading names from the standard input is that command line -arguments are expected to be just mangled names and no checking is -performed to seperate them from surrounding text. Thus for example: - - c++filt -n _Z1fv - - will work and demangle the name to "f()" whereas: - - c++filt -n _Z1fv, - - will not work. (Note the extra comma at the end of the mangled name -which makes it invalid). This command however will work: - - echo _Z1fv, | c++filt -n - - and will display "f()," ie the demangled name followed by a trailing -comma. This behaviour is because when the names are read from the -standard input it is expected that they might be part of an assembler -source file where there might be extra, extraneous characters trailing -after a mangled name. eg: - - .type _Z1fv, @function - -`-_' -`--strip-underscores' - On some systems, both the C and C++ compilers put an underscore in - front of every name. For example, the C name `foo' gets the - low-level name `_foo'. This option removes the initial - underscore. Whether `c++filt' removes the underscore by default - is target dependent. - -`-j' -`--java' - Prints demangled names using Java syntax. The default is to use - C++ syntax. - -`-n' -`--no-strip-underscores' - Do not remove the initial underscore. - -`-p' -`--no-params' - When demangling the name of a function, do not display the types of - the function's parameters. - -`-t' -`--types' - Attempt to demangle types as well as function names. This is - disabled by default since mangled types are normally only used - internally in the compiler, and they can be confused with - non-mangled names. eg a function called "a" treated as a mangled - type name would be demangled to "signed char". - -`-i' -`--no-verbose' - Do not include implementation details (if any) in the demangled - output. - -`-s FORMAT' -`--format=FORMAT' - `c++filt' can decode various methods of mangling, used by - different compilers. The argument to this option selects which - method it uses: - - `auto' - Automatic selection based on executable (the default method) - - `gnu' - the one used by the GNU C++ compiler (g++) - - `lucid' - the one used by the Lucid compiler (lcc) - - `arm' - the one specified by the C++ Annotated Reference Manual - - `hp' - the one used by the HP compiler (aCC) - - `edg' - the one used by the EDG compiler - - `gnu-v3' - the one used by the GNU C++ compiler (g++) with the V3 ABI. - - `java' - the one used by the GNU Java compiler (gcj) - - `gnat' - the one used by the GNU Ada compiler (GNAT). - -`--help' - Print a summary of the options to `c++filt' and exit. - -`--version' - Print the version number of `c++filt' and exit. - - _Warning:_ `c++filt' is a new utility, and the details of its user - interface are subject to change in future releases. In particular, - a command-line option may be required in the the future to decode - a name passed as an argument on the command line; in other words, - - c++filt SYMBOL - - may in a future release become - - c++filt OPTION SYMBOL - - ---------- Footnotes ---------- - - (1) MS-DOS does not allow `+' characters in file names, so on MS-DOS -this program is named `CXXFILT'. - - -File: binutils.info, Node: addr2line, Next: nlmconv, Prev: c++filt, Up: Top - -10 addr2line -************ - - addr2line [`-b' BFDNAME|`--target='BFDNAME] - [`-C'|`--demangle'[=STYLE]] - [`-e' FILENAME|`--exe='FILENAME] - [`-f'|`--functions'] [`-s'|`--basename'] - [`-i'|`--inlines'] - [`-j'|`--section='NAME] - [`-H'|`--help'] [`-V'|`--version'] - [addr addr ...] - - `addr2line' translates addresses into file names and line numbers. -Given an address in an executable or an offset in a section of a -relocatable object, it uses the debugging information to figure out -which file name and line number are associated with it. - - The executable or relocatable object to use is specified with the -`-e' option. The default is the file `a.out'. The section in the -relocatable object to use is specified with the `-j' option. - - `addr2line' has two modes of operation. - - In the first, hexadecimal addresses are specified on the command -line, and `addr2line' displays the file name and line number for each -address. - - In the second, `addr2line' reads hexadecimal addresses from standard -input, and prints the file name and line number for each address on -standard output. In this mode, `addr2line' may be used in a pipe to -convert dynamically chosen addresses. - - The format of the output is `FILENAME:LINENO'. The file name and -line number for each address is printed on a separate line. If the -`-f' option is used, then each `FILENAME:LINENO' line is preceded by a -`FUNCTIONNAME' line which is the name of the function containing the -address. - - If the file name or function name can not be determined, `addr2line' -will print two question marks in their place. If the line number can -not be determined, `addr2line' will print 0. - - The long and short forms of options, shown here as alternatives, are -equivalent. - -`-b BFDNAME' -`--target=BFDNAME' - Specify that the object-code format for the object files is - BFDNAME. - -`-C' -`--demangle[=STYLE]' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. Different compilers have - different mangling styles. The optional demangling style argument - can be used to choose an appropriate demangling style for your - compiler. *Note c++filt::, for more information on demangling. - -`-e FILENAME' -`--exe=FILENAME' - Specify the name of the executable for which addresses should be - translated. The default file is `a.out'. - -`-f' -`--functions' - Display function names as well as file and line number information. - -`-s' -`--basenames' - Display only the base of each file name. - -`-i' -`--inlines' - If the address belongs to a function that was inlined, the source - information for all enclosing scopes back to the first non-inlined - function will also be printed. For example, if `main' inlines - `callee1' which inlines `callee2', and address is from `callee2', - the source information for `callee1' and `main' will also be - printed. - -`-j' -`--section' - Read offsets relative to the specified section instead of absolute - addresses. - - -File: binutils.info, Node: nlmconv, Next: windres, Prev: addr2line, Up: Top - -11 nlmconv -********** - -`nlmconv' converts a relocatable object file into a NetWare Loadable -Module. - - _Warning:_ `nlmconv' is not always built as part of the binary - utilities, since it is only useful for NLM targets. - - nlmconv [`-I' BFDNAME|`--input-target='BFDNAME] - [`-O' BFDNAME|`--output-target='BFDNAME] - [`-T' HEADERFILE|`--header-file='HEADERFILE] - [`-d'|`--debug'] [`-l' LINKER|`--linker='LINKER] - [`-h'|`--help'] [`-V'|`--version'] - INFILE OUTFILE - - `nlmconv' converts the relocatable `i386' object file INFILE into -the NetWare Loadable Module OUTFILE, optionally reading HEADERFILE for -NLM header information. For instructions on writing the NLM command -file language used in header files, see the `linkers' section, -`NLMLINK' in particular, of the `NLM Development and Tools Overview', -which is part of the NLM Software Developer's Kit ("NLM SDK"), -available from Novell, Inc. `nlmconv' uses the GNU Binary File -Descriptor library to read INFILE; see *Note BFD: (ld.info)BFD, for -more information. - - `nlmconv' can perform a link step. In other words, you can list -more than one object file for input if you list them in the definitions -file (rather than simply specifying one input file on the command line). -In this case, `nlmconv' calls the linker for you. - -`-I BFDNAME' -`--input-target=BFDNAME' - Object format of the input file. `nlmconv' can usually determine - the format of a given file (so no default is necessary). *Note - Target Selection::, for more information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Object format of the output file. `nlmconv' infers the output - format based on the input format, e.g. for a `i386' input file the - output format is `nlm32-i386'. *Note Target Selection::, for more - information. - -`-T HEADERFILE' -`--header-file=HEADERFILE' - Reads HEADERFILE for NLM header information. For instructions on - writing the NLM command file language used in header files, see - see the `linkers' section, of the `NLM Development and Tools - Overview', which is part of the NLM Software Developer's Kit, - available from Novell, Inc. - -`-d' -`--debug' - Displays (on standard error) the linker command line used by - `nlmconv'. - -`-l LINKER' -`--linker=LINKER' - Use LINKER for any linking. LINKER can be an absolute or a - relative pathname. - -`-h' -`--help' - Prints a usage summary. - -`-V' -`--version' - Prints the version number for `nlmconv'. - - -File: binutils.info, Node: windres, Next: dlltool, Prev: nlmconv, Up: Top - -12 windres -********** - -`windres' may be used to manipulate Windows resources. - - _Warning:_ `windres' is not always built as part of the binary - utilities, since it is only useful for Windows targets. - - windres [options] [input-file] [output-file] - - `windres' reads resources from an input file and copies them into an -output file. Either file may be in one of three formats: - -`rc' - A text format read by the Resource Compiler. - -`res' - A binary format generated by the Resource Compiler. - -`coff' - A COFF object or executable. - - The exact description of these different formats is available in -documentation from Microsoft. - - When `windres' converts from the `rc' format to the `res' format, it -is acting like the Windows Resource Compiler. When `windres' converts -from the `res' format to the `coff' format, it is acting like the -Windows `CVTRES' program. - - When `windres' generates an `rc' file, the output is similar but not -identical to the format expected for the input. When an input `rc' -file refers to an external filename, an output `rc' file will instead -include the file contents. - - If the input or output format is not specified, `windres' will guess -based on the file name, or, for the input file, the file contents. A -file with an extension of `.rc' will be treated as an `rc' file, a file -with an extension of `.res' will be treated as a `res' file, and a file -with an extension of `.o' or `.exe' will be treated as a `coff' file. - - If no output file is specified, `windres' will print the resources -in `rc' format to standard output. - - The normal use is for you to write an `rc' file, use `windres' to -convert it to a COFF object file, and then link the COFF file into your -application. This will make the resources described in the `rc' file -available to Windows. - -`-i FILENAME' -`--input FILENAME' - The name of the input file. If this option is not used, then - `windres' will use the first non-option argument as the input file - name. If there are no non-option arguments, then `windres' will - read from standard input. `windres' can not read a COFF file from - standard input. - -`-o FILENAME' -`--output FILENAME' - The name of the output file. If this option is not used, then - `windres' will use the first non-option argument, after any used - for the input file name, as the output file name. If there is no - non-option argument, then `windres' will write to standard output. - `windres' can not write a COFF file to standard output. Note, for - compatability with `rc' the option `-fo' is also accepted, but its - use is not recommended. - -`-J FORMAT' -`--input-format FORMAT' - The input format to read. FORMAT may be `res', `rc', or `coff'. - If no input format is specified, `windres' will guess, as - described above. - -`-O FORMAT' -`--output-format FORMAT' - The output format to generate. FORMAT may be `res', `rc', or - `coff'. If no output format is specified, `windres' will guess, - as described above. - -`-F TARGET' -`--target TARGET' - Specify the BFD format to use for a COFF file as input or output. - This is a BFD target name; you can use the `--help' option to see - a list of supported targets. Normally `windres' will use the - default format, which is the first one listed by the `--help' - option. *Note Target Selection::. - -`--preprocessor PROGRAM' - When `windres' reads an `rc' file, it runs it through the C - preprocessor first. This option may be used to specify the - preprocessor to use, including any leading arguments. The default - preprocessor argument is `gcc -E -xc-header -DRC_INVOKED'. - -`-I DIRECTORY' -`--include-dir DIRECTORY' - Specify an include directory to use when reading an `rc' file. - `windres' will pass this to the preprocessor as an `-I' option. - `windres' will also search this directory when looking for files - named in the `rc' file. If the argument passed to this command - matches any of the supported FORMATS (as descrived in the `-J' - option), it will issue a deprecation warning, and behave just like - the `-J' option. New programs should not use this behaviour. If a - directory happens to match a FORMAT, simple prefix it with `./' to - disable the backward compatibility. - -`-D TARGET' -`--define SYM[=VAL]' - Specify a `-D' option to pass to the preprocessor when reading an - `rc' file. - -`-U TARGET' -`--undefine SYM' - Specify a `-U' option to pass to the preprocessor when reading an - `rc' file. - -`-r' - Ignored for compatibility with rc. - -`-v' - Enable verbose mode. This tells you what the preprocessor is if - you didn't specify one. - -`-l VAL' - -`--language VAL' - Specify the default language to use when reading an `rc' file. - VAL should be a hexadecimal language code. The low eight bits are - the language, and the high eight bits are the sublanguage. - -`--use-temp-file' - Use a temporary file to instead of using popen to read the output - of the preprocessor. Use this option if the popen implementation - is buggy on the host (eg., certain non-English language versions - of Windows 95 and Windows 98 are known to have buggy popen where - the output will instead go the console). - -`--no-use-temp-file' - Use popen, not a temporary file, to read the output of the - preprocessor. This is the default behaviour. - -`-h' - -`--help' - Prints a usage summary. - -`-V' - -`--version' - Prints the version number for `windres'. - -`--yydebug' - If `windres' is compiled with `YYDEBUG' defined as `1', this will - turn on parser debugging. - - -File: binutils.info, Node: dlltool, Next: Common Options, Prev: windres, Up: Top - -13 dlltool -********** - -`dlltool' is used to create the files needed to create dynamic link -libraries (DLLs) on systems which understand PE format image files such -as Windows. A DLL contains an export table which contains information -that the runtime loader needs to resolve references from a referencing -program. - - The export table is generated by this program by reading in a `.def' -file or scanning the `.a' and `.o' files which will be in the DLL. A -`.o' file can contain information in special `.drectve' sections with -export information. - - _Note:_ `dlltool' is not always built as part of the binary - utilities, since it is only useful for those targets which support - DLLs. - - dlltool [`-d'|`--input-def' DEF-FILE-NAME] - [`-b'|`--base-file' BASE-FILE-NAME] - [`-e'|`--output-exp' EXPORTS-FILE-NAME] - [`-z'|`--output-def' DEF-FILE-NAME] - [`-l'|`--output-lib' LIBRARY-FILE-NAME] - [`--export-all-symbols'] [`--no-export-all-symbols'] - [`--exclude-symbols' LIST] - [`--no-default-excludes'] - [`-S'|`--as' PATH-TO-ASSEMBLER] [`-f'|`--as-flags' OPTIONS] - [`-D'|`--dllname' NAME] [`-m'|`--machine' MACHINE] - [`-a'|`--add-indirect'] - [`-U'|`--add-underscore'] [`--add-stdcall-underscore'] - [`-k'|`--kill-at'] [`-A'|`--add-stdcall-alias'] - [`-p'|`--ext-prefix-alias' PREFIX] - [`-x'|`--no-idata4'] [`-c'|`--no-idata5'] [`-i'|`--interwork'] - [`-n'|`--nodelete'] [`-t'|`--temp-prefix' PREFIX] - [`-v'|`--verbose'] - [`-h'|`--help'] [`-V'|`--version'] - [object-file ...] - - `dlltool' reads its inputs, which can come from the `-d' and `-b' -options as well as object files specified on the command line. It then -processes these inputs and if the `-e' option has been specified it -creates a exports file. If the `-l' option has been specified it -creates a library file and if the `-z' option has been specified it -creates a def file. Any or all of the `-e', `-l' and `-z' options can -be present in one invocation of dlltool. - - When creating a DLL, along with the source for the DLL, it is -necessary to have three other files. `dlltool' can help with the -creation of these files. - - The first file is a `.def' file which specifies which functions are -exported from the DLL, which functions the DLL imports, and so on. This -is a text file and can be created by hand, or `dlltool' can be used to -create it using the `-z' option. In this case `dlltool' will scan the -object files specified on its command line looking for those functions -which have been specially marked as being exported and put entries for -them in the `.def' file it creates. - - In order to mark a function as being exported from a DLL, it needs to -have an `-export:<name_of_function>' entry in the `.drectve' section of -the object file. This can be done in C by using the asm() operator: - - asm (".section .drectve"); - asm (".ascii \"-export:my_func\""); - - int my_func (void) { ... } - - The second file needed for DLL creation is an exports file. This -file is linked with the object files that make up the body of the DLL -and it handles the interface between the DLL and the outside world. -This is a binary file and it can be created by giving the `-e' option to -`dlltool' when it is creating or reading in a `.def' file. - - The third file needed for DLL creation is the library file that -programs will link with in order to access the functions in the DLL. -This file can be created by giving the `-l' option to dlltool when it -is creating or reading in a `.def' file. - - `dlltool' builds the library file by hand, but it builds the exports -file by creating temporary files containing assembler statements and -then assembling these. The `-S' command line option can be used to -specify the path to the assembler that dlltool will use, and the `-f' -option can be used to pass specific flags to that assembler. The `-n' -can be used to prevent dlltool from deleting these temporary assembler -files when it is done, and if `-n' is specified twice then this will -prevent dlltool from deleting the temporary object files it used to -build the library. - - Here is an example of creating a DLL from a source file `dll.c' and -also creating a program (from an object file called `program.o') that -uses that DLL: - - gcc -c dll.c - dlltool -e exports.o -l dll.lib dll.o - gcc dll.o exports.o -o dll.dll - gcc program.o dll.lib -o program - - The command line options have the following meanings: - -`-d FILENAME' -`--input-def FILENAME' - Specifies the name of a `.def' file to be read in and processed. - -`-b FILENAME' -`--base-file FILENAME' - Specifies the name of a base file to be read in and processed. The - contents of this file will be added to the relocation section in - the exports file generated by dlltool. - -`-e FILENAME' -`--output-exp FILENAME' - Specifies the name of the export file to be created by dlltool. - -`-z FILENAME' -`--output-def FILENAME' - Specifies the name of the `.def' file to be created by dlltool. - -`-l FILENAME' -`--output-lib FILENAME' - Specifies the name of the library file to be created by dlltool. - -`--export-all-symbols' - Treat all global and weak defined symbols found in the input object - files as symbols to be exported. There is a small list of symbols - which are not exported by default; see the `--no-default-excludes' - option. You may add to the list of symbols to not export by using - the `--exclude-symbols' option. - -`--no-export-all-symbols' - Only export symbols explicitly listed in an input `.def' file or in - `.drectve' sections in the input object files. This is the default - behaviour. The `.drectve' sections are created by `dllexport' - attributes in the source code. - -`--exclude-symbols LIST' - Do not export the symbols in LIST. This is a list of symbol names - separated by comma or colon characters. The symbol names should - not contain a leading underscore. This is only meaningful when - `--export-all-symbols' is used. - -`--no-default-excludes' - When `--export-all-symbols' is used, it will by default avoid - exporting certain special symbols. The current list of symbols to - avoid exporting is `DllMain@12', `DllEntryPoint@0', `impure_ptr'. - You may use the `--no-default-excludes' option to go ahead and - export these special symbols. This is only meaningful when - `--export-all-symbols' is used. - -`-S PATH' -`--as PATH' - Specifies the path, including the filename, of the assembler to be - used to create the exports file. - -`-f OPTIONS' -`--as-flags OPTIONS' - Specifies any specific command line options to be passed to the - assembler when building the exports file. This option will work - even if the `-S' option is not used. This option only takes one - argument, and if it occurs more than once on the command line, - then later occurrences will override earlier occurrences. So if - it is necessary to pass multiple options to the assembler they - should be enclosed in double quotes. - -`-D NAME' -`--dll-name NAME' - Specifies the name to be stored in the `.def' file as the name of - the DLL when the `-e' option is used. If this option is not - present, then the filename given to the `-e' option will be used - as the name of the DLL. - -`-m MACHINE' -`-machine MACHINE' - Specifies the type of machine for which the library file should be - built. `dlltool' has a built in default type, depending upon how - it was created, but this option can be used to override that. - This is normally only useful when creating DLLs for an ARM - processor, when the contents of the DLL are actually encode using - Thumb instructions. - -`-a' -`--add-indirect' - Specifies that when `dlltool' is creating the exports file it - should add a section which allows the exported functions to be - referenced without using the import library. Whatever the hell - that means! - -`-U' -`--add-underscore' - Specifies that when `dlltool' is creating the exports file it - should prepend an underscore to the names of _all_ exported - symbols. - -`--add-stdcall-underscore' - Specifies that when `dlltool' is creating the exports file it - should prepend an underscore to the names of exported _stdcall_ - functions. Variable names and non-stdcall function names are not - modified. This option is useful when creating GNU-compatible - import libs for third party DLLs that were built with MS-Windows - tools. - -`-k' -`--kill-at' - Specifies that when `dlltool' is creating the exports file it - should not append the string `@ <number>'. These numbers are - called ordinal numbers and they represent another way of accessing - the function in a DLL, other than by name. - -`-A' -`--add-stdcall-alias' - Specifies that when `dlltool' is creating the exports file it - should add aliases for stdcall symbols without `@ <number>' in - addition to the symbols with `@ <number>'. - -`-p' -`--ext-prefix-alias PREFIX' - Causes `dlltool' to create external aliases for all DLL imports - with the specified prefix. The aliases are created for both - external and import symbols with no leading underscore. - -`-x' -`--no-idata4' - Specifies that when `dlltool' is creating the exports and library - files it should omit the `.idata4' section. This is for - compatibility with certain operating systems. - -`-c' -`--no-idata5' - Specifies that when `dlltool' is creating the exports and library - files it should omit the `.idata5' section. This is for - compatibility with certain operating systems. - -`-i' -`--interwork' - Specifies that `dlltool' should mark the objects in the library - file and exports file that it produces as supporting interworking - between ARM and Thumb code. - -`-n' -`--nodelete' - Makes `dlltool' preserve the temporary assembler files it used to - create the exports file. If this option is repeated then dlltool - will also preserve the temporary object files it uses to create - the library file. - -`-t PREFIX' -`--temp-prefix PREFIX' - Makes `dlltool' use PREFIX when constructing the names of - temporary assembler and object files. By default, the temp file - prefix is generated from the pid. - -`-v' -`--verbose' - Make dlltool describe what it is doing. - -`-h' -`--help' - Displays a list of command line options and then exits. - -`-V' -`--version' - Displays dlltool's version number and then exits. - - -* Menu: - -* def file format:: The format of the dlltool `.def' file - - -File: binutils.info, Node: def file format, Up: dlltool - -13.1 The format of the `dlltool' `.def' file -============================================ - -A `.def' file contains any number of the following commands: - -`NAME' NAME `[ ,' BASE `]' - The result is going to be named NAME`.exe'. - -`LIBRARY' NAME `[ ,' BASE `]' - The result is going to be named NAME`.dll'. - -`EXPORTS ( ( (' NAME1 `[ = ' NAME2 `] ) | ( ' NAME1 `=' MODULE-NAME `.' EXTERNAL-NAME `) )' - -`[' INTEGER `] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *' - Declares NAME1 as an exported symbol from the DLL, with optional - ordinal number INTEGER, or declares NAME1 as an alias (forward) of - the function EXTERNAL-NAME in the DLL MODULE-NAME. - -`IMPORTS ( (' INTERNAL-NAME `=' MODULE-NAME `.' INTEGER `) | [' INTERNAL-NAME `= ]' MODULE-NAME `.' EXTERNAL-NAME `) ) *' - Declares that EXTERNAL-NAME or the exported function whose ordinal - number is INTEGER is to be imported from the file MODULE-NAME. If - INTERNAL-NAME is specified then this is the name that the imported - function will be referred to in the body of the DLL. - -`DESCRIPTION' STRING - Puts STRING into the output `.exp' file in the `.rdata' section. - -`STACKSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]' - -`HEAPSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]' - Generates `--stack' or `--heap' NUMBER-RESERVE,NUMBER-COMMIT in - the output `.drectve' section. The linker will see this and act - upon it. - -`CODE' ATTR `+' - -`DATA' ATTR `+' - -`SECTIONS (' SECTION-NAME ATTR` + ) *' - Generates `--attr' SECTION-NAME ATTR in the output `.drectve' - section, where ATTR is one of `READ', `WRITE', `EXECUTE' or - `SHARED'. The linker will see this and act upon it. - - - -File: binutils.info, Node: readelf, Next: size, Prev: ranlib, Up: Top - -14 readelf -********** - - readelf [`-a'|`--all'] - [`-h'|`--file-header'] - [`-l'|`--program-headers'|`--segments'] - [`-S'|`--section-headers'|`--sections'] - [`-g'|`--section-groups'] - [`-t'|`--section-details'] - [`-e'|`--headers'] - [`-s'|`--syms'|`--symbols'] - [`-n'|`--notes'] - [`-r'|`--relocs'] - [`-u'|`--unwind'] - [`-d'|`--dynamic'] - [`-V'|`--version-info'] - [`-A'|`--arch-specific'] - [`-D'|`--use-dynamic'] - [`-x' <number or name>|`--hex-dump='<number or name>] - [`-w[liaprmfFsoR]'| - `--debug-dump'[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]] - [`-I'|`-histogram'] - [`-v'|`--version'] - [`-W'|`--wide'] - [`-H'|`--help'] - ELFFILE... - - `readelf' displays information about one or more ELF format object -files. The options control what particular information to display. - - ELFFILE... are the object files to be examined. 32-bit and 64-bit -ELF files are supported, as are archives containing ELF files. - - This program performs a similar function to `objdump' but it goes -into more detail and it exists independently of the BFD library, so if -there is a bug in BFD then readelf will not be affected. - - The long and short forms of options, shown here as alternatives, are -equivalent. At least one option besides `-v' or `-H' must be given. - -`-a' -`--all' - Equivalent to specifiying `--file-header', `--program-headers', - `--sections', `--symbols', `--relocs', `--dynamic', `--notes' and - `--version-info'. - -`-h' -`--file-header' - Displays the information contained in the ELF header at the start - of the file. - -`-l' -`--program-headers' -`--segments' - Displays the information contained in the file's segment headers, - if it has any. - -`-S' -`--sections' -`--section-headers' - Displays the information contained in the file's section headers, - if it has any. - -`-g' -`--section-groups' - Displays the information contained in the file's section groups, - if it has any. - -`-t' -`--section-details' - Displays the detailed section information. Implies `-S'. - -`-s' -`--symbols' -`--syms' - Displays the entries in symbol table section of the file, if it - has one. - -`-e' -`--headers' - Display all the headers in the file. Equivalent to `-h -l -S'. - -`-n' -`--notes' - Displays the contents of the NOTE segments and/or sections, if any. - -`-r' -`--relocs' - Displays the contents of the file's relocation section, if it has - one. - -`-u' -`--unwind' - Displays the contents of the file's unwind section, if it has one. - Only the unwind sections for IA64 ELF files are currently - supported. - -`-d' -`--dynamic' - Displays the contents of the file's dynamic section, if it has one. - -`-V' -`--version-info' - Displays the contents of the version sections in the file, it they - exist. - -`-A' -`--arch-specific' - Displays architecture-specific information in the file, if there - is any. - -`-D' -`--use-dynamic' - When displaying symbols, this option makes `readelf' use the - symbol table in the file's dynamic section, rather than the one in - the symbols section. - -`-x <number or name>' -`--hex-dump=<number or name>' - Displays the contents of the indicated section as a hexadecimal - dump. A number identifies a particular section by index in the - section table; any other string identifies all sections with that - name in the object file. - -`-w[liaprmfFsoR]' -`--debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]' - Displays the contents of the debug sections in the file, if any are - present. If one of the optional letters or words follows the - switch then only data found in those specific sections will be - dumped. - -`-I' -`--histogram' - Display a histogram of bucket list lengths when displaying the - contents of the symbol tables. - -`-v' -`--version' - Display the version number of readelf. - -`-W' -`--wide' - Don't break output lines to fit into 80 columns. By default - `readelf' breaks section header and segment listing lines for - 64-bit ELF files, so that they fit into 80 columns. This option - causes `readelf' to print each section header resp. each segment - one a single line, which is far more readable on terminals wider - than 80 columns. - -`-H' -`--help' - Display the command line options understood by `readelf'. - - - -File: binutils.info, Node: Common Options, Next: Selecting The Target System, Prev: dlltool, Up: Top - -15 Common Options -***************** - -The following command-line options are supported by all of the programs -described in this manual. - -`@FILE' - Read command-line options from FILE. The options read are - inserted in place of the original @FILE option. If FILE does not - exist, or cannot be read, then the option will be treated - literally, and not removed. - - Options in FILE are separated by whitespace. A whitespace - character may be included in an option by surrounding the entire - option in either single or double quotes. Any character - (including a backslash) may be included by prefixing the character - to be included with a backslash. The FILE may itself contain - additional @FILE options; any such options will be processed - recursively. - -`--help' - Display the command-line options supported by the program. - -`--version' - Display the version number of the program. - - - -File: binutils.info, Node: Selecting The Target System, Next: Reporting Bugs, Prev: Common Options, Up: Top - -16 Selecting the Target System -****************************** - -You can specify two aspects of the target system to the GNU binary file -utilities, each in several ways: - - * the target - - * the architecture - - In the following summaries, the lists of ways to specify values are -in order of decreasing precedence. The ways listed first override those -listed later. - - The commands to list valid values only list the values for which the -programs you are running were configured. If they were configured with -`--enable-targets=all', the commands list most of the available values, -but a few are left out; not all targets can be configured in at once -because some of them can only be configured "native" (on hosts with the -same type as the target system). - -* Menu: - -* Target Selection:: -* Architecture Selection:: - - -File: binutils.info, Node: Target Selection, Next: Architecture Selection, Up: Selecting The Target System - -16.1 Target Selection -===================== - -A "target" is an object file format. A given target may be supported -for multiple architectures (*note Architecture Selection::). A target -selection may also have variations for different operating systems or -architectures. - - The command to list valid target values is `objdump -i' (the first -column of output contains the relevant information). - - Some sample values are: `a.out-hp300bsd', `ecoff-littlemips', -`a.out-sunos-big'. - - You can also specify a target using a configuration triplet. This is -the same sort of name that is passed to `configure' to specify a -target. When you use a configuration triplet as an argument, it must be -fully canonicalized. You can see the canonical version of a triplet by -running the shell script `config.sub' which is included with the -sources. - - Some sample configuration triplets are: `m68k-hp-bsd', -`mips-dec-ultrix', `sparc-sun-sunos'. - -`objdump' Target ----------------- - -Ways to specify: - - 1. command line option: `-b' or `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -`objcopy' and `strip' Input Target ----------------------------------- - -Ways to specify: - - 1. command line options: `-I' or `--input-target', or `-F' or - `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -`objcopy' and `strip' Output Target ------------------------------------ - -Ways to specify: - - 1. command line options: `-O' or `--output-target', or `-F' or - `--target' - - 2. the input target (see "`objcopy' and `strip' Input Target" above) - - 3. environment variable `GNUTARGET' - - 4. deduced from the input file - -`nm', `size', and `strings' Target ----------------------------------- - -Ways to specify: - - 1. command line option: `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - - -File: binutils.info, Node: Architecture Selection, Prev: Target Selection, Up: Selecting The Target System - -16.2 Architecture Selection -=========================== - -An "architecture" is a type of CPU on which an object file is to run. -Its name may contain a colon, separating the name of the processor -family from the name of the particular CPU. - - The command to list valid architecture values is `objdump -i' (the -second column contains the relevant information). - - Sample values: `m68k:68020', `mips:3000', `sparc'. - -`objdump' Architecture ----------------------- - -Ways to specify: - - 1. command line option: `-m' or `--architecture' - - 2. deduced from the input file - -`objcopy', `nm', `size', `strings' Architecture ------------------------------------------------ - -Ways to specify: - - 1. deduced from the input file - - -File: binutils.info, Node: Reporting Bugs, Next: GNU Free Documentation License, Prev: Selecting The Target System, Up: Top - -17 Reporting Bugs -***************** - -Your bug reports play an essential role in making the binary utilities -reliable. - - Reporting a bug may help you by bringing a solution to your problem, -or it may not. But in any case the principal function of a bug report -is to help the entire community by making the next version of the binary -utilities work better. Bug reports are your contribution to their -maintenance. - - In order for a bug report to serve its purpose, you must include the -information that enables us to fix the bug. - -* Menu: - -* Bug Criteria:: Have you found a bug? -* Bug Reporting:: How to report bugs - - -File: binutils.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs - -17.1 Have You Found a Bug? -========================== - -If you are not sure whether you have found a bug, here are some -guidelines: - - * If a binary utility gets a fatal signal, for any input whatever, - that is a bug. Reliable utilities never crash. - - * If a binary utility produces an error message for valid input, - that is a bug. - - * If you are an experienced user of binary utilities, your - suggestions for improvement are welcome in any case. - - -File: binutils.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs - -17.2 How to Report Bugs -======================= - -A number of companies and individuals offer support for GNU products. -If you obtained the binary utilities from a support organization, we -recommend you contact that organization first. - - You can find contact information for many support companies and -individuals in the file `etc/SERVICE' in the GNU Emacs distribution. - - In any event, we also recommend that you send bug reports for the -binary utilities to `bug-binutils@gnu.org'. - - The fundamental principle of reporting bugs usefully is this: -*report all the facts*. If you are not sure whether to state a fact or -leave it out, state it! - - Often people omit facts because they think they know what causes the -problem and assume that some details do not matter. Thus, you might -assume that the name of a file you use in an example does not matter. -Well, probably it does not, but one cannot be sure. Perhaps the bug is -a stray memory reference which happens to fetch from the location where -that pathname is stored in memory; perhaps, if the pathname were -different, the contents of that location would fool the utility into -doing the right thing despite the bug. Play it safe and give a -specific, complete example. That is the easiest thing for you to do, -and the most helpful. - - Keep in mind that the purpose of a bug report is to enable us to fix -the bug if it is new to us. Therefore, always write your bug reports -on the assumption that the bug has not been reported previously. - - Sometimes people give a few sketchy facts and ask, "Does this ring a -bell?" This cannot help us fix a bug, so it is basically useless. We -respond by asking for enough details to enable us to investigate. You -might as well expedite matters by sending them to begin with. - - To enable us to fix the bug, you should include all these things: - - * The version of the utility. Each utility announces it if you - start it with the `--version' argument. - - Without this, we will not know whether there is any point in - looking for the bug in the current version of the binary utilities. - - * Any patches you may have applied to the source, including any - patches made to the `BFD' library. - - * The type of machine you are using, and the operating system name - and version number. - - * What compiler (and its version) was used to compile the - utilities--e.g. "`gcc-2.7'". - - * The command arguments you gave the utility to observe the bug. To - guarantee you will not omit something important, list them all. A - copy of the Makefile (or the output from make) is sufficient. - - If we were to try to guess the arguments, we would probably guess - wrong and then we might not encounter the bug. - - * A complete input file, or set of input files, that will reproduce - the bug. If the utility is reading an object file or files, then - it is generally most helpful to send the actual object files, - uuencoded if necessary to get them through the mail system. Note - that `bug-binutils@gnu.org' is a mailing list, so you should avoid - sending very large files to it. Making the files available for - anonymous FTP is OK. - - If the source files were produced exclusively using GNU programs - (e.g., `gcc', `gas', and/or the GNU `ld'), then it may be OK to - send the source files rather than the object files. In this case, - be sure to say exactly what version of `gcc', or whatever, was - used to produce the object files. Also say how `gcc', or - whatever, was configured. - - * A description of what behavior you observe that you believe is - incorrect. For example, "It gets a fatal signal." - - Of course, if the bug is that the utility gets a fatal signal, - then we will certainly notice it. But if the bug is incorrect - output, we might not notice unless it is glaringly wrong. You - might as well not give us a chance to make a mistake. - - Even if the problem you experience is a fatal signal, you should - still say so explicitly. Suppose something strange is going on, - such as your copy of the utility is out of synch, or you have - encountered a bug in the C library on your system. (This has - happened!) Your copy might crash and ours would not. If you told - us to expect a crash, then when ours fails to crash, we would know - that the bug was not happening for us. If you had not told us to - expect a crash, then we would not be able to draw any conclusion - from our observations. - - * If you wish to suggest changes to the source, send us context - diffs, as generated by `diff' with the `-u', `-c', or `-p' option. - Always send diffs from the old file to the new file. If you wish - to discuss something in the `ld' source, refer to it by context, - not by line number. - - The line numbers in our development sources will not match those - in your sources. Your line numbers would convey no useful - information to us. - - Here are some things that are not necessary: - - * A description of the envelope of the bug. - - Often people who encounter a bug spend a lot of time investigating - which changes to the input file will make the bug go away and which - changes will not affect it. - - This is often time consuming and not very useful, because the way - we will find the bug is by running a single example under the - debugger with breakpoints, not by pure deduction from a series of - examples. We recommend that you save your time for something else. - - Of course, if you can find a simpler example to report _instead_ - of the original one, that is a convenience for us. Errors in the - output will be easier to spot, running under the debugger will take - less time, and so on. - - However, simplification is not vital; if you do not want to do - this, report the bug anyway and send us the entire test case you - used. - - * A patch for the bug. - - A patch for the bug does help us if it is a good one. But do not - omit the necessary information, such as the test case, on the - assumption that a patch is all we need. We might see problems - with your patch and decide to fix the problem another way, or we - might not understand it at all. - - Sometimes with programs as complicated as the binary utilities it - is very hard to construct an example that will make the program - follow a certain path through the code. If you do not send us the - example, we will not be able to construct one, so we will not be - able to verify that the bug is fixed. - - And if we cannot understand what bug you are trying to fix, or why - your patch should be an improvement, we will not install it. A - test case will help us to understand. - - * A guess about what the bug is or what it depends on. - - Such guesses are usually wrong. Even we cannot guess right about - such things without first using the debugger to find the facts. - - -File: binutils.info, Node: GNU Free Documentation License, Next: Index, Prev: Reporting Bugs, Up: Top - -Appendix A GNU Free Documentation License -***************************************** - - Version 1.1, March 2000 - - Copyright (C) 2000, 2003 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - 0. PREAMBLE - - The purpose of this License is to make a manual, textbook, or other - written document "free" in the sense of freedom: to assure everyone - the effective freedom to copy and redistribute it, with or without - modifying it, either commercially or noncommercially. Secondarily, - this License preserves for the author and publisher a way to get - credit for their work, while not being considered responsible for - modifications made by others. - - This License is a kind of "copyleft", which means that derivative - works of the document must themselves be free in the same sense. - It complements the GNU General Public License, which is a copyleft - license designed for free software. - - We have designed this License in order to use it for manuals for - free software, because free software needs free documentation: a - free program should come with manuals providing the same freedoms - that the software does. But this License is not limited to - software manuals; it can be used for any textual work, regardless - of subject matter or whether it is published as a printed book. - We recommend this License principally for works whose purpose is - instruction or reference. - - - 1. APPLICABILITY AND DEFINITIONS - - This License applies to any manual or other work that contains a - notice placed by the copyright holder saying it can be distributed - under the terms of this License. The "Document", below, refers to - any such manual or work. Any member of the public is a licensee, - and is addressed as "you." - - A "Modified Version" of the Document means any work containing the - Document or a portion of it, either copied verbatim, or with - modifications and/or translated into another language. - - A "Secondary Section" is a named appendix or a front-matter - section of the Document that deals exclusively with the - relationship of the publishers or authors of the Document to the - Document's overall subject (or to related matters) and contains - nothing that could fall directly within that overall subject. - (For example, if the Document is in part a textbook of - mathematics, a Secondary Section may not explain any mathematics.) - The relationship could be a matter of historical connection with - the subject or with related matters, or of legal, commercial, - philosophical, ethical or political position regarding them. - - The "Invariant Sections" are certain Secondary Sections whose - titles are designated, as being those of Invariant Sections, in - the notice that says that the Document is released under this - License. - - The "Cover Texts" are certain short passages of text that are - listed, as Front-Cover Texts or Back-Cover Texts, in the notice - that says that the Document is released under this License. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, whose contents can be viewed and edited directly - and straightforwardly with generic text editors or (for images - composed of pixels) generic paint programs or (for drawings) some - widely available drawing editor, and that is suitable for input to - text formatters or for automatic translation to a variety of - formats suitable for input to text formatters. A copy made in an - otherwise Transparent file format whose markup has been designed - to thwart or discourage subsequent modification by readers is not - Transparent. A copy that is not "Transparent" is called "Opaque." - - Examples of suitable formats for Transparent copies include plain - ASCII without markup, Texinfo input format, LaTeX input format, - SGML or XML using a publicly available DTD, and - standard-conforming simple HTML designed for human modification. - Opaque formats include PostScript, PDF, proprietary formats that - can be read and edited only by proprietary word processors, SGML - or XML for which the DTD and/or processing tools are not generally - available, and the machine-generated HTML produced by some word - processors for output purposes only. - - The "Title Page" means, for a printed book, the title page itself, - plus such following pages as are needed to hold, legibly, the - material this License requires to appear in the title page. For - works in formats which do not have any title page as such, "Title - Page" means the text near the most prominent appearance of the - work's title, preceding the beginning of the body of the text. - - 2. VERBATIM COPYING - - You may copy and distribute the Document in any medium, either - commercially or noncommercially, provided that this License, the - copyright notices, and the license notice saying this License - applies to the Document are reproduced in all copies, and that you - add no other conditions whatsoever to those of this License. You - may not use technical measures to obstruct or control the reading - or further copying of the copies you make or distribute. However, - you may accept compensation in exchange for copies. If you - distribute a large enough number of copies you must also follow - the conditions in section 3. - - You may also lend copies, under the same conditions stated above, - and you may publicly display copies. - - 3. COPYING IN QUANTITY - - If you publish printed copies of the Document numbering more than - 100, and the Document's license notice requires Cover Texts, you - must enclose the copies in covers that carry, clearly and legibly, - all these Cover Texts: Front-Cover Texts on the front cover, and - Back-Cover Texts on the back cover. Both covers must also clearly - and legibly identify you as the publisher of these copies. The - front cover must present the full title with all words of the - title equally prominent and visible. You may add other material - on the covers in addition. Copying with changes limited to the - covers, as long as they preserve the title of the Document and - satisfy these conditions, can be treated as verbatim copying in - other respects. - - If the required texts for either cover are too voluminous to fit - legibly, you should put the first ones listed (as many as fit - reasonably) on the actual cover, and continue the rest onto - adjacent pages. - - If you publish or distribute Opaque copies of the Document - numbering more than 100, you must either include a - machine-readable Transparent copy along with each Opaque copy, or - state in or with each Opaque copy a publicly-accessible - computer-network location containing a complete Transparent copy - of the Document, free of added material, which the general - network-using public has access to download anonymously at no - charge using public-standard network protocols. If you use the - latter option, you must take reasonably prudent steps, when you - begin distribution of Opaque copies in quantity, to ensure that - this Transparent copy will remain thus accessible at the stated - location until at least one year after the last time you - distribute an Opaque copy (directly or through your agents or - retailers) of that edition to the public. - - It is requested, but not required, that you contact the authors of - the Document well before redistributing any large number of - copies, to give them a chance to provide you with an updated - version of the Document. - - 4. MODIFICATIONS - - You may copy and distribute a Modified Version of the Document - under the conditions of sections 2 and 3 above, provided that you - release the Modified Version under precisely this License, with - the Modified Version filling the role of the Document, thus - licensing distribution and modification of the Modified Version to - whoever possesses a copy of it. In addition, you must do these - things in the Modified Version: - - A. Use in the Title Page (and on the covers, if any) a title - distinct from that of the Document, and from those of previous - versions (which should, if there were any, be listed in the - History section of the Document). You may use the same title - as a previous version if the original publisher of that version - gives permission. - B. List on the Title Page, as authors, one or more persons or - entities responsible for authorship of the modifications in the - Modified Version, together with at least five of the principal - authors of the Document (all of its principal authors, if it - has less than five). - C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. - D. Preserve all the copyright notices of the Document. - E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. - F. Include, immediately after the copyright notices, a license - notice giving the public permission to use the Modified Version - under the terms of this License, in the form shown in the - Addendum below. - G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document's - license notice. - H. Include an unaltered copy of this License. - I. Preserve the section entitled "History", and its title, and add - to it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. - If there is no section entitled "History" in the Document, - create one stating the title, year, authors, and publisher of - the Document as given on its Title Page, then add an item - describing the Modified Version as stated in the previous - sentence. - J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and - likewise the network locations given in the Document for - previous versions it was based on. These may be placed in the - "History" section. You may omit a network location for a work - that was published at least four years before the Document - itself, or if the original publisher of the version it refers - to gives permission. - K. In any section entitled "Acknowledgements" or "Dedications", - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements - and/or dedications given therein. - L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. - M. Delete any section entitled "Endorsements." Such a section - may not be included in the Modified Version. - N. Do not retitle any existing section as "Endorsements" or to - conflict in title with any Invariant Section. - - If the Modified Version includes new front-matter sections or - appendices that qualify as Secondary Sections and contain no - material copied from the Document, you may at your option - designate some or all of these sections as invariant. To do this, - add their titles to the list of Invariant Sections in the Modified - Version's license notice. These titles must be distinct from any - other section titles. - - You may add a section entitled "Endorsements", provided it contains - nothing but endorsements of your Modified Version by various - parties-for example, statements of peer review or that the text has - been approved by an organization as the authoritative definition - of a standard. - - You may add a passage of up to five words as a Front-Cover Text, - and a passage of up to 25 words as a Back-Cover Text, to the end - of the list of Cover Texts in the Modified Version. Only one - passage of Front-Cover Text and one of Back-Cover Text may be - added by (or through arrangements made by) any one entity. If the - Document already includes a cover text for the same cover, - previously added by you or by arrangement made by the same entity - you are acting on behalf of, you may not add another; but you may - replace the old one, on explicit permission from the previous - publisher that added the old one. - - The author(s) and publisher(s) of the Document do not by this - License give permission to use their names for publicity for or to - assert or imply endorsement of any Modified Version. - - 5. COMBINING DOCUMENTS - - You may combine the Document with other documents released under - this License, under the terms defined in section 4 above for - modified versions, provided that you include in the combination - all of the Invariant Sections of all of the original documents, - unmodified, and list them all as Invariant Sections of your - combined work in its license notice. - - The combined work need only contain one copy of this License, and - multiple identical Invariant Sections may be replaced with a single - copy. If there are multiple Invariant Sections with the same name - but different contents, make the title of each such section unique - by adding at the end of it, in parentheses, the name of the - original author or publisher of that section if known, or else a - unique number. Make the same adjustment to the section titles in - the list of Invariant Sections in the license notice of the - combined work. - - In the combination, you must combine any sections entitled - "History" in the various original documents, forming one section - entitled "History"; likewise combine any sections entitled - "Acknowledgements", and any sections entitled "Dedications." You - must delete all sections entitled "Endorsements." - - 6. COLLECTIONS OF DOCUMENTS - - You may make a collection consisting of the Document and other - documents released under this License, and replace the individual - copies of this License in the various documents with a single copy - that is included in the collection, provided that you follow the - rules of this License for verbatim copying of each of the - documents in all other respects. - - You may extract a single document from such a collection, and - distribute it individually under this License, provided you insert - a copy of this License into the extracted document, and follow - this License in all other respects regarding verbatim copying of - that document. - - 7. AGGREGATION WITH INDEPENDENT WORKS - - A compilation of the Document or its derivatives with other - separate and independent documents or works, in or on a volume of - a storage or distribution medium, does not as a whole count as a - Modified Version of the Document, provided no compilation - copyright is claimed for the compilation. Such a compilation is - called an "aggregate", and this License does not apply to the - other self-contained works thus compiled with the Document, on - account of their being thus compiled, if they are not themselves - derivative works of the Document. - - If the Cover Text requirement of section 3 is applicable to these - copies of the Document, then if the Document is less than one - quarter of the entire aggregate, the Document's Cover Texts may be - placed on covers that surround only the Document within the - aggregate. Otherwise they must appear on covers around the whole - aggregate. - - 8. TRANSLATION - - Translation is considered a kind of modification, so you may - distribute translations of the Document under the terms of section - 4. Replacing Invariant Sections with translations requires special - permission from their copyright holders, but you may include - translations of some or all Invariant Sections in addition to the - original versions of these Invariant Sections. You may include a - translation of this License provided that you also include the - original English version of this License. In case of a - disagreement between the translation and the original English - version of this License, the original English version will prevail. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other - attempt to copy, modify, sublicense or distribute the Document is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. - - 10. FUTURE REVISIONS OF THIS LICENSE - - The Free Software Foundation may publish new, revised versions of - the GNU Free Documentation License from time to time. Such new - versions will be similar in spirit to the present version, but may - differ in detail to address new problems or concerns. See - http://www.gnu.org/copyleft/. - - Each version of the License is given a distinguishing version - number. If the Document specifies that a particular numbered - version of this License "or any later version" applies to it, you - have the option of following the terms and conditions either of - that specified version or of any later version that has been - published (not as a draft) by the Free Software Foundation. If - the Document does not specify a version number of this License, - you may choose any version ever published (not as a draft) by the - Free Software Foundation. - - -ADDENDUM: How to use this License for your documents -==================================================== - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and license -notices just after the title page: - - Copyright (C) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - A copy of the license is included in the section entitled "GNU - Free Documentation License." - - If you have no Invariant Sections, write "with no Invariant Sections" -instead of saying which ones are invariant. If you have no Front-Cover -Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being -LIST"; likewise for Back-Cover Texts. - - If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, to -permit their use in free software. - - -File: binutils.info, Node: Index, Prev: GNU Free Documentation License, Up: Top - -Index -***** - - -* Menu: - -* .stab: objdump. (line 324) -* addr2line: addr2line. (line 6) -* address to file name and line number: addr2line. (line 6) -* all header information, object file: objdump. (line 364) -* ar: ar. (line 6) -* ar compatibility: ar. (line 40) -* architecture: objdump. (line 176) -* architectures available: objdump. (line 161) -* archive contents: ranlib. (line 6) -* archive headers: objdump. (line 60) -* archives: ar. (line 6) -* base files: dlltool. (line 108) -* bug criteria: Bug Criteria. (line 6) -* bug reports: Bug Reporting. (line 6) -* bugs: Reporting Bugs. (line 6) -* bugs, reporting: Bug Reporting. (line 6) -* c++filt: c++filt. (line 6) -* changing object addresses: objcopy. (line 266) -* changing section address: objcopy. (line 276) -* changing section LMA: objcopy. (line 284) -* changing section VMA: objcopy. (line 297) -* changing start address: objcopy. (line 261) -* collections of files: ar. (line 6) -* compatibility, ar: ar. (line 40) -* contents of archive: ar cmdline. (line 88) -* crash: Bug Criteria. (line 9) -* creating archives: ar cmdline. (line 127) -* cxxfilt: c++filt. (line 14) -* dates in archive: ar cmdline. (line 154) -* debug symbols: objdump. (line 319) -* debugging symbols: nm. (line 116) -* deleting from archive: ar cmdline. (line 26) -* demangling C++ symbols: c++filt. (line 6) -* demangling in nm: nm. (line 124) -* demangling in objdump <1>: addr2line. (line 55) -* demangling in objdump: objdump. (line 88) -* disassembling object code: objdump. (line 110) -* disassembly architecture: objdump. (line 176) -* disassembly endianness: objdump. (line 126) -* disassembly, with source: objdump. (line 305) -* discarding symbols: strip. (line 6) -* DLL: dlltool. (line 6) -* dlltool: dlltool. (line 6) -* DWARF: objdump. (line 319) -* dynamic relocation entries, in object file: objdump. (line 294) -* dynamic symbol table entries, printing: objdump. (line 348) -* dynamic symbols: nm. (line 136) -* ELF dynamic section information: readelf. (line 102) -* ELF file header information: readelf. (line 51) -* ELF file information: readelf. (line 6) -* ELF notes: readelf. (line 87) -* ELF object file format: objdump. (line 324) -* ELF program header information: readelf. (line 57) -* ELF reloc information: readelf. (line 91) -* ELF section group information: readelf. (line 68) -* ELF section information: readelf. (line 63) -* ELF segment information: readelf. (line 57) -* ELF symbol table information: readelf. (line 78) -* ELF version sections informations: readelf. (line 106) -* endianness: objdump. (line 126) -* error on valid input: Bug Criteria. (line 12) -* external symbols: nm. (line 148) -* extract from archive: ar cmdline. (line 103) -* fatal signal: Bug Criteria. (line 9) -* file name: nm. (line 110) -* header information, all: objdump. (line 364) -* input .def file: dlltool. (line 104) -* input file name: nm. (line 110) -* libraries: ar. (line 25) -* listings strings: strings. (line 6) -* machine instructions: objdump. (line 110) -* moving in archive: ar cmdline. (line 34) -* MRI compatibility, ar: ar scripts. (line 8) -* name duplication in archive: ar cmdline. (line 97) -* name length: ar. (line 18) -* nm: nm. (line 6) -* nm compatibility: nm. (line 120) -* nm format: nm. (line 120) -* not writing archive index: ar cmdline. (line 173) -* objdump: objdump. (line 6) -* object code format <1>: addr2line. (line 50) -* object code format <2>: strings. (line 65) -* object code format <3>: size. (line 79) -* object code format <4>: objdump. (line 74) -* object code format: nm. (line 212) -* object file header: objdump. (line 132) -* object file information: objdump. (line 6) -* object file sections: objdump. (line 300) -* object formats available: objdump. (line 161) -* operations on archive: ar cmdline. (line 22) -* printing from archive: ar cmdline. (line 46) -* printing strings: strings. (line 6) -* quick append to archive: ar cmdline. (line 54) -* radix for section sizes: size. (line 65) -* ranlib: ranlib. (line 6) -* readelf: readelf. (line 6) -* relative placement in archive: ar cmdline. (line 115) -* relocation entries, in object file: objdump. (line 288) -* removing symbols: strip. (line 6) -* repeated names in archive: ar cmdline. (line 97) -* replacement in archive: ar cmdline. (line 70) -* reporting bugs: Reporting Bugs. (line 6) -* scripts, ar: ar scripts. (line 8) -* section addresses in objdump: objdump. (line 66) -* section headers: objdump. (line 143) -* section information: objdump. (line 166) -* section sizes: size. (line 6) -* sections, full contents: objdump. (line 300) -* size: size. (line 6) -* size display format: size. (line 26) -* size number format: size. (line 65) -* sorting symbols: nm. (line 167) -* source code context: objdump. (line 136) -* source disassembly: objdump. (line 305) -* source file name: nm. (line 110) -* source filenames for object files: objdump. (line 170) -* stab: objdump. (line 324) -* start-address: objdump. (line 334) -* stop-address: objdump. (line 338) -* strings: strings. (line 6) -* strings, printing: strings. (line 6) -* strip: strip. (line 6) -* symbol index <1>: ranlib. (line 6) -* symbol index: ar. (line 28) -* symbol index, listing: nm. (line 182) -* symbol line numbers: nm. (line 152) -* symbol table entries, printing: objdump. (line 343) -* symbols: nm. (line 6) -* symbols, discarding: strip. (line 6) -* undefined symbols: nm. (line 217) -* Unix compatibility, ar: ar cmdline. (line 8) -* unwind information: readelf. (line 96) -* updating an archive: ar cmdline. (line 180) -* version: Top. (line 6) -* VMA in objdump: objdump. (line 66) -* wide output, printing: objdump. (line 370) -* writing archive index: ar cmdline. (line 167) - - - -Tag Table: -Node: Top1751 -Node: ar3304 -Node: ar cmdline5482 -Node: ar scripts13625 -Node: nm19313 -Node: objcopy27509 -Node: objdump50561 -Node: ranlib65474 -Node: size66229 -Node: strings69076 -Node: strip71426 -Node: c++filt76905 -Ref: c++filt-Footnote-181833 -Node: addr2line81939 -Node: nlmconv85210 -Node: windres87816 -Node: dlltool93549 -Node: def file format104387 -Node: readelf106125 -Node: Common Options110833 -Node: Selecting The Target System111873 -Node: Target Selection112805 -Node: Architecture Selection114787 -Node: Reporting Bugs115615 -Node: Bug Criteria116394 -Node: Bug Reporting116947 -Node: GNU Free Documentation License124041 -Node: Index143773 - -End Tag Table diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index be571d2a7cc9..9499634458d6 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -1,9 +1,10 @@ \input texinfo @c -*- Texinfo -*- @setfilename binutils.info -@c Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +@c Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 +@c Free Software Foundation, Inc. @c man begin INCLUDE -@include config.texi +@include bfdver.texi @c man end @ifinfo @@ -24,15 +25,16 @@ START-INFO-DIR-ENTRY * addr2line: (binutils)addr2line. Convert addresses to file and line * nlmconv: (binutils)nlmconv. Converts object code into an NLM * windres: (binutils)windres. Manipulate Windows resources +* windmc: (binutils)windmc. Generator for Windows message resources * dlltool: (binutils)dlltool. Create files needed to build and use DLLs END-INFO-DIR-ENTRY @end format @end ifinfo -@ifinfo +@copying @c man begin COPYRIGHT Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 @@ -42,23 +44,16 @@ Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @c man end -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries a copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -@end ifinfo +@end copying @synindex ky cp @c @c This file documents the GNU binary utilities "ar", "ld", "objcopy", @c "objdump", "nm", "size", "strings", "strip", "readelf" and "ranlib". @c -@c Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -@c 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -@c +@c Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +@c @c This text may be freely distributed under the terms of the GNU @c Free Documentation License. @c @@ -68,6 +63,9 @@ notice identical to this one except for the removal of this paragraph @titlepage @finalout @title The @sc{gnu} Binary Utilities +@ifset VERSION_PACKAGE +@subtitle @value{VERSION_PACKAGE} +@end ifset @subtitle Version @value{VERSION} @sp 1 @subtitle @value{UPDATED} @@ -83,7 +81,7 @@ notice identical to this one except for the removal of this paragraph @vskip 0pt plus 1filll Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 @@ -93,13 +91,18 @@ Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, section entitled ``GNU Free Documentation License''. @end titlepage +@contents @node Top @top Introduction @cindex version This brief manual contains documentation for the @sc{gnu} binary -utilities (collectively version @value{VERSION}): +utilities +@ifset VERSION_PACKAGE +@value{VERSION_PACKAGE} +@end ifset +version @value{VERSION}: @iftex @table @code @@ -143,6 +146,9 @@ Convert object code into a Netware Loadable Module @item windres Manipulate Windows resources +@item windmc +Genertor for Windows message resources + @item dlltool Create the files needed to build and use Dynamic Link Libraries @end table @@ -167,12 +173,13 @@ section entitled "GNU Free Documentation License". * addr2line:: Convert addresses to file and line * nlmconv:: Converts object code into an NLM * windres:: Manipulate Windows resources +* windmc:: Generator for Windows message resources * dlltool:: Create files needed to build and use DLLs * Common Options:: Command-line options for all utilities * Selecting The Target System:: How these utilities determine the target. * Reporting Bugs:: Reporting Bugs * GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index +* Binutils Index:: Binutils Index @end menu @node ar @@ -198,7 +205,7 @@ the original individual files (called @dfn{members} of the archive). The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and can be restored on -extraction. +extraction. @cindex name length @sc{gnu} @command{ar} can maintain archives whose members have names of any @@ -289,7 +296,7 @@ Use this operation to @emph{move} members in an archive. The ordering of members in an archive can make a difference in how programs are linked using the library, if a symbol is defined in more -than one member. +than one member. If no modifiers are used with @code{m}, any members you name in the @var{member} arguments are moved to the @emph{end} of the archive; @@ -413,7 +420,7 @@ member must be present as the @var{relpos} argument, before the @item l This modifier is accepted but not used. @c whaffor ar l modifier??? presumably compat; with -@c what???---doc@@cygnus.com, 25jan91 +@c what???---doc@@cygnus.com, 25jan91 @item N Uses the @var{count} parameter. This is used if there are multiple @@ -546,7 +553,7 @@ to @code{SAVE}, commands affect only the temporary copy of the current archive. @table @code -@item ADDLIB @var{archive} +@item ADDLIB @var{archive} @itemx ADDLIB @var{archive} (@var{module}, @var{module}, @dots{} @var{module}) Add all the contents of @var{archive} (or, if specified, each named @var{module} from @var{archive}) to the current archive. @@ -627,7 +634,7 @@ will not actually affect @var{archive} until you next use @code{SAVE}. In the current archive, replace each existing @var{module} (named in the @code{REPLACE} arguments) from files in the current working directory. To execute this command without errors, both the file, and the module in -the current archive, must exist. +the current archive, must exist. Requires prior use of @code{OPEN} or @code{CREATE}. @@ -639,7 +646,7 @@ When the flag is on, @code{DIRECTORY} output matches output from @item SAVE Commit your changes to the current archive, and actually save it as a file with the name specified in the last @code{CREATE} or @code{OPEN} -command. +command. Requires prior use of @code{OPEN} or @code{CREATE}. @@ -752,7 +759,7 @@ weak object symbol. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the symbol is determined in a system-specific manner without -error. On some systems, uppercase indicates that a default value has been +error. On some systems, uppercase indicates that a default value has been specified. @@ -782,7 +789,7 @@ equivalent. @table @env @item -A @itemx -o -@itemx --print-file-name +@itemx --print-file-name @cindex input file name @cindex file name @cindex source file name @@ -791,7 +798,7 @@ in which it was found, rather than identifying the input file once only, before all of its symbols. @item -a -@itemx --debug-syms +@itemx --debug-syms @cindex debugging symbols Display all symbols, even debugger-only symbols; normally these are not listed. @@ -807,8 +814,8 @@ The same as @option{--format=bsd} (for compatibility with the MIPS @command{nm}) Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, for more information on demangling. @item --no-demangle @@ -831,7 +838,7 @@ Only the first character of @var{format} is significant; it can be either upper or lower case. @item -g -@itemx --extern-only +@itemx --extern-only @cindex external symbols Display only external symbols. @@ -846,12 +853,12 @@ information can be found, print it after the other symbol information. @item -n @itemx -v -@itemx --numeric-sort +@itemx --numeric-sort Sort symbols numerically by their addresses, rather than alphabetically -by their names. +by their names. @item -p -@itemx --no-sort +@itemx --no-sort @cindex sorting symbols Do not bother to sort the symbols in any order; print them in the order encountered. @@ -873,15 +880,15 @@ When listing symbols from archive members, include the index: a mapping contain definitions for which names. @item -r -@itemx --reverse-sort +@itemx --reverse-sort Reverse the order of the sort (whether numeric or alphabetic); let the last come first. @item --size-sort Sort symbols by size. The size is computed as the difference between the value of the symbol and the value of the symbol with the next higher -value. If the @code{bsd} output format is used the size of the symbol -is printed, rather than the value, and @samp{-S} must be used in order +value. If the @code{bsd} output format is used the size of the symbol +is printed, rather than the value, and @samp{-S} must be used in order both size and value to be printed. @item --special-syms @@ -889,7 +896,7 @@ Display symbols which have a target-specific special meaning. These symbols are usually used by the target for some special processing and are not normally helpful when included included in the normal symbol lists. For example for ARM targets this option would skip the mapping -symbols used to mark transistions between ARM code, THUMB code and +symbols used to mark transitions between ARM code, THUMB code and data. @item -t @var{radix} @@ -903,7 +910,7 @@ Specify an object code format other than your system's default format. @xref{Target Selection}, for more information. @item -u -@itemx --undefined-only +@itemx --undefined-only @cindex external symbols @cindex undefined symbols Display only undefined symbols (those external to each object file). @@ -952,6 +959,7 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{-N} @var{symbolname}|@option{--strip-symbol=}@var{symbolname}] [@option{--strip-unneeded-symbol=}@var{symbolname}] [@option{-G} @var{symbolname}|@option{--keep-global-symbol=}@var{symbolname}] + [@option{--localize-hidden}] [@option{-L} @var{symbolname}|@option{--localize-symbol=}@var{symbolname}] [@option{--globalize-symbol=}@var{symbolname}] [@option{-W} @var{symbolname}|@option{--weaken-symbol=}@var{symbolname}] @@ -977,6 +985,7 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{--add-section} @var{sectionname}=@var{filename}] [@option{--rename-section} @var{oldname}=@var{newname}[,@var{flags}]] [@option{--change-leading-char}] [@option{--remove-leading-char}] + [@option{--reverse-bytes=}@var{num}] [@option{--srec-len=}@var{ival}] [@option{--srec-forceS3}] [@option{--redefine-sym} @var{old}=@var{new}] [@option{--redefine-syms=}@var{filename}] @@ -995,12 +1004,13 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{--add-gnu-debuglink=}@var{path-to-file}] [@option{--keep-file-symbols}] [@option{--only-keep-debug}] + [@option{--extract-symbol}] [@option{--writable-text}] [@option{--readonly-text}] [@option{--pure}] [@option{--impure}] [@option{-v}|@option{--verbose}] - [@option{-V}|@option{--version}] + [@option{-V}|@option{--version}] [@option{--help}] [@option{--info}] @var{infile} [@var{outfile}] @c man end @@ -1041,6 +1051,7 @@ Note---@command{objcopy} is not able to change the endianness of its input files. If the input format has an endianness (some formats do not), @command{objcopy} can only copy the inputs into file formats that have the same endianness or which have no endianness (e.g., @samp{srec}). +(However, see the @option{--reverse-bytes} option.) @c man end @@ -1079,7 +1090,7 @@ can access this binary data inside a program by referencing the special symbols that are created by the conversion process. These symbols are called _binary_@var{objfile}_start, _binary_@var{objfile}_end and _binary_@var{objfile}_size. e.g. you can transform a picture file into -an object file and then access it in your code using these symbols. +an object file and then access it in your code using these symbols. @item -j @var{sectionname} @itemx --only-section=@var{sectionname} @@ -1124,6 +1135,11 @@ Keep only symbol @var{symbolname} global. Make all other symbols local to the file, so that they are not visible externally. This option may be given more than once. +@item --localize-hidden +In an ELF object, mark all symbols that have hidden or internal visibility +as local. This option applies on top of symbol-specific localization options +such as @option{-L}. + @item -L @var{symbolname} @itemx --localize-symbol=@var{symbolname} Make symbol @var{symbolname} local to the file, so that it is not @@ -1219,7 +1235,7 @@ address, by adding @var{incr}. Some object file formats do not permit section addresses to be changed arbitrarily. Note that this does not relocate the sections; if the program expects sections to be loaded at a certain address, and this option is used to change the sections such -that they are loaded at a different address, the program may fail. +that they are loaded at a different address, the program may fail. @item --change-section-address @var{section}@{=,+,-@}@var{val} @itemx --adjust-section-vma @var{section}@{=,+,-@}@var{val} @@ -1242,7 +1258,7 @@ different. If @samp{=} is used, the section address is set to @var{val}. Otherwise, @var{val} is added to or subtracted from the section address. See the comments under @option{--change-addresses}, above. If @var{section} does not exist in the input file, a warning -will be issued, unless @option{--no-change-warnings} is used. +will be issued, unless @option{--no-change-warnings} is used. @item --change-section-vma @var{section}@{=,+,-@}@var{val} @cindex changing section VMA @@ -1256,19 +1272,19 @@ is set to @var{val}. Otherwise, @var{val} is added to or subtracted from the section address. See the comments under @option{--change-addresses}, above. If @var{section} does not exist in the input file, a warning will be issued, unless -@option{--no-change-warnings} is used. +@option{--no-change-warnings} is used. @item --change-warnings @itemx --adjust-warnings If @option{--change-section-address} or @option{--change-section-lma} or @option{--change-section-vma} is used, and the named section does not -exist, issue a warning. This is the default. +exist, issue a warning. This is the default. @item --no-change-warnings @itemx --no-adjust-warnings Do not issue a warning if @option{--change-section-address} or @option{--adjust-section-lma} or @option{--adjust-section-vma} is used, even -if the named section does not exist. +if the named section does not exist. @item --set-section-flags @var{section}=@var{flags} Set the flags for the named section. The @var{flags} argument is a @@ -1326,13 +1342,37 @@ different conventions for symbol names. This is different from when appropriate, regardless of the object file format of the output file. +@item --reverse-bytes=@var{num} +Reverse the bytes in a section with output contents. A section length must +be evenly divisible by the value given in order for the swap to be able to +take place. Reversing takes place before the interleaving is performed. + +This option is used typically in generating ROM images for problematic +target systems. For example, on some target boards, the 32-bit words +fetched from 8-bit ROMs are re-assembled in little-endian byte order +regardless of the CPU byte order. Depending on the programming model, the +endianness of the ROM may need to be modified. + +Consider a simple file with a section containing the following eight +bytes: @code{12345678}. + +Using @samp{--reverse-bytes=2} for the above example, the bytes in the +output file would be ordered @code{21436587}. + +Using @samp{--reverse-bytes=4} for the above example, the bytes in the +output file would be ordered @code{43218765}. + +By using @samp{--reverse-bytes=2} for the above example, followed by +@samp{--reverse-bytes=4} on the output file, the bytes in the second +output file would be ordered @code{34127856}. + @item --srec-len=@var{ival} Meaningful only for srec output. Set the maximum length of the Srecords being produced to @var{ival}. This length covers both address, data and crc fields. @item --srec-forceS3 -Meaningful only for srec output. Avoid generation of S1/S2 records, +Meaningful only for srec output. Avoid generation of S1/S2 records, creating S3-only record format. @item --redefine-sym @var{old}=@var{new} @@ -1397,7 +1437,7 @@ This option may be given more than once. @item --alt-machine-code=@var{index} If the output architecture has alternate machine codes, use the @var{index}th code instead of the default one. This is useful in case -a machine is assigned an official code and the tool-chain adopts the +a machine is assigned an official code and the tool-chain adopts the new code, but other applications still depend on the original code being used. For ELF based architectures if the @var{index} alternative does not exist then the value is treated as an absolute @@ -1441,7 +1481,7 @@ which would otherwise get stripped. @item --only-keep-debug Strip a file, removing contents of any sections that would not be stripped by @option{--strip-debug} and leaving the debugging sections -intact. +intact. In ELF files, this preserves all note sections in the output. The intention is that this option will be used in conjunction with @option{--add-gnu-debuglink} to create a two part executable. One a @@ -1472,10 +1512,32 @@ optional. You could instead do this: @item Run @code{objcopy --add-gnu-debuglink=foo.full foo} @end enumerate -i.e. the file pointed to by the @option{--add-gnu-debuglink} can be the +i.e., the file pointed to by the @option{--add-gnu-debuglink} can be the full executable. It does not have to be a file created by the @option{--only-keep-debug} switch. +Note - this switch is only intended for use on fully linked files. It +does not make sense to use it on object files where the debugging +information may be incomplete. Besides the gnu_debuglink feature +currently only supports the presence of one filename containing +debugging information, not multiple filenames on a one-per-object-file +basis. + +@item --extract-symbol +Keep the file's section flags and symbols but remove all section data. +Specifically, the option: + +@itemize +@item sets the virtual and load addresses of every section to zero; +@item removes the contents of all sections; +@item sets the size of every section to zero; and +@item sets the file's start address to zero. +@end itemize + +This option is used to build a @file{.sym} file for a VxWorks kernel. +It can also be a useful way of reducing the size of a @option{--just-symbols} +linker input file. + @item -V @itemx --version Show the version number of @command{objcopy}. @@ -1612,8 +1674,8 @@ formats available with the @option{-i} option. Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, for more information on demangling. @item -g @@ -1747,7 +1809,7 @@ switch, but allow finer grained control. Multiple selections from the following may be specified as a comma separated string. @option{x86-64}, @option{i386} and @option{i8086} select disassembly for the given architecture. @option{intel} and @option{att} select between -intel syntax mode and AT&T syntax mode. @option{addr32}, +intel syntax mode and AT&T syntax mode. @option{addr64}, @option{addr32}, @option{addr16}, @option{data32} and @option{data16} specify the default address size and operand size. These four options will be overridden if @option{x86-64}, @option{i386} or @option{i8086} appear later in the @@ -1758,17 +1820,18 @@ suffix could be inferred by the operands. For PPC, @option{booke}, @option{booke32} and @option{booke64} select disassembly of BookE instructions. @option{32} and @option{64} select PowerPC and PowerPC64 disassembly, respectively. @option{e300} selects -disassembly for the e300 family. +disassembly for the e300 family. @option{440} selects disassembly for +the PowerPC 440. -For MIPS, this option controls the printing of instruction mneumonic +For MIPS, this option controls the printing of instruction mnemonic names and register names in disassembled instructions. Multiple selections from the following may be specified as a comma separated string, and invalid options are ignored: @table @code @item no-aliases -Print the 'raw' instruction mneumonic instead of some pseudo -instruction mneumonic. I.E. print 'daddu' or 'or' instead of 'move', +Print the 'raw' instruction mnemonic instead of some pseudo +instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move', 'sll' instead of 'nop', etc. @item gpr-names=@var{ABI} @@ -1811,7 +1874,7 @@ For VAX, you can specify function entry addresses with @option{-M entry:0xf00ba}. You can use this multiple times to properly disassemble VAX binary files that don't contain symbol tables (like ROM dumps). In these cases, the function entry mask would otherwise -be decoded as VAX instructions, which would probably lead the the rest +be decoded as VAX instructions, which would probably lead the rest of the function being wrongly disassembled. @item -p @@ -1963,7 +2026,7 @@ ranlib [@option{-vV}] @var{archive} @command{ranlib} generates an index to the contents of an archive and stores it in the archive. The index lists each symbol defined by a -member of an archive that is a relocatable object file. +member of an archive that is a relocatable object file. You may use @samp{nm -s} or @samp{nm --print-armap} to list this index. @@ -2008,7 +2071,7 @@ size [@option{-A}|@option{-B}|@option{--format=}@var{compatibility}] [@option{--help}] [@option{-d}|@option{-o}|@option{-x}|@option{--radix=}@var{number}] [@option{-t}|@option{--totals}] - [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] + [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] [@var{objfile}@dots{}] @c man end @end smallexample @@ -2038,13 +2101,13 @@ Using one of these options, you can choose whether the output from @sc{gnu} @command{size} resembles output from System V @command{size} (using @option{-A}, or @option{--format=sysv}), or Berkeley @command{size} (using @option{-B}, or @option{--format=berkeley}). The default is the one-line format similar to -Berkeley's. +Berkeley's. @c Bonus for doc-source readers: you can also say --format=strange (or @c anything else that starts with 's') for sysv, and --format=boring (or @c anything else that starts with 'b') for Berkeley. Here is an example of the Berkeley (default) format of output from -@command{size}: +@command{size}: @smallexample $ size --format=Berkeley ranlib size text data bss dec hex filename @@ -2059,18 +2122,18 @@ This is the same data, but displayed closer to System V conventions: $ size --format=SysV ranlib size ranlib : section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11592 385024 -Total 388392 +.text 294880 8192 +.data 81920 303104 +.bss 11592 385024 +Total 388392 size : section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11888 385024 -Total 388688 +.text 294880 8192 +.data 81920 303104 +.bss 11888 385024 +Total 388688 @end smallexample @item --help @@ -2130,7 +2193,7 @@ strings [@option{-afov}] [@option{-}@var{min-len}] [@option{-t} @var{radix}] [@option{--radix=}@var{radix}] [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}] [@option{-}] [@option{--all}] [@option{--print-file-name}] - [@option{--target=}@var{bfdname}] + [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}] [@option{--help}] [@option{--version}] @var{file}@dots{} @c man end @end smallexample @@ -2191,7 +2254,8 @@ single-8-bit-byte characters, @samp{b} = 16-bit bigendian, @samp{l} = 16-bit littleendian, @samp{B} = 32-bit bigendian, @samp{L} = 32-bit littleendian. Useful for finding wide character strings. -@item --target=@var{bfdname} +@item -T @var{bfdname} +@itemx --target=@var{bfdname} @cindex object code format Specify an object code format other than your system's default format. @xref{Target Selection}, for more information. @@ -2348,8 +2412,9 @@ When stripping a file, perhaps with @option{--strip-debug} or which would otherwise get stripped. @item --only-keep-debug -Strip a file, removing any sections that would be stripped by -@option{--strip-debug} and leaving the debugging sections. +Strip a file, removing contents of any sections that would not be +stripped by @option{--strip-debug} and leaving the debugging sections +intact. In ELF files, this preserves all note sections in the output. The intention is that this option will be used in conjunction with @option{--add-gnu-debuglink} to create a two part executable. One a @@ -2384,6 +2449,13 @@ ie the file pointed to by the @option{--add-gnu-debuglink} can be the full executable. It does not have to be a file created by the @option{--only-keep-debug} switch. +Note - this switch is only intended for use on fully linked files. It +does not make sense to use it on object files where the debugging +information may be incomplete. Besides the gnu_debuglink feature +currently only supports the presence of one filename containing +debugging information, not multiple filenames on a one-per-object-file +basis. + @item -V @itemx --version Show the version number for @command{strip}. @@ -2432,7 +2504,7 @@ able to distinguish these similarly named functions C++ and Java encode them into a low-level assembler name which uniquely identifies each different version. This process is known as @dfn{mangling}. The @command{c++filt} -@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on +@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on MS-DOS this program is named @command{CXXFILT}.} program does the inverse mapping: it decodes (@dfn{demangles}) low-level names into user-level names so that they can be read. @@ -2457,7 +2529,7 @@ names from the standard input instead. All the results are printed on the standard output. The difference between reading names from the command line versus reading names from the standard input is that command line arguments are expected to be just mangled names and no -checking is performed to seperate them from surrounding text. Thus +checking is performed to separate them from surrounding text. Thus for example: @smallexample @@ -2571,8 +2643,8 @@ the Info entries for @file{binutils}. @quotation @emph{Warning:} @command{c++filt} is a new utility, and the details of its user interface are subject to change in future releases. In particular, -a command-line option may be required in the the future to decode a name -passed as an argument on the command line; in other words, +a command-line option may be required in the future to decode a name +passed as an argument on the command line; in other words, @example c++filt @var{symbol} @@ -2659,8 +2731,8 @@ Specify that the object-code format for the object files is Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, for more information on demangling. @item -e @var{filename} @@ -2803,6 +2875,168 @@ the Info entries for @file{binutils}. @c man end @end ignore +@node windmc +@chapter windmc + +@command{windmc} may be used to generator Windows message resources. + +@quotation +@emph{Warning:} @command{windmc} is not always built as part of the binary +utilities, since it is only useful for Windows targets. +@end quotation + +@c man title windmc generates Windows message resources. + +@smallexample +@c man begin SYNOPSIS windres +windmc [options] input-file +@c man end +@end smallexample + +@c man begin DESCRIPTION windmc + +@command{windmc} reads message definitions from an input file (.mc) and +translate them into a set of output files. The output files may be of +four kinds: + +@table @code +@item h +A C header file containing the message definitions. + +@item rc +A resource file compilable by the @command{windres} tool. + +@item bin +One or more binary files containing the resource data for a specific +message language. + +@item dbg +A C include file that maps message id's to their symbolic name. +@end table + +The exact description of these different formats is available in +documentation from Microsoft. + +When @command{windmc} converts from the @code{mc} format to the @code{bin} +format, @code{rc}, @code{h}, and optional @code{dbg} it is acting like the +Windows Message Compiler. + +@c man end + +@c man begin OPTIONS windmc + +@table @env +@item -a +@itemx --ascii_in +Specifies that the input file specified is ANSI. This is the default +behaviour. + +@item -A +@itemx --ascii_out +Specifies that messages in the output @code{bin} files should be in ANSI +format. + +@item -b +@itemx --binprefix +Specifies that @code{bin} filenames should have to be prefixed by the +basename of the source file. + +@item -c +@itemx --customflag +Sets the customer bit in all message id's. + +@item -C @var{codepage} +@itemx --codepage_in @var{codepage} +Sets the default codepage to be used to convert input file to UTF16. The +default is ocdepage 1252. + +@item -d +@itemx --decimal_values +Outputs the constants in the header file in decimal. Default is using +hexadecimal output. + +@item -e @var{ext} +@itemx --extension @var{ext} +The extension for the header file. The default is .h extension. + +@item -F @var{target} +@itemx --target @var{target} +Specify the BFD format to use for a bin file as output. This +is a BFD target name; you can use the @option{--help} option to see a list +of supported targets. Normally @command{windmc} will use the default +format, which is the first one listed by the @option{--help} option. +@ifclear man +@ref{Target Selection}. +@end ifclear + +@item -h @var{path} +@itemx --headerdir @var{path} +The target directory of the generated header file. The default is the +current directory. + +@item -H +@itemx --help +Displays a list of command line options and then exits. + +@item -m @var{characters} +@itemx --maxlength @var{characters} +Instructs @command{windmc} to generate a warning if the length +of any message exceeds the number specified. + +@item -n +@itemx --nullterminate +Terminate message text in @code{bin} files by zero. By default they are +terminated by CR/LF. + +@item -o +@itemx --hresult_use +Not yet implemented. Instructs @code{windmc} to generate an OLE2 header +file, using HRESULT definitions. Status codes are used if the flag is not +specified. + +@item -O @var{codepage} +@itemx --codepage_out @var{codepage} +Sets the default codepage to be used to output text files. The default +is ocdepage 1252. + +@item -r @var{path} +@itemx --rcdir @var{path} +The target directory for the generated @code{rc} script and the generated +@code{bin} files that the resource compiler script includes. The default +is the current directory. + +@item -u +@itemx --unicode_in +Specifies that the input file is UTF16. + +@item -U +@itemx --unicode_out +Specifies that messages in the output @code{bin} file should be in UTF16 +format. This is the default behaviour. + +@item -v +@item --verbose +Enable verbose mode. This tells you what the preprocessor is if you +didn't specify one. + +@item -V +@item --version +Prints the version number for @command{windres}. + +@item -x @var{path} +@itemx --xdgb @var{path} +The path of the @code{dbg} C include file that maps message id's to the +symbolic name. No such file is generated without specifying the switch. +@end table + +@c man end + +@ignore +@c man begin SEEALSO windmc +the Info entries for @file{binutils}. +@c man end +@end ignore + @node windres @chapter windres @@ -2885,7 +3119,7 @@ The name of the output file. If this option is not used, then for the input file name, as the output file name. If there is no non-option argument, then @command{windres} will write to standard output. @command{windres} can not write a COFF file to standard output. Note, -for compatability with @command{rc} the option @option{-fo} is also +for compatibility with @command{rc} the option @option{-fo} is also accepted, but its use is not recommended. @item -J @var{format} @@ -2922,7 +3156,7 @@ Specify an include directory to use when reading an @code{rc} file. @command{windres} will pass this to the preprocessor as an @option{-I} option. @command{windres} will also search this directory when looking for files named in the @code{rc} file. If the argument passed to this command -matches any of the supported @var{formats} (as descrived in the @option{-J} +matches any of the supported @var{formats} (as described in the @option{-J} option), it will issue a deprecation warning, and behave just like the @option{-J} option. New programs should not use this behaviour. If a directory happens to match a @var{format}, simple prefix it with @samp{./} @@ -2945,6 +3179,13 @@ Ignored for compatibility with rc. Enable verbose mode. This tells you what the preprocessor is if you didn't specify one. +@item -c @var{val} +@item --codepage @var{val} +Specify the default codepage to use when reading an @code{rc} file. +@var{val} should be a hexadecimal prefixed by @samp{0x} or decimal +codepage code. The valid range is from zero up to 0xffff, but the +validity of the codepage is host and configuration dependent. + @item -l @var{val} @item --language @var{val} Specify the default language to use when reading an @code{rc} file. @@ -2953,8 +3194,8 @@ the language, and the high eight bits are the sublanguage. @item --use-temp-file Use a temporary file to instead of using popen to read the output of -the preprocessor. Use this option if the popen implementation is buggy -on the host (eg., certain non-English language versions of Windows 95 and +the preprocessor. Use this option if the popen implementation is buggy +on the host (eg., certain non-English language versions of Windows 95 and Windows 98 are known to have buggy popen where the output will instead go the console). @@ -3013,7 +3254,7 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] [@option{-b}|@option{--base-file} @var{base-file-name}] [@option{-e}|@option{--output-exp} @var{exports-file-name}] [@option{-z}|@option{--output-def} @var{def-file-name}] - [@option{-l}|@option{--output-lib} @var{library-file-name}] + [@option{-l}|@option{--output-lib} @var{library-file-name}] [@option{--export-all-symbols}] [@option{--no-export-all-symbols}] [@option{--exclude-symbols} @var{list}] [@option{--no-default-excludes}] @@ -3025,7 +3266,7 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] [@option{-p}|@option{--ext-prefix-alias} @var{prefix}] [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}] [@option{-i}|@option{--interwork}] [@option{-n}|@option{--nodelete}] [@option{-t}|@option{--temp-prefix} @var{prefix}] - [@option{-v}|@option{--verbose}] + [@option{-v}|@option{--verbose}] [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] [object-file @dots{}] @c man end @@ -3038,8 +3279,8 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] line. It then processes these inputs and if the @option{-e} option has been specified it creates a exports file. If the @option{-l} option has been specified it creates a library file and if the @option{-z} option -has been specified it creates a def file. Any or all of the @option{-e}, -@option{-l} and @option{-z} options can be present in one invocation of +has been specified it creates a def file. Any or all of the @option{-e}, +@option{-l} and @option{-z} options can be present in one invocation of dlltool. When creating a DLL, along with the source for the DLL, it is necessary @@ -3060,7 +3301,7 @@ section of the object file. This can be done in C by using the asm() operator: @smallexample - asm (".section .drectve"); + asm (".section .drectve"); asm (".ascii \"-export:my_func\""); int my_func (void) @{ @dots{} @} @@ -3070,7 +3311,7 @@ The second file needed for DLL creation is an exports file. This file is linked with the object files that make up the body of the DLL and it handles the interface between the DLL and the outside world. This is a binary file and it can be created by giving the @option{-e} option to -@command{dlltool} when it is creating or reading in a @file{.def} file. +@command{dlltool} when it is creating or reading in a @file{.def} file. The third file needed for DLL creation is the library file that programs will link with in order to access the functions in the DLL. This file @@ -3192,12 +3433,12 @@ contents of the DLL are actually encode using Thumb instructions. Specifies that when @command{dlltool} is creating the exports file it should add a section which allows the exported functions to be referenced without using the import library. Whatever the hell that -means! +means! @item -U @itemx --add-underscore Specifies that when @command{dlltool} is creating the exports file it -should prepend an underscore to the names of @emph{all} exported symbols. +should prepend an underscore to the names of @emph{all} exported symbols. @item --add-stdcall-underscore Specifies that when @command{dlltool} is creating the exports file it @@ -3254,7 +3495,7 @@ file. @itemx --temp-prefix @var{prefix} Makes @command{dlltool} use @var{prefix} when constructing the names of temporary assembler and object files. By default, the temp file prefix -is generated from the pid. +is generated from the pid. @item -v @itemx --verbose @@ -3339,7 +3580,7 @@ The Info pages for @file{binutils}. @smallexample @c man begin SYNOPSIS readelf -readelf [@option{-a}|@option{--all}] +readelf [@option{-a}|@option{--all}] [@option{-h}|@option{--file-header}] [@option{-l}|@option{--program-headers}|@option{--segments}] [@option{-S}|@option{--section-headers}|@option{--sections}] @@ -3384,15 +3625,15 @@ affected. The long and short forms of options, shown here as alternatives, are equivalent. At least one option besides @samp{-v} or @samp{-H} must be -given. +given. @table @env @item -a @itemx --all -Equivalent to specifiying @option{--file-header}, +Equivalent to specifying @option{--file-header}, @option{--program-headers}, @option{--sections}, @option{--symbols}, @option{--relocs}, @option{--dynamic}, @option{--notes} and -@option{--version-info}. +@option{--version-info}. @item -h @itemx --file-header @@ -3564,8 +3805,8 @@ once because some of them can only be configured @dfn{native} (on hosts with the same type as the target system). @menu -* Target Selection:: -* Architecture Selection:: +* Target Selection:: +* Architecture Selection:: @end menu @node Target Selection @@ -3746,8 +3987,10 @@ You can find contact information for many support companies and individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs distribution. +@ifset BUGURL In any event, we also recommend that you send bug reports for the binary -utilities to @samp{bug-binutils@@gnu.org}. +utilities to @value{BUGURL}. +@end ifset The fundamental principle of reporting bugs usefully is this: @strong{report all the facts}. If you are not sure whether to state a @@ -3806,11 +4049,7 @@ and then we might not encounter the bug. @item A complete input file, or set of input files, that will reproduce the bug. If the utility is reading an object file or files, then it is -generally most helpful to send the actual object files, uuencoded if -necessary to get them through the mail system. Note that -@samp{bug-binutils@@gnu.org} is a mailing list, so you should avoid -sending very large files to it. Making the files available for -anonymous FTP is OK. +generally most helpful to send the actual object files. If the source files were produced exclusively using @sc{gnu} programs (e.g., @command{gcc}, @command{gas}, and/or the @sc{gnu} @command{ld}), then it @@ -3830,7 +4069,7 @@ a chance to make a mistake. Even if the problem you experience is a fatal signal, you should still say so explicitly. Suppose something strange is going on, such as your -copy of the utility is out of synch, or you have encountered a bug in +copy of the utility is out of sync, or you have encountered a bug in the C library on your system. (This has happened!) Your copy might crash and ours would not. If you told us to expect a crash, then when ours fails to crash, we would know that the bug was not happening for @@ -3898,10 +4137,9 @@ things without first using the debugger to find the facts. @include fdl.texi -@node Index -@unnumbered Index +@node Binutils Index +@unnumbered Binutils Index @printindex cp -@contents @bye diff --git a/binutils/doc/config.texi b/binutils/doc/config.texi deleted file mode 100644 index c49c43a461bb..000000000000 --- a/binutils/doc/config.texi +++ /dev/null @@ -1,2 +0,0 @@ -@set VERSION 2.17 -@set UPDATED June 2006 diff --git a/binutils/doc/cxxfilt.man b/binutils/doc/cxxfilt.man deleted file mode 100644 index 08e77f18ed9d..000000000000 --- a/binutils/doc/cxxfilt.man +++ /dev/null @@ -1,345 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "C++FILT 1" -.TH C++FILT 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -cxxfilt \- Demangle C++ and Java symbols. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -c++filt [\fB\-_\fR|\fB\-\-strip\-underscores\fR] - [\fB\-n\fR|\fB\-\-no\-strip\-underscores\fR] - [\fB\-p\fR|\fB\-\-no\-params\fR] - [\fB\-t\fR|\fB\-\-types\fR] - [\fB\-i\fR|\fB\-\-no\-verbose\fR] - [\fB\-s\fR \fIformat\fR|\fB\-\-format=\fR\fIformat\fR] - [\fB\-\-help\fR] [\fB\-\-version\fR] [\fIsymbol\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \*(C+ and Java languages provide function overloading, which means -that you can write many functions with the same name, providing that -each function takes parameters of different types. In order to be -able to distinguish these similarly named functions \*(C+ and Java -encode them into a low-level assembler name which uniquely identifies -each different version. This process is known as \fImangling\fR. The -\&\fBc++filt\fR -[1] -program does the inverse mapping: it decodes (\fIdemangles\fR) low-level -names into user-level names so that they can be read. -.PP -Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential mangled name. -If the name decodes into a \*(C+ name, the \*(C+ name replaces the -low-level name in the output, otherwise the original word is output. -In this way you can pass an entire assembler source file, containing -mangled names, through \fBc++filt\fR and see the same source file -containing demangled names. -.PP -You can also use \fBc++filt\fR to decipher individual symbols by -passing them on the command line: -.PP -.Vb 1 -\& c++filt <symbol> -.Ve -.PP -If no \fIsymbol\fR arguments are given, \fBc++filt\fR reads symbol -names from the standard input instead. All the results are printed on -the standard output. The difference between reading names from the -command line versus reading names from the standard input is that -command line arguments are expected to be just mangled names and no -checking is performed to seperate them from surrounding text. Thus -for example: -.PP -.Vb 1 -\& c++filt \-n _Z1fv -.Ve -.PP -will work and demangle the name to \*(L"f()\*(R" whereas: -.PP -.Vb 1 -\& c++filt \-n _Z1fv, -.Ve -.PP -will not work. (Note the extra comma at the end of the mangled -name which makes it invalid). This command however will work: -.PP -.Vb 1 -\& echo _Z1fv, | c++filt \-n -.Ve -.PP -and will display \*(L"f(),\*(R" ie the demangled name followed by a -trailing comma. This behaviour is because when the names are read -from the standard input it is expected that they might be part of an -assembler source file where there might be extra, extraneous -characters trailing after a mangled name. eg: -.PP -.Vb 1 -\& .type _Z1fv, @function -.Ve -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-_\fR" 4 -.IX Item "-_" -.PD 0 -.IP "\fB\-\-strip\-underscores\fR" 4 -.IX Item "--strip-underscores" -.PD -On some systems, both the C and \*(C+ compilers put an underscore in front -of every name. For example, the C name \f(CW\*(C`foo\*(C'\fR gets the low-level -name \f(CW\*(C`_foo\*(C'\fR. This option removes the initial underscore. Whether -\&\fBc++filt\fR removes the underscore by default is target dependent. -.IP "\fB\-j\fR" 4 -.IX Item "-j" -.PD 0 -.IP "\fB\-\-java\fR" 4 -.IX Item "--java" -.PD -Prints demangled names using Java syntax. The default is to use \*(C+ -syntax. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-no\-strip\-underscores\fR" 4 -.IX Item "--no-strip-underscores" -.PD -Do not remove the initial underscore. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-no\-params\fR" 4 -.IX Item "--no-params" -.PD -When demangling the name of a function, do not display the types of -the function's parameters. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-types\fR" 4 -.IX Item "--types" -.PD -Attempt to demangle types as well as function names. This is disabled -by default since mangled types are normally only used internally in -the compiler, and they can be confused with non-mangled names. eg -a function called \*(L"a\*(R" treated as a mangled type name would be -demangled to \*(L"signed char\*(R". -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-no\-verbose\fR" 4 -.IX Item "--no-verbose" -.PD -Do not include implementation details (if any) in the demangled -output. -.IP "\fB\-s\fR \fIformat\fR" 4 -.IX Item "-s format" -.PD 0 -.IP "\fB\-\-format=\fR\fIformat\fR" 4 -.IX Item "--format=format" -.PD -\&\fBc++filt\fR can decode various methods of mangling, used by -different compilers. The argument to this option selects which -method it uses: -.RS 4 -.ie n .IP """auto""" 4 -.el .IP "\f(CWauto\fR" 4 -.IX Item "auto" -Automatic selection based on executable (the default method) -.ie n .IP """gnu""" 4 -.el .IP "\f(CWgnu\fR" 4 -.IX Item "gnu" -the one used by the \s-1GNU\s0 \*(C+ compiler (g++) -.ie n .IP """lucid""" 4 -.el .IP "\f(CWlucid\fR" 4 -.IX Item "lucid" -the one used by the Lucid compiler (lcc) -.ie n .IP """arm""" 4 -.el .IP "\f(CWarm\fR" 4 -.IX Item "arm" -the one specified by the \*(C+ Annotated Reference Manual -.ie n .IP """hp""" 4 -.el .IP "\f(CWhp\fR" 4 -.IX Item "hp" -the one used by the \s-1HP\s0 compiler (aCC) -.ie n .IP """edg""" 4 -.el .IP "\f(CWedg\fR" 4 -.IX Item "edg" -the one used by the \s-1EDG\s0 compiler -.ie n .IP """gnu\-v3""" 4 -.el .IP "\f(CWgnu\-v3\fR" 4 -.IX Item "gnu-v3" -the one used by the \s-1GNU\s0 \*(C+ compiler (g++) with the V3 \s-1ABI\s0. -.ie n .IP """java""" 4 -.el .IP "\f(CWjava\fR" 4 -.IX Item "java" -the one used by the \s-1GNU\s0 Java compiler (gcj) -.ie n .IP """gnat""" 4 -.el .IP "\f(CWgnat\fR" 4 -.IX Item "gnat" -the one used by the \s-1GNU\s0 Ada compiler (\s-1GNAT\s0). -.RE -.RS 4 -.RE -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the options to \fBc++filt\fR and exit. -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -Print the version number of \fBc++filt\fR and exit. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "FOOTNOTES" -.IX Header "FOOTNOTES" -.IP "1." 4 -MS-DOS does not allow \f(CW\*(C`+\*(C'\fR characters in file names, so on -MS-DOS this program is named \fB\s-1CXXFILT\s0\fR. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/dlltool.1 b/binutils/doc/dlltool.1 deleted file mode 100644 index 44c5a4e01ddc..000000000000 --- a/binutils/doc/dlltool.1 +++ /dev/null @@ -1,478 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "DLLTOOL 1" -.TH DLLTOOL 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -dlltool \- Create files needed to build and use DLLs. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -dlltool [\fB\-d\fR|\fB\-\-input\-def\fR \fIdef-file-name\fR] - [\fB\-b\fR|\fB\-\-base\-file\fR \fIbase-file-name\fR] - [\fB\-e\fR|\fB\-\-output\-exp\fR \fIexports-file-name\fR] - [\fB\-z\fR|\fB\-\-output\-def\fR \fIdef-file-name\fR] - [\fB\-l\fR|\fB\-\-output\-lib\fR \fIlibrary-file-name\fR] - [\fB\-\-export\-all\-symbols\fR] [\fB\-\-no\-export\-all\-symbols\fR] - [\fB\-\-exclude\-symbols\fR \fIlist\fR] - [\fB\-\-no\-default\-excludes\fR] - [\fB\-S\fR|\fB\-\-as\fR \fIpath-to-assembler\fR] [\fB\-f\fR|\fB\-\-as\-flags\fR \fIoptions\fR] - [\fB\-D\fR|\fB\-\-dllname\fR \fIname\fR] [\fB\-m\fR|\fB\-\-machine\fR \fImachine\fR] - [\fB\-a\fR|\fB\-\-add\-indirect\fR] - [\fB\-U\fR|\fB\-\-add\-underscore\fR] [\fB\-\-add\-stdcall\-underscore\fR] - [\fB\-k\fR|\fB\-\-kill\-at\fR] [\fB\-A\fR|\fB\-\-add\-stdcall\-alias\fR] - [\fB\-p\fR|\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR] - [\fB\-x\fR|\fB\-\-no\-idata4\fR] [\fB\-c\fR|\fB\-\-no\-idata5\fR] [\fB\-i\fR|\fB\-\-interwork\fR] - [\fB\-n\fR|\fB\-\-nodelete\fR] [\fB\-t\fR|\fB\-\-temp\-prefix\fR \fIprefix\fR] - [\fB\-v\fR|\fB\-\-verbose\fR] - [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - [object\-file ...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBdlltool\fR reads its inputs, which can come from the \fB\-d\fR and -\&\fB\-b\fR options as well as object files specified on the command -line. It then processes these inputs and if the \fB\-e\fR option has -been specified it creates a exports file. If the \fB\-l\fR option -has been specified it creates a library file and if the \fB\-z\fR option -has been specified it creates a def file. Any or all of the \fB\-e\fR, -\&\fB\-l\fR and \fB\-z\fR options can be present in one invocation of -dlltool. -.PP -When creating a \s-1DLL\s0, along with the source for the \s-1DLL\s0, it is necessary -to have three other files. \fBdlltool\fR can help with the creation of -these files. -.PP -The first file is a \fI.def\fR file which specifies which functions are -exported from the \s-1DLL\s0, which functions the \s-1DLL\s0 imports, and so on. This -is a text file and can be created by hand, or \fBdlltool\fR can be used -to create it using the \fB\-z\fR option. In this case \fBdlltool\fR -will scan the object files specified on its command line looking for -those functions which have been specially marked as being exported and -put entries for them in the \fI.def\fR file it creates. -.PP -In order to mark a function as being exported from a \s-1DLL\s0, it needs to -have an \fB\-export:<name_of_function>\fR entry in the \fB.drectve\fR -section of the object file. This can be done in C by using the -\&\fIasm()\fR operator: -.PP -.Vb 2 -\& asm (".section .drectve"); -\& asm (".ascii \e"\-export:my_func\e""); -.Ve -.PP -.Vb 1 -\& int my_func (void) { ... } -.Ve -.PP -The second file needed for \s-1DLL\s0 creation is an exports file. This file -is linked with the object files that make up the body of the \s-1DLL\s0 and it -handles the interface between the \s-1DLL\s0 and the outside world. This is a -binary file and it can be created by giving the \fB\-e\fR option to -\&\fBdlltool\fR when it is creating or reading in a \fI.def\fR file. -.PP -The third file needed for \s-1DLL\s0 creation is the library file that programs -will link with in order to access the functions in the \s-1DLL\s0. This file -can be created by giving the \fB\-l\fR option to dlltool when it -is creating or reading in a \fI.def\fR file. -.PP -\&\fBdlltool\fR builds the library file by hand, but it builds the -exports file by creating temporary files containing assembler statements -and then assembling these. The \fB\-S\fR command line option can be -used to specify the path to the assembler that dlltool will use, -and the \fB\-f\fR option can be used to pass specific flags to that -assembler. The \fB\-n\fR can be used to prevent dlltool from deleting -these temporary assembler files when it is done, and if \fB\-n\fR is -specified twice then this will prevent dlltool from deleting the -temporary object files it used to build the library. -.PP -Here is an example of creating a \s-1DLL\s0 from a source file \fBdll.c\fR and -also creating a program (from an object file called \fBprogram.o\fR) -that uses that \s-1DLL:\s0 -.PP -.Vb 4 -\& gcc \-c dll.c -\& dlltool \-e exports.o \-l dll.lib dll.o -\& gcc dll.o exports.o \-o dll.dll -\& gcc program.o dll.lib \-o program -.Ve -.SH "OPTIONS" -.IX Header "OPTIONS" -The command line options have the following meanings: -.IP "\fB\-d\fR \fIfilename\fR" 4 -.IX Item "-d filename" -.PD 0 -.IP "\fB\-\-input\-def\fR \fIfilename\fR" 4 -.IX Item "--input-def filename" -.PD -Specifies the name of a \fI.def\fR file to be read in and processed. -.IP "\fB\-b\fR \fIfilename\fR" 4 -.IX Item "-b filename" -.PD 0 -.IP "\fB\-\-base\-file\fR \fIfilename\fR" 4 -.IX Item "--base-file filename" -.PD -Specifies the name of a base file to be read in and processed. The -contents of this file will be added to the relocation section in the -exports file generated by dlltool. -.IP "\fB\-e\fR \fIfilename\fR" 4 -.IX Item "-e filename" -.PD 0 -.IP "\fB\-\-output\-exp\fR \fIfilename\fR" 4 -.IX Item "--output-exp filename" -.PD -Specifies the name of the export file to be created by dlltool. -.IP "\fB\-z\fR \fIfilename\fR" 4 -.IX Item "-z filename" -.PD 0 -.IP "\fB\-\-output\-def\fR \fIfilename\fR" 4 -.IX Item "--output-def filename" -.PD -Specifies the name of the \fI.def\fR file to be created by dlltool. -.IP "\fB\-l\fR \fIfilename\fR" 4 -.IX Item "-l filename" -.PD 0 -.IP "\fB\-\-output\-lib\fR \fIfilename\fR" 4 -.IX Item "--output-lib filename" -.PD -Specifies the name of the library file to be created by dlltool. -.IP "\fB\-\-export\-all\-symbols\fR" 4 -.IX Item "--export-all-symbols" -Treat all global and weak defined symbols found in the input object -files as symbols to be exported. There is a small list of symbols which -are not exported by default; see the \fB\-\-no\-default\-excludes\fR -option. You may add to the list of symbols to not export by using the -\&\fB\-\-exclude\-symbols\fR option. -.IP "\fB\-\-no\-export\-all\-symbols\fR" 4 -.IX Item "--no-export-all-symbols" -Only export symbols explicitly listed in an input \fI.def\fR file or in -\&\fB.drectve\fR sections in the input object files. This is the default -behaviour. The \fB.drectve\fR sections are created by \fBdllexport\fR -attributes in the source code. -.IP "\fB\-\-exclude\-symbols\fR \fIlist\fR" 4 -.IX Item "--exclude-symbols list" -Do not export the symbols in \fIlist\fR. This is a list of symbol names -separated by comma or colon characters. The symbol names should not -contain a leading underscore. This is only meaningful when -\&\fB\-\-export\-all\-symbols\fR is used. -.IP "\fB\-\-no\-default\-excludes\fR" 4 -.IX Item "--no-default-excludes" -When \fB\-\-export\-all\-symbols\fR is used, it will by default avoid -exporting certain special symbols. The current list of symbols to avoid -exporting is \fBDllMain@12\fR, \fBDllEntryPoint@0\fR, -\&\fBimpure_ptr\fR. You may use the \fB\-\-no\-default\-excludes\fR option -to go ahead and export these special symbols. This is only meaningful -when \fB\-\-export\-all\-symbols\fR is used. -.IP "\fB\-S\fR \fIpath\fR" 4 -.IX Item "-S path" -.PD 0 -.IP "\fB\-\-as\fR \fIpath\fR" 4 -.IX Item "--as path" -.PD -Specifies the path, including the filename, of the assembler to be used -to create the exports file. -.IP "\fB\-f\fR \fIoptions\fR" 4 -.IX Item "-f options" -.PD 0 -.IP "\fB\-\-as\-flags\fR \fIoptions\fR" 4 -.IX Item "--as-flags options" -.PD -Specifies any specific command line options to be passed to the -assembler when building the exports file. This option will work even if -the \fB\-S\fR option is not used. This option only takes one argument, -and if it occurs more than once on the command line, then later -occurrences will override earlier occurrences. So if it is necessary to -pass multiple options to the assembler they should be enclosed in -double quotes. -.IP "\fB\-D\fR \fIname\fR" 4 -.IX Item "-D name" -.PD 0 -.IP "\fB\-\-dll\-name\fR \fIname\fR" 4 -.IX Item "--dll-name name" -.PD -Specifies the name to be stored in the \fI.def\fR file as the name of -the \s-1DLL\s0 when the \fB\-e\fR option is used. If this option is not -present, then the filename given to the \fB\-e\fR option will be -used as the name of the \s-1DLL\s0. -.IP "\fB\-m\fR \fImachine\fR" 4 -.IX Item "-m machine" -.PD 0 -.IP "\fB\-machine\fR \fImachine\fR" 4 -.IX Item "-machine machine" -.PD -Specifies the type of machine for which the library file should be -built. \fBdlltool\fR has a built in default type, depending upon how -it was created, but this option can be used to override that. This is -normally only useful when creating DLLs for an \s-1ARM\s0 processor, when the -contents of the \s-1DLL\s0 are actually encode using Thumb instructions. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-add\-indirect\fR" 4 -.IX Item "--add-indirect" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should add a section which allows the exported functions to be -referenced without using the import library. Whatever the hell that -means! -.IP "\fB\-U\fR" 4 -.IX Item "-U" -.PD 0 -.IP "\fB\-\-add\-underscore\fR" 4 -.IX Item "--add-underscore" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should prepend an underscore to the names of \fIall\fR exported symbols. -.IP "\fB\-\-add\-stdcall\-underscore\fR" 4 -.IX Item "--add-stdcall-underscore" -Specifies that when \fBdlltool\fR is creating the exports file it -should prepend an underscore to the names of exported \fIstdcall\fR -functions. Variable names and non-stdcall function names are not modified. -This option is useful when creating GNU-compatible import libs for third -party DLLs that were built with MS-Windows tools. -.IP "\fB\-k\fR" 4 -.IX Item "-k" -.PD 0 -.IP "\fB\-\-kill\-at\fR" 4 -.IX Item "--kill-at" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should not append the string \fB@ <number>\fR. These numbers are -called ordinal numbers and they represent another way of accessing the -function in a \s-1DLL\s0, other than by name. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-\-add\-stdcall\-alias\fR" 4 -.IX Item "--add-stdcall-alias" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should add aliases for stdcall symbols without \fB@ <number>\fR -in addition to the symbols with \fB@ <number>\fR. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR" 4 -.IX Item "--ext-prefix-alias prefix" -.PD -Causes \fBdlltool\fR to create external aliases for all \s-1DLL\s0 -imports with the specified prefix. The aliases are created for both -external and import symbols with no leading underscore. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-no\-idata4\fR" 4 -.IX Item "--no-idata4" -.PD -Specifies that when \fBdlltool\fR is creating the exports and library -files it should omit the \f(CW\*(C`.idata4\*(C'\fR section. This is for compatibility -with certain operating systems. -.IP "\fB\-c\fR" 4 -.IX Item "-c" -.PD 0 -.IP "\fB\-\-no\-idata5\fR" 4 -.IX Item "--no-idata5" -.PD -Specifies that when \fBdlltool\fR is creating the exports and library -files it should omit the \f(CW\*(C`.idata5\*(C'\fR section. This is for compatibility -with certain operating systems. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-interwork\fR" 4 -.IX Item "--interwork" -.PD -Specifies that \fBdlltool\fR should mark the objects in the library -file and exports file that it produces as supporting interworking -between \s-1ARM\s0 and Thumb code. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-nodelete\fR" 4 -.IX Item "--nodelete" -.PD -Makes \fBdlltool\fR preserve the temporary assembler files it used to -create the exports file. If this option is repeated then dlltool will -also preserve the temporary object files it uses to create the library -file. -.IP "\fB\-t\fR \fIprefix\fR" 4 -.IX Item "-t prefix" -.PD 0 -.IP "\fB\-\-temp\-prefix\fR \fIprefix\fR" 4 -.IX Item "--temp-prefix prefix" -.PD -Makes \fBdlltool\fR use \fIprefix\fR when constructing the names of -temporary assembler and object files. By default, the temp file prefix -is generated from the pid. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Make dlltool describe what it is doing. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Displays a list of command line options and then exits. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Displays dlltool's version number and then exits. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -The Info pages for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/nlmconv.1 b/binutils/doc/nlmconv.1 deleted file mode 100644 index d8f4d14cae27..000000000000 --- a/binutils/doc/nlmconv.1 +++ /dev/null @@ -1,243 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "NLMCONV 1" -.TH NLMCONV 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -nlmconv \- converts object code into an NLM. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -nlmconv [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-T\fR \fIheaderfile\fR|\fB\-\-header\-file=\fR\fIheaderfile\fR] - [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-l\fR \fIlinker\fR|\fB\-\-linker=\fR\fIlinker\fR] - [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - \fIinfile\fR \fIoutfile\fR -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBnlmconv\fR converts the relocatable \fBi386\fR object file -\&\fIinfile\fR into the NetWare Loadable Module \fIoutfile\fR, optionally -reading \fIheaderfile\fR for \s-1NLM\s0 header information. For instructions -on writing the \s-1NLM\s0 command file language used in header files, see the -\&\fBlinkers\fR section, \fB\s-1NLMLINK\s0\fR in particular, of the \fI\s-1NLM\s0 -Development and Tools Overview\fR, which is part of the \s-1NLM\s0 Software -Developer's Kit (\*(L"\s-1NLM\s0 \s-1SDK\s0\*(R"), available from Novell, Inc. -\&\fBnlmconv\fR uses the \s-1GNU\s0 Binary File Descriptor library to read -\&\fIinfile\fR; -.PP -\&\fBnlmconv\fR can perform a link step. In other words, you can list -more than one object file for input if you list them in the definitions -file (rather than simply specifying one input file on the command line). -In this case, \fBnlmconv\fR calls the linker for you. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Object format of the input file. \fBnlmconv\fR can usually determine -the format of a given file (so no default is necessary). -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Object format of the output file. \fBnlmconv\fR infers the output -format based on the input format, e.g. for a \fBi386\fR input file the -output format is \fBnlm32\-i386\fR. -.IP "\fB\-T\fR \fIheaderfile\fR" 4 -.IX Item "-T headerfile" -.PD 0 -.IP "\fB\-\-header\-file=\fR\fIheaderfile\fR" 4 -.IX Item "--header-file=headerfile" -.PD -Reads \fIheaderfile\fR for \s-1NLM\s0 header information. For instructions on -writing the \s-1NLM\s0 command file language used in header files, see see the -\&\fBlinkers\fR section, of the \fI\s-1NLM\s0 Development and Tools -Overview\fR, which is part of the \s-1NLM\s0 Software Developer's Kit, available -from Novell, Inc. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-debug\fR" 4 -.IX Item "--debug" -.PD -Displays (on standard error) the linker command line used by \fBnlmconv\fR. -.IP "\fB\-l\fR \fIlinker\fR" 4 -.IX Item "-l linker" -.PD 0 -.IP "\fB\-\-linker=\fR\fIlinker\fR" 4 -.IX Item "--linker=linker" -.PD -Use \fIlinker\fR for any linking. \fIlinker\fR can be an absolute or a -relative pathname. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Prints a usage summary. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Prints the version number for \fBnlmconv\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/nm.1 b/binutils/doc/nm.1 deleted file mode 100644 index 9f2271c7cbd4..000000000000 --- a/binutils/doc/nm.1 +++ /dev/null @@ -1,449 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "NM 1" -.TH NM 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -nm \- list symbols from object files -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -nm [\fB\-a\fR|\fB\-\-debug\-syms\fR] [\fB\-g\fR|\fB\-\-extern\-only\fR] - [\fB\-B\fR] [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] [\fB\-D\fR|\fB\-\-dynamic\fR] - [\fB\-S\fR|\fB\-\-print\-size\fR] [\fB\-s\fR|\fB\-\-print\-armap\fR] - [\fB\-A\fR|\fB\-o\fR|\fB\-\-print\-file\-name\fR][\fB\-\-special\-syms\fR] - [\fB\-n\fR|\fB\-v\fR|\fB\-\-numeric\-sort\fR] [\fB\-p\fR|\fB\-\-no\-sort\fR] - [\fB\-r\fR|\fB\-\-reverse\-sort\fR] [\fB\-\-size\-sort\fR] [\fB\-u\fR|\fB\-\-undefined\-only\fR] - [\fB\-t\fR \fIradix\fR|\fB\-\-radix=\fR\fIradix\fR] [\fB\-P\fR|\fB\-\-portability\fR] - [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-f\fR\fIformat\fR|\fB\-\-format=\fR\fIformat\fR] - [\fB\-\-defined\-only\fR] [\fB\-l\fR|\fB\-\-line\-numbers\fR] [\fB\-\-no\-demangle\fR] - [\fB\-V\fR|\fB\-\-version\fR] [\fB\-X 32_64\fR] [\fB\-\-help\fR] [\fIobjfile\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\s-1GNU\s0 \fBnm\fR lists the symbols from object files \fIobjfile\fR.... -If no object files are listed as arguments, \fBnm\fR assumes the file -\&\fIa.out\fR. -.PP -For each symbol, \fBnm\fR shows: -.IP "\(bu" 4 -The symbol value, in the radix selected by options (see below), or -hexadecimal by default. -.IP "\(bu" 4 -The symbol type. At least the following types are used; others are, as -well, depending on the object file format. If lowercase, the symbol is -local; if uppercase, the symbol is global (external). -.RS 4 -.ie n .IP """A""" 4 -.el .IP "\f(CWA\fR" 4 -.IX Item "A" -The symbol's value is absolute, and will not be changed by further -linking. -.ie n .IP """B""" 4 -.el .IP "\f(CWB\fR" 4 -.IX Item "B" -The symbol is in the uninitialized data section (known as \s-1BSS\s0). -.ie n .IP """C""" 4 -.el .IP "\f(CWC\fR" 4 -.IX Item "C" -The symbol is common. Common symbols are uninitialized data. When -linking, multiple common symbols may appear with the same name. If the -symbol is defined anywhere, the common symbols are treated as undefined -references. -.ie n .IP """D""" 4 -.el .IP "\f(CWD\fR" 4 -.IX Item "D" -The symbol is in the initialized data section. -.ie n .IP """G""" 4 -.el .IP "\f(CWG\fR" 4 -.IX Item "G" -The symbol is in an initialized data section for small objects. Some -object file formats permit more efficient access to small data objects, -such as a global int variable as opposed to a large global array. -.ie n .IP """I""" 4 -.el .IP "\f(CWI\fR" 4 -.IX Item "I" -The symbol is an indirect reference to another symbol. This is a \s-1GNU\s0 -extension to the a.out object file format which is rarely used. -.ie n .IP """N""" 4 -.el .IP "\f(CWN\fR" 4 -.IX Item "N" -The symbol is a debugging symbol. -.ie n .IP """R""" 4 -.el .IP "\f(CWR\fR" 4 -.IX Item "R" -The symbol is in a read only data section. -.ie n .IP """S""" 4 -.el .IP "\f(CWS\fR" 4 -.IX Item "S" -The symbol is in an uninitialized data section for small objects. -.ie n .IP """T""" 4 -.el .IP "\f(CWT\fR" 4 -.IX Item "T" -The symbol is in the text (code) section. -.ie n .IP """U""" 4 -.el .IP "\f(CWU\fR" 4 -.IX Item "U" -The symbol is undefined. -.ie n .IP """V""" 4 -.el .IP "\f(CWV\fR" 4 -.IX Item "V" -The symbol is a weak object. When a weak defined symbol is linked with -a normal defined symbol, the normal defined symbol is used with no error. -When a weak undefined symbol is linked and the symbol is not defined, -the value of the weak symbol becomes zero with no error. -.ie n .IP """W""" 4 -.el .IP "\f(CWW\fR" 4 -.IX Item "W" -The symbol is a weak symbol that has not been specifically tagged as a -weak object symbol. When a weak defined symbol is linked with a normal -defined symbol, the normal defined symbol is used with no error. -When a weak undefined symbol is linked and the symbol is not defined, -the value of the symbol is determined in a system-specific manner without -error. On some systems, uppercase indicates that a default value has been -specified. -.ie n .IP """\-""" 4 -.el .IP "\f(CW\-\fR" 4 -.IX Item "-" -The symbol is a stabs symbol in an a.out object file. In this case, the -next values printed are the stabs other field, the stabs desc field, and -the stab type. Stabs symbols are used to hold debugging information. -.ie n .IP """?""" 4 -.el .IP "\f(CW?\fR" 4 -.IX Item "?" -The symbol type is unknown, or object file format specific. -.RE -.RS 4 -.RE -.IP "\(bu" 4 -The symbol name. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-o\fR" 4 -.IX Item "-o" -.IP "\fB\-\-print\-file\-name\fR" 4 -.IX Item "--print-file-name" -.PD -Precede each symbol by the name of the input file (or archive member) -in which it was found, rather than identifying the input file once only, -before all of its symbols. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-debug\-syms\fR" 4 -.IX Item "--debug-syms" -.PD -Display all symbols, even debugger-only symbols; normally these are not -listed. -.IP "\fB\-B\fR" 4 -.IX Item "-B" -The same as \fB\-\-format=bsd\fR (for compatibility with the \s-1MIPS\s0 \fBnm\fR). -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes \*(C+ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. -.IP "\fB\-\-no\-demangle\fR" 4 -.IX Item "--no-demangle" -Do not demangle low-level symbol names. This is the default. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-dynamic\fR" 4 -.IX Item "--dynamic" -.PD -Display the dynamic symbols rather than the normal symbols. This is -only meaningful for dynamic objects, such as certain types of shared -libraries. -.IP "\fB\-f\fR \fIformat\fR" 4 -.IX Item "-f format" -.PD 0 -.IP "\fB\-\-format=\fR\fIformat\fR" 4 -.IX Item "--format=format" -.PD -Use the output format \fIformat\fR, which can be \f(CW\*(C`bsd\*(C'\fR, -\&\f(CW\*(C`sysv\*(C'\fR, or \f(CW\*(C`posix\*(C'\fR. The default is \f(CW\*(C`bsd\*(C'\fR. -Only the first character of \fIformat\fR is significant; it can be -either upper or lower case. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-extern\-only\fR" 4 -.IX Item "--extern-only" -.PD -Display only external symbols. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-line\-numbers\fR" 4 -.IX Item "--line-numbers" -.PD -For each symbol, use debugging information to try to find a filename and -line number. For a defined symbol, look for the line number of the -address of the symbol. For an undefined symbol, look for the line -number of a relocation entry which refers to the symbol. If line number -information can be found, print it after the other symbol information. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.IP "\fB\-\-numeric\-sort\fR" 4 -.IX Item "--numeric-sort" -.PD -Sort symbols numerically by their addresses, rather than alphabetically -by their names. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-no\-sort\fR" 4 -.IX Item "--no-sort" -.PD -Do not bother to sort the symbols in any order; print them in the order -encountered. -.IP "\fB\-P\fR" 4 -.IX Item "-P" -.PD 0 -.IP "\fB\-\-portability\fR" 4 -.IX Item "--portability" -.PD -Use the \s-1POSIX\s0.2 standard output format instead of the default format. -Equivalent to \fB\-f posix\fR. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-print\-size\fR" 4 -.IX Item "--print-size" -.PD -Print size, not the value, of defined symbols for the \f(CW\*(C`bsd\*(C'\fR output format. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-print\-armap\fR" 4 -.IX Item "--print-armap" -.PD -When listing symbols from archive members, include the index: a mapping -(stored in the archive by \fBar\fR or \fBranlib\fR) of which modules -contain definitions for which names. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-reverse\-sort\fR" 4 -.IX Item "--reverse-sort" -.PD -Reverse the order of the sort (whether numeric or alphabetic); let the -last come first. -.IP "\fB\-\-size\-sort\fR" 4 -.IX Item "--size-sort" -Sort symbols by size. The size is computed as the difference between -the value of the symbol and the value of the symbol with the next higher -value. If the \f(CW\*(C`bsd\*(C'\fR output format is used the size of the symbol -is printed, rather than the value, and \fB\-S\fR must be used in order -both size and value to be printed. -.IP "\fB\-\-special\-syms\fR" 4 -.IX Item "--special-syms" -Display symbols which have a target-specific special meaning. These -symbols are usually used by the target for some special processing and -are not normally helpful when included included in the normal symbol -lists. For example for \s-1ARM\s0 targets this option would skip the mapping -symbols used to mark transistions between \s-1ARM\s0 code, \s-1THUMB\s0 code and -data. -.IP "\fB\-t\fR \fIradix\fR" 4 -.IX Item "-t radix" -.PD 0 -.IP "\fB\-\-radix=\fR\fIradix\fR" 4 -.IX Item "--radix=radix" -.PD -Use \fIradix\fR as the radix for printing the symbol values. It must be -\&\fBd\fR for decimal, \fBo\fR for octal, or \fBx\fR for hexadecimal. -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -Specify an object code format other than your system's default format. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-undefined\-only\fR" 4 -.IX Item "--undefined-only" -.PD -Display only undefined symbols (those external to each object file). -.IP "\fB\-\-defined\-only\fR" 4 -.IX Item "--defined-only" -Display only defined symbols for each object file. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBnm\fR and exit. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -This option is ignored for compatibility with the \s-1AIX\s0 version of -\&\fBnm\fR. It takes one parameter which must be the string -\&\fB32_64\fR. The default mode of \s-1AIX\s0 \fBnm\fR corresponds -to \fB\-X 32\fR, which is not supported by \s-1GNU\s0 \fBnm\fR. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of the options to \fBnm\fR and exit. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/objcopy.1 b/binutils/doc/objcopy.1 deleted file mode 100644 index 828cddef56ec..000000000000 --- a/binutils/doc/objcopy.1 +++ /dev/null @@ -1,795 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "OBJCOPY 1" -.TH OBJCOPY 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -objcopy \- copy and translate object files -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-B\fR \fIbfdarch\fR|\fB\-\-binary\-architecture=\fR\fIbfdarch\fR] - [\fB\-S\fR|\fB\-\-strip\-all\fR] - [\fB\-g\fR|\fB\-\-strip\-debug\fR] - [\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] - [\fB\-N\fR \fIsymbolname\fR|\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] - [\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR] - [\fB\-G\fR \fIsymbolname\fR|\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR] - [\fB\-L\fR \fIsymbolname\fR|\fB\-\-localize\-symbol=\fR\fIsymbolname\fR] - [\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR] - [\fB\-W\fR \fIsymbolname\fR|\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR] - [\fB\-w\fR|\fB\-\-wildcard\fR] - [\fB\-x\fR|\fB\-\-discard\-all\fR] - [\fB\-X\fR|\fB\-\-discard\-locals\fR] - [\fB\-b\fR \fIbyte\fR|\fB\-\-byte=\fR\fIbyte\fR] - [\fB\-i\fR \fIinterleave\fR|\fB\-\-interleave=\fR\fIinterleave\fR] - [\fB\-j\fR \fIsectionname\fR|\fB\-\-only\-section=\fR\fIsectionname\fR] - [\fB\-R\fR \fIsectionname\fR|\fB\-\-remove\-section=\fR\fIsectionname\fR] - [\fB\-p\fR|\fB\-\-preserve\-dates\fR] - [\fB\-\-debugging\fR] - [\fB\-\-gap\-fill=\fR\fIval\fR] - [\fB\-\-pad\-to=\fR\fIaddress\fR] - [\fB\-\-set\-start=\fR\fIval\fR] - [\fB\-\-adjust\-start=\fR\fIincr\fR] - [\fB\-\-change\-addresses=\fR\fIincr\fR] - [\fB\-\-change\-section\-address\fR \fIsection\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-section\-lma\fR \fIsection\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-section\-vma\fR \fIsection\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-warnings\fR] [\fB\-\-no\-change\-warnings\fR] - [\fB\-\-set\-section\-flags\fR \fIsection\fR=\fIflags\fR] - [\fB\-\-add\-section\fR \fIsectionname\fR=\fIfilename\fR] - [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR[,\fIflags\fR]] - [\fB\-\-change\-leading\-char\fR] [\fB\-\-remove\-leading\-char\fR] - [\fB\-\-srec\-len=\fR\fIival\fR] [\fB\-\-srec\-forceS3\fR] - [\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR] - [\fB\-\-redefine\-syms=\fR\fIfilename\fR] - [\fB\-\-weaken\fR] - [\fB\-\-keep\-symbols=\fR\fIfilename\fR] - [\fB\-\-strip\-symbols=\fR\fIfilename\fR] - [\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR] - [\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR] - [\fB\-\-localize\-symbols=\fR\fIfilename\fR] - [\fB\-\-globalize\-symbols=\fR\fIfilename\fR] - [\fB\-\-weaken\-symbols=\fR\fIfilename\fR] - [\fB\-\-alt\-machine\-code=\fR\fIindex\fR] - [\fB\-\-prefix\-symbols=\fR\fIstring\fR] - [\fB\-\-prefix\-sections=\fR\fIstring\fR] - [\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR] - [\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR] - [\fB\-\-keep\-file\-symbols\fR] - [\fB\-\-only\-keep\-debug\fR] - [\fB\-\-writable\-text\fR] - [\fB\-\-readonly\-text\fR] - [\fB\-\-pure\fR] - [\fB\-\-impure\fR] - [\fB\-v\fR|\fB\-\-verbose\fR] - [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-\-help\fR] [\fB\-\-info\fR] - \fIinfile\fR [\fIoutfile\fR] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBobjcopy\fR utility copies the contents of an object -file to another. \fBobjcopy\fR uses the \s-1GNU\s0 \s-1BFD\s0 Library to -read and write the object files. It can write the destination object -file in a format different from that of the source object file. The -exact behavior of \fBobjcopy\fR is controlled by command-line options. -Note that \fBobjcopy\fR should be able to copy a fully linked file -between any two formats. However, copying a relocatable object file -between any two formats may not work as expected. -.PP -\&\fBobjcopy\fR creates temporary files to do its translations and -deletes them afterward. \fBobjcopy\fR uses \s-1BFD\s0 to do all its -translation work; it has access to all the formats described in \s-1BFD\s0 -and thus is able to recognize most formats without being told -explicitly. -.PP -\&\fBobjcopy\fR can be used to generate S\-records by using an output -target of \fBsrec\fR (e.g., use \fB\-O srec\fR). -.PP -\&\fBobjcopy\fR can be used to generate a raw binary file by using an -output target of \fBbinary\fR (e.g., use \fB\-O binary\fR). When -\&\fBobjcopy\fR generates a raw binary file, it will essentially produce -a memory dump of the contents of the input object file. All symbols and -relocation information will be discarded. The memory dump will start at -the load address of the lowest section copied into the output file. -.PP -When generating an S\-record or a raw binary file, it may be helpful to -use \fB\-S\fR to remove sections containing debugging information. In -some cases \fB\-R\fR will be useful to remove sections which contain -information that is not needed by the binary file. -.PP -Note\-\-\-\fBobjcopy\fR is not able to change the endianness of its input -files. If the input format has an endianness (some formats do not), -\&\fBobjcopy\fR can only copy the inputs into file formats that have the -same endianness or which have no endianness (e.g., \fBsrec\fR). -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fIinfile\fR" 4 -.IX Item "infile" -.PD 0 -.IP "\fIoutfile\fR" 4 -.IX Item "outfile" -.PD -The input and output files, respectively. -If you do not specify \fIoutfile\fR, \fBobjcopy\fR creates a -temporary file and destructively renames the result with -the name of \fIinfile\fR. -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Consider the source file's object format to be \fIbfdname\fR, rather than -attempting to deduce it. -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Write the output file using the object format \fIbfdname\fR. -.IP "\fB\-F\fR \fIbfdname\fR" 4 -.IX Item "-F bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Use \fIbfdname\fR as the object format for both the input and the output -file; i.e., simply transfer data from source to destination with no -translation. -.IP "\fB\-B\fR \fIbfdarch\fR" 4 -.IX Item "-B bfdarch" -.PD 0 -.IP "\fB\-\-binary\-architecture=\fR\fIbfdarch\fR" 4 -.IX Item "--binary-architecture=bfdarch" -.PD -Useful when transforming a raw binary input file into an object file. -In this case the output architecture can be set to \fIbfdarch\fR. This -option will be ignored if the input file has a known \fIbfdarch\fR. You -can access this binary data inside a program by referencing the special -symbols that are created by the conversion process. These symbols are -called _binary_\fIobjfile\fR_start, _binary_\fIobjfile\fR_end and -_binary_\fIobjfile\fR_size. e.g. you can transform a picture file into -an object file and then access it in your code using these symbols. -.IP "\fB\-j\fR \fIsectionname\fR" 4 -.IX Item "-j sectionname" -.PD 0 -.IP "\fB\-\-only\-section=\fR\fIsectionname\fR" 4 -.IX Item "--only-section=sectionname" -.PD -Copy only the named section from the input file to the output file. -This option may be given more than once. Note that using this option -inappropriately may make the output file unusable. -.IP "\fB\-R\fR \fIsectionname\fR" 4 -.IX Item "-R sectionname" -.PD 0 -.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4 -.IX Item "--remove-section=sectionname" -.PD -Remove any section named \fIsectionname\fR from the output file. This -option may be given more than once. Note that using this option -inappropriately may make the output file unusable. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-strip\-all\fR" 4 -.IX Item "--strip-all" -.PD -Do not copy relocation and symbol information from the source file. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-strip\-debug\fR" 4 -.IX Item "--strip-debug" -.PD -Do not copy debugging symbols or sections from the source file. -.IP "\fB\-\-strip\-unneeded\fR" 4 -.IX Item "--strip-unneeded" -Strip all symbols that are not needed for relocation processing. -.IP "\fB\-K\fR \fIsymbolname\fR" 4 -.IX Item "-K symbolname" -.PD 0 -.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-symbol=symbolname" -.PD -When stripping symbols, keep symbol \fIsymbolname\fR even if it would -normally be stripped. This option may be given more than once. -.IP "\fB\-N\fR \fIsymbolname\fR" 4 -.IX Item "-N symbolname" -.PD 0 -.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-symbol=symbolname" -.PD -Do not copy symbol \fIsymbolname\fR from the source file. This option -may be given more than once. -.IP "\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-unneeded-symbol=symbolname" -Do not copy symbol \fIsymbolname\fR from the source file unless it is needed -by a relocation. This option may be given more than once. -.IP "\fB\-G\fR \fIsymbolname\fR" 4 -.IX Item "-G symbolname" -.PD 0 -.IP "\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-global-symbol=symbolname" -.PD -Keep only symbol \fIsymbolname\fR global. Make all other symbols local -to the file, so that they are not visible externally. This option may -be given more than once. -.IP "\fB\-L\fR \fIsymbolname\fR" 4 -.IX Item "-L symbolname" -.PD 0 -.IP "\fB\-\-localize\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--localize-symbol=symbolname" -.PD -Make symbol \fIsymbolname\fR local to the file, so that it is not -visible externally. This option may be given more than once. -.IP "\fB\-W\fR \fIsymbolname\fR" 4 -.IX Item "-W symbolname" -.PD 0 -.IP "\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--weaken-symbol=symbolname" -.PD -Make symbol \fIsymbolname\fR weak. This option may be given more than once. -.IP "\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--globalize-symbol=symbolname" -Give symbol \fIsymbolname\fR global scoping so that it is visible -outside of the file in which it is defined. This option may be given -more than once. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wildcard\fR" 4 -.IX Item "--wildcard" -.PD -Permit regular expressions in \fIsymbolname\fRs used in other command -line options. The question mark (?), asterisk (*), backslash (\e) and -square brackets ([]) operators can be used anywhere in the symbol -name. If the first character of the symbol name is the exclamation -point (!) then the sense of the switch is reversed for that symbol. -For example: -.Sp -.Vb 1 -\& \-w \-W !foo \-W fo* -.Ve -.Sp -would cause objcopy to weaken all symbols that start with \*(L"fo\*(R" -except for the symbol \*(L"foo\*(R". -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-discard\-all\fR" 4 -.IX Item "--discard-all" -.PD -Do not copy non-global symbols from the source file. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -.PD 0 -.IP "\fB\-\-discard\-locals\fR" 4 -.IX Item "--discard-locals" -.PD -Do not copy compiler-generated local symbols. -(These usually start with \fBL\fR or \fB.\fR.) -.IP "\fB\-b\fR \fIbyte\fR" 4 -.IX Item "-b byte" -.PD 0 -.IP "\fB\-\-byte=\fR\fIbyte\fR" 4 -.IX Item "--byte=byte" -.PD -Keep only every \fIbyte\fRth byte of the input file (header data is not -affected). \fIbyte\fR can be in the range from 0 to \fIinterleave\fR\-1, -where \fIinterleave\fR is given by the \fB\-i\fR or \fB\-\-interleave\fR -option, or the default of 4. This option is useful for creating files -to program \s-1ROM\s0. It is typically used with an \f(CW\*(C`srec\*(C'\fR output -target. -.IP "\fB\-i\fR \fIinterleave\fR" 4 -.IX Item "-i interleave" -.PD 0 -.IP "\fB\-\-interleave=\fR\fIinterleave\fR" 4 -.IX Item "--interleave=interleave" -.PD -Only copy one out of every \fIinterleave\fR bytes. Select which byte to -copy with the \fB\-b\fR or \fB\-\-byte\fR option. The default is 4. -\&\fBobjcopy\fR ignores this option if you do not specify either \fB\-b\fR or -\&\fB\-\-byte\fR. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-preserve\-dates\fR" 4 -.IX Item "--preserve-dates" -.PD -Set the access and modification dates of the output file to be the same -as those of the input file. -.IP "\fB\-\-debugging\fR" 4 -.IX Item "--debugging" -Convert debugging information, if possible. This is not the default -because only certain debugging formats are supported, and the -conversion process can be time consuming. -.IP "\fB\-\-gap\-fill\fR \fIval\fR" 4 -.IX Item "--gap-fill val" -Fill gaps between sections with \fIval\fR. This operation applies to -the \fIload address\fR (\s-1LMA\s0) of the sections. It is done by increasing -the size of the section with the lower address, and filling in the extra -space created with \fIval\fR. -.IP "\fB\-\-pad\-to\fR \fIaddress\fR" 4 -.IX Item "--pad-to address" -Pad the output file up to the load address \fIaddress\fR. This is -done by increasing the size of the last section. The extra space is -filled in with the value specified by \fB\-\-gap\-fill\fR (default zero). -.IP "\fB\-\-set\-start\fR \fIval\fR" 4 -.IX Item "--set-start val" -Set the start address of the new file to \fIval\fR. Not all object file -formats support setting the start address. -.IP "\fB\-\-change\-start\fR \fIincr\fR" 4 -.IX Item "--change-start incr" -.PD 0 -.IP "\fB\-\-adjust\-start\fR \fIincr\fR" 4 -.IX Item "--adjust-start incr" -.PD -Change the start address by adding \fIincr\fR. Not all object file -formats support setting the start address. -.IP "\fB\-\-change\-addresses\fR \fIincr\fR" 4 -.IX Item "--change-addresses incr" -.PD 0 -.IP "\fB\-\-adjust\-vma\fR \fIincr\fR" 4 -.IX Item "--adjust-vma incr" -.PD -Change the \s-1VMA\s0 and \s-1LMA\s0 addresses of all sections, as well as the start -address, by adding \fIincr\fR. Some object file formats do not permit -section addresses to be changed arbitrarily. Note that this does not -relocate the sections; if the program expects sections to be loaded at a -certain address, and this option is used to change the sections such -that they are loaded at a different address, the program may fail. -.IP "\fB\-\-change\-section\-address\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-address section{=,+,-}val" -.PD 0 -.IP "\fB\-\-adjust\-section\-vma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--adjust-section-vma section{=,+,-}val" -.PD -Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of the named -\&\fIsection\fR. If \fB=\fR is used, the section address is set to -\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the -section address. See the comments under \fB\-\-change\-addresses\fR, -above. If \fIsection\fR does not exist in the input file, a warning will -be issued, unless \fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-section\-lma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-lma section{=,+,-}val" -Set or change the \s-1LMA\s0 address of the named \fIsection\fR. The \s-1LMA\s0 -address is the address where the section will be loaded into memory at -program load time. Normally this is the same as the \s-1VMA\s0 address, which -is the address of the section at program run time, but on some systems, -especially those where a program is held in \s-1ROM\s0, the two can be -different. If \fB=\fR is used, the section address is set to -\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the -section address. See the comments under \fB\-\-change\-addresses\fR, -above. If \fIsection\fR does not exist in the input file, a warning -will be issued, unless \fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-section\-vma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-vma section{=,+,-}val" -Set or change the \s-1VMA\s0 address of the named \fIsection\fR. The \s-1VMA\s0 -address is the address where the section will be located once the -program has started executing. Normally this is the same as the \s-1LMA\s0 -address, which is the address where the section will be loaded into -memory, but on some systems, especially those where a program is held in -\&\s-1ROM\s0, the two can be different. If \fB=\fR is used, the section address -is set to \fIval\fR. Otherwise, \fIval\fR is added to or subtracted -from the section address. See the comments under -\&\fB\-\-change\-addresses\fR, above. If \fIsection\fR does not exist in -the input file, a warning will be issued, unless -\&\fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-warnings\fR" 4 -.IX Item "--change-warnings" -.PD 0 -.IP "\fB\-\-adjust\-warnings\fR" 4 -.IX Item "--adjust-warnings" -.PD -If \fB\-\-change\-section\-address\fR or \fB\-\-change\-section\-lma\fR or -\&\fB\-\-change\-section\-vma\fR is used, and the named section does not -exist, issue a warning. This is the default. -.IP "\fB\-\-no\-change\-warnings\fR" 4 -.IX Item "--no-change-warnings" -.PD 0 -.IP "\fB\-\-no\-adjust\-warnings\fR" 4 -.IX Item "--no-adjust-warnings" -.PD -Do not issue a warning if \fB\-\-change\-section\-address\fR or -\&\fB\-\-adjust\-section\-lma\fR or \fB\-\-adjust\-section\-vma\fR is used, even -if the named section does not exist. -.IP "\fB\-\-set\-section\-flags\fR \fIsection\fR\fB=\fR\fIflags\fR" 4 -.IX Item "--set-section-flags section=flags" -Set the flags for the named section. The \fIflags\fR argument is a -comma separated string of flag names. The recognized names are -\&\fBalloc\fR, \fBcontents\fR, \fBload\fR, \fBnoload\fR, -\&\fBreadonly\fR, \fBcode\fR, \fBdata\fR, \fBrom\fR, \fBshare\fR, and -\&\fBdebug\fR. You can set the \fBcontents\fR flag for a section which -does not have contents, but it is not meaningful to clear the -\&\fBcontents\fR flag of a section which does have contents\*(--just remove -the section instead. Not all flags are meaningful for all object file -formats. -.IP "\fB\-\-add\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4 -.IX Item "--add-section sectionname=filename" -Add a new section named \fIsectionname\fR while copying the file. The -contents of the new section are taken from the file \fIfilename\fR. The -size of the section will be the size of the file. This option only -works on file formats which can support sections with arbitrary names. -.IP "\fB\-\-rename\-section\fR \fIoldname\fR\fB=\fR\fInewname\fR\fB[,\fR\fIflags\fR\fB]\fR" 4 -.IX Item "--rename-section oldname=newname[,flags]" -Rename a section from \fIoldname\fR to \fInewname\fR, optionally -changing the section's flags to \fIflags\fR in the process. This has -the advantage over usng a linker script to perform the rename in that -the output stays as an object file and does not become a linked -executable. -.Sp -This option is particularly helpful when the input format is binary, -since this will always create a section called .data. If for example, -you wanted instead to create a section called .rodata containing binary -data you could use the following command line to achieve it: -.Sp -.Vb 3 -\& objcopy \-I binary \-O <output_format> \-B <architecture> \e -\& \-\-rename\-section .data=.rodata,alloc,load,readonly,data,contents \e -\& <input_binary_file> <output_object_file> -.Ve -.IP "\fB\-\-change\-leading\-char\fR" 4 -.IX Item "--change-leading-char" -Some object file formats use special characters at the start of -symbols. The most common such character is underscore, which compilers -often add before every symbol. This option tells \fBobjcopy\fR to -change the leading character of every symbol when it converts between -object file formats. If the object file formats use the same leading -character, this option has no effect. Otherwise, it will add a -character, or remove a character, or change a character, as -appropriate. -.IP "\fB\-\-remove\-leading\-char\fR" 4 -.IX Item "--remove-leading-char" -If the first character of a global symbol is a special symbol leading -character used by the object file format, remove the character. The -most common symbol leading character is underscore. This option will -remove a leading underscore from all global symbols. This can be useful -if you want to link together objects of different file formats with -different conventions for symbol names. This is different from -\&\fB\-\-change\-leading\-char\fR because it always changes the symbol name -when appropriate, regardless of the object file format of the output -file. -.IP "\fB\-\-srec\-len=\fR\fIival\fR" 4 -.IX Item "--srec-len=ival" -Meaningful only for srec output. Set the maximum length of the Srecords -being produced to \fIival\fR. This length covers both address, data and -crc fields. -.IP "\fB\-\-srec\-forceS3\fR" 4 -.IX Item "--srec-forceS3" -Meaningful only for srec output. Avoid generation of S1/S2 records, -creating S3\-only record format. -.IP "\fB\-\-redefine\-sym\fR \fIold\fR\fB=\fR\fInew\fR" 4 -.IX Item "--redefine-sym old=new" -Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful -when one is trying link two things together for which you have no -source, and there are name collisions. -.IP "\fB\-\-redefine\-syms=\fR\fIfilename\fR" 4 -.IX Item "--redefine-syms=filename" -Apply \fB\-\-redefine\-sym\fR to each symbol pair "\fIold\fR \fInew\fR" -listed in the file \fIfilename\fR. \fIfilename\fR is simply a flat file, -with one symbol pair per line. Line comments may be introduced by the hash -character. This option may be given more than once. -.IP "\fB\-\-weaken\fR" 4 -.IX Item "--weaken" -Change all global symbols in the file to be weak. This can be useful -when building an object which will be linked against other objects using -the \fB\-R\fR option to the linker. This option is only effective when -using an object file format which supports weak symbols. -.IP "\fB\-\-keep\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--keep-symbols=filename" -Apply \fB\-\-keep\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-strip\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--strip-symbols=filename" -Apply \fB\-\-strip\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--strip-unneeded-symbols=filename" -Apply \fB\-\-strip\-unneeded\-symbol\fR option to each symbol listed in -the file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one -symbol name per line. Line comments may be introduced by the hash -character. This option may be given more than once. -.IP "\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--keep-global-symbols=filename" -Apply \fB\-\-keep\-global\-symbol\fR option to each symbol listed in the -file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one -symbol name per line. Line comments may be introduced by the hash -character. This option may be given more than once. -.IP "\fB\-\-localize\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--localize-symbols=filename" -Apply \fB\-\-localize\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-globalize\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--globalize-symbols=filename" -Apply \fB\-\-globalize\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-weaken\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--weaken-symbols=filename" -Apply \fB\-\-weaken\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-alt\-machine\-code=\fR\fIindex\fR" 4 -.IX Item "--alt-machine-code=index" -If the output architecture has alternate machine codes, use the -\&\fIindex\fRth code instead of the default one. This is useful in case -a machine is assigned an official code and the tool-chain adopts the -new code, but other applications still depend on the original code -being used. For \s-1ELF\s0 based architectures if the \fIindex\fR -alternative does not exist then the value is treated as an absolute -number to be stored in the e_machine field of the \s-1ELF\s0 header. -.IP "\fB\-\-writable\-text\fR" 4 -.IX Item "--writable-text" -Mark the output text as writable. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-readonly\-text\fR" 4 -.IX Item "--readonly-text" -Make the output text write protected. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-pure\fR" 4 -.IX Item "--pure" -Mark the output file as demand paged. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-impure\fR" 4 -.IX Item "--impure" -Mark the output file as impure. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-prefix\-symbols=\fR\fIstring\fR" 4 -.IX Item "--prefix-symbols=string" -Prefix all symbols in the output file with \fIstring\fR. -.IP "\fB\-\-prefix\-sections=\fR\fIstring\fR" 4 -.IX Item "--prefix-sections=string" -Prefix all section names in the output file with \fIstring\fR. -.IP "\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR" 4 -.IX Item "--prefix-alloc-sections=string" -Prefix all the names of all allocated sections in the output file with -\&\fIstring\fR. -.IP "\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR" 4 -.IX Item "--add-gnu-debuglink=path-to-file" -Creates a .gnu_debuglink section which contains a reference to \fIpath-to-file\fR -and adds it to the output file. -.IP "\fB\-\-keep\-file\-symbols\fR" 4 -.IX Item "--keep-file-symbols" -When stripping a file, perhaps with \fB\-\-strip\-debug\fR or -\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names, -which would otherwise get stripped. -.IP "\fB\-\-only\-keep\-debug\fR" 4 -.IX Item "--only-keep-debug" -Strip a file, removing contents of any sections that would not be -stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections -intact. -.Sp -The intention is that this option will be used in conjunction with -\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a -stripped binary which will occupy less space in \s-1RAM\s0 and in a -distribution and the second a debugging information file which is only -needed if debugging abilities are required. The suggested procedure -to create these files is as follows: -.RS 4 -.IP "1.<Link the executable as normal. Assuming that is is called>" 4 -.IX Item "1.<Link the executable as normal. Assuming that is is called>" -\&\f(CW\*(C`foo\*(C'\fR then... -.ie n .IP "1.<Run ""objcopy \-\-only\-keep\-debug foo foo.dbg"" to>" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-only\-keep\-debug foo foo.dbg\fR to>" 4 -.IX Item "1.<Run objcopy --only-keep-debug foo foo.dbg to>" -create a file containing the debugging info. -.ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"" to create a>" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR to create a>" 4 -.IX Item "1.<Run objcopy --strip-debug foo to create a>" -stripped executable. -.ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.dbg foo"">" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.dbg foo\fR>" 4 -.IX Item "1.<Run objcopy --add-gnu-debuglink=foo.dbg foo>" -to add a link to the debugging info into the stripped executable. -.RE -.RS 4 -.Sp -Note \- the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info -file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is -optional. You could instead do this: -.IP "1.<Link the executable as normal.>" 4 -.IX Item "1.<Link the executable as normal.>" -.PD 0 -.ie n .IP "1.<Copy ""foo""\fR to \f(CW""foo.full"">" 4 -.el .IP "1.<Copy \f(CWfoo\fR to \f(CWfoo.full\fR>" 4 -.IX Item "1.<Copy foo to foo.full>" -.ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"">" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR>" 4 -.IX Item "1.<Run objcopy --strip-debug foo>" -.ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.full foo"">" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.full foo\fR>" 4 -.IX Item "1.<Run objcopy --add-gnu-debuglink=foo.full foo>" -.RE -.RS 4 -.PD -.Sp -i.e. the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the -full executable. It does not have to be a file created by the -\&\fB\-\-only\-keep\-debug\fR switch. -.RE -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBobjcopy\fR. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Verbose output: list all object files modified. In the case of -archives, \fBobjcopy \-V\fR lists all members of the archive. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of the options to \fBobjcopy\fR. -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -Display a list showing all architectures and object formats available. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/objdump.1 b/binutils/doc/objdump.1 deleted file mode 100644 index a27423c21ba2..000000000000 --- a/binutils/doc/objdump.1 +++ /dev/null @@ -1,634 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "OBJDUMP 1" -.TH OBJDUMP 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -objdump \- display information from object files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -objdump [\fB\-a\fR|\fB\-\-archive\-headers\fR] - [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR] ] - [\fB\-d\fR|\fB\-\-disassemble\fR] - [\fB\-D\fR|\fB\-\-disassemble\-all\fR] - [\fB\-z\fR|\fB\-\-disassemble\-zeroes\fR] - [\fB\-EB\fR|\fB\-EL\fR|\fB\-\-endian=\fR{big | little }] - [\fB\-f\fR|\fB\-\-file\-headers\fR] - [\fB\-\-file\-start\-context\fR] - [\fB\-g\fR|\fB\-\-debugging\fR] - [\fB\-e\fR|\fB\-\-debugging\-tags\fR] - [\fB\-h\fR|\fB\-\-section\-headers\fR|\fB\-\-headers\fR] - [\fB\-i\fR|\fB\-\-info\fR] - [\fB\-j\fR \fIsection\fR|\fB\-\-section=\fR\fIsection\fR] - [\fB\-l\fR|\fB\-\-line\-numbers\fR] - [\fB\-S\fR|\fB\-\-source\fR] - [\fB\-m\fR \fImachine\fR|\fB\-\-architecture=\fR\fImachine\fR] - [\fB\-M\fR \fIoptions\fR|\fB\-\-disassembler\-options=\fR\fIoptions\fR] - [\fB\-p\fR|\fB\-\-private\-headers\fR] - [\fB\-r\fR|\fB\-\-reloc\fR] - [\fB\-R\fR|\fB\-\-dynamic\-reloc\fR] - [\fB\-s\fR|\fB\-\-full\-contents\fR] - [\fB\-W\fR|\fB\-\-dwarf\fR] - [\fB\-G\fR|\fB\-\-stabs\fR] - [\fB\-t\fR|\fB\-\-syms\fR] - [\fB\-T\fR|\fB\-\-dynamic\-syms\fR] - [\fB\-x\fR|\fB\-\-all\-headers\fR] - [\fB\-w\fR|\fB\-\-wide\fR] - [\fB\-\-start\-address=\fR\fIaddress\fR] - [\fB\-\-stop\-address=\fR\fIaddress\fR] - [\fB\-\-prefix\-addresses\fR] - [\fB\-\-[no\-]show\-raw\-insn\fR] - [\fB\-\-adjust\-vma=\fR\fIoffset\fR] - [\fB\-\-special\-syms\fR] - [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-H\fR|\fB\-\-help\fR] - \fIobjfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBobjdump\fR displays information about one or more object files. -The options control what particular information to display. This -information is mostly useful to programmers who are working on the -compilation tools, as opposed to programmers who just want their -program to compile and work. -.PP -\&\fIobjfile\fR... are the object files to be examined. When you -specify archives, \fBobjdump\fR shows information on each of the member -object files. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. At least one option from the list -\&\fB\-a,\-d,\-D,\-e,\-f,\-g,\-G,\-h,\-H,\-p,\-r,\-R,\-s,\-S,\-t,\-T,\-V,\-x\fR must be given. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-archive\-header\fR" 4 -.IX Item "--archive-header" -.PD -If any of the \fIobjfile\fR files are archives, display the archive -header information (in a format similar to \fBls \-l\fR). Besides the -information you could list with \fBar tv\fR, \fBobjdump \-a\fR shows -the object file format of each archive member. -.IP "\fB\-\-adjust\-vma=\fR\fIoffset\fR" 4 -.IX Item "--adjust-vma=offset" -When dumping information, first add \fIoffset\fR to all the section -addresses. This is useful if the section addresses do not correspond to -the symbol table, which can happen when putting sections at particular -addresses when using a format which can not represent section addresses, -such as a.out. -.IP "\fB\-b\fR \fIbfdname\fR" 4 -.IX Item "-b bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Specify that the object-code format for the object files is -\&\fIbfdname\fR. This option may not be necessary; \fIobjdump\fR can -automatically recognize many formats. -.Sp -For example, -.Sp -.Vb 1 -\& objdump \-b oasys \-m vax \-h fu.o -.Ve -.Sp -displays summary information from the section headers (\fB\-h\fR) of -\&\fIfu.o\fR, which is explicitly identified (\fB\-m\fR) as a \s-1VAX\s0 object -file in the format produced by Oasys compilers. You can list the -formats available with the \fB\-i\fR option. -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes \*(C+ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-debugging\fR" 4 -.IX Item "--debugging" -.PD -Display debugging information. This attempts to parse debugging -information stored in the file and print it out using a C like syntax. -Only certain types of debugging information have been implemented. -Some other types are supported by \fBreadelf \-w\fR. -.IP "\fB\-e\fR" 4 -.IX Item "-e" -.PD 0 -.IP "\fB\-\-debugging\-tags\fR" 4 -.IX Item "--debugging-tags" -.PD -Like \fB\-g\fR, but the information is generated in a format compatible -with ctags tool. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-disassemble\fR" 4 -.IX Item "--disassemble" -.PD -Display the assembler mnemonics for the machine instructions from -\&\fIobjfile\fR. This option only disassembles those sections which are -expected to contain instructions. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-disassemble\-all\fR" 4 -.IX Item "--disassemble-all" -.PD -Like \fB\-d\fR, but disassemble the contents of all sections, not just -those expected to contain instructions. -.IP "\fB\-\-prefix\-addresses\fR" 4 -.IX Item "--prefix-addresses" -When disassembling, print the complete address on each line. This is -the older disassembly format. -.IP "\fB\-EB\fR" 4 -.IX Item "-EB" -.PD 0 -.IP "\fB\-EL\fR" 4 -.IX Item "-EL" -.IP "\fB\-\-endian={big|little}\fR" 4 -.IX Item "--endian={big|little}" -.PD -Specify the endianness of the object files. This only affects -disassembly. This can be useful when disassembling a file format which -does not describe endianness information, such as S\-records. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-file\-headers\fR" 4 -.IX Item "--file-headers" -.PD -Display summary information from the overall header of -each of the \fIobjfile\fR files. -.IP "\fB\-\-file\-start\-context\fR" 4 -.IX Item "--file-start-context" -Specify that when displaying interlisted source code/disassembly -(assumes \fB\-S\fR) from a file that has not yet been displayed, extend the -context to the start of the file. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-section\-headers\fR" 4 -.IX Item "--section-headers" -.IP "\fB\-\-headers\fR" 4 -.IX Item "--headers" -.PD -Display summary information from the section headers of the -object file. -.Sp -File segments may be relocated to nonstandard addresses, for example by -using the \fB\-Ttext\fR, \fB\-Tdata\fR, or \fB\-Tbss\fR options to -\&\fBld\fR. However, some object file formats, such as a.out, do not -store the starting address of the file segments. In those situations, -although \fBld\fR relocates the sections correctly, using \fBobjdump -\&\-h\fR to list the file section headers cannot show the correct addresses. -Instead, it shows the usual addresses, which are implicit for the -target. -.IP "\fB\-H\fR" 4 -.IX Item "-H" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Print a summary of the options to \fBobjdump\fR and exit. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -.PD -Display a list showing all architectures and object formats available -for specification with \fB\-b\fR or \fB\-m\fR. -.IP "\fB\-j\fR \fIname\fR" 4 -.IX Item "-j name" -.PD 0 -.IP "\fB\-\-section=\fR\fIname\fR" 4 -.IX Item "--section=name" -.PD -Display information only for section \fIname\fR. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-line\-numbers\fR" 4 -.IX Item "--line-numbers" -.PD -Label the display (using debugging information) with the filename and -source line numbers corresponding to the object code or relocs shown. -Only useful with \fB\-d\fR, \fB\-D\fR, or \fB\-r\fR. -.IP "\fB\-m\fR \fImachine\fR" 4 -.IX Item "-m machine" -.PD 0 -.IP "\fB\-\-architecture=\fR\fImachine\fR" 4 -.IX Item "--architecture=machine" -.PD -Specify the architecture to use when disassembling object files. This -can be useful when disassembling object files which do not describe -architecture information, such as S\-records. You can list the available -architectures with the \fB\-i\fR option. -.IP "\fB\-M\fR \fIoptions\fR" 4 -.IX Item "-M options" -.PD 0 -.IP "\fB\-\-disassembler\-options=\fR\fIoptions\fR" 4 -.IX Item "--disassembler-options=options" -.PD -Pass target specific information to the disassembler. Only supported on -some targets. If it is necessary to specify more than one -disassembler option then multiple \fB\-M\fR options can be used or -can be placed together into a comma separated list. -.Sp -If the target is an \s-1ARM\s0 architecture then this switch can be used to -select which register name set is used during disassembler. Specifying -\&\fB\-M reg-names-std\fR (the default) will select the register names as -used in \s-1ARM\s0's instruction set documentation, but with register 13 called -\&'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying -\&\fB\-M reg-names-apcs\fR will select the name set used by the \s-1ARM\s0 -Procedure Call Standard, whilst specifying \fB\-M reg-names-raw\fR will -just use \fBr\fR followed by the register number. -.Sp -There are also two variants on the \s-1APCS\s0 register naming scheme enabled -by \fB\-M reg-names-atpcs\fR and \fB\-M reg-names-special-atpcs\fR which -use the ARM/Thumb Procedure Call Standard naming conventions. (Either -with the normal register names or the special register names). -.Sp -This option can also be used for \s-1ARM\s0 architectures to force the -disassembler to interpret all instructions as Thumb instructions by -using the switch \fB\-\-disassembler\-options=force\-thumb\fR. This can be -useful when attempting to disassemble thumb code produced by other -compilers. -.Sp -For the x86, some of the options duplicate functions of the \fB\-m\fR -switch, but allow finer grained control. Multiple selections from the -following may be specified as a comma separated string. -\&\fBx86\-64\fR, \fBi386\fR and \fBi8086\fR select disassembly for -the given architecture. \fBintel\fR and \fBatt\fR select between -intel syntax mode and \s-1AT&T\s0 syntax mode. \fBaddr32\fR, -\&\fBaddr16\fR, \fBdata32\fR and \fBdata16\fR specify the default -address size and operand size. These four options will be overridden if -\&\fBx86\-64\fR, \fBi386\fR or \fBi8086\fR appear later in the -option string. Lastly, \fBsuffix\fR, when in \s-1AT&T\s0 mode, -instructs the disassembler to print a mnemonic suffix even when the -suffix could be inferred by the operands. -.Sp -For \s-1PPC\s0, \fBbooke\fR, \fBbooke32\fR and \fBbooke64\fR select -disassembly of BookE instructions. \fB32\fR and \fB64\fR select -PowerPC and PowerPC64 disassembly, respectively. \fBe300\fR selects -disassembly for the e300 family. -.Sp -For \s-1MIPS\s0, this option controls the printing of instruction mneumonic -names and register names in disassembled instructions. Multiple -selections from the following may be specified as a comma separated -string, and invalid options are ignored: -.RS 4 -.ie n .IP """no\-aliases""" 4 -.el .IP "\f(CWno\-aliases\fR" 4 -.IX Item "no-aliases" -Print the 'raw' instruction mneumonic instead of some pseudo -instruction mneumonic. I.E. print 'daddu' or 'or' instead of 'move', -\&'sll' instead of 'nop', etc. -.ie n .IP """gpr\-names=\f(CI\s-1ABI\s0\f(CW""" 4 -.el .IP "\f(CWgpr\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 -.IX Item "gpr-names=ABI" -Print \s-1GPR\s0 (general\-purpose register) names as appropriate -for the specified \s-1ABI\s0. By default, \s-1GPR\s0 names are selected according to -the \s-1ABI\s0 of the binary being disassembled. -.ie n .IP """fpr\-names=\f(CI\s-1ABI\s0\f(CW""" 4 -.el .IP "\f(CWfpr\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 -.IX Item "fpr-names=ABI" -Print \s-1FPR\s0 (floating\-point register) names as -appropriate for the specified \s-1ABI\s0. By default, \s-1FPR\s0 numbers are printed -rather than names. -.ie n .IP """cp0\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 -.el .IP "\f(CWcp0\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 -.IX Item "cp0-names=ARCH" -Print \s-1CP0\s0 (system control coprocessor; coprocessor 0) register names -as appropriate for the \s-1CPU\s0 or architecture specified by -\&\fI\s-1ARCH\s0\fR. By default, \s-1CP0\s0 register names are selected according to -the architecture and \s-1CPU\s0 of the binary being disassembled. -.ie n .IP """hwr\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 -.el .IP "\f(CWhwr\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 -.IX Item "hwr-names=ARCH" -Print \s-1HWR\s0 (hardware register, used by the \f(CW\*(C`rdhwr\*(C'\fR instruction) names -as appropriate for the \s-1CPU\s0 or architecture specified by -\&\fI\s-1ARCH\s0\fR. By default, \s-1HWR\s0 names are selected according to -the architecture and \s-1CPU\s0 of the binary being disassembled. -.ie n .IP """reg\-names=\f(CI\s-1ABI\s0\f(CW""" 4 -.el .IP "\f(CWreg\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 -.IX Item "reg-names=ABI" -Print \s-1GPR\s0 and \s-1FPR\s0 names as appropriate for the selected \s-1ABI\s0. -.ie n .IP """reg\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 -.el .IP "\f(CWreg\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 -.IX Item "reg-names=ARCH" -Print CPU-specific register names (\s-1CP0\s0 register and \s-1HWR\s0 names) -as appropriate for the selected \s-1CPU\s0 or architecture. -.RE -.RS 4 -.Sp -For any of the options listed above, \fI\s-1ABI\s0\fR or -\&\fI\s-1ARCH\s0\fR may be specified as \fBnumeric\fR to have numbers printed -rather than names, for the selected types of registers. -You can list the available values of \fI\s-1ABI\s0\fR and \fI\s-1ARCH\s0\fR using -the \fB\-\-help\fR option. -.Sp -For \s-1VAX\s0, you can specify function entry addresses with \fB\-M -entry:0xf00ba\fR. You can use this multiple times to properly -disassemble \s-1VAX\s0 binary files that don't contain symbol tables (like -\&\s-1ROM\s0 dumps). In these cases, the function entry mask would otherwise -be decoded as \s-1VAX\s0 instructions, which would probably lead the the rest -of the function being wrongly disassembled. -.RE -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-private\-headers\fR" 4 -.IX Item "--private-headers" -.PD -Print information that is specific to the object file format. The exact -information printed depends upon the object file format. For some -object file formats, no additional information is printed. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-reloc\fR" 4 -.IX Item "--reloc" -.PD -Print the relocation entries of the file. If used with \fB\-d\fR or -\&\fB\-D\fR, the relocations are printed interspersed with the -disassembly. -.IP "\fB\-R\fR" 4 -.IX Item "-R" -.PD 0 -.IP "\fB\-\-dynamic\-reloc\fR" 4 -.IX Item "--dynamic-reloc" -.PD -Print the dynamic relocation entries of the file. This is only -meaningful for dynamic objects, such as certain types of shared -libraries. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-full\-contents\fR" 4 -.IX Item "--full-contents" -.PD -Display the full contents of any sections requested. By default all -non-empty sections are displayed. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-source\fR" 4 -.IX Item "--source" -.PD -Display source code intermixed with disassembly, if possible. Implies -\&\fB\-d\fR. -.IP "\fB\-\-show\-raw\-insn\fR" 4 -.IX Item "--show-raw-insn" -When disassembling instructions, print the instruction in hex as well as -in symbolic form. This is the default except when -\&\fB\-\-prefix\-addresses\fR is used. -.IP "\fB\-\-no\-show\-raw\-insn\fR" 4 -.IX Item "--no-show-raw-insn" -When disassembling instructions, do not print the instruction bytes. -This is the default when \fB\-\-prefix\-addresses\fR is used. -.IP "\fB\-W\fR" 4 -.IX Item "-W" -.PD 0 -.IP "\fB\-\-dwarf\fR" 4 -.IX Item "--dwarf" -.PD -Displays the contents of the \s-1DWARF\s0 debug sections in the file, if any -are present. -.IP "\fB\-G\fR" 4 -.IX Item "-G" -.PD 0 -.IP "\fB\-\-stabs\fR" 4 -.IX Item "--stabs" -.PD -Display the full contents of any sections requested. Display the -contents of the .stab and .stab.index and .stab.excl sections from an -\&\s-1ELF\s0 file. This is only useful on systems (such as Solaris 2.0) in which -\&\f(CW\*(C`.stab\*(C'\fR debugging symbol-table entries are carried in an \s-1ELF\s0 -section. In most other file formats, debugging symbol-table entries are -interleaved with linkage symbols, and are visible in the \fB\-\-syms\fR -output. -.IP "\fB\-\-start\-address=\fR\fIaddress\fR" 4 -.IX Item "--start-address=address" -Start displaying data at the specified address. This affects the output -of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options. -.IP "\fB\-\-stop\-address=\fR\fIaddress\fR" 4 -.IX Item "--stop-address=address" -Stop displaying data at the specified address. This affects the output -of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-syms\fR" 4 -.IX Item "--syms" -.PD -Print the symbol table entries of the file. -This is similar to the information provided by the \fBnm\fR program. -.IP "\fB\-T\fR" 4 -.IX Item "-T" -.PD 0 -.IP "\fB\-\-dynamic\-syms\fR" 4 -.IX Item "--dynamic-syms" -.PD -Print the dynamic symbol table entries of the file. This is only -meaningful for dynamic objects, such as certain types of shared -libraries. This is similar to the information provided by the \fBnm\fR -program when given the \fB\-D\fR (\fB\-\-dynamic\fR) option. -.IP "\fB\-\-special\-syms\fR" 4 -.IX Item "--special-syms" -When displaying symbols include those which the target considers to be -special in some way and which would not normally be of interest to the -user. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Print the version number of \fBobjdump\fR and exit. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-all\-headers\fR" 4 -.IX Item "--all-headers" -.PD -Display all available header information, including the symbol table and -relocation entries. Using \fB\-x\fR is equivalent to specifying all of -\&\fB\-a \-f \-h \-p \-r \-t\fR. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wide\fR" 4 -.IX Item "--wide" -.PD -Format some lines for output devices that have more than 80 columns. -Also do not truncate symbol names when they are displayed. -.IP "\fB\-z\fR" 4 -.IX Item "-z" -.PD 0 -.IP "\fB\-\-disassemble\-zeroes\fR" 4 -.IX Item "--disassemble-zeroes" -.PD -Normally the disassembly output will skip blocks of zeroes. This -option directs the disassembler to disassemble those blocks, just like -any other data. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fInm\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/ranlib.1 b/binutils/doc/ranlib.1 deleted file mode 100644 index fd03dd02c726..000000000000 --- a/binutils/doc/ranlib.1 +++ /dev/null @@ -1,188 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "RANLIB 1" -.TH RANLIB 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -ranlib \- generate index to archive. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -ranlib [\fB\-vV\fR] \fIarchive\fR -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBranlib\fR generates an index to the contents of an archive and -stores it in the archive. The index lists each symbol defined by a -member of an archive that is a relocatable object file. -.PP -You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index. -.PP -An archive with such an index speeds up linking to the library and -allows routines in the library to call each other without regard to -their placement in the archive. -.PP -The \s-1GNU\s0 \fBranlib\fR program is another form of \s-1GNU\s0 \fBar\fR; running -\&\fBranlib\fR is completely equivalent to executing \fBar \-s\fR. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBranlib\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fInm\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/readelf.1 b/binutils/doc/readelf.1 deleted file mode 100644 index 14480c7938ea..000000000000 --- a/binutils/doc/readelf.1 +++ /dev/null @@ -1,376 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "READELF 1" -.TH READELF 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -readelf \- Displays information about ELF files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -readelf [\fB\-a\fR|\fB\-\-all\fR] - [\fB\-h\fR|\fB\-\-file\-header\fR] - [\fB\-l\fR|\fB\-\-program\-headers\fR|\fB\-\-segments\fR] - [\fB\-S\fR|\fB\-\-section\-headers\fR|\fB\-\-sections\fR] - [\fB\-g\fR|\fB\-\-section\-groups\fR] - [\fB\-t\fR|\fB\-\-section\-details\fR] - [\fB\-e\fR|\fB\-\-headers\fR] - [\fB\-s\fR|\fB\-\-syms\fR|\fB\-\-symbols\fR] - [\fB\-n\fR|\fB\-\-notes\fR] - [\fB\-r\fR|\fB\-\-relocs\fR] - [\fB\-u\fR|\fB\-\-unwind\fR] - [\fB\-d\fR|\fB\-\-dynamic\fR] - [\fB\-V\fR|\fB\-\-version\-info\fR] - [\fB\-A\fR|\fB\-\-arch\-specific\fR] - [\fB\-D\fR|\fB\-\-use\-dynamic\fR] - [\fB\-x\fR <number or name>|\fB\-\-hex\-dump=\fR<number or name>] - [\fB\-w[liaprmfFsoR]\fR| - \fB\-\-debug\-dump\fR[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges]] - [\fB\-I\fR|\fB\-histogram\fR] - [\fB\-v\fR|\fB\-\-version\fR] - [\fB\-W\fR|\fB\-\-wide\fR] - [\fB\-H\fR|\fB\-\-help\fR] - \fIelffile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBreadelf\fR displays information about one or more \s-1ELF\s0 format object -files. The options control what particular information to display. -.PP -\&\fIelffile\fR... are the object files to be examined. 32\-bit and -64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files. -.PP -This program performs a similar function to \fBobjdump\fR but it -goes into more detail and it exists independently of the \s-1BFD\s0 -library, so if there is a bug in \s-1BFD\s0 then readelf will not be -affected. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. At least one option besides \fB\-v\fR or \fB\-H\fR must be -given. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-all\fR" 4 -.IX Item "--all" -.PD -Equivalent to specifiying \fB\-\-file\-header\fR, -\&\fB\-\-program\-headers\fR, \fB\-\-sections\fR, \fB\-\-symbols\fR, -\&\fB\-\-relocs\fR, \fB\-\-dynamic\fR, \fB\-\-notes\fR and -\&\fB\-\-version\-info\fR. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-file\-header\fR" 4 -.IX Item "--file-header" -.PD -Displays the information contained in the \s-1ELF\s0 header at the start of the -file. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-program\-headers\fR" 4 -.IX Item "--program-headers" -.IP "\fB\-\-segments\fR" 4 -.IX Item "--segments" -.PD -Displays the information contained in the file's segment headers, if it -has any. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-sections\fR" 4 -.IX Item "--sections" -.IP "\fB\-\-section\-headers\fR" 4 -.IX Item "--section-headers" -.PD -Displays the information contained in the file's section headers, if it -has any. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-section\-groups\fR" 4 -.IX Item "--section-groups" -.PD -Displays the information contained in the file's section groups, if it -has any. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-section\-details\fR" 4 -.IX Item "--section-details" -.PD -Displays the detailed section information. Implies \fB\-S\fR. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-symbols\fR" 4 -.IX Item "--symbols" -.IP "\fB\-\-syms\fR" 4 -.IX Item "--syms" -.PD -Displays the entries in symbol table section of the file, if it has one. -.IP "\fB\-e\fR" 4 -.IX Item "-e" -.PD 0 -.IP "\fB\-\-headers\fR" 4 -.IX Item "--headers" -.PD -Display all the headers in the file. Equivalent to \fB\-h \-l \-S\fR. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-notes\fR" 4 -.IX Item "--notes" -.PD -Displays the contents of the \s-1NOTE\s0 segments and/or sections, if any. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-relocs\fR" 4 -.IX Item "--relocs" -.PD -Displays the contents of the file's relocation section, if it has one. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-unwind\fR" 4 -.IX Item "--unwind" -.PD -Displays the contents of the file's unwind section, if it has one. Only -the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-dynamic\fR" 4 -.IX Item "--dynamic" -.PD -Displays the contents of the file's dynamic section, if it has one. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\-info\fR" 4 -.IX Item "--version-info" -.PD -Displays the contents of the version sections in the file, it they -exist. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-\-arch\-specific\fR" 4 -.IX Item "--arch-specific" -.PD -Displays architecture-specific information in the file, if there -is any. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-use\-dynamic\fR" 4 -.IX Item "--use-dynamic" -.PD -When displaying symbols, this option makes \fBreadelf\fR use the -symbol table in the file's dynamic section, rather than the one in the -symbols section. -.IP "\fB\-x <number or name>\fR" 4 -.IX Item "-x <number or name>" -.PD 0 -.IP "\fB\-\-hex\-dump=<number or name>\fR" 4 -.IX Item "--hex-dump=<number or name>" -.PD -Displays the contents of the indicated section as a hexadecimal dump. -A number identifies a particular section by index in the section table; -any other string identifies all sections with that name in the object file. -.IP "\fB\-w[liaprmfFsoR]\fR" 4 -.IX Item "-w[liaprmfFsoR]" -.PD 0 -.IP "\fB\-\-debug\-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges]\fR" 4 -.IX Item "--debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]" -.PD -Displays the contents of the debug sections in the file, if any are -present. If one of the optional letters or words follows the switch -then only data found in those specific sections will be dumped. -.IP "\fB\-I\fR" 4 -.IX Item "-I" -.PD 0 -.IP "\fB\-\-histogram\fR" 4 -.IX Item "--histogram" -.PD -Display a histogram of bucket list lengths when displaying the contents -of the symbol tables. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Display the version number of readelf. -.IP "\fB\-W\fR" 4 -.IX Item "-W" -.PD 0 -.IP "\fB\-\-wide\fR" 4 -.IX Item "--wide" -.PD -Don't break output lines to fit into 80 columns. By default -\&\fBreadelf\fR breaks section header and segment listing lines for -64\-bit \s-1ELF\s0 files, so that they fit into 80 columns. This option causes -\&\fBreadelf\fR to print each section header resp. each segment one a -single line, which is far more readable on terminals wider than 80 columns. -.IP "\fB\-H\fR" 4 -.IX Item "-H" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Display the command line options understood by \fBreadelf\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/size.1 b/binutils/doc/size.1 deleted file mode 100644 index 1cf72ac7fe26..000000000000 --- a/binutils/doc/size.1 +++ /dev/null @@ -1,263 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "SIZE 1" -.TH SIZE 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -size \- list section sizes and total size. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -size [\fB\-A\fR|\fB\-B\fR|\fB\-\-format=\fR\fIcompatibility\fR] - [\fB\-\-help\fR] - [\fB\-d\fR|\fB\-o\fR|\fB\-x\fR|\fB\-\-radix=\fR\fInumber\fR] - [\fB\-t\fR|\fB\-\-totals\fR] - [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fIobjfile\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBsize\fR utility lists the section sizes\-\-\-and the total -size\-\-\-for each of the object or archive files \fIobjfile\fR in its -argument list. By default, one line of output is generated for each -object file or each module in an archive. -.PP -\&\fIobjfile\fR... are the object files to be examined. -If none are specified, the file \f(CW\*(C`a.out\*(C'\fR will be used. -.SH "OPTIONS" -.IX Header "OPTIONS" -The command line options have the following meanings: -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-B\fR" 4 -.IX Item "-B" -.IP "\fB\-\-format=\fR\fIcompatibility\fR" 4 -.IX Item "--format=compatibility" -.PD -Using one of these options, you can choose whether the output from \s-1GNU\s0 -\&\fBsize\fR resembles output from System V \fBsize\fR (using \fB\-A\fR, -or \fB\-\-format=sysv\fR), or Berkeley \fBsize\fR (using \fB\-B\fR, or -\&\fB\-\-format=berkeley\fR). The default is the one-line format similar to -Berkeley's. -.Sp -Here is an example of the Berkeley (default) format of output from -\&\fBsize\fR: -.Sp -.Vb 4 -\& $ size \-\-format=Berkeley ranlib size -\& text data bss dec hex filename -\& 294880 81920 11592 388392 5ed28 ranlib -\& 294880 81920 11888 388688 5ee50 size -.Ve -.Sp -This is the same data, but displayed closer to System V conventions: -.Sp -.Vb 7 -\& $ size \-\-format=SysV ranlib size -\& ranlib : -\& section size addr -\& .text 294880 8192 -\& .data 81920 303104 -\& .bss 11592 385024 -\& Total 388392 -.Ve -.Sp -.Vb 6 -\& size : -\& section size addr -\& .text 294880 8192 -\& .data 81920 303104 -\& .bss 11888 385024 -\& Total 388688 -.Ve -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of acceptable arguments and options. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-o\fR" 4 -.IX Item "-o" -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.IP "\fB\-\-radix=\fR\fInumber\fR" 4 -.IX Item "--radix=number" -.PD -Using one of these options, you can control whether the size of each -section is given in decimal (\fB\-d\fR, or \fB\-\-radix=10\fR); octal -(\fB\-o\fR, or \fB\-\-radix=8\fR); or hexadecimal (\fB\-x\fR, or -\&\fB\-\-radix=16\fR). In \fB\-\-radix=\fR\fInumber\fR, only the three -values (8, 10, 16) are supported. The total size is always given in two -radices; decimal and hexadecimal for \fB\-d\fR or \fB\-x\fR output, or -octal and hexadecimal if you're using \fB\-o\fR. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-totals\fR" 4 -.IX Item "--totals" -.PD -Show totals of all objects listed (Berkeley format listing mode only). -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -Specify that the object-code format for \fIobjfile\fR is -\&\fIbfdname\fR. This option may not be necessary; \fBsize\fR can -automatically recognize many formats. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Display the version number of \fBsize\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/strings.1 b/binutils/doc/strings.1 deleted file mode 100644 index 5cffee121bf4..000000000000 --- a/binutils/doc/strings.1 +++ /dev/null @@ -1,249 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "STRINGS 1" -.TH STRINGS 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -strings \- print the strings of printable characters in files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -strings [\fB\-afov\fR] [\fB\-\fR\fImin-len\fR] - [\fB\-n\fR \fImin-len\fR] [\fB\-\-bytes=\fR\fImin-len\fR] - [\fB\-t\fR \fIradix\fR] [\fB\-\-radix=\fR\fIradix\fR] - [\fB\-e\fR \fIencoding\fR] [\fB\-\-encoding=\fR\fIencoding\fR] - [\fB\-\fR] [\fB\-\-all\fR] [\fB\-\-print\-file\-name\fR] - [\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-\-help\fR] [\fB\-\-version\fR] \fIfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -For each \fIfile\fR given, \s-1GNU\s0 \fBstrings\fR prints the printable -character sequences that are at least 4 characters long (or the number -given with the options below) and are followed by an unprintable -character. By default, it only prints the strings from the initialized -and loaded sections of object files; for other types of files, it prints -the strings from the whole file. -.PP -\&\fBstrings\fR is mainly useful for determining the contents of non-text -files. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-all\fR" 4 -.IX Item "--all" -.IP "\fB\-\fR" 4 -.IX Item "-" -.PD -Do not scan only the initialized and loaded sections of object files; -scan the whole files. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-print\-file\-name\fR" 4 -.IX Item "--print-file-name" -.PD -Print the name of the file before each string. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the program usage on the standard output and exit. -.IP "\fB\-\fR\fImin-len\fR" 4 -.IX Item "-min-len" -.PD 0 -.IP "\fB\-n\fR \fImin-len\fR" 4 -.IX Item "-n min-len" -.IP "\fB\-\-bytes=\fR\fImin-len\fR" 4 -.IX Item "--bytes=min-len" -.PD -Print sequences of characters that are at least \fImin-len\fR characters -long, instead of the default 4. -.IP "\fB\-o\fR" 4 -.IX Item "-o" -Like \fB\-t o\fR. Some other versions of \fBstrings\fR have \fB\-o\fR -act like \fB\-t d\fR instead. Since we can not be compatible with both -ways, we simply chose one. -.IP "\fB\-t\fR \fIradix\fR" 4 -.IX Item "-t radix" -.PD 0 -.IP "\fB\-\-radix=\fR\fIradix\fR" 4 -.IX Item "--radix=radix" -.PD -Print the offset within the file before each string. The single -character argument specifies the radix of the offset\-\-\-\fBo\fR for -octal, \fBx\fR for hexadecimal, or \fBd\fR for decimal. -.IP "\fB\-e\fR \fIencoding\fR" 4 -.IX Item "-e encoding" -.PD 0 -.IP "\fB\-\-encoding=\fR\fIencoding\fR" 4 -.IX Item "--encoding=encoding" -.PD -Select the character encoding of the strings that are to be found. -Possible values for \fIencoding\fR are: \fBs\fR = single\-7\-bit\-byte -characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBS\fR = -single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR = -16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit -littleendian. Useful for finding wide character strings. -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -Specify an object code format other than your system's default format. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Print the program version number on the standard output and exit. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fInm\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), \fIreadelf\fR\|(1) -and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/strip.1 b/binutils/doc/strip.1 deleted file mode 100644 index 982255ef754e..000000000000 --- a/binutils/doc/strip.1 +++ /dev/null @@ -1,383 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "STRIP 1" -.TH STRIP 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -strip \- Discard symbols from object files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -strip [\fB\-F\fR \fIbfdname\fR |\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-I\fR \fIbfdname\fR |\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR |\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-s\fR|\fB\-\-strip\-all\fR] - [\fB\-S\fR|\fB\-g\fR|\fB\-d\fR|\fB\-\-strip\-debug\fR] - [\fB\-K\fR \fIsymbolname\fR |\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] - [\fB\-N\fR \fIsymbolname\fR |\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] - [\fB\-w\fR|\fB\-\-wildcard\fR] - [\fB\-x\fR|\fB\-\-discard\-all\fR] [\fB\-X\fR |\fB\-\-discard\-locals\fR] - [\fB\-R\fR \fIsectionname\fR |\fB\-\-remove\-section=\fR\fIsectionname\fR] - [\fB\-o\fR \fIfile\fR] [\fB\-p\fR|\fB\-\-preserve\-dates\fR] - [\fB\-\-keep\-file\-symbols\fR] - [\fB\-\-only\-keep\-debug\fR] - [\fB\-v\fR |\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-\-help\fR] [\fB\-\-info\fR] - \fIobjfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\s-1GNU\s0 \fBstrip\fR discards all symbols from object files -\&\fIobjfile\fR. The list of object files may include archives. -At least one object file must be given. -.PP -\&\fBstrip\fR modifies the files named in its argument, -rather than writing modified copies under different names. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-F\fR \fIbfdname\fR" 4 -.IX Item "-F bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Treat the original \fIobjfile\fR as a file with the object -code format \fIbfdname\fR, and rewrite it in the same format. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of the options to \fBstrip\fR and exit. -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -Display a list showing all architectures and object formats available. -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Treat the original \fIobjfile\fR as a file with the object -code format \fIbfdname\fR. -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Replace \fIobjfile\fR with a file in the output format \fIbfdname\fR. -.IP "\fB\-R\fR \fIsectionname\fR" 4 -.IX Item "-R sectionname" -.PD 0 -.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4 -.IX Item "--remove-section=sectionname" -.PD -Remove any section named \fIsectionname\fR from the output file. This -option may be given more than once. Note that using this option -inappropriately may make the output file unusable. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-strip\-all\fR" 4 -.IX Item "--strip-all" -.PD -Remove all symbols. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.IP "\fB\-\-strip\-debug\fR" 4 -.IX Item "--strip-debug" -.PD -Remove debugging symbols only. -.IP "\fB\-\-strip\-unneeded\fR" 4 -.IX Item "--strip-unneeded" -Remove all symbols that are not needed for relocation processing. -.IP "\fB\-K\fR \fIsymbolname\fR" 4 -.IX Item "-K symbolname" -.PD 0 -.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-symbol=symbolname" -.PD -When stripping symbols, keep symbol \fIsymbolname\fR even if it would -normally be stripped. This option may be given more than once. -.IP "\fB\-N\fR \fIsymbolname\fR" 4 -.IX Item "-N symbolname" -.PD 0 -.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-symbol=symbolname" -.PD -Remove symbol \fIsymbolname\fR from the source file. This option may be -given more than once, and may be combined with strip options other than -\&\fB\-K\fR. -.IP "\fB\-o\fR \fIfile\fR" 4 -.IX Item "-o file" -Put the stripped output in \fIfile\fR, rather than replacing the -existing file. When this argument is used, only one \fIobjfile\fR -argument may be specified. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-preserve\-dates\fR" 4 -.IX Item "--preserve-dates" -.PD -Preserve the access and modification dates of the file. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wildcard\fR" 4 -.IX Item "--wildcard" -.PD -Permit regular expressions in \fIsymbolname\fRs used in other command -line options. The question mark (?), asterisk (*), backslash (\e) and -square brackets ([]) operators can be used anywhere in the symbol -name. If the first character of the symbol name is the exclamation -point (!) then the sense of the switch is reversed for that symbol. -For example: -.Sp -.Vb 1 -\& \-w \-K !foo \-K fo* -.Ve -.Sp -would cause strip to only keep symbols that start with the letters -\&\*(L"fo\*(R", but to discard the symbol \*(L"foo\*(R". -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-discard\-all\fR" 4 -.IX Item "--discard-all" -.PD -Remove non-global symbols. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -.PD 0 -.IP "\fB\-\-discard\-locals\fR" 4 -.IX Item "--discard-locals" -.PD -Remove compiler-generated local symbols. -(These usually start with \fBL\fR or \fB.\fR.) -.IP "\fB\-\-keep\-file\-symbols\fR" 4 -.IX Item "--keep-file-symbols" -When stripping a file, perhaps with \fB\-\-strip\-debug\fR or -\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names, -which would otherwise get stripped. -.IP "\fB\-\-only\-keep\-debug\fR" 4 -.IX Item "--only-keep-debug" -Strip a file, removing any sections that would be stripped by -\&\fB\-\-strip\-debug\fR and leaving the debugging sections. -.Sp -The intention is that this option will be used in conjunction with -\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a -stripped binary which will occupy less space in \s-1RAM\s0 and in a -distribution and the second a debugging information file which is only -needed if debugging abilities are required. The suggested procedure -to create these files is as follows: -.RS 4 -.IP "1.<Link the executable as normal. Assuming that is is called>" 4 -.IX Item "1.<Link the executable as normal. Assuming that is is called>" -\&\f(CW\*(C`foo\*(C'\fR then... -.ie n .IP "1.<Run ""objcopy \-\-only\-keep\-debug foo foo.dbg"" to>" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-only\-keep\-debug foo foo.dbg\fR to>" 4 -.IX Item "1.<Run objcopy --only-keep-debug foo foo.dbg to>" -create a file containing the debugging info. -.ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"" to create a>" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR to create a>" 4 -.IX Item "1.<Run objcopy --strip-debug foo to create a>" -stripped executable. -.ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.dbg foo"">" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.dbg foo\fR>" 4 -.IX Item "1.<Run objcopy --add-gnu-debuglink=foo.dbg foo>" -to add a link to the debugging info into the stripped executable. -.RE -.RS 4 -.Sp -Note \- the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info -file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is -optional. You could instead do this: -.IP "1.<Link the executable as normal.>" 4 -.IX Item "1.<Link the executable as normal.>" -.PD 0 -.ie n .IP "1.<Copy ""foo""\fR to \f(CW""foo.full"">" 4 -.el .IP "1.<Copy \f(CWfoo\fR to \f(CWfoo.full\fR>" 4 -.IX Item "1.<Copy foo to foo.full>" -.ie n .IP "1.<Run ""strip \-\-strip\-debug foo"">" 4 -.el .IP "1.<Run \f(CWstrip \-\-strip\-debug foo\fR>" 4 -.IX Item "1.<Run strip --strip-debug foo>" -.ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.full foo"">" 4 -.el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.full foo\fR>" 4 -.IX Item "1.<Run objcopy --add-gnu-debuglink=foo.full foo>" -.RE -.RS 4 -.PD -.Sp -ie the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the -full executable. It does not have to be a file created by the -\&\fB\-\-only\-keep\-debug\fR switch. -.RE -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number for \fBstrip\fR. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Verbose output: list all object files modified. In the case of -archives, \fBstrip \-v\fR lists all members of the archive. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/windres.1 b/binutils/doc/windres.1 deleted file mode 100644 index 8d102543d161..000000000000 --- a/binutils/doc/windres.1 +++ /dev/null @@ -1,343 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "WINDRES 1" -.TH WINDRES 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -windres \- manipulate Windows resources. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -windres [options] [input\-file] [output\-file] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBwindres\fR reads resources from an input file and copies them into -an output file. Either file may be in one of three formats: -.ie n .IP """rc""" 4 -.el .IP "\f(CWrc\fR" 4 -.IX Item "rc" -A text format read by the Resource Compiler. -.ie n .IP """res""" 4 -.el .IP "\f(CWres\fR" 4 -.IX Item "res" -A binary format generated by the Resource Compiler. -.ie n .IP """coff""" 4 -.el .IP "\f(CWcoff\fR" 4 -.IX Item "coff" -A \s-1COFF\s0 object or executable. -.PP -The exact description of these different formats is available in -documentation from Microsoft. -.PP -When \fBwindres\fR converts from the \f(CW\*(C`rc\*(C'\fR format to the \f(CW\*(C`res\*(C'\fR -format, it is acting like the Windows Resource Compiler. When -\&\fBwindres\fR converts from the \f(CW\*(C`res\*(C'\fR format to the \f(CW\*(C`coff\*(C'\fR -format, it is acting like the Windows \f(CW\*(C`CVTRES\*(C'\fR program. -.PP -When \fBwindres\fR generates an \f(CW\*(C`rc\*(C'\fR file, the output is similar -but not identical to the format expected for the input. When an input -\&\f(CW\*(C`rc\*(C'\fR file refers to an external filename, an output \f(CW\*(C`rc\*(C'\fR file -will instead include the file contents. -.PP -If the input or output format is not specified, \fBwindres\fR will -guess based on the file name, or, for the input file, the file contents. -A file with an extension of \fI.rc\fR will be treated as an \f(CW\*(C`rc\*(C'\fR -file, a file with an extension of \fI.res\fR will be treated as a -\&\f(CW\*(C`res\*(C'\fR file, and a file with an extension of \fI.o\fR or -\&\fI.exe\fR will be treated as a \f(CW\*(C`coff\*(C'\fR file. -.PP -If no output file is specified, \fBwindres\fR will print the resources -in \f(CW\*(C`rc\*(C'\fR format to standard output. -.PP -The normal use is for you to write an \f(CW\*(C`rc\*(C'\fR file, use \fBwindres\fR -to convert it to a \s-1COFF\s0 object file, and then link the \s-1COFF\s0 file into -your application. This will make the resources described in the -\&\f(CW\*(C`rc\*(C'\fR file available to Windows. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-i\fR \fIfilename\fR" 4 -.IX Item "-i filename" -.PD 0 -.IP "\fB\-\-input\fR \fIfilename\fR" 4 -.IX Item "--input filename" -.PD -The name of the input file. If this option is not used, then -\&\fBwindres\fR will use the first non-option argument as the input file -name. If there are no non-option arguments, then \fBwindres\fR will -read from standard input. \fBwindres\fR can not read a \s-1COFF\s0 file from -standard input. -.IP "\fB\-o\fR \fIfilename\fR" 4 -.IX Item "-o filename" -.PD 0 -.IP "\fB\-\-output\fR \fIfilename\fR" 4 -.IX Item "--output filename" -.PD -The name of the output file. If this option is not used, then -\&\fBwindres\fR will use the first non-option argument, after any used -for the input file name, as the output file name. If there is no -non-option argument, then \fBwindres\fR will write to standard output. -\&\fBwindres\fR can not write a \s-1COFF\s0 file to standard output. Note, -for compatability with \fBrc\fR the option \fB\-fo\fR is also -accepted, but its use is not recommended. -.IP "\fB\-J\fR \fIformat\fR" 4 -.IX Item "-J format" -.PD 0 -.IP "\fB\-\-input\-format\fR \fIformat\fR" 4 -.IX Item "--input-format format" -.PD -The input format to read. \fIformat\fR may be \fBres\fR, \fBrc\fR, or -\&\fBcoff\fR. If no input format is specified, \fBwindres\fR will -guess, as described above. -.IP "\fB\-O\fR \fIformat\fR" 4 -.IX Item "-O format" -.PD 0 -.IP "\fB\-\-output\-format\fR \fIformat\fR" 4 -.IX Item "--output-format format" -.PD -The output format to generate. \fIformat\fR may be \fBres\fR, -\&\fBrc\fR, or \fBcoff\fR. If no output format is specified, -\&\fBwindres\fR will guess, as described above. -.IP "\fB\-F\fR \fItarget\fR" 4 -.IX Item "-F target" -.PD 0 -.IP "\fB\-\-target\fR \fItarget\fR" 4 -.IX Item "--target target" -.PD -Specify the \s-1BFD\s0 format to use for a \s-1COFF\s0 file as input or output. This -is a \s-1BFD\s0 target name; you can use the \fB\-\-help\fR option to see a list -of supported targets. Normally \fBwindres\fR will use the default -format, which is the first one listed by the \fB\-\-help\fR option. -.IP "\fB\-\-preprocessor\fR \fIprogram\fR" 4 -.IX Item "--preprocessor program" -When \fBwindres\fR reads an \f(CW\*(C`rc\*(C'\fR file, it runs it through the C -preprocessor first. This option may be used to specify the preprocessor -to use, including any leading arguments. The default preprocessor -argument is \f(CW\*(C`gcc \-E \-xc\-header \-DRC_INVOKED\*(C'\fR. -.IP "\fB\-I\fR \fIdirectory\fR" 4 -.IX Item "-I directory" -.PD 0 -.IP "\fB\-\-include\-dir\fR \fIdirectory\fR" 4 -.IX Item "--include-dir directory" -.PD -Specify an include directory to use when reading an \f(CW\*(C`rc\*(C'\fR file. -\&\fBwindres\fR will pass this to the preprocessor as an \fB\-I\fR -option. \fBwindres\fR will also search this directory when looking for -files named in the \f(CW\*(C`rc\*(C'\fR file. If the argument passed to this command -matches any of the supported \fIformats\fR (as descrived in the \fB\-J\fR -option), it will issue a deprecation warning, and behave just like the -\&\fB\-J\fR option. New programs should not use this behaviour. If a -directory happens to match a \fIformat\fR, simple prefix it with \fB./\fR -to disable the backward compatibility. -.IP "\fB\-D\fR \fItarget\fR" 4 -.IX Item "-D target" -.PD 0 -.IP "\fB\-\-define\fR \fIsym\fR\fB[=\fR\fIval\fR\fB]\fR" 4 -.IX Item "--define sym[=val]" -.PD -Specify a \fB\-D\fR option to pass to the preprocessor when reading an -\&\f(CW\*(C`rc\*(C'\fR file. -.IP "\fB\-U\fR \fItarget\fR" 4 -.IX Item "-U target" -.PD 0 -.IP "\fB\-\-undefine\fR \fIsym\fR" 4 -.IX Item "--undefine sym" -.PD -Specify a \fB\-U\fR option to pass to the preprocessor when reading an -\&\f(CW\*(C`rc\*(C'\fR file. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -Ignored for compatibility with rc. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -Enable verbose mode. This tells you what the preprocessor is if you -didn't specify one. -.IP "\fB\-l\fR \fIval\fR" 4 -.IX Item "-l val" -.PD 0 -.IP "\fB\-\-language\fR \fIval\fR" 4 -.IX Item "--language val" -.PD -Specify the default language to use when reading an \f(CW\*(C`rc\*(C'\fR file. -\&\fIval\fR should be a hexadecimal language code. The low eight bits are -the language, and the high eight bits are the sublanguage. -.IP "\fB\-\-use\-temp\-file\fR" 4 -.IX Item "--use-temp-file" -Use a temporary file to instead of using popen to read the output of -the preprocessor. Use this option if the popen implementation is buggy -on the host (eg., certain non-English language versions of Windows 95 and -Windows 98 are known to have buggy popen where the output will instead -go the console). -.IP "\fB\-\-no\-use\-temp\-file\fR" 4 -.IX Item "--no-use-temp-file" -Use popen, not a temporary file, to read the output of the preprocessor. -This is the default behaviour. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Prints a usage summary. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Prints the version number for \fBwindres\fR. -.IP "\fB\-\-yydebug\fR" 4 -.IX Item "--yydebug" -If \fBwindres\fR is compiled with \f(CW\*(C`YYDEBUG\*(C'\fR defined as \f(CW1\fR, -this will turn on parser debugging. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/dwarf.c b/binutils/dwarf.c index c69cab224b28..cc37b25b701d 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -1,5 +1,5 @@ /* dwarf.c -- display DWARF contents of a BFD binary file - Copyright 2005, 2006 + Copyright 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,12 +19,12 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <stdio.h> - -#include "dwarf.h" - -#include "bucomm.h" +#include "sysdep.h" #include "libiberty.h" +#include "bfd.h" +#include "bucomm.h" +#include "elf/dwarf2.h" +#include "dwarf.h" static int have_frame_base; static int need_base_address; @@ -895,6 +895,9 @@ decode_location_expression (unsigned char * data, case DW_OP_call_ref: printf ("DW_OP_call_ref"); break; + case DW_OP_form_tls_address: + printf ("DW_OP_form_tls_address"); + break; /* GNU extensions. */ case DW_OP_GNU_push_tls_address: @@ -1213,26 +1216,37 @@ read_and_display_attr_value (unsigned long attribute, case DW_AT_language: switch (uvalue) { - case DW_LANG_C: printf ("(non-ANSI C)"); break; + /* Ordered by the numeric value of these constants. */ case DW_LANG_C89: printf ("(ANSI C)"); break; + case DW_LANG_C: printf ("(non-ANSI C)"); break; + case DW_LANG_Ada83: printf ("(Ada)"); break; case DW_LANG_C_plus_plus: printf ("(C++)"); break; + case DW_LANG_Cobol74: printf ("(Cobol 74)"); break; + case DW_LANG_Cobol85: printf ("(Cobol 85)"); break; case DW_LANG_Fortran77: printf ("(FORTRAN 77)"); break; case DW_LANG_Fortran90: printf ("(Fortran 90)"); break; - case DW_LANG_Modula2: printf ("(Modula 2)"); break; case DW_LANG_Pascal83: printf ("(ANSI Pascal)"); break; - case DW_LANG_Ada83: printf ("(Ada)"); break; - case DW_LANG_Cobol74: printf ("(Cobol 74)"); break; - case DW_LANG_Cobol85: printf ("(Cobol 85)"); break; + case DW_LANG_Modula2: printf ("(Modula 2)"); break; /* DWARF 2.1 values. */ + case DW_LANG_Java: printf ("(Java)"); break; case DW_LANG_C99: printf ("(ANSI C99)"); break; case DW_LANG_Ada95: printf ("(ADA 95)"); break; case DW_LANG_Fortran95: printf ("(Fortran 95)"); break; + /* DWARF 3 values. */ + case DW_LANG_PLI: printf ("(PLI)"); break; + case DW_LANG_ObjC: printf ("(Objective C)"); break; + case DW_LANG_ObjC_plus_plus: printf ("(Objective C++)"); break; + case DW_LANG_UPC: printf ("(Unified Parallel C)"); break; + case DW_LANG_D: printf ("(D)"); break; /* MIPS extension. */ case DW_LANG_Mips_Assembler: printf ("(MIPS assembler)"); break; /* UPC extension. */ case DW_LANG_Upc: printf ("(Unified Parallel C)"); break; default: - printf ("(Unknown: %lx)", uvalue); + if (uvalue >= DW_LANG_lo_user && uvalue <= DW_LANG_hi_user) + printf ("(implementation defined: %lx)", uvalue); + else + printf ("(Unknown: %lx)", uvalue); break; } break; @@ -1604,7 +1618,6 @@ process_debug_info (struct dwarf_section *section, void *file, hdrptr += 2; cu_offset = start - section_begin; - start += compunit.cu_length + initial_length_size; cu_abbrev_offset_ptr = hdrptr; compunit.cu_abbrev_offset = byte_get (hdrptr, offset_size); @@ -1628,8 +1641,6 @@ process_debug_info (struct dwarf_section *section, void *file, debug_information [unit].num_range_lists = 0; } - tags = hdrptr; - if (!do_loc) { printf (_(" Compilation Unit @ offset 0x%lx:\n"), cu_offset); @@ -1639,6 +1650,16 @@ process_debug_info (struct dwarf_section *section, void *file, printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size); } + if (cu_offset + compunit.cu_length + initial_length_size + > section->size) + { + warn (_("Debug info is corrupted, length is invalid (section is %lu bytes)\n"), + (unsigned long)section->size); + break; + } + tags = hdrptr; + start += compunit.cu_length + initial_length_size; + if (compunit.cu_version != 2 && compunit.cu_version != 3) { warn (_("Only version 2 and 3 DWARF debug information is currently supported.\n")); @@ -1649,11 +1670,15 @@ process_debug_info (struct dwarf_section *section, void *file, /* Process the abbrevs used by this compilation unit. DWARF sections under Mach-O have non-zero addresses. */ - process_abbrev_section - ((unsigned char *) debug_displays [abbrev].section.start - + compunit.cu_abbrev_offset - debug_displays [abbrev].section.address, - (unsigned char *) debug_displays [abbrev].section.start - + debug_displays [abbrev].section.size); + if (compunit.cu_abbrev_offset >= debug_displays [abbrev].section.size) + warn (_("Debug info is corrupted, abbrev offset is invalid (section is %lu bytes)\n"), + (unsigned long)debug_displays [abbrev].section.size); + else + process_abbrev_section + ((unsigned char *) debug_displays [abbrev].section.start + + compunit.cu_abbrev_offset - debug_displays [abbrev].section.address, + (unsigned char *) debug_displays [abbrev].section.start + + debug_displays [abbrev].section.size); level = 0; while (tags < start) @@ -1673,6 +1698,13 @@ process_debug_info (struct dwarf_section *section, void *file, continue; } + if (!do_loc) + printf (_(" <%d><%lx>: Abbrev Number: %lu"), + level, + (unsigned long) (tags - section_begin + - bytes_read), + abbrev_number); + /* Scan through the abbreviation list until we reach the correct entry. */ for (entry = first_abbrev; @@ -1682,18 +1714,18 @@ process_debug_info (struct dwarf_section *section, void *file, if (entry == NULL) { + if (!do_loc) + { + printf ("\n"); + fflush (stdout); + } warn (_("Unable to locate entry %lu in the abbreviation table\n"), abbrev_number); return 0; } if (!do_loc) - printf (_(" <%d><%lx>: Abbrev Number: %lu (%s)\n"), - level, - (unsigned long) (tags - section_begin - - bytes_read), - abbrev_number, - get_TAG_name (entry->tag)); + printf (_(" (%s)\n"), get_TAG_name (entry->tag)); switch (entry->tag) { @@ -1704,7 +1736,6 @@ process_debug_info (struct dwarf_section *section, void *file, need_base_address = 1; break; case DW_TAG_entry_point: - case DW_TAG_inlined_subroutine: case DW_TAG_subprogram: need_base_address = 0; /* Assuming that there is no DW_AT_frame_base. */ @@ -1713,14 +1744,20 @@ process_debug_info (struct dwarf_section *section, void *file, } for (attr = entry->first_attr; attr; attr = attr->next) - tags = read_and_display_attr (attr->attribute, - attr->form, - tags, cu_offset, - compunit.cu_pointer_size, - offset_size, - compunit.cu_version, - &debug_information [unit], - do_loc); + { + if (! do_loc) + /* Show the offset from where the tag was extracted. */ + printf (" <%2lx>", (unsigned long)(tags - section_begin)); + + tags = read_and_display_attr (attr->attribute, + attr->form, + tags, cu_offset, + compunit.cu_pointer_size, + offset_size, + compunit.cu_version, + &debug_information [unit], + do_loc); + } if (entry->children) ++level; @@ -2315,7 +2352,8 @@ display_debug_loc (struct dwarf_section *section, void *file) error (_("No location lists in .debug_info section!\n")); /* DWARF sections under Mach-O have non-zero addresses. */ - if (debug_information [first].loc_offsets [0] != section->address) + if (debug_information [first].num_loc_offsets > 0 + && debug_information [first].loc_offsets [0] != section->address) warn (_("Location lists in %s section start at 0x%lx\n"), section->name, debug_information [first].loc_offsets [0]); @@ -2495,7 +2533,6 @@ display_debug_str (struct dwarf_section *section, return 1; } - static int display_debug_info (struct dwarf_section *section, void *file) { @@ -2519,6 +2556,7 @@ display_debug_aranges (struct dwarf_section *section, unsigned char *ranges; unsigned long length; unsigned long address; + unsigned char address_size; int excess; int offset_size; int initial_length_size; @@ -2565,28 +2603,45 @@ display_debug_aranges (struct dwarf_section *section, printf (_(" Pointer Size: %d\n"), arange.ar_pointer_size); printf (_(" Segment Size: %d\n"), arange.ar_segment_size); - printf (_("\n Address Length\n")); + address_size = arange.ar_pointer_size + arange.ar_segment_size; + + /* The DWARF spec does not require that the address size be a power + of two, but we do. This will have to change if we ever encounter + an uneven architecture. */ + if ((address_size & (address_size - 1)) != 0) + { + warn (_("Pointer size + Segment size is not a power of two.\n")); + break; + } + + if (address_size > 4) + printf (_("\n Address Length\n")); + else + printf (_("\n Address Length\n")); ranges = hdrptr; - /* Must pad to an alignment boundary that is twice the pointer size. */ - excess = (hdrptr - start) % (2 * arange.ar_pointer_size); + /* Must pad to an alignment boundary that is twice the address size. */ + excess = (hdrptr - start) % (2 * address_size); if (excess) - ranges += (2 * arange.ar_pointer_size) - excess; + ranges += (2 * address_size) - excess; start += arange.ar_length + initial_length_size; - while (ranges + 2 * arange.ar_pointer_size <= start) + while (ranges + 2 * address_size <= start) { - address = byte_get (ranges, arange.ar_pointer_size); + address = byte_get (ranges, address_size); - ranges += arange.ar_pointer_size; + ranges += address_size; - length = byte_get (ranges, arange.ar_pointer_size); + length = byte_get (ranges, address_size); - ranges += arange.ar_pointer_size; + ranges += address_size; - printf (" %8.8lx %lu\n", address, length); + if (address_size > 4) + printf (" 0x%16.16lx 0x%lx\n", address, length); + else + printf (" 0x%8.8lx 0x%lx\n", address, length); } } @@ -2668,7 +2723,8 @@ display_debug_ranges (struct dwarf_section *section, error (_("No range lists in .debug_info section!\n")); /* DWARF sections under Mach-O have non-zero addresses. */ - if (debug_information [first].range_lists [0] != section->address) + if (debug_information [first].num_range_lists > 0 + && debug_information [first].range_lists [0] != section->address) warn (_("Range lists in %s section start at 0x%lx\n"), section->name, debug_information [first].range_lists [0]); @@ -2879,6 +2935,7 @@ static dwarf_vma get_encoded_value (unsigned char *data, int encoding) { int size = size_of_encoded_value (encoding); + if (encoding & DW_EH_PE_signed) return byte_get_signed (data, size); else @@ -2927,7 +2984,7 @@ display_debug_frames (struct dwarf_section *section, { printf ("\n%08lx ZERO terminator\n\n", (unsigned long)(saved_start - section_start)); - return 1; + continue; } if (length == 0xffffffff) @@ -2944,6 +3001,12 @@ display_debug_frames (struct dwarf_section *section, } block_end = saved_start + length + initial_length_size; + if (block_end > end) + { + warn ("Invalid length %#08lx in FDE at %#08lx\n", + length, (unsigned long)(saved_start - section_start)); + block_end = end; + } cie_id = byte_get (start, offset_size); start += offset_size; if (is_eh ? (cie_id == 0) : (cie_id == DW_CIE_ID)) @@ -3078,9 +3141,8 @@ display_debug_frames (struct dwarf_section *section, if (!cie) { - warn ("Invalid CIE pointer %08lx in FDE at %08lx\n", + warn ("Invalid CIE pointer %#08lx in FDE at %#08lx\n", cie_id, (unsigned long)(saved_start - section_start)); - start = block_end; fc->ncols = 0; fc->col_type = xmalloc (sizeof (short int)); fc->col_offset = xmalloc (sizeof (int)); @@ -3584,7 +3646,10 @@ display_debug_frames (struct dwarf_section *section, break; default: - warn (_("unsupported or unknown DW_CFA_%d\n"), op); + if (op >= DW_CFA_lo_user && op <= DW_CFA_hi_user) + printf (_(" DW_CFA_??? (User defined call frame op: %#x)\n"), op); + else + warn (_("unsupported or unknown Dwarf Call Frame Instruction number: %#x\n"), op); start = block_end; } } diff --git a/binutils/dwarf.h b/binutils/dwarf.h index 907ac93ef717..6b4674268a99 100644 --- a/binutils/dwarf.h +++ b/binutils/dwarf.h @@ -1,5 +1,5 @@ /* dwwrf.h - DWARF support header file - Copyright 2005 + Copyright 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -18,9 +18,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" -#include "elf/dwarf2.h" - #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) /* We can't use any bfd types here since readelf may define BFD64 and objdump may not. */ diff --git a/binutils/embedspu.sh b/binutils/embedspu.sh new file mode 100644 index 000000000000..6611172814e6 --- /dev/null +++ b/binutils/embedspu.sh @@ -0,0 +1,257 @@ +#! /bin/sh +# Embed an SPU ELF executable into a PowerPC object file. +# +# Copyright 2006, 2007 Free Software Foundation, Inc. +# +# This file is part of GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. + +usage () +{ + echo "Usage: embedspu [flags] symbol_name input_filename output_filename" + echo + echo " input_filename: SPU ELF executable to be embedded" + echo " output_filename: Resulting PowerPC object file" + echo " symbol_name: Name of program handle struct to be defined" + echo " flags: GCC flags defining PowerPC object file format" + echo " (e.g. -m32 or -m64)" + exit 1 +} + +program_transform_name= +mydir=`dirname "$0"` + +find_prog () +{ + prog=`echo $1 | sed "$program_transform_name"` + prog="$mydir/$prog" + test -x "$prog" && return 0 + prog="$mydir/$1" + test -x "$prog" && return 0 + prog=`echo $1 | sed "$program_transform_name"` + which $prog > /dev/null 2> /dev/null && return 0 + return 1 +} + +SYMBOL= +INFILE= +OUTFILE= +FLAGS= + +parse_args () +{ + while test -n "$1"; do + case "$1" in + -*) FLAGS="${FLAGS} $1" ;; + *) if test -z "$SYMBOL"; then + SYMBOL="$1" + elif test -z "$INFILE"; then + INFILE="$1" + elif test -z "$OUTFILE"; then + OUTFILE="$1" + else + echo "Too many arguments!" + usage + fi ;; + esac + shift + done + if test -z "$OUTFILE"; then + usage + fi + if test ! -r "$INFILE"; then + echo "${INFILE}: File not found" + usage + fi +} + +main () +{ + parse_args "$@" + + # Find a powerpc gcc. Support running from a combined tree build. + if test -x "$mydir/../gcc/xgcc"; then + CC="$mydir/../gcc/xgcc -B$mydir/../gcc/" + else + find_prog gcc + if test $? -ne 0; then + echo "Cannot find $prog" + exit 1 + fi + CC="$prog" + fi + + # Find readelf. Any old readelf should do. + find_prog readelf + if test $? -ne 0; then + if which readelf > /dev/null 2> /dev/null; then + prog=readelf + else + echo "Cannot find $prog" + exit 1 + fi + fi + READELF="$prog" + + # Sanity check the input file + if ! ${READELF} -h ${INFILE} | grep 'Class:.*ELF32' >/dev/null 2>/dev/null \ + || ! ${READELF} -h ${INFILE} | grep 'Type:.*EXEC' >/dev/null 2>/dev/null \ + || ! ${READELF} -h ${INFILE} | egrep 'Machine:.*(SPU|17)' >/dev/null 2>/dev/null + then + echo "${INFILE}: Does not appear to be an SPU executable" + exit 1 + fi + + toe=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *\([0-9]*\)\] *\.toe *[PROGN]*BITS *\([0-9a-f]*\).*,\1 \2,p'` + toe_addr=`echo $toe | sed -n -e 's,.* ,,p'` + toe=`echo $toe | sed -n -e 's, .*,,p'` + # For loaded sections, pick off section number, address, and file offset + sections=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *\([0-9]*\)\] *[^ ]* *PROGBITS *\([0-9a-f]*\) *\([0-9a-f]*\).*,\1 \2 \3,p'` + sections=`echo ${sections}` + # For relocation sections, pick off file offset and info (points to + # section where relocs apply) + relas=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *[0-9]*\] *[^ ]* *RELA *[0-9a-f]* *0*\([0-9a-f][0-9a-f]*\).* \([0-9a-f][0-9a-f]*\) *[0-9a-f][0-9a-f]*$,\1 \2,p'` + relas=`echo ${relas}` + + # Build embedded SPU image. + # 1. The whole SPU ELF file is written to .rodata.speelf + # 2. Symbols starting with the string "_EAR_" in the SPU ELF image are + # special. They allow an SPU program to access corresponding symbols + # (ie. minus the _EAR_ prefix), in the PowerPC program. _EAR_ without + # a suffix is used to refer to the addrress of the SPU image in + # PowerPC address space. _EAR_* symbols must all be defined in .toe + # at 16 byte intervals, or they must be defined in other non-bss + # sections. + # Find all _EAR_ symbols in .toe using readelf, sort by address, and + # write the address of the corresponding PowerPC symbol in a table + # built in .data.spetoe. For _EAE_ symbols not in .toe, create + # .reloc commands to relocate their location directly. + # 3. Look for R_SPU_PPU32 and R_SPU_PPU64 relocations in the SPU ELF image + # and create .reloc commands for them. + # 4. Write a struct spe_program_handle to .data. + # 5. Write a table of _SPUEAR_ symbols. + ${CC} ${FLAGS} -x assembler-with-cpp -nostartfiles -nostdlib \ + -Wa,-mbig -Wl,-r -Wl,-x -o ${OUTFILE} - <<EOF + .section .data.spetoe,"aw",@progbits + .p2align 7 +__spetoe__: +`${READELF} -s -W ${INFILE} | grep ' _EAR_' | sort -k 2 | awk \ +'BEGIN { \ + addr = strtonum ("0x" "'${toe_addr-0}'"); \ + split ("'"${sections}"'", s, " "); \ + for (i = 1; i in s; i += 3) { \ + sec_off[s[i]] = strtonum ("0x" s[i+2]) - strtonum ("0x" s[i+1]); \ + } \ +} \ +$7 == "'${toe}'" && strtonum ("0x" $2) != addr { \ + print "#error Symbol " $8 " not in 16 byte element toe array!"; \ +} \ +$7 == "'${toe}'" { \ + addr = addr + 16; \ +} \ +$7 == "'${toe}'" { \ + print "#ifdef _LP64"; \ + print " .quad " ($8 == "_EAR_" ? "__speelf__" : substr($8, 6)) ", 0"; \ + print "#else"; \ + print " .int 0, " ($8 == "_EAR_" ? "__speelf__" : substr($8, 6)) ", 0, 0"; \ + print "#endif"; \ +} \ +$7 != "'${toe}'" && $7 in sec_off { \ + print "#ifdef _LP64"; \ + print " .reloc __speelf__+" strtonum ("0x" $2) + sec_off[$7] ", R_PPC64_ADDR64, " ($8 == "_EAR_" ? "__speelf__" : substr($8, 6)); \ + print "#else"; \ + print " .reloc __speelf__+" strtonum ("0x" $2) + sec_off[$7] + 4 ", R_PPC_ADDR32, " ($8 == "_EAR_" ? "__speelf__" : substr($8, 6)); \ + print "#endif"; \ + if (!donedef) { print "#define HAS_RELOCS 1"; donedef = 1; }; \ +} \ +$7 != "'${toe}'" && ! $7 in sec_off { \ + print "#error Section not found for " $8; \ +} \ +'` +`test -z "${relas}" || ${READELF} -r -W ${INFILE} | awk \ +'BEGIN { \ + split ("'"${sections}"'", s, " "); \ + for (i = 1; i in s; i += 3) { \ + sec_off[s[i]] = strtonum ("0x" s[i+2]) - strtonum ("0x" s[i+1]); \ + } \ + split ("'"${relas}"'", s, " "); \ + for (i = 1; i in s; i += 2) { \ + rela[s[i]] = strtonum (s[i+1]); \ + } \ +} \ +/^Relocation section/ { \ + sec = substr($6, 3); \ +} \ +$3 ~ /R_SPU_PPU/ { \ + print "#ifdef _LP64"; \ + print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] ", R_PPC64_ADDR" substr($3, 10) ", " ($5 != "" ? $5 "+0x" $7 : "__speelf__ + 0x" $4); \ + print "#else"; \ + print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] + (substr($3, 10) == "64" ? 4 : 0)", R_PPC_ADDR32, " ($5 != "" ? $5 "+0x" $7 : "__speelf__ + 0x" $4); \ + print "#endif"; \ + if (!donedef) { print "#define HAS_RELOCS 1"; donedef = 1; }; \ +} \ +$3 ~ /unrecognized:/ { \ + print "#ifdef _LP64"; \ + print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] ", R_PPC64_ADDR" ($4 == "f" ? "64" : "32") ", " ($6 != "" ? $6 "+0x" $8 : "__speelf__ + 0x" $5); \ + print "#else"; \ + print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] + ($4 == "f" ? 4 : 0)", R_PPC_ADDR32, " ($6 != "" ? $6 "+0x" $8 : "__speelf__ + 0x" $5); \ + print "#endif"; \ + if (!donedef) { print "#define HAS_RELOCS 1"; donedef = 1; }; \ +} \ +'` +#if defined (HAS_RELOCS) && (defined (__PIC__) || defined (__PIE__)) + .section .data.rel.ro.speelf,"a",@progbits +#else + .section .rodata.speelf,"a",@progbits +#endif + .p2align 7 +__speelf__: + .incbin "${INFILE}" + + .section .data,"aw",@progbits + .globl ${SYMBOL} + .type ${SYMBOL}, @object +# fill in a struct spe_program_handle +#ifdef _LP64 + .p2align 3 +${SYMBOL}: + .int 24 + .int 0 + .quad __speelf__ + .quad __spetoe__ +#else + .p2align 2 +${SYMBOL}: + .int 12 + .int __speelf__ + .int __spetoe__ +#endif + .size ${SYMBOL}, . - ${SYMBOL} + +`${READELF} -s -W ${INFILE} | grep ' _SPUEAR_' | sort -k 2 | awk \ +'{ \ + print " .globl '${SYMBOL}'_" substr($8, 9); \ + print " .type '${SYMBOL}'_" substr($8, 9) ", @object"; \ + print " .size '${SYMBOL}'_" substr($8, 9) ", 4"; \ + print "'${SYMBOL}'_" substr($8, 9) ":"; \ + print " .int 0x" $2; \ +} \ +'` +EOF +} + +main "$@" diff --git a/binutils/emul_aix.c b/binutils/emul_aix.c index 8161a86822bb..97677bc36d29 100644 --- a/binutils/emul_aix.c +++ b/binutils/emul_aix.c @@ -1,5 +1,5 @@ /* Binutils emulation layer. - Copyright 2002, 2003 Free Software Foundation, Inc. + Copyright 2002, 2003, 2006 Free Software Foundation, Inc. Written by Tom Rix, Red Hat Inc. This file is part of GNU Binutils. @@ -126,25 +126,25 @@ ar_emul_aix5_replace (bfd **after_bfd, char *file_name, bfd_boolean verbose) static bfd_boolean ar_emul_aix_parse_arg (char *arg) { - if (strncmp (arg, "-X32_64", 6) == 0) + if (CONST_STRNEQ (arg, "-X32_64")) { big_archive = TRUE; X32 = TRUE; X64 = TRUE; } - else if (strncmp (arg, "-X32", 3) == 0) + else if (CONST_STRNEQ (arg, "-X32")) { big_archive = TRUE; X32 = TRUE; X64 = FALSE; } - else if (strncmp (arg, "-X64", 3) == 0) + else if (CONST_STRNEQ (arg, "-X64")) { big_archive = TRUE; X32 = FALSE; X64 = TRUE; } - else if (strncmp (arg, "-g", 2) == 0) + else if (CONST_STRNEQ (arg, "-g")) { big_archive = FALSE; X32 = TRUE; diff --git a/binutils/filemode.c b/binutils/filemode.c index 78578c88241c..9c44709111b6 100644 --- a/binutils/filemode.c +++ b/binutils/filemode.c @@ -1,6 +1,6 @@ /* filemode.c -- make a string describing file modes - Copyright 1985, 1990, 1991, 1994, 1995, 1997, 1999, 2002, 2003, 2005 - Free Software Foundation, Inc. + Copyright 1985, 1990, 1991, 1994, 1995, 1997, 1999, 2002, 2003, 2005, + 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" diff --git a/binutils/ieee.c b/binutils/ieee.c index 98ec30de9efd..987420b9209d 100644 --- a/binutils/ieee.c +++ b/binutils/ieee.c @@ -1,5 +1,5 @@ /* ieee.c -- Read and write IEEE-695 debugging information. - Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2006 + Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. @@ -22,12 +22,10 @@ /* This file reads and writes IEEE-695 debugging information. */ -#include <stdio.h> +#include "sysdep.h" #include <assert.h> - #include "bfd.h" #include "ieee.h" -#include "bucomm.h" #include "libiberty.h" #include "debug.h" #include "budbg.h" diff --git a/binutils/mclex.c b/binutils/mclex.c new file mode 100644 index 000000000000..f6cedd9efd74 --- /dev/null +++ b/binutils/mclex.c @@ -0,0 +1,441 @@ +/* mclex.c -- lexer for Windows mc files parser. + Copyright 2007 + Free Software Foundation, Inc. + + Written by Kai Tietz, Onevision. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +/* This is a lexer used by the Windows rc file parser. + It basically just recognized a bunch of keywords. */ + +#include "sysdep.h" +#include "bfd.h" +#include "bucomm.h" +#include "libiberty.h" +#include "safe-ctype.h" +#include "windmc.h" +#include "mcparse.h" + +#include <assert.h> + +/* Exported globals. */ +bfd_boolean mclex_want_nl = FALSE; +bfd_boolean mclex_want_line = FALSE; +bfd_boolean mclex_want_filename = FALSE; + +/* Local globals. */ +static unichar *input_stream = NULL; +static unichar *input_stream_pos = NULL; +static int input_line = 1; +static const char *input_filename = NULL; + +void +mc_set_content (const unichar *src) +{ + if (!src) + return; + input_stream = input_stream_pos = unichar_dup (src); +} + +void +mc_set_inputfile (const char *name) +{ + if (! name || *name == 0) + input_filename = "-"; + else + { + const char *s1 = strrchr (name, '/'); + const char *s2 = strrchr (name, '\\'); + + if (! s1) + s1 = s2; + if (s1 && s2 && s1 < s2) + s1 = s2; + if (! s1) + s1 = name; + else + s1++; + s1 = xstrdup (s1); + input_filename = s1; + } +} + +static void +show_msg (const char *kind, const char *msg, va_list argp) +{ + fprintf (stderr, "In %s at line %d: %s: ", input_filename, input_line, kind); + vfprintf (stderr, msg, argp); + fprintf (stderr, ".\n"); +} + +void +mc_warn (const char *s, ...) +{ + va_list argp; + va_start (argp, s); + show_msg ("warning", s, argp); + va_end (argp); +} + +void +mc_fatal (const char *s, ...) +{ + va_list argp; + va_start (argp, s); + show_msg ("fatal", s, argp); + va_end (argp); + xexit (1); +} + + +int +yyerror (const char *s, ...) +{ + va_list argp; + va_start (argp, s); + show_msg ("parser", s, argp); + va_end (argp); + return 1; +} + +static unichar * +get_diff (unichar *end, unichar *start) +{ + unichar *ret; + unichar save = *end; + + *end = 0; + ret = unichar_dup (start); + *end = save; + return ret; +} + +static rc_uint_type +parse_digit (unichar ch) +{ + rc_uint_type base = 10, v = 0, c; + + if (ch == '0') + { + base = 8; + switch (input_stream_pos[0]) + { + case 'x': case 'X': base = 16; input_stream_pos++; break; + case 'o': case 'O': base = 8; input_stream_pos++; break; + case 'b': case 'B': base = 2; input_stream_pos++; break; + } + } + else + v = (rc_uint_type) (ch - '0'); + + while ((ch = input_stream_pos[0]) != 0) + { + if (ch >= 'A' && ch <= 'F') + c = (rc_uint_type) (ch - 'A') + 10; + else if (ch >= 'a' && ch <= 'f') + c = (rc_uint_type) (ch - 'a') + 10; + else if (ch >= '0' && ch <= '9') + c = (rc_uint_type) (ch - '0'); + else + break; + v *= base; + v += c; + ++input_stream_pos; + } + if (input_stream_pos[0] == 'U' || input_stream_pos[0] == 'u') + input_stream_pos++; + if (input_stream_pos[0] == 'L' || input_stream_pos[0] == 'l') + input_stream_pos++; + if (input_stream_pos[0] == 'L' || input_stream_pos[0] == 'l') + input_stream_pos++; + return v; +} + +static mc_keyword *keyword_top = NULL; + +const mc_keyword * +enum_facility (int e) +{ + mc_keyword *h = keyword_top; + + while (h != NULL) + { + while (h && strcmp (h->group_name, "facility") != 0) + h = h->next; + if (e == 0) + return h; + --e; + if (h) + h = h->next; + } + return h; +} + +const mc_keyword * +enum_severity (int e) +{ + mc_keyword *h = keyword_top; + + while (h != NULL) + { + while (h && strcmp (h->group_name, "severity") != 0) + h = h->next; + if (e == 0) + return h; + --e; + if (h) + h = h->next; + } + return h; +} + +static void +mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv) +{ + unichar *usz, *usv = NULL; + rc_uint_type usz_len; + + unicode_from_codepage (&usz_len, &usz, sz, CP_ACP); + if (sv) + unicode_from_codepage (&usz_len, &usv, sv, CP_ACP); + mc_add_keyword (usz, rid, grp, nv, usv); +} + +void +mc_add_keyword (unichar *usz, int rid, const char *grp, rc_uint_type nv, unichar *sv) +{ + mc_keyword *p, *c, *n; + size_t len = unichar_len (usz); + + c = keyword_top; + p = NULL; + while (c != NULL) + { + if (c->len > len) + break; + if (c->len == len) + { + int e = memcmp (usz, c->usz, len * sizeof (unichar)); + + if (e < 0) + break; + if (! e) + { + if (! strcmp (grp, "keyword") || strcmp (c->group_name, grp) != 0) + fatal (_("Duplicate symbol entered into keyword list.")); + c->rid = rid; + c->nval = nv; + c->sval = (!sv ? NULL : unichar_dup (sv)); + if (! strcmp (grp, "language")) + { + const wind_language_t *lag = wind_find_language_by_id ((unsigned) nv); + + if (lag == NULL) + fatal ("Language ident 0x%lx is not resolvable.\n", (long) nv); + memcpy (&c->lang_info, lag, sizeof (*lag)); + } + return; + } + } + c = (p = c)->next; + } + n = xmalloc (sizeof (mc_keyword)); + n->next = c; + n->len = len; + n->group_name = grp; + n->usz = usz; + n->rid = rid; + n->nval = nv; + n->sval = (!sv ? NULL : unichar_dup (sv)); + if (! strcmp (grp, "language")) + { + const wind_language_t *lag = wind_find_language_by_id ((unsigned) nv); + if (lag == NULL) + fatal ("Language ident 0x%lx is not resolvable.\n", (long) nv); + memcpy (&n->lang_info, lag, sizeof (*lag)); + } + if (! p) + keyword_top = n; + else + p->next = n; +} + +static int +mc_token (const unichar *t, size_t len) +{ + static int was_init = 0; + mc_keyword *k; + + if (! was_init) + { + was_init = 1; + mc_add_keyword_ascii ("OutputBase", MCOUTPUTBASE, "keyword", 0, NULL); + mc_add_keyword_ascii ("MessageIdTypedef", MCMESSAGEIDTYPEDEF, "keyword", 0, NULL); + mc_add_keyword_ascii ("SeverityNames", MCSEVERITYNAMES, "keyword", 0, NULL); + mc_add_keyword_ascii ("FacilityNames", MCFACILITYNAMES, "keyword", 0, NULL); + mc_add_keyword_ascii ("LanguageNames", MCLANGUAGENAMES, "keyword", 0, NULL); + mc_add_keyword_ascii ("MessageId", MCMESSAGEID, "keyword", 0, NULL); + mc_add_keyword_ascii ("Severity", MCSEVERITY, "keyword", 0, NULL); + mc_add_keyword_ascii ("Facility", MCFACILITY, "keyword", 0, NULL); + mc_add_keyword_ascii ("SymbolicName", MCSYMBOLICNAME, "keyword", 0, NULL); + mc_add_keyword_ascii ("Language", MCLANGUAGE, "keyword", 0, NULL); + mc_add_keyword_ascii ("Success", MCTOKEN, "severity", 0, NULL); + mc_add_keyword_ascii ("Informational", MCTOKEN, "severity", 1, NULL); + mc_add_keyword_ascii ("Warning", MCTOKEN, "severity", 2, NULL); + mc_add_keyword_ascii ("Error", MCTOKEN, "severity", 3, NULL); + mc_add_keyword_ascii ("System", MCTOKEN, "facility", 0xff, NULL); + mc_add_keyword_ascii ("Application", MCTOKEN, "facility", 0xfff, NULL); + mc_add_keyword_ascii ("English", MCTOKEN, "language", 0x409, "MSG00001"); + } + k = keyword_top; + if (!len || !t || *t == 0) + return -1; + while (k != NULL) + { + if (k->len > len) + break; + if (k->len == len) + { + if (! memcmp (k->usz, t, len * sizeof (unichar))) + { + if (k->rid == MCTOKEN) + yylval.tok = k; + return k->rid; + } + } + k = k->next; + } + return -1; +} + +int +yylex (void) +{ + unichar *start_token; + unichar ch; + + if (! input_stream_pos) + { + fatal ("Input stream not setuped.\n"); + return -1; + } + if (mclex_want_line) + { + start_token = input_stream_pos; + if (input_stream_pos[0] == '.' + && (input_stream_pos[1] == '\n' + || (input_stream_pos[1] == '\r' && input_stream_pos[2] == '\n'))) + { + mclex_want_line = FALSE; + while (input_stream_pos[0] != 0 && input_stream_pos[0] != '\n') + ++input_stream_pos; + if (input_stream_pos[0] == '\n') + ++input_stream_pos; + return MCENDLINE; + } + while (input_stream_pos[0] != 0 && input_stream_pos[0] != '\n') + ++input_stream_pos; + if (input_stream_pos[0] == '\n') + ++input_stream_pos; + yylval.ustr = get_diff (input_stream_pos, start_token); + return MCLINE; + } + while ((ch = input_stream_pos[0]) <= 0x20) + { + if (ch == 0) + return -1; + ++input_stream_pos; + if (ch == '\n') + input_line += 1; + if (mclex_want_nl && ch == '\n') + { + mclex_want_nl = FALSE; + return NL; + } + } + start_token = input_stream_pos; + ++input_stream_pos; + if (mclex_want_filename) + { + mclex_want_filename = FALSE; + if (ch == '"') + { + start_token++; + while ((ch = input_stream_pos[0]) != 0) + { + if (ch == '"') + break; + ++input_stream_pos; + } + yylval.ustr = get_diff (input_stream_pos, start_token); + if (ch == '"') + ++input_stream_pos; + } + else + { + while ((ch = input_stream_pos[0]) != 0) + { + if (ch <= 0x20 || ch == ')') + break; + ++input_stream_pos; + } + yylval.ustr = get_diff (input_stream_pos, start_token); + } + return MCFILENAME; + } + switch (ch) + { + case ';': + ++start_token; + while (input_stream_pos[0] != '\n' && input_stream_pos[0] != 0) + ++input_stream_pos; + if (input_stream_pos[0] == '\n') + input_stream_pos++; + yylval.ustr = get_diff (input_stream_pos, start_token); + return MCCOMMENT; + case '=': + return '='; + case '(': + return '('; + case ')': + return ')'; + case '+': + return '+'; + case ':': + return ':'; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + yylval.ival = parse_digit (ch); + return MCNUMBER; + default: + if (ch >= 0x40) + { + int ret; + while (input_stream_pos[0] >= 0x40 || (input_stream_pos[0] >= '0' && input_stream_pos[0] <= '9')) + ++input_stream_pos; + ret = mc_token (start_token, (size_t) (input_stream_pos - start_token)); + if (ret != -1) + return ret; + yylval.ustr = get_diff (input_stream_pos, start_token); + return MCIDENT; + } + yyerror ("illegal character 0x%x.", ch); + } + return -1; +} diff --git a/binutils/mcparse.y b/binutils/mcparse.y new file mode 100644 index 000000000000..9aaba9b8d419 --- /dev/null +++ b/binutils/mcparse.y @@ -0,0 +1,356 @@ +%{ /* mcparse.y -- parser for Windows mc files + Copyright 2007 + Free Software Foundation, Inc. + + Parser for Windows mc files + Written by Kai Tietz, Onevision. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +/* This is a parser for Windows rc files. It is based on the parser + by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */ + +#include "sysdep.h" +#include "bfd.h" +#include "bucomm.h" +#include "libiberty.h" +#include "windmc.h" +#include "safe-ctype.h" + +static rc_uint_type mc_last_id = 0; +static rc_uint_type mc_sefa_val = 0; +static unichar *mc_last_symbol = NULL; +static const mc_keyword *mc_cur_severity = NULL; +static const mc_keyword *mc_cur_facility = NULL; +static mc_node *cur_node = NULL; + +%} + +%union +{ + rc_uint_type ival; + unichar *ustr; + const mc_keyword *tok; + mc_node *nod; +}; + +%start input + +%token NL +%token<ustr> MCIDENT MCFILENAME MCLINE MCCOMMENT +%token<tok> MCTOKEN +%token MCENDLINE +%token MCLANGUAGENAMES MCFACILITYNAMES MCSEVERITYNAMES MCOUTPUTBASE MCMESSAGEIDTYPEDEF +%token MCLANGUAGE MCMESSAGEID MCSEVERITY MCFACILITY MCSYMBOLICNAME +%token <ival> MCNUMBER + +%type<ival> id vid sefasy_def +%type<ustr> alias_name token lines comments +%type<tok> lang + +%% +input: entities + ; + +entities: + /* empty */ + | entities entity + ; +entity: global_section + | message + | comments + { + cur_node = mc_add_node (); + cur_node->user_text = $1; + } + | error { mc_fatal ("syntax error"); } +; + +global_section: + MCSEVERITYNAMES '=' '(' severitymaps ')' + | MCSEVERITYNAMES '=' '(' severitymaps error { mc_fatal ("missing ')' in SeverityNames"); } + | MCSEVERITYNAMES '=' error { mc_fatal ("missing '(' in SeverityNames"); } + | MCSEVERITYNAMES error { mc_fatal ("missing '=' for SeverityNames"); } + | MCLANGUAGENAMES '=' '(' langmaps ')' + | MCLANGUAGENAMES '=' '(' langmaps error { mc_fatal ("missing ')' in LanguageNames"); } + | MCLANGUAGENAMES '=' error { mc_fatal ("missing '(' in LanguageNames"); } + | MCLANGUAGENAMES error { mc_fatal ("missing '=' for LanguageNames"); } + | MCFACILITYNAMES '=' '(' facilitymaps ')' + | MCFACILITYNAMES '=' '(' facilitymaps error { mc_fatal ("missing ')' in FacilityNames"); } + | MCFACILITYNAMES '=' error { mc_fatal ("missing '(' in FacilityNames"); } + | MCFACILITYNAMES error { mc_fatal ("missing '=' for FacilityNames"); } + | MCOUTPUTBASE '=' MCNUMBER + { + if ($3 != 10 && $3 != 16) + mc_fatal ("OutputBase allows 10 or 16 as value"); + mcset_out_values_are_decimal = ($3 == 10 ? 1 : 0); + } + | MCMESSAGEIDTYPEDEF '=' MCIDENT + { + mcset_msg_id_typedef = $3; + } + | MCMESSAGEIDTYPEDEF '=' error + { + mc_fatal ("MessageIdTypedef expects an identifier"); + } + | MCMESSAGEIDTYPEDEF error + { + mc_fatal ("missing '=' for MessageIdTypedef"); + } +; + +severitymaps: + severitymap + | severitymaps severitymap + | error { mc_fatal ("severity ident missing"); } +; + +severitymap: + token '=' MCNUMBER alias_name + { + mc_add_keyword ($1, MCTOKEN, "severity", $3, $4); + } + | token '=' error { mc_fatal ("severity number missing"); } + | token error { mc_fatal ("severity missing '='"); } +; + +facilitymaps: + facilitymap + | facilitymaps facilitymap + | error { mc_fatal ("missing ident in FacilityNames"); } +; + +facilitymap: + token '=' MCNUMBER alias_name + { + mc_add_keyword ($1, MCTOKEN, "facility", $3, $4); + } + | token '=' error { mc_fatal ("facility number missing"); } + | token error { mc_fatal ("facility missing '='"); } +; + +langmaps: + langmap + | langmaps langmap + | error { mc_fatal ("missing ident in LanguageNames"); } +; + +langmap: + token '=' MCNUMBER lex_want_filename ':' MCFILENAME + { + mc_add_keyword ($1, MCTOKEN, "language", $3, $6); + } + | token '=' MCNUMBER lex_want_filename ':' error { mc_fatal ("missing filename in LanguageNames"); } + | token '=' MCNUMBER error { mc_fatal ("missing ':' in LanguageNames"); } + | token '=' error { mc_fatal ("missing language code in LanguageNames"); } + | token error { mc_fatal ("missing '=' for LanguageNames"); } +; + +alias_name: + /* empty */ + { + $$ = NULL; + } + | ':' MCIDENT + { + $$ = $2; + } + | ':' error { mc_fatal ("illegal token in identifier"); $$ = NULL; } +; + +message: + id sefasy_def + { + cur_node = mc_add_node (); + cur_node->symbol = mc_last_symbol; + cur_node->facility = mc_cur_facility; + cur_node->severity = mc_cur_severity; + cur_node->id = ($1 & 0xffffUL); + cur_node->vid = ($1 & 0xffffUL) | mc_sefa_val; + mc_last_id = $1; + } + lang_entities +; + +id: MCMESSAGEID '=' vid { $$ = $3; } + | MCMESSAGEID '=' error { mc_fatal ("missing number in MessageId"); $$ = 0; } + | MCMESSAGEID error { mc_fatal ("missing '=' for MessageId"); $$ = 0; } +; + +vid: /* empty */ + { + $$ = ++mc_last_id; + } + | MCNUMBER + { + $$ = $1; + } + | '+' MCNUMBER + { + $$ = mc_last_id + $2; + } + | '+' error { mc_fatal ("missing number after MessageId '+'"); } +; + +sefasy_def: + /* empty */ + { + $$ = 0; + mc_sefa_val = (mcset_custom_bit ? 1 : 0) << 29; + mc_last_symbol = NULL; + mc_cur_severity = NULL; + mc_cur_facility = NULL; + } + | sefasy_def severity + { + if ($1 & 1) + mc_warn (_("duplicate definition of Severity")); + $$ = $1 | 1; + } + | sefasy_def facility + { + if ($1 & 2) + mc_warn (_("duplicate definition of Facility")); + $$ = $1 | 2; + } + | sefasy_def symbol + { + if ($1 & 4) + mc_warn (_("duplicate definition of SymbolicName")); + $$ = $1 | 4; + } +; + +severity: MCSEVERITY '=' MCTOKEN + { + mc_sefa_val &= ~ (0x3UL << 30); + mc_sefa_val |= (($3->nval & 0x3UL) << 30); + mc_cur_severity = $3; + } +; + +facility: MCFACILITY '=' MCTOKEN + { + mc_sefa_val &= ~ (0xfffUL << 16); + mc_sefa_val |= (($3->nval & 0xfffUL) << 16); + mc_cur_facility = $3; + } +; + +symbol: MCSYMBOLICNAME '=' MCIDENT + { + mc_last_symbol = $3; + } +; + +lang_entities: + lang_entity + | lang_entities lang_entity +; + +lang_entity: + lang lex_want_line lines MCENDLINE + { + mc_node_lang *h; + h = mc_add_node_lang (cur_node, $1, cur_node->vid); + h->message = $3; + if (mcset_max_message_length != 0 && unichar_len (h->message) > mcset_max_message_length) + mc_warn ("message length to long"); + } +; + +lines: MCLINE + { + $$ = $1; + } + | lines MCLINE + { + unichar *h; + rc_uint_type l1,l2; + l1 = unichar_len ($1); + l2 = unichar_len ($2); + h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); + if (l1) memcpy (h, $1, l1 * sizeof (unichar)); + if (l2) memcpy (&h[l1], $2, l2 * sizeof (unichar)); + h[l1 + l2] = 0; + $$ = h; + } + | error { mc_fatal ("missing end of message text"); $$ = NULL; } + | lines error { mc_fatal ("missing end of message text"); $$ = $1; } +; + +comments: MCCOMMENT { $$ = $1; } + | comments MCCOMMENT + { + unichar *h; + rc_uint_type l1,l2; + l1 = unichar_len ($1); + l2 = unichar_len ($2); + h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); + if (l1) memcpy (h, $1, l1 * sizeof (unichar)); + if (l2) memcpy (&h[l1], $2, l2 * sizeof (unichar)); + h[l1 + l2] = 0; + $$ = h; + } +; + +lang: MCLANGUAGE lex_want_nl '=' MCTOKEN NL + { + $$ = $4; + } + | MCLANGUAGE lex_want_nl '=' MCIDENT NL + { + $$ = NULL; + mc_fatal (_("undeclared language identifier")); + } + | MCLANGUAGE lex_want_nl '=' token error + { + $$ = NULL; + mc_fatal ("missing newline after Language"); + } + | MCLANGUAGE lex_want_nl '=' error + { + $$ = NULL; + mc_fatal ("missing ident for Language"); + } + | MCLANGUAGE error + { + $$ = NULL; + mc_fatal ("missing '=' for Language"); + } +; + +token: MCIDENT { $$ = $1; } + | MCTOKEN { $$ = $1->usz; } +; + +lex_want_nl: + /* Empty */ { mclex_want_nl = 1; } +; + +lex_want_line: + /* Empty */ { mclex_want_line = 1; } +; + +lex_want_filename: + /* Empty */ { mclex_want_filename = 1; } +; + +%% + +/* Something else. */ diff --git a/binutils/nlmconv.c b/binutils/nlmconv.c index 551e7e59e430..9932ba29b71d 100644 --- a/binutils/nlmconv.c +++ b/binutils/nlmconv.c @@ -1,6 +1,6 @@ /* nlmconv.c -- NLM conversion program Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -32,9 +32,9 @@ #endif #endif +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" -#include "bucomm.h" #include "safe-ctype.h" #include "ansidecl.h" @@ -53,6 +53,8 @@ #include "coff/ecoff.h" #endif +#include "bucomm.h" + /* If strerror is just a macro, we want to use the one from libiberty since it will handle undefined values. */ #undef strerror @@ -737,7 +739,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, help_section, SEC_HAS_CONTENTS)) bfd_fatal (_("help section")); - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (message_file != NULL) @@ -759,7 +761,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, message_section, SEC_HAS_CONTENTS)) bfd_fatal (_("message section")); - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (modules != NULL) @@ -795,7 +797,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, rpc_section, SEC_HAS_CONTENTS)) bfd_fatal (_("rpc section")); - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (sharelib_file != NULL) @@ -852,20 +854,20 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, shared_section, SEC_HAS_CONTENTS)) bfd_fatal (_("shared section")); - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } } /* Check whether a version was given. */ - if (strncmp (version_hdr->stamp, "VeRsIoN#", 8) != 0) + if (!CONST_STRNEQ (version_hdr->stamp, "VeRsIoN#")) non_fatal (_("warning: No version number given")); /* At least for now, always create an extended header, because that is what NLMLINK does. */ - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); - strncpy (nlm_cygnus_ext_header (outbfd)->stamp, "CyGnUsEx", 8); + LITMEMCPY (nlm_cygnus_ext_header (outbfd)->stamp, "CyGnUsEx"); /* If the date was not given, force it in. */ if (nlm_version_header (outbfd)->month == 0 @@ -880,7 +882,7 @@ main (int argc, char **argv) nlm_version_header (outbfd)->month = ptm->tm_mon + 1; nlm_version_header (outbfd)->day = ptm->tm_mday; nlm_version_header (outbfd)->year = ptm->tm_year + 1900; - strncpy (version_hdr->stamp, "VeRsIoN#", 8); + LITMEMCPY (version_hdr->stamp, "VeRsIoN#"); } #ifdef NLMCONV_POWERPC @@ -1109,7 +1111,7 @@ show_usage (FILE *file, int status) -h --help Display this information\n\ -v --version Display the program's version\n\ ")); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } @@ -1747,9 +1749,9 @@ powerpc_build_stubs (bfd *inbfd, bfd *outbfd ATTRIBUTE_UNUSED, /* Make a new undefined symbol with the same name but without the leading `.'. */ - newsym = (asymbol *) xmalloc (sizeof (asymbol)); + newsym = xmalloc (sizeof (asymbol)); *newsym = *sym; - newname = (char *) xmalloc (strlen (bfd_asymbol_name (sym))); + newname = xmalloc (strlen (bfd_asymbol_name (sym))); strcpy (newname, bfd_asymbol_name (sym) + 1); newsym->name = newname; diff --git a/binutils/nlmheader.c b/binutils/nlmheader.c deleted file mode 100644 index 1e6a862b2e52..000000000000 --- a/binutils/nlmheader.c +++ /dev/null @@ -1,2534 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHECK = 258, - CODESTART = 259, - COPYRIGHT = 260, - CUSTOM = 261, - DATE = 262, - DEBUG = 263, - DESCRIPTION = 264, - EXIT = 265, - EXPORT = 266, - FLAG_ON = 267, - FLAG_OFF = 268, - FULLMAP = 269, - HELP = 270, - IMPORT = 271, - INPUT = 272, - MAP = 273, - MESSAGES = 274, - MODULE = 275, - MULTIPLE = 276, - OS_DOMAIN = 277, - OUTPUT = 278, - PSEUDOPREEMPTION = 279, - REENTRANT = 280, - SCREENNAME = 281, - SHARELIB = 282, - STACK = 283, - START = 284, - SYNCHRONIZE = 285, - THREADNAME = 286, - TYPE = 287, - VERBOSE = 288, - VERSIONK = 289, - XDCDATA = 290, - STRING = 291, - QUOTED_STRING = 292 - }; -#endif -/* Tokens. */ -#define CHECK 258 -#define CODESTART 259 -#define COPYRIGHT 260 -#define CUSTOM 261 -#define DATE 262 -#define DEBUG 263 -#define DESCRIPTION 264 -#define EXIT 265 -#define EXPORT 266 -#define FLAG_ON 267 -#define FLAG_OFF 268 -#define FULLMAP 269 -#define HELP 270 -#define IMPORT 271 -#define INPUT 272 -#define MAP 273 -#define MESSAGES 274 -#define MODULE 275 -#define MULTIPLE 276 -#define OS_DOMAIN 277 -#define OUTPUT 278 -#define PSEUDOPREEMPTION 279 -#define REENTRANT 280 -#define SCREENNAME 281 -#define SHARELIB 282 -#define STACK 283 -#define START 284 -#define SYNCHRONIZE 285 -#define THREADNAME 286 -#define TYPE 287 -#define VERBOSE 288 -#define VERSIONK 289 -#define XDCDATA 290 -#define STRING 291 -#define QUOTED_STRING 292 - - - - -/* Copy the first part of user declarations. */ -#line 1 "nlmheader.y" -/* nlmheader.y - parse NLM header specification keywords. - Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003 - Free Software Foundation, Inc. - -This file is part of GNU Binutils. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Ian Lance Taylor <ian@cygnus.com>. - - This bison file parses the commands recognized by the NetWare NLM - linker, except for lists of object files. It stores the - information in global variables. - - This implementation is based on the description in the NetWare Tool - Maker Specification manual, edition 1.0. */ - -#include "ansidecl.h" -#include <stdio.h> -#include "safe-ctype.h" -#include "bfd.h" -#include "bucomm.h" -#include "nlm/common.h" -#include "nlm/internal.h" -#include "nlmconv.h" - -/* Information is stored in the structures pointed to by these - variables. */ - -Nlm_Internal_Fixed_Header *fixed_hdr; -Nlm_Internal_Variable_Header *var_hdr; -Nlm_Internal_Version_Header *version_hdr; -Nlm_Internal_Copyright_Header *copyright_hdr; -Nlm_Internal_Extended_Header *extended_hdr; - -/* Procedure named by CHECK. */ -char *check_procedure; -/* File named by CUSTOM. */ -char *custom_file; -/* Whether to generate debugging information (DEBUG). */ -bfd_boolean debug_info; -/* Procedure named by EXIT. */ -char *exit_procedure; -/* Exported symbols (EXPORT). */ -struct string_list *export_symbols; -/* List of files from INPUT. */ -struct string_list *input_files; -/* Map file name (MAP, FULLMAP). */ -char *map_file; -/* Whether a full map has been requested (FULLMAP). */ -bfd_boolean full_map; -/* File named by HELP. */ -char *help_file; -/* Imported symbols (IMPORT). */ -struct string_list *import_symbols; -/* File named by MESSAGES. */ -char *message_file; -/* Autoload module list (MODULE). */ -struct string_list *modules; -/* File named by OUTPUT. */ -char *output_file; -/* File named by SHARELIB. */ -char *sharelib_file; -/* Start procedure name (START). */ -char *start_procedure; -/* VERBOSE. */ -bfd_boolean verbose; -/* RPC description file (XDCDATA). */ -char *rpc_file; - -/* The number of serious errors that have occurred. */ -int parse_errors; - -/* The current symbol prefix when reading a list of import or export - symbols. */ -static char *symbol_prefix; - -/* Parser error message handler. */ -#define yyerror(msg) nlmheader_error (msg); - -/* Local functions. */ -static int yylex (void); -static void nlmlex_file_push (const char *); -static bfd_boolean nlmlex_file_open (const char *); -static int nlmlex_buf_init (void); -static char nlmlex_buf_add (int); -static long nlmlex_get_number (const char *); -static void nlmheader_identify (void); -static void nlmheader_warn (const char *, int); -static void nlmheader_error (const char *); -static struct string_list * string_list_cons (char *, struct string_list *); -static struct string_list * string_list_append (struct string_list *, - struct string_list *); -static struct string_list * string_list_append1 (struct string_list *, - char *); -static char *xstrdup (const char *); - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 113 "nlmheader.y" -typedef union YYSTYPE { - char *string; - struct string_list *list; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 275 "nlmheader.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 287 "nlmheader.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 64 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 73 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 40 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 11 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 52 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 82 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 292 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 38, 39, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 5, 6, 9, 12, 15, 18, 21, - 26, 28, 31, 34, 35, 39, 42, 45, 47, 50, - 53, 54, 58, 61, 63, 66, 69, 72, 74, 76, - 79, 81, 83, 86, 89, 92, 95, 97, 100, 103, - 105, 110, 114, 117, 118, 120, 122, 124, 127, 130, - 134, 136, 137 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 41, 0, -1, 42, -1, -1, 43, 42, -1, 3, - 36, -1, 4, 36, -1, 5, 37, -1, 6, 36, - -1, 7, 36, 36, 36, -1, 8, -1, 9, 37, - -1, 10, 36, -1, -1, 11, 44, 46, -1, 12, - 36, -1, 13, 36, -1, 14, -1, 14, 36, -1, - 15, 36, -1, -1, 16, 45, 46, -1, 17, 50, - -1, 18, -1, 18, 36, -1, 19, 36, -1, 20, - 50, -1, 21, -1, 22, -1, 23, 36, -1, 24, - -1, 25, -1, 26, 37, -1, 27, 36, -1, 28, - 36, -1, 29, 36, -1, 30, -1, 31, 37, -1, - 32, 36, -1, 33, -1, 34, 36, 36, 36, -1, - 34, 36, 36, -1, 35, 36, -1, -1, 47, -1, - 49, -1, 48, -1, 47, 49, -1, 47, 48, -1, - 38, 36, 39, -1, 36, -1, -1, 36, 50, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 144, 144, 149, 151, 157, 161, 166, 183, 187, - 205, 209, 225, 230, 229, 237, 242, 247, 252, 257, - 262, 261, 269, 273, 277, 281, 285, 289, 293, 297, - 304, 308, 312, 328, 332, 337, 341, 345, 361, 366, - 370, 394, 410, 420, 423, 434, 438, 442, 446, 455, - 466, 483, 486 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "CHECK", "CODESTART", "COPYRIGHT", - "CUSTOM", "DATE", "DEBUG", "DESCRIPTION", "EXIT", "EXPORT", "FLAG_ON", - "FLAG_OFF", "FULLMAP", "HELP", "IMPORT", "INPUT", "MAP", "MESSAGES", - "MODULE", "MULTIPLE", "OS_DOMAIN", "OUTPUT", "PSEUDOPREEMPTION", - "REENTRANT", "SCREENNAME", "SHARELIB", "STACK", "START", "SYNCHRONIZE", - "THREADNAME", "TYPE", "VERBOSE", "VERSIONK", "XDCDATA", "STRING", - "QUOTED_STRING", "'('", "')'", "$accept", "file", "commands", "command", - "@1", "@2", "symbol_list_opt", "symbol_list", "symbol_prefix", "symbol", - "string_list", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 40, 41 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 40, 41, 42, 42, 43, 43, 43, 43, 43, - 43, 43, 43, 44, 43, 43, 43, 43, 43, 43, - 45, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 46, 46, 47, 47, 47, 47, 48, - 49, 50, 50 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 1, 0, 2, 2, 2, 2, 2, 4, - 1, 2, 2, 0, 3, 2, 2, 1, 2, 2, - 0, 3, 2, 1, 2, 2, 2, 1, 1, 2, - 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, - 4, 3, 2, 0, 1, 1, 1, 2, 2, 3, - 1, 0, 2 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 3, 0, 0, 0, 0, 0, 10, 0, 0, 13, - 0, 0, 17, 0, 20, 51, 23, 0, 51, 27, - 28, 0, 30, 31, 0, 0, 0, 0, 36, 0, - 0, 39, 0, 0, 0, 2, 3, 5, 6, 7, - 8, 0, 11, 12, 43, 15, 16, 18, 19, 43, - 51, 22, 24, 25, 26, 29, 32, 33, 34, 35, - 37, 38, 0, 42, 1, 4, 0, 50, 0, 14, - 44, 46, 45, 21, 52, 41, 9, 0, 48, 47, - 40, 49 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 34, 35, 36, 44, 49, 69, 70, 71, 72, - 51 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -20 -static const yysigned_char yypact[] = -{ - -3, -1, 1, 2, 4, 5, -20, 6, 8, -20, - 9, 10, 11, 12, -20, 13, 14, 16, 13, -20, - -20, 17, -20, -20, 18, 20, 21, 22, -20, 23, - 25, -20, 26, 27, 38, -20, -3, -20, -20, -20, - -20, 28, -20, -20, -2, -20, -20, -20, -20, -2, - 13, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, 30, -20, -20, -20, 31, -20, 32, -20, - -2, -20, -20, -20, -20, 33, -20, 3, -20, -20, - -20, -20 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -20, -20, 34, -20, -20, -20, 24, -20, -19, -16, - 15 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const unsigned char yytable[] = -{ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 54, 67, 37, 68, 38, 64, 39, - 40, 41, 81, 42, 43, 45, 46, 47, 48, 50, - 52, 78, 53, 55, 79, 56, 57, 58, 59, 0, - 60, 61, 62, 63, 66, 74, 75, 76, 77, 80, - 65, 0, 0, 73 -}; - -static const yysigned_char yycheck[] = -{ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 18, 36, 36, 38, 36, 0, 37, - 36, 36, 39, 37, 36, 36, 36, 36, 36, 36, - 36, 70, 36, 36, 70, 37, 36, 36, 36, -1, - 37, 36, 36, 36, 36, 50, 36, 36, 36, 36, - 36, -1, -1, 49 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 41, 42, 43, 36, 36, 37, - 36, 36, 37, 36, 44, 36, 36, 36, 36, 45, - 36, 50, 36, 36, 50, 36, 37, 36, 36, 36, - 37, 36, 36, 36, 0, 42, 36, 36, 38, 46, - 47, 48, 49, 46, 50, 36, 36, 36, 48, 49, - 36, 39 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 5: -#line 158 "nlmheader.y" - { - check_procedure = (yyvsp[0].string); - } - break; - - case 6: -#line 162 "nlmheader.y" - { - nlmheader_warn (_("CODESTART is not implemented; sorry"), -1); - free ((yyvsp[0].string)); - } - break; - - case 7: -#line 167 "nlmheader.y" - { - int len; - - strncpy (copyright_hdr->stamp, "CoPyRiGhT=", 10); - len = strlen ((yyvsp[0].string)); - if (len >= NLM_MAX_COPYRIGHT_MESSAGE_LENGTH) - { - nlmheader_warn (_("copyright string is too long"), - NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1); - len = NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1; - } - copyright_hdr->copyrightMessageLength = len; - strncpy (copyright_hdr->copyrightMessage, (yyvsp[0].string), len); - copyright_hdr->copyrightMessage[len] = '\0'; - free ((yyvsp[0].string)); - } - break; - - case 8: -#line 184 "nlmheader.y" - { - custom_file = (yyvsp[0].string); - } - break; - - case 9: -#line 188 "nlmheader.y" - { - /* We don't set the version stamp here, because we use the - version stamp to detect whether the required VERSION - keyword was given. */ - version_hdr->month = nlmlex_get_number ((yyvsp[-2].string)); - version_hdr->day = nlmlex_get_number ((yyvsp[-1].string)); - version_hdr->year = nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[-2].string)); - free ((yyvsp[-1].string)); - free ((yyvsp[0].string)); - if (version_hdr->month < 1 || version_hdr->month > 12) - nlmheader_warn (_("illegal month"), -1); - if (version_hdr->day < 1 || version_hdr->day > 31) - nlmheader_warn (_("illegal day"), -1); - if (version_hdr->year < 1900 || version_hdr->year > 3000) - nlmheader_warn (_("illegal year"), -1); - } - break; - - case 10: -#line 206 "nlmheader.y" - { - debug_info = TRUE; - } - break; - - case 11: -#line 210 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[0].string)); - if (len > NLM_MAX_DESCRIPTION_LENGTH) - { - nlmheader_warn (_("description string is too long"), - NLM_MAX_DESCRIPTION_LENGTH); - len = NLM_MAX_DESCRIPTION_LENGTH; - } - var_hdr->descriptionLength = len; - strncpy (var_hdr->descriptionText, (yyvsp[0].string), len); - var_hdr->descriptionText[len] = '\0'; - free ((yyvsp[0].string)); - } - break; - - case 12: -#line 226 "nlmheader.y" - { - exit_procedure = (yyvsp[0].string); - } - break; - - case 13: -#line 230 "nlmheader.y" - { - symbol_prefix = NULL; - } - break; - - case 14: -#line 234 "nlmheader.y" - { - export_symbols = string_list_append (export_symbols, (yyvsp[0].list)); - } - break; - - case 15: -#line 238 "nlmheader.y" - { - fixed_hdr->flags |= nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[0].string)); - } - break; - - case 16: -#line 243 "nlmheader.y" - { - fixed_hdr->flags &=~ nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[0].string)); - } - break; - - case 17: -#line 248 "nlmheader.y" - { - map_file = ""; - full_map = TRUE; - } - break; - - case 18: -#line 253 "nlmheader.y" - { - map_file = (yyvsp[0].string); - full_map = TRUE; - } - break; - - case 19: -#line 258 "nlmheader.y" - { - help_file = (yyvsp[0].string); - } - break; - - case 20: -#line 262 "nlmheader.y" - { - symbol_prefix = NULL; - } - break; - - case 21: -#line 266 "nlmheader.y" - { - import_symbols = string_list_append (import_symbols, (yyvsp[0].list)); - } - break; - - case 22: -#line 270 "nlmheader.y" - { - input_files = string_list_append (input_files, (yyvsp[0].list)); - } - break; - - case 23: -#line 274 "nlmheader.y" - { - map_file = ""; - } - break; - - case 24: -#line 278 "nlmheader.y" - { - map_file = (yyvsp[0].string); - } - break; - - case 25: -#line 282 "nlmheader.y" - { - message_file = (yyvsp[0].string); - } - break; - - case 26: -#line 286 "nlmheader.y" - { - modules = string_list_append (modules, (yyvsp[0].list)); - } - break; - - case 27: -#line 290 "nlmheader.y" - { - fixed_hdr->flags |= 0x2; - } - break; - - case 28: -#line 294 "nlmheader.y" - { - fixed_hdr->flags |= 0x10; - } - break; - - case 29: -#line 298 "nlmheader.y" - { - if (output_file == NULL) - output_file = (yyvsp[0].string); - else - nlmheader_warn (_("ignoring duplicate OUTPUT statement"), -1); - } - break; - - case 30: -#line 305 "nlmheader.y" - { - fixed_hdr->flags |= 0x8; - } - break; - - case 31: -#line 309 "nlmheader.y" - { - fixed_hdr->flags |= 0x1; - } - break; - - case 32: -#line 313 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[0].string)); - if (len >= NLM_MAX_SCREEN_NAME_LENGTH) - { - nlmheader_warn (_("screen name is too long"), - NLM_MAX_SCREEN_NAME_LENGTH); - len = NLM_MAX_SCREEN_NAME_LENGTH; - } - var_hdr->screenNameLength = len; - strncpy (var_hdr->screenName, (yyvsp[0].string), len); - var_hdr->screenName[NLM_MAX_SCREEN_NAME_LENGTH] = '\0'; - free ((yyvsp[0].string)); - } - break; - - case 33: -#line 329 "nlmheader.y" - { - sharelib_file = (yyvsp[0].string); - } - break; - - case 34: -#line 333 "nlmheader.y" - { - var_hdr->stackSize = nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[0].string)); - } - break; - - case 35: -#line 338 "nlmheader.y" - { - start_procedure = (yyvsp[0].string); - } - break; - - case 36: -#line 342 "nlmheader.y" - { - fixed_hdr->flags |= 0x4; - } - break; - - case 37: -#line 346 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[0].string)); - if (len >= NLM_MAX_THREAD_NAME_LENGTH) - { - nlmheader_warn (_("thread name is too long"), - NLM_MAX_THREAD_NAME_LENGTH); - len = NLM_MAX_THREAD_NAME_LENGTH; - } - var_hdr->threadNameLength = len; - strncpy (var_hdr->threadName, (yyvsp[0].string), len); - var_hdr->threadName[len] = '\0'; - free ((yyvsp[0].string)); - } - break; - - case 38: -#line 362 "nlmheader.y" - { - fixed_hdr->moduleType = nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[0].string)); - } - break; - - case 39: -#line 367 "nlmheader.y" - { - verbose = TRUE; - } - break; - - case 40: -#line 371 "nlmheader.y" - { - long val; - - strncpy (version_hdr->stamp, "VeRsIoN#", 8); - version_hdr->majorVersion = nlmlex_get_number ((yyvsp[-2].string)); - val = nlmlex_get_number ((yyvsp[-1].string)); - if (val < 0 || val > 99) - nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"), - -1); - else - version_hdr->minorVersion = val; - val = nlmlex_get_number ((yyvsp[0].string)); - if (val < 0) - nlmheader_warn (_("illegal revision number (must be between 0 and 26)"), - -1); - else if (val > 26) - version_hdr->revision = 0; - else - version_hdr->revision = val; - free ((yyvsp[-2].string)); - free ((yyvsp[-1].string)); - free ((yyvsp[0].string)); - } - break; - - case 41: -#line 395 "nlmheader.y" - { - long val; - - strncpy (version_hdr->stamp, "VeRsIoN#", 8); - version_hdr->majorVersion = nlmlex_get_number ((yyvsp[-1].string)); - val = nlmlex_get_number ((yyvsp[0].string)); - if (val < 0 || val > 99) - nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"), - -1); - else - version_hdr->minorVersion = val; - version_hdr->revision = 0; - free ((yyvsp[-1].string)); - free ((yyvsp[0].string)); - } - break; - - case 42: -#line 411 "nlmheader.y" - { - rpc_file = (yyvsp[0].string); - } - break; - - case 43: -#line 420 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 44: -#line 424 "nlmheader.y" - { - (yyval.list) = (yyvsp[0].list); - } - break; - - case 45: -#line 435 "nlmheader.y" - { - (yyval.list) = string_list_cons ((yyvsp[0].string), NULL); - } - break; - - case 46: -#line 439 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 47: -#line 443 "nlmheader.y" - { - (yyval.list) = string_list_append1 ((yyvsp[-1].list), (yyvsp[0].string)); - } - break; - - case 48: -#line 447 "nlmheader.y" - { - (yyval.list) = (yyvsp[-1].list); - } - break; - - case 49: -#line 456 "nlmheader.y" - { - if (symbol_prefix != NULL) - free (symbol_prefix); - symbol_prefix = (yyvsp[-1].string); - } - break; - - case 50: -#line 467 "nlmheader.y" - { - if (symbol_prefix == NULL) - (yyval.string) = (yyvsp[0].string); - else - { - (yyval.string) = xmalloc (strlen (symbol_prefix) + strlen ((yyvsp[0].string)) + 2); - sprintf ((yyval.string), "%s@%s", symbol_prefix, (yyvsp[0].string)); - free ((yyvsp[0].string)); - } - } - break; - - case 51: -#line 483 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 52: -#line 487 "nlmheader.y" - { - (yyval.list) = string_list_cons ((yyvsp[-1].string), (yyvsp[0].list)); - } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 1797 "nlmheader.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 492 "nlmheader.y" - - -/* If strerror is just a macro, we want to use the one from libiberty - since it will handle undefined values. */ -#undef strerror -extern char *strerror PARAMS ((int)); - -/* The lexer is simple, too simple for flex. Keywords are only - recognized at the start of lines. Everything else must be an - argument. A comma is treated as whitespace. */ - -/* The states the lexer can be in. */ - -enum lex_state -{ - /* At the beginning of a line. */ - BEGINNING_OF_LINE, - /* In the middle of a line. */ - IN_LINE -}; - -/* We need to keep a stack of files to handle file inclusion. */ - -struct input -{ - /* The file to read from. */ - FILE *file; - /* The name of the file. */ - char *name; - /* The current line number. */ - int lineno; - /* The current state. */ - enum lex_state state; - /* The next file on the stack. */ - struct input *next; -}; - -/* The current input file. */ - -static struct input current; - -/* The character which introduces comments. */ -#define COMMENT_CHAR '#' - -/* Start the lexer going on the main input file. */ - -bfd_boolean -nlmlex_file (const char *name) -{ - current.next = NULL; - return nlmlex_file_open (name); -} - -/* Start the lexer going on a subsidiary input file. */ - -static void -nlmlex_file_push (const char *name) -{ - struct input *push; - - push = (struct input *) xmalloc (sizeof (struct input)); - *push = current; - if (nlmlex_file_open (name)) - current.next = push; - else - { - current = *push; - free (push); - } -} - -/* Start lexing from a file. */ - -static bfd_boolean -nlmlex_file_open (const char *name) -{ - current.file = fopen (name, "r"); - if (current.file == NULL) - { - fprintf (stderr, "%s:%s: %s\n", program_name, name, strerror (errno)); - ++parse_errors; - return FALSE; - } - current.name = xstrdup (name); - current.lineno = 1; - current.state = BEGINNING_OF_LINE; - return TRUE; -} - -/* Table used to turn keywords into tokens. */ - -struct keyword_tokens_struct -{ - const char *keyword; - int token; -}; - -static struct keyword_tokens_struct keyword_tokens[] = -{ - { "CHECK", CHECK }, - { "CODESTART", CODESTART }, - { "COPYRIGHT", COPYRIGHT }, - { "CUSTOM", CUSTOM }, - { "DATE", DATE }, - { "DEBUG", DEBUG }, - { "DESCRIPTION", DESCRIPTION }, - { "EXIT", EXIT }, - { "EXPORT", EXPORT }, - { "FLAG_ON", FLAG_ON }, - { "FLAG_OFF", FLAG_OFF }, - { "FULLMAP", FULLMAP }, - { "HELP", HELP }, - { "IMPORT", IMPORT }, - { "INPUT", INPUT }, - { "MAP", MAP }, - { "MESSAGES", MESSAGES }, - { "MODULE", MODULE }, - { "MULTIPLE", MULTIPLE }, - { "OS_DOMAIN", OS_DOMAIN }, - { "OUTPUT", OUTPUT }, - { "PSEUDOPREEMPTION", PSEUDOPREEMPTION }, - { "REENTRANT", REENTRANT }, - { "SCREENNAME", SCREENNAME }, - { "SHARELIB", SHARELIB }, - { "STACK", STACK }, - { "STACKSIZE", STACK }, - { "START", START }, - { "SYNCHRONIZE", SYNCHRONIZE }, - { "THREADNAME", THREADNAME }, - { "TYPE", TYPE }, - { "VERBOSE", VERBOSE }, - { "VERSION", VERSIONK }, - { "XDCDATA", XDCDATA } -}; - -#define KEYWORD_COUNT (sizeof (keyword_tokens) / sizeof (keyword_tokens[0])) - -/* The lexer accumulates strings in these variables. */ -static char *lex_buf; -static int lex_size; -static int lex_pos; - -/* Start accumulating strings into the buffer. */ -#define BUF_INIT() \ - ((void) (lex_buf != NULL ? lex_pos = 0 : nlmlex_buf_init ())) - -static int -nlmlex_buf_init (void) -{ - lex_size = 10; - lex_buf = xmalloc (lex_size + 1); - lex_pos = 0; - return 0; -} - -/* Finish a string in the buffer. */ -#define BUF_FINISH() ((void) (lex_buf[lex_pos] = '\0')) - -/* Accumulate a character into the buffer. */ -#define BUF_ADD(c) \ - ((void) (lex_pos < lex_size \ - ? lex_buf[lex_pos++] = (c) \ - : nlmlex_buf_add (c))) - -static char -nlmlex_buf_add (int c) -{ - if (lex_pos >= lex_size) - { - lex_size *= 2; - lex_buf = xrealloc (lex_buf, lex_size + 1); - } - - return lex_buf[lex_pos++] = c; -} - -/* The lexer proper. This is called by the bison generated parsing - code. */ - -static int -yylex (void) -{ - int c; - -tail_recurse: - - c = getc (current.file); - - /* Commas are treated as whitespace characters. */ - while (ISSPACE (c) || c == ',') - { - current.state = IN_LINE; - if (c == '\n') - { - ++current.lineno; - current.state = BEGINNING_OF_LINE; - } - c = getc (current.file); - } - - /* At the end of the file we either pop to the previous file or - finish up. */ - if (c == EOF) - { - fclose (current.file); - free (current.name); - if (current.next == NULL) - return 0; - else - { - struct input *next; - - next = current.next; - current = *next; - free (next); - goto tail_recurse; - } - } - - /* A comment character always means to drop everything until the - next newline. */ - if (c == COMMENT_CHAR) - { - do - { - c = getc (current.file); - } - while (c != '\n'); - ++current.lineno; - current.state = BEGINNING_OF_LINE; - goto tail_recurse; - } - - /* An '@' introduces an include file. */ - if (c == '@') - { - do - { - c = getc (current.file); - if (c == '\n') - ++current.lineno; - } - while (ISSPACE (c)); - BUF_INIT (); - while (! ISSPACE (c) && c != EOF) - { - BUF_ADD (c); - c = getc (current.file); - } - BUF_FINISH (); - - ungetc (c, current.file); - - nlmlex_file_push (lex_buf); - goto tail_recurse; - } - - /* A non-space character at the start of a line must be the start of - a keyword. */ - if (current.state == BEGINNING_OF_LINE) - { - BUF_INIT (); - while (ISALNUM (c) || c == '_') - { - BUF_ADD (TOUPPER (c)); - c = getc (current.file); - } - BUF_FINISH (); - - if (c != EOF && ! ISSPACE (c) && c != ',') - { - nlmheader_identify (); - fprintf (stderr, _("%s:%d: illegal character in keyword: %c\n"), - current.name, current.lineno, c); - } - else - { - unsigned int i; - - for (i = 0; i < KEYWORD_COUNT; i++) - { - if (lex_buf[0] == keyword_tokens[i].keyword[0] - && strcmp (lex_buf, keyword_tokens[i].keyword) == 0) - { - /* Pushing back the final whitespace avoids worrying - about \n here. */ - ungetc (c, current.file); - current.state = IN_LINE; - return keyword_tokens[i].token; - } - } - - nlmheader_identify (); - fprintf (stderr, _("%s:%d: unrecognized keyword: %s\n"), - current.name, current.lineno, lex_buf); - } - - ++parse_errors; - /* Treat the rest of this line as a comment. */ - ungetc (COMMENT_CHAR, current.file); - goto tail_recurse; - } - - /* Parentheses just represent themselves. */ - if (c == '(' || c == ')') - return c; - - /* Handle quoted strings. */ - if (c == '"' || c == '\'') - { - int quote; - int start_lineno; - - quote = c; - start_lineno = current.lineno; - - c = getc (current.file); - BUF_INIT (); - while (c != quote && c != EOF) - { - BUF_ADD (c); - if (c == '\n') - ++current.lineno; - c = getc (current.file); - } - BUF_FINISH (); - - if (c == EOF) - { - nlmheader_identify (); - fprintf (stderr, _("%s:%d: end of file in quoted string\n"), - current.name, start_lineno); - ++parse_errors; - } - - /* FIXME: Possible memory leak. */ - yylval.string = xstrdup (lex_buf); - return QUOTED_STRING; - } - - /* Gather a generic argument. */ - BUF_INIT (); - while (! ISSPACE (c) - && c != ',' - && c != COMMENT_CHAR - && c != '(' - && c != ')') - { - BUF_ADD (c); - c = getc (current.file); - } - BUF_FINISH (); - - ungetc (c, current.file); - - /* FIXME: Possible memory leak. */ - yylval.string = xstrdup (lex_buf); - return STRING; -} - -/* Get a number from a string. */ - -static long -nlmlex_get_number (const char *s) -{ - long ret; - char *send; - - ret = strtol (s, &send, 10); - if (*send != '\0') - nlmheader_warn (_("bad number"), -1); - return ret; -} - -/* Prefix the nlmconv warnings with a note as to where they come from. - We don't use program_name on every warning, because then some - versions of the emacs next-error function can't recognize the line - number. */ - -static void -nlmheader_identify (void) -{ - static int done; - - if (! done) - { - fprintf (stderr, _("%s: problems in NLM command language input:\n"), - program_name); - done = 1; - } -} - -/* Issue a warning. */ - -static void -nlmheader_warn (const char *s, int imax) -{ - nlmheader_identify (); - fprintf (stderr, "%s:%d: %s", current.name, current.lineno, s); - if (imax != -1) - fprintf (stderr, " (max %d)", imax); - fprintf (stderr, "\n"); -} - -/* Report an error. */ - -static void -nlmheader_error (const char *s) -{ - nlmheader_warn (s, -1); - ++parse_errors; -} - -/* Add a string to a string list. */ - -static struct string_list * -string_list_cons (char *s, struct string_list *l) -{ - struct string_list *ret; - - ret = (struct string_list *) xmalloc (sizeof (struct string_list)); - ret->next = l; - ret->string = s; - return ret; -} - -/* Append a string list to another string list. */ - -static struct string_list * -string_list_append (struct string_list *l1, struct string_list *l2) -{ - register struct string_list **pp; - - for (pp = &l1; *pp != NULL; pp = &(*pp)->next) - ; - *pp = l2; - return l1; -} - -/* Append a string to a string list. */ - -static struct string_list * -string_list_append1 (struct string_list *l, char *s) -{ - struct string_list *n; - register struct string_list **pp; - - n = (struct string_list *) xmalloc (sizeof (struct string_list)); - n->next = NULL; - n->string = s; - for (pp = &l; *pp != NULL; pp = &(*pp)->next) - ; - *pp = n; - return l; -} - -/* Duplicate a string in memory. */ - -static char * -xstrdup (const char *s) -{ - unsigned long len; - char *ret; - - len = strlen (s); - ret = xmalloc (len + 1); - strcpy (ret, s); - return ret; -} - diff --git a/binutils/nlmheader.h b/binutils/nlmheader.h deleted file mode 100644 index 42ca39afc10c..000000000000 --- a/binutils/nlmheader.h +++ /dev/null @@ -1,125 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHECK = 258, - CODESTART = 259, - COPYRIGHT = 260, - CUSTOM = 261, - DATE = 262, - DEBUG = 263, - DESCRIPTION = 264, - EXIT = 265, - EXPORT = 266, - FLAG_ON = 267, - FLAG_OFF = 268, - FULLMAP = 269, - HELP = 270, - IMPORT = 271, - INPUT = 272, - MAP = 273, - MESSAGES = 274, - MODULE = 275, - MULTIPLE = 276, - OS_DOMAIN = 277, - OUTPUT = 278, - PSEUDOPREEMPTION = 279, - REENTRANT = 280, - SCREENNAME = 281, - SHARELIB = 282, - STACK = 283, - START = 284, - SYNCHRONIZE = 285, - THREADNAME = 286, - TYPE = 287, - VERBOSE = 288, - VERSIONK = 289, - XDCDATA = 290, - STRING = 291, - QUOTED_STRING = 292 - }; -#endif -/* Tokens. */ -#define CHECK 258 -#define CODESTART 259 -#define COPYRIGHT 260 -#define CUSTOM 261 -#define DATE 262 -#define DEBUG 263 -#define DESCRIPTION 264 -#define EXIT 265 -#define EXPORT 266 -#define FLAG_ON 267 -#define FLAG_OFF 268 -#define FULLMAP 269 -#define HELP 270 -#define IMPORT 271 -#define INPUT 272 -#define MAP 273 -#define MESSAGES 274 -#define MODULE 275 -#define MULTIPLE 276 -#define OS_DOMAIN 277 -#define OUTPUT 278 -#define PSEUDOPREEMPTION 279 -#define REENTRANT 280 -#define SCREENNAME 281 -#define SHARELIB 282 -#define STACK 283 -#define START 284 -#define SYNCHRONIZE 285 -#define THREADNAME 286 -#define TYPE 287 -#define VERBOSE 288 -#define VERSIONK 289 -#define XDCDATA 290 -#define STRING 291 -#define QUOTED_STRING 292 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 113 "nlmheader.y" -typedef union YYSTYPE { - char *string; - struct string_list *list; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 117 "nlmheader.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/nlmheader.y b/binutils/nlmheader.y index b79d63ad91e1..192aafa3fb90 100644 --- a/binutils/nlmheader.y +++ b/binutils/nlmheader.y @@ -1,5 +1,5 @@ %{/* nlmheader.y - parse NLM header specification keywords. - Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003 + Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -27,13 +27,12 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. This implementation is based on the description in the NetWare Tool Maker Specification manual, edition 1.0. */ -#include "ansidecl.h" -#include <stdio.h> +#include "sysdep.h" #include "safe-ctype.h" #include "bfd.h" -#include "bucomm.h" #include "nlm/common.h" #include "nlm/internal.h" +#include "bucomm.h" #include "nlmconv.h" /* Information is stored in the structures pointed to by these diff --git a/binutils/nm.c b/binutils/nm.c index c1fb4d803e84..62328a4d54e9 100644 --- a/binutils/nm.c +++ b/binutils/nm.c @@ -1,6 +1,6 @@ /* nm.c -- Describe symbol table of a rel file. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,10 +20,9 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "progress.h" -#include "bucomm.h" -#include "budemang.h" #include "getopt.h" #include "aout/stab_gnu.h" #include "aout/ranlib.h" @@ -31,6 +30,7 @@ #include "libiberty.h" #include "elf-bfd.h" #include "elf/common.h" +#include "bucomm.h" /* When sorting by size, we use this structure to hold the size and a pointer to the minisymbol. */ @@ -159,20 +159,9 @@ static int filename_per_file = 0; /* Once per file, on its own line. */ static int filename_per_symbol = 0; /* Once per symbol, at start of line. */ /* Print formats for printing a symbol value. */ -#ifndef BFD64 -static char value_format[] = "%08lx"; -#else -#if BFD_HOST_64BIT_LONG -static char value_format[] = "%016lx"; -#else -/* We don't use value_format for this case. */ -#endif -#endif -#ifdef BFD64 -static int print_width = 16; -#else -static int print_width = 8; -#endif +static char value_format_32bit[] = "%08lx"; +static char value_format_64bit[] = "%016lx"; +static int print_width = 0; static int print_radix = 16; /* Print formats for printing stab info. */ static char other_format[] = "%02x"; @@ -259,7 +248,7 @@ usage (FILE *stream, int status) -V, --version Display this program's version number\n\ \n")); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } @@ -279,16 +268,8 @@ set_print_radix (char *radix) print_radix = 10; else print_radix = 8; -#ifndef BFD64 - value_format[4] = *radix; -#else -#if BFD_HOST_64BIT_LONG - value_format[5] = *radix; -#else - /* This case requires special handling for octal and decimal - printing. */ -#endif -#endif + value_format_32bit[4] = *radix; + value_format_64bit[5] = *radix; other_format[3] = desc_format[3] = *radix; break; default: @@ -354,11 +335,14 @@ print_symname (const char *format, const char *name, bfd *abfd) { if (do_demangle && *name) { - char *res = demangle (abfd, name); + char *res = bfd_demangle (abfd, name, DMGL_ANSI | DMGL_PARAMS); - printf (format, res); - free (res); - return; + if (res != NULL) + { + printf (format, res); + free (res); + return; + } } printf (format, name); @@ -1094,6 +1078,26 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) } static void +set_print_width (bfd *file) +{ + print_width = bfd_get_arch_size (file); + + if (print_width == -1) + { + /* PR binutils/4292 + Guess the target's bitsize based on its name. + We assume here than any 64-bit format will include + "64" somewhere in its name. The only known exception + is the MMO object file format. */ + if (strstr (bfd_get_target (file), "64") != NULL + || strcmp (bfd_get_target (file), "mmo") == 0) + print_width = 64; + else + print_width = 32; + } +} + +static void display_archive (bfd *file) { bfd *arfile = NULL; @@ -1120,10 +1124,7 @@ display_archive (bfd *file) if (bfd_check_format_matches (arfile, bfd_object, &matching)) { - char buf[30]; - - bfd_sprintf_vma (arfile, buf, (bfd_vma) -1); - print_width = strlen (buf); + set_print_width (arfile); format->print_archive_member (bfd_get_filename (file), bfd_get_filename (arfile)); display_rel_file (arfile, file); @@ -1178,10 +1179,7 @@ display_file (char *filename) } else if (bfd_check_format_matches (file, bfd_object, &matching)) { - char buf[30]; - - bfd_sprintf_vma (file, buf, (bfd_vma) -1); - print_width = strlen (buf); + set_print_width (file); format->print_object_filename (filename); display_rel_file (file, NULL); } @@ -1227,7 +1225,7 @@ print_object_filename_sysv (char *filename) printf (_("\n\nUndefined symbols from %s:\n\n"), filename); else printf (_("\n\nSymbols from %s:\n\n"), filename); - if (print_width == 8) + if (print_width == 32) printf (_("\ Name Value Class Type Size Line Section\n\n")); else @@ -1278,7 +1276,7 @@ print_archive_member_sysv (char *archive, const char *filename) printf (_("\n\nUndefined symbols from %s[%s]:\n\n"), archive, filename); else printf (_("\n\nSymbols from %s[%s]:\n\n"), archive, filename); - if (print_width == 8) + if (print_width == 32) printf (_("\ Name Value Class Type Size Line Section\n\n")); else @@ -1336,29 +1334,42 @@ print_symbol_filename_posix (bfd *archive_bfd, bfd *abfd) static void print_value (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma val) { -#if ! defined (BFD64) || BFD_HOST_64BIT_LONG - printf (value_format, val); -#else - /* We have a 64 bit value to print, but the host is only 32 bit. */ - if (print_radix == 16) - bfd_fprintf_vma (abfd, stdout, val); - else + switch (print_width) { - char buf[30]; - char *s; + case 32: + printf (value_format_32bit, (unsigned long) val); + break; - s = buf + sizeof buf; - *--s = '\0'; - while (val > 0) + case 64: +#if BFD_HOST_64BIT_LONG + printf (value_format_64bit, val); +#else + /* We have a 64 bit value to print, but the host is only 32 bit. */ + if (print_radix == 16) + bfd_fprintf_vma (abfd, stdout, val); + else { - *--s = (val % print_radix) + '0'; - val /= print_radix; + char buf[30]; + char *s; + + s = buf + sizeof buf; + *--s = '\0'; + while (val > 0) + { + *--s = (val % print_radix) + '0'; + val /= print_radix; + } + while ((buf + sizeof buf - 1) - s < 16) + *--s = '0'; + printf ("%s", s); } - while ((buf + sizeof buf - 1) - s < 16) - *--s = '0'; - printf ("%s", s); - } #endif + break; + + default: + fatal (_("Print width has not been initialized (%d)"), print_width); + break; + } } /* Print a line of information about a symbol. */ @@ -1368,7 +1379,7 @@ print_symbol_info_bsd (struct extended_symbol_info *info, bfd *abfd) { if (bfd_is_undefined_symclass (SYM_TYPE (info))) { - if (print_width == 16) + if (print_width == 64) printf (" "); printf (" "); } @@ -1411,7 +1422,7 @@ print_symbol_info_sysv (struct extended_symbol_info *info, bfd *abfd) if (bfd_is_undefined_symclass (SYM_TYPE (info))) { - if (print_width == 8) + if (print_width == 32) printf (" "); else printf (" "); @@ -1441,7 +1452,7 @@ print_symbol_info_sysv (struct extended_symbol_info *info, bfd *abfd) print_value (abfd, SYM_SIZE (info)); else { - if (print_width == 8) + if (print_width == 32) printf (" "); else printf (" "); diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 0e0cfaaccf5e..06e2946ce349 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -1,6 +1,6 @@ /* objcopy.c -- copy object file from input to output, optionally massaging it. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,11 +20,12 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "progress.h" -#include "bucomm.h" #include "getopt.h" #include "libiberty.h" +#include "bucomm.h" #include "budbg.h" #include "filenames.h" #include "fnmatch.h" @@ -190,6 +191,9 @@ static bfd_boolean remove_leading_char = FALSE; /* Whether to permit wildcard in symbol comparison. */ static bfd_boolean wildcard = FALSE; +/* True if --localize-hidden is in effect. */ +static bfd_boolean localize_hidden = FALSE; + /* List of symbols to strip, keep, localize, keep-global, weaken, or redefine. */ static struct symlist *strip_specific_list = NULL; @@ -212,6 +216,14 @@ static char *prefix_symbols_string = 0; static char *prefix_sections_string = 0; static char *prefix_alloc_sections_string = 0; +/* True if --extract-symbol was passed on the command line. */ +static bfd_boolean extract_symbol = FALSE; + +/* If `reverse_bytes' is nonzero, then reverse the order of every chunk + of <reverse_bytes> bytes within each output section. */ +static int reverse_bytes = 0; + + /* 150 isn't special; it's just an arbitrary non-ASCII char value. */ enum command_line_switch { @@ -240,6 +252,7 @@ enum command_line_switch OPTION_STRIP_UNNEEDED_SYMBOL, OPTION_STRIP_UNNEEDED_SYMBOLS, OPTION_KEEP_SYMBOLS, + OPTION_LOCALIZE_HIDDEN, OPTION_LOCALIZE_SYMBOLS, OPTION_GLOBALIZE_SYMBOL, OPTION_GLOBALIZE_SYMBOLS, @@ -257,7 +270,9 @@ enum command_line_switch OPTION_READONLY_TEXT, OPTION_WRITABLE_TEXT, OPTION_PURE, - OPTION_IMPURE + OPTION_IMPURE, + OPTION_EXTRACT_SYMBOL, + OPTION_REVERSE_BYTES }; /* Options to handle if running as "strip". */ @@ -313,6 +328,7 @@ static struct option copy_options[] = {"debugging", no_argument, 0, OPTION_DEBUGGING}, {"discard-all", no_argument, 0, 'x'}, {"discard-locals", no_argument, 0, 'X'}, + {"extract-symbol", no_argument, 0, OPTION_EXTRACT_SYMBOL}, {"format", required_argument, 0, 'F'}, /* Obsolete */ {"gap-fill", required_argument, 0, OPTION_GAP_FILL}, {"globalize-symbol", required_argument, 0, OPTION_GLOBALIZE_SYMBOL}, @@ -328,6 +344,7 @@ static struct option copy_options[] = {"keep-global-symbols", required_argument, 0, OPTION_KEEPGLOBAL_SYMBOLS}, {"keep-symbol", required_argument, 0, 'K'}, {"keep-symbols", required_argument, 0, OPTION_KEEP_SYMBOLS}, + {"localize-hidden", no_argument, 0, OPTION_LOCALIZE_HIDDEN}, {"localize-symbol", required_argument, 0, 'L'}, {"localize-symbols", required_argument, 0, OPTION_LOCALIZE_SYMBOLS}, {"no-adjust-warnings", no_argument, 0, OPTION_NO_CHANGE_WARNINGS}, @@ -348,6 +365,7 @@ static struct option copy_options[] = {"remove-leading-char", no_argument, 0, OPTION_REMOVE_LEADING_CHAR}, {"remove-section", required_argument, 0, 'R'}, {"rename-section", required_argument, 0, OPTION_RENAME_SECTION}, + {"reverse-bytes", required_argument, 0, OPTION_REVERSE_BYTES}, {"set-section-flags", required_argument, 0, OPTION_SET_SECTION_FLAGS}, {"set-start", required_argument, 0, OPTION_SET_START}, {"srec-len", required_argument, 0, OPTION_SREC_LEN}, @@ -426,8 +444,10 @@ copy_usage (FILE *stream, int exit_status) Do not copy symbol <name> unless needed by\n\ relocations\n\ --only-keep-debug Strip everything but the debug information\n\ + --extract-symbol Remove section contents but keep symbols\n\ -K --keep-symbol <name> Do not strip symbol <name>\n\ --keep-file-symbols Do not strip file symbol(s)\n\ + --localize-hidden Turn all ELF hidden symbols into locals\n\ -L --localize-symbol <name> Force symbol <name> to be marked as a local\n\ --globalize-symbol <name> Force symbol <name> to be marked as a global\n\ -G --keep-global-symbol <name> Localize all symbols except <name>\n\ @@ -459,6 +479,7 @@ copy_usage (FILE *stream, int exit_status) --rename-section <old>=<new>[,<flags>] Rename section <old> to <new>\n\ --change-leading-char Force output format's leading character style\n\ --remove-leading-char Remove leading character from global symbols\n\ + --reverse-bytes=<num> Reverse <num> bytes at a time, in output sections with content\n\ --redefine-sym <old>=<new> Redefine symbol name <old> to <new>\n\ --redefine-syms <file> --redefine-sym for all symbol pairs \n\ listed in <file>\n\ @@ -490,7 +511,7 @@ copy_usage (FILE *stream, int exit_status) --info List object formats & architectures supported\n\ ")); list_supported_targets (program_name, stream); - if (exit_status == 0) + if (REPORT_BUGS_TO[0] && exit_status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (exit_status); } @@ -525,7 +546,7 @@ strip_usage (FILE *stream, int exit_status) ")); list_supported_targets (program_name, stream); - if (exit_status == 0) + if (REPORT_BUGS_TO[0] && exit_status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (exit_status); } @@ -647,7 +668,10 @@ add_specific_symbols (const char *filename, struct symlist **list) size = get_file_size (filename); if (size == 0) - return; + { + status = 1; + return; + } buffer = xmalloc (size + 2); f = fopen (filename, FOPEN_RT); @@ -776,6 +800,30 @@ is_specified_symbol (const char *name, struct symlist *list) return FALSE; } +/* Return a pointer to the symbol used as a signature for GROUP. */ + +static asymbol * +group_signature (asection *group) +{ + bfd *abfd = group->owner; + Elf_Internal_Shdr *ghdr; + + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + return NULL; + + ghdr = &elf_section_data (group)->this_hdr; + if (ghdr->sh_link < elf_numsections (abfd)) + { + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + Elf_Internal_Shdr *symhdr = elf_elfsections (abfd) [ghdr->sh_link]; + + if (symhdr->sh_type == SHT_SYMTAB + && ghdr->sh_info < symhdr->sh_size / bed->s->sizeof_sym) + return isympp[ghdr->sh_info - 1]; + } + return NULL; +} + /* See if a section is being removed. */ static bfd_boolean @@ -806,6 +854,49 @@ is_strip_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) return FALSE; } + if ((bfd_get_section_flags (abfd, sec) & SEC_GROUP) != 0) + { + asymbol *gsym; + const char *gname; + + /* PR binutils/3166 + Group sections look like debugging sections but they are not. + (They have a non-zero size but they are not ALLOCated). */ + if (strip_symbols == STRIP_NONDEBUG) + return TRUE; + + /* PR binutils/3181 + If we are going to strip the group signature symbol, then + strip the group section too. */ + gsym = group_signature (sec); + if (gsym != NULL) + gname = gsym->name; + else + gname = sec->name; + if ((strip_symbols == STRIP_ALL + && !is_specified_symbol (gname, keep_specific_list)) + || is_specified_symbol (gname, strip_specific_list)) + return TRUE; + } + + return FALSE; +} + +/* Return true if SYM is a hidden symbol. */ + +static bfd_boolean +is_hidden_symbol (asymbol *sym) +{ + elf_symbol_type *elf_sym; + + elf_sym = elf_symbol_from (sym->the_bfd, sym); + if (elf_sym != NULL) + switch (ELF_ST_VISIBILITY (elf_sym->internal_elf_sym.st_other)) + { + case STV_HIDDEN: + case STV_INTERNAL: + return TRUE; + } return FALSE; } @@ -819,15 +910,15 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, { asymbol **from = isyms, **to = osyms; long src_count = 0, dst_count = 0; - int relocatable = (abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC)) - == HAS_RELOC; + int relocatable = (abfd->flags & (EXEC_P | DYNAMIC)) == 0; for (; src_count < symcount; src_count++) { asymbol *sym = from[src_count]; flagword flags = sym->flags; char *name = (char *) bfd_asymbol_name (sym); - int keep; + bfd_boolean keep; + bfd_boolean used_in_reloc = FALSE; bfd_boolean undefined; bfd_boolean rem_leading_char; bfd_boolean add_leading_char; @@ -895,21 +986,24 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, } if (strip_symbols == STRIP_ALL) - keep = 0; + keep = FALSE; else if ((flags & BSF_KEEP) != 0 /* Used in relocation. */ || ((flags & BSF_SECTION_SYM) != 0 && ((*bfd_get_section (sym)->symbol_ptr_ptr)->flags & BSF_KEEP) != 0)) - keep = 1; + { + keep = TRUE; + used_in_reloc = TRUE; + } else if (relocatable /* Relocatable file. */ && (flags & (BSF_GLOBAL | BSF_WEAK)) != 0) - keep = 1; + keep = TRUE; else if (bfd_decode_symclass (sym) == 'I') /* Global symbols in $idata sections need to be retained even if relocatable is FALSE. External users of the library containing the $idata section may reference these symbols. */ - keep = 1; + keep = TRUE; else if ((flags & BSF_GLOBAL) != 0 /* Global symbol. */ || (flags & BSF_WEAK) != 0 || undefined @@ -922,7 +1016,7 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, else if (bfd_coff_get_comdat_section (abfd, bfd_get_section (sym))) /* COMDAT sections store special information in local symbols, so we cannot risk stripping any of them. */ - keep = 1; + keep = TRUE; else /* Local symbol. */ keep = (strip_symbols != STRIP_UNNEEDED && (discard_locals != LOCALS_ALL @@ -930,17 +1024,30 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, || ! bfd_is_local_label (abfd, sym)))); if (keep && is_specified_symbol (name, strip_specific_list)) - keep = 0; + { + /* There are multiple ways to set 'keep' above, but if it + was the relocatable symbol case, then that's an error. */ + if (used_in_reloc) + { + non_fatal (_("not stripping symbol `%s' because it is named in a relocation"), name); + status = 1; + } + else + keep = FALSE; + } + if (keep && !(flags & BSF_KEEP) && is_specified_symbol (name, strip_unneeded_list)) - keep = 0; + keep = FALSE; + if (!keep && ((keep_file_symbols && (flags & BSF_FILE)) || is_specified_symbol (name, keep_specific_list))) - keep = 1; + keep = TRUE; + if (keep && is_strip_section (abfd, bfd_get_section (sym))) - keep = 0; + keep = FALSE; if (keep) { @@ -955,14 +1062,15 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, && (flags & (BSF_GLOBAL | BSF_WEAK)) && (is_specified_symbol (name, localize_specific_list) || (keepglobal_specific_list != NULL - && ! is_specified_symbol (name, keepglobal_specific_list)))) + && ! is_specified_symbol (name, keepglobal_specific_list)) + || (localize_hidden && is_hidden_symbol (sym)))) { sym->flags &= ~ (BSF_GLOBAL | BSF_WEAK); sym->flags |= BSF_LOCAL; } if (!undefined - && (flags & BSF_LOCAL) + && (flags & BSF_LOCAL) && is_specified_symbol (name, globalize_specific_list)) { sym->flags &= ~ BSF_LOCAL; @@ -1105,7 +1213,7 @@ add_redefine_syms_file (const char *filename) if (buf[0] != '\0') redefine_list_append (filename, &buf[0], &buf[outsym_off]); - lineno++; + lineno++; len = 0; outsym_off = 0; if (c == EOF) @@ -1233,11 +1341,16 @@ copy_object (bfd *ibfd, bfd *obfd) bfd_get_archive_filename (ibfd), bfd_get_target (ibfd), bfd_get_filename (obfd), bfd_get_target (obfd)); - if (set_start_set) - start = set_start; + if (extract_symbol) + start = 0; else - start = bfd_get_start_address (ibfd); - start += change_start; + { + if (set_start_set) + start = set_start; + else + start = bfd_get_start_address (ibfd); + start += change_start; + } /* Neither the start address nor the flags need to be set for a core file. */ @@ -1290,6 +1403,21 @@ copy_object (bfd *ibfd, bfd *obfd) isympp = NULL; osympp = NULL; + symsize = bfd_get_symtab_upper_bound (ibfd); + if (symsize < 0) + { + bfd_nonfatal (bfd_get_archive_filename (ibfd)); + return FALSE; + } + + osympp = isympp = xmalloc (symsize); + symcount = bfd_canonicalize_symtab (ibfd, isympp); + if (symcount < 0) + { + bfd_nonfatal (bfd_get_filename (ibfd)); + return FALSE; + } + /* BFD mandates that all output sections be created and sizes set before any output is done. Thus, we traverse all sections multiple times. */ bfd_map_over_sections (ibfd, setup_section, obfd); @@ -1418,13 +1546,8 @@ copy_object (bfd *ibfd, bfd *obfd) } } - if (bfd_count_sections (obfd) == 0) - { - non_fatal (_("there are no sections to be copied!")); - return FALSE; - } - - if (gap_fill_set || pad_to_set) + if (bfd_count_sections (obfd) != 0 + && (gap_fill_set || pad_to_set)) { asection **set; unsigned int c, i; @@ -1509,21 +1632,6 @@ copy_object (bfd *ibfd, bfd *obfd) /* Symbol filtering must happen after the output sections have been created, but before their contents are set. */ dhandle = NULL; - symsize = bfd_get_symtab_upper_bound (ibfd); - if (symsize < 0) - { - bfd_nonfatal (bfd_get_archive_filename (ibfd)); - return FALSE; - } - - osympp = isympp = xmalloc (symsize); - symcount = bfd_canonicalize_symtab (ibfd, isympp); - if (symcount < 0) - { - bfd_nonfatal (bfd_get_filename (ibfd)); - return FALSE; - } - if (convert_debugging) dhandle = read_debugging_info (ibfd, isympp, symcount); @@ -1532,6 +1640,7 @@ copy_object (bfd *ibfd, bfd *obfd) || strip_symbols == STRIP_UNNEEDED || strip_symbols == STRIP_NONDEBUG || discard_locals != LOCALS_UNDEF + || localize_hidden || strip_specific_list != NULL || keep_specific_list != NULL || localize_specific_list != NULL @@ -1647,16 +1756,16 @@ copy_object (bfd *ibfd, bfd *obfd) } } + /* Do not copy backend data if --extract-symbol is passed; anything + that needs to look at the section contents will fail. */ + if (extract_symbol) + return TRUE; + /* Allow the BFD backend to copy any private data it understands from the input BFD to the output BFD. This is done last to permit the routine to look at the filtered symbol table, which is important for the ECOFF code at least. */ - if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour - && strip_symbols == STRIP_NONDEBUG) - /* Do not copy the private data when creating an ELF format - debug info file. We do not want the program headers. */ - ; - else if (! bfd_copy_private_bfd_data (ibfd, obfd)) + if (! bfd_copy_private_bfd_data (ibfd, obfd)) { non_fatal (_("%s: error copying private BFD data: %s"), bfd_get_filename (obfd), @@ -1686,18 +1795,15 @@ copy_object (bfd *ibfd, bfd *obfd) return TRUE; } -#undef MKDIR -#if defined (_WIN32) && !defined (__CYGWIN32__) -#define MKDIR(DIR, MODE) mkdir (DIR) -#else -#define MKDIR(DIR, MODE) mkdir (DIR, MODE) -#endif - /* Read each archive element in turn from IBFD, copy the - contents to temp file, and keep the temp file handle. */ + contents to temp file, and keep the temp file handle. + If 'force_output_target' is TRUE then make sure that + all elements in the new archive are of the type + 'output_target'. */ static void -copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) +copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, + bfd_boolean force_output_target) { struct name_list { @@ -1707,12 +1813,13 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) } *list, *l; bfd **ptr = &obfd->archive_head; bfd *this_element; - char *dir = make_tempname (bfd_get_filename (obfd)); + char * dir; /* Make a temp directory to hold the contents. */ - if (MKDIR (dir, 0700) != 0) - fatal (_("cannot mkdir %s for archive copying (error: %s)"), - dir, strerror (errno)); + dir = make_tempdir (bfd_get_filename (obfd)); + if (dir == NULL) + fatal (_("cannot create tempdir for archive copying (error: %s)"), + strerror (errno)); obfd->has_armap = ibfd->has_armap; @@ -1739,10 +1846,10 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) /* If the file already exists, make another temp dir. */ if (stat (output_name, &buf) >= 0) { - output_name = make_tempname (output_name); - if (MKDIR (output_name, 0700) != 0) - fatal (_("cannot mkdir %s for archive copying (error: %s)"), - output_name, strerror (errno)); + output_name = make_tempdir (output_name); + if (output_name == NULL) + fatal (_("cannot create tempdir for archive copying (error: %s)"), + strerror (errno)); l = xmalloc (sizeof (struct name_list)); l->name = output_name; @@ -1753,7 +1860,6 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) bfd_get_filename (this_element), (char *) 0); } - output_bfd = bfd_openw (output_name, output_target); if (preserve_dates) { stat_status = bfd_stat_arch_elt (this_element, &buf); @@ -1769,11 +1875,18 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) l->obfd = NULL; list = l; - if (output_bfd == NULL) - RETURN_NONFATAL (output_name); - if (bfd_check_format (this_element, bfd_object)) { + /* PR binutils/3110: Cope with archives + containing multiple target types. */ + if (force_output_target) + output_bfd = bfd_openw (output_name, output_target); + else + output_bfd = bfd_openw (output_name, bfd_get_target (this_element)); + + if (output_bfd == NULL) + RETURN_NONFATAL (output_name); + delete = ! copy_object (this_element, output_bfd); if (! delete @@ -1794,6 +1907,7 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) non_fatal (_("Unable to recognise the format of the input file `%s'"), bfd_get_archive_filename (this_element)); + output_bfd = bfd_openw (output_name, output_target); copy_unknown_element: delete = !copy_unknown_object (this_element, output_bfd); if (!bfd_close_all_done (output_bfd)) @@ -1820,7 +1934,7 @@ copy_unknown_element: l->obfd = output_bfd; *ptr = output_bfd; - ptr = &output_bfd->next; + ptr = &output_bfd->archive_next; last_element = this_element; @@ -1863,7 +1977,6 @@ copy_file (const char *input_filename, const char *output_filename, if (get_file_size (input_filename) < 1) { - non_fatal (_("error: the input file '%s' is empty"), input_filename); status = 1; return; } @@ -1876,18 +1989,24 @@ copy_file (const char *input_filename, const char *output_filename, if (bfd_check_format (ibfd, bfd_archive)) { + bfd_boolean force_output_target; bfd *obfd; /* bfd_get_target does not return the correct value until bfd_check_format succeeds. */ if (output_target == NULL) - output_target = bfd_get_target (ibfd); + { + output_target = bfd_get_target (ibfd); + force_output_target = FALSE; + } + else + force_output_target = TRUE; obfd = bfd_openw (output_filename, output_target); if (obfd == NULL) RETURN_NONFATAL (output_filename); - copy_archive (ibfd, obfd, output_target); + copy_archive (ibfd, obfd, output_target, force_output_target); } else if (bfd_check_format_matches (ibfd, bfd_object, &obj_matching)) { @@ -2076,7 +2195,9 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) if (p != NULL && p->set_flags) flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC)); - else if (strip_symbols == STRIP_NONDEBUG && (flags & SEC_ALLOC) != 0) + else if (strip_symbols == STRIP_NONDEBUG + && obfd->xvec->flavour != bfd_target_elf_flavour + && (flags & SEC_ALLOC) != 0) flags &= ~(SEC_HAS_CONTENTS | SEC_LOAD); osection = bfd_make_section_anyway_with_flags (obfd, name, flags); @@ -2090,12 +2211,17 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) if (strip_symbols == STRIP_NONDEBUG && obfd->xvec->flavour == bfd_target_elf_flavour && (flags & SEC_ALLOC) != 0 + && elf_section_type (osection) != SHT_NOTE + && (ibfd->xvec->flavour != bfd_target_elf_flavour + || elf_section_type (isection) != SHT_NOTE) && (p == NULL || !p->set_flags)) elf_section_type (osection) = SHT_NOBITS; size = bfd_section_size (ibfd, isection); if (copy_byte >= 0) size = (size + interleave - 1) / interleave; + else if (extract_symbol) + size = 0; if (! bfd_set_section_size (obfd, osection, size)) { err = _("size"); @@ -2110,7 +2236,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) else vma += change_section_address; - if (! bfd_set_section_vma (obfd, osection, vma)) + if (! bfd_set_section_vma (obfd, osection, extract_symbol ? 0 : vma)) { err = _("vma"); goto loser; @@ -2129,7 +2255,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) else lma += change_section_address; - osection->lma = lma; + osection->lma = extract_symbol ? 0 : lma; /* FIXME: This is probably not enough. If we change the LMA we may have to recompute the header for the file as well. */ @@ -2148,20 +2274,27 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) bfd_get_section_by_name since some formats allow multiple sections with the same name. */ isection->output_section = osection; - isection->output_offset = 0; + isection->output_offset = extract_symbol ? vma : 0; + + /* Do not copy backend data if --extract-symbol is passed; anything + that needs to look at the section contents will fail. */ + if (extract_symbol) + return; /* Allow the BFD backend to copy any private data it understands from the input section to the output section. */ - if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour - && strip_symbols == STRIP_NONDEBUG) - /* Do not copy the private data when creating an ELF format - debug info file. We do not want the program headers. */ - ; - else if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection)) + if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection)) { err = _("private data"); goto loser; } + else if ((isection->flags & SEC_GROUP) != 0) + { + asymbol *gsym = group_signature (isection); + + if (gsym != NULL) + gsym->flags |= BSF_KEEP; + } /* All went well. */ return; @@ -2259,6 +2392,9 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) free (relpp); } + if (extract_symbol) + return; + if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS && bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS) { @@ -2267,6 +2403,32 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) if (!bfd_get_section_contents (ibfd, isection, memhunk, 0, size)) RETURN_NONFATAL (bfd_get_filename (ibfd)); + if (reverse_bytes) + { + /* We don't handle leftover bytes (too many possible behaviors, + and we don't know what the user wants). The section length + must be a multiple of the number of bytes to swap. */ + if ((size % reverse_bytes) == 0) + { + unsigned long i, j; + bfd_byte b; + + for (i = 0; i < size; i += reverse_bytes) + for (j = 0; j < (unsigned long)(reverse_bytes / 2); j++) + { + bfd_byte *m = (bfd_byte *) memhunk; + + b = m[i + j]; + m[i + j] = m[(i + reverse_bytes) - (j + 1)]; + m[(i + reverse_bytes) - (j + 1)] = b; + } + } + else + /* User must pad the section up in order to do this. */ + fatal (_("cannot reverse bytes: length of section %s must be evenly divisible by %d"), + bfd_section_name (ibfd, isection), reverse_bytes); + } + if (copy_byte >= 0) { /* Keep only every `copy_byte'th byte in MEMHUNK. */ @@ -2561,7 +2723,7 @@ strip_main (int argc, char *argv[]) display_info (); return 0; } - + if (show_version) print_version ("strip"); @@ -2586,35 +2748,47 @@ strip_main (int argc, char *argv[]) char *tmpname; if (get_file_size (argv[i]) < 1) - continue; + { + status = 1; + continue; + } if (preserve_dates) /* No need to check the return value of stat(). It has already been checked in get_file_size(). */ stat (argv[i], &statbuf); - if (output_file != NULL) - tmpname = output_file; - else + if (output_file == NULL || strcmp (argv[i], output_file) == 0) tmpname = make_tempname (argv[i]); - status = 0; + else + tmpname = output_file; + + if (tmpname == NULL) + { + non_fatal (_("could not create temporary file to hold stripped copy of '%s'"), + argv[i]); + status = 1; + continue; + } + status = 0; copy_file (argv[i], tmpname, input_target, output_target); if (status == 0) { if (preserve_dates) set_times (tmpname, &statbuf); - if (output_file == NULL) - smart_rename (tmpname, argv[i], preserve_dates); + if (output_file != tmpname) + smart_rename (tmpname, output_file ? output_file : argv[i], + preserve_dates); status = hold_status; } else unlink_if_ordinary (tmpname); - if (output_file == NULL) + if (output_file != tmpname) free (tmpname); } - return 0; + return status; } static int @@ -2623,6 +2797,7 @@ copy_main (int argc, char *argv[]) char * binary_architecture = NULL; char *input_filename = NULL; char *output_filename = NULL; + char *tmpname; char *input_target = NULL; char *output_target = NULL; bfd_boolean show_version = FALSE; @@ -2783,7 +2958,10 @@ copy_main (int argc, char *argv[]) size = get_file_size (s + 1); if (size < 1) - break; + { + status = 1; + break; + } pa = xmalloc (sizeof (struct section_add)); @@ -3064,6 +3242,10 @@ copy_main (int argc, char *argv[]) add_specific_symbols (optarg, &keep_specific_list); break; + case OPTION_LOCALIZE_HIDDEN: + localize_hidden = TRUE; + break; + case OPTION_LOCALIZE_SYMBOLS: add_specific_symbols (optarg, &localize_specific_list); break; @@ -3118,6 +3300,24 @@ copy_main (int argc, char *argv[]) bfd_flags_to_set &= ~D_PAGED; break; + case OPTION_EXTRACT_SYMBOL: + extract_symbol = TRUE; + break; + + case OPTION_REVERSE_BYTES: + { + int prev = reverse_bytes; + + reverse_bytes = atoi (optarg); + if ((reverse_bytes <= 0) || ((reverse_bytes % 2) != 0)) + fatal (_("number of bytes to reverse must be positive and even")); + + if (prev && prev != reverse_bytes) + non_fatal (_("Warning: ignoring previous --reverse-bytes value of %d"), + prev); + break; + } + case 0: /* We've been given a long option. */ break; @@ -3136,7 +3336,7 @@ copy_main (int argc, char *argv[]) display_info (); return 0; } - + if (show_version) print_version ("objcopy"); @@ -3188,28 +3388,24 @@ copy_main (int argc, char *argv[]) /* If there is no destination file, or the source and destination files are the same, then create a temp and rename the result into the input. */ if (output_filename == NULL || strcmp (input_filename, output_filename) == 0) - { - char *tmpname = make_tempname (input_filename); - - copy_file (input_filename, tmpname, input_target, output_target); - if (status == 0) - { - if (preserve_dates) - set_times (tmpname, &statbuf); - smart_rename (tmpname, input_filename, preserve_dates); - } - else - unlink (tmpname); - } + tmpname = make_tempname (input_filename); else - { - copy_file (input_filename, output_filename, input_target, output_target); + tmpname = output_filename; + + if (tmpname == NULL) + fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), + input_filename, strerror (errno)); - if (status == 0 && preserve_dates) - set_times (output_filename, &statbuf); - else if (status != 0) - unlink_if_ordinary (output_filename); + copy_file (input_filename, tmpname, input_target, output_target); + if (status == 0) + { + if (preserve_dates) + set_times (tmpname, &statbuf); + if (tmpname != output_filename) + smart_rename (tmpname, input_filename, preserve_dates); } + else + unlink_if_ordinary (tmpname); if (change_warn) { diff --git a/binutils/objdump.c b/binutils/objdump.c index 6e5eab56da24..38e7c0289854 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -1,6 +1,6 @@ /* objdump.c -- dump information about an object file. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -48,12 +48,11 @@ disassembling is done by the libopcodes library, via a function pointer supplied by the disassembler() function. */ +#include "sysdep.h" #include "bfd.h" -#include "bfdver.h" #include "progress.h" #include "bucomm.h" #include "dwarf.h" -#include "budemang.h" #include "getopt.h" #include "safe-ctype.h" #include "dis-asm.h" @@ -62,6 +61,12 @@ #include "debug.h" #include "budbg.h" +#ifdef HAVE_MMAP +#include <sys/mman.h> +#endif + +#include <sys/stat.h> + /* Internal headers for the ELF .stab-dump code - sorry. */ #define BYTES_IN_WORD 32 #include "aout/aout64.h" @@ -225,7 +230,7 @@ usage (FILE *stream, int status) disassembler_usage (stream); } - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } @@ -650,8 +655,9 @@ objdump_print_symname (bfd *abfd, struct disassemble_info *info, if (do_demangle && name[0] != '\0') { /* Demangle the name. */ - alloc = demangle (abfd, name); - name = alloc; + alloc = bfd_demangle (abfd, name, DMGL_ANSI | DMGL_PARAMS); + if (alloc != NULL) + name = alloc; } if (info != NULL) @@ -687,6 +693,7 @@ find_symbol_for_address (bfd_vma vma, bfd *abfd; asection *sec; unsigned int opb; + bfd_boolean want_section; if (sorted_symcount < 1) return NULL; @@ -732,15 +739,19 @@ find_symbol_for_address (bfd_vma vma, Note that this may be wrong for some symbol references if the sections have overlapping memory ranges, but in that case there's no way to tell what's desired without looking at the relocation - table. */ - if (sorted_syms[thisplace]->section != sec - && (aux->require_sec - || ((abfd->flags & HAS_RELOC) != 0 - && vma >= bfd_get_section_vma (abfd, sec) - && vma < (bfd_get_section_vma (abfd, sec) - + bfd_section_size (abfd, sec) / opb)))) + table. + + Also give the target a chance to reject symbols. */ + want_section = (aux->require_sec + || ((abfd->flags & HAS_RELOC) != 0 + && vma >= bfd_get_section_vma (abfd, sec) + && vma < (bfd_get_section_vma (abfd, sec) + + bfd_section_size (abfd, sec) / opb))); + if ((sorted_syms[thisplace]->section != sec && want_section) + || !info->symbol_is_valid (sorted_syms[thisplace], info)) { long i; + long newplace; for (i = thisplace + 1; i < sorted_symcount; i++) { @@ -750,27 +761,36 @@ find_symbol_for_address (bfd_vma vma, } --i; + newplace = sorted_symcount; for (; i >= 0; i--) { - if (sorted_syms[i]->section == sec - && (i == 0 - || sorted_syms[i - 1]->section != sec - || (bfd_asymbol_value (sorted_syms[i]) - != bfd_asymbol_value (sorted_syms[i - 1])))) + if ((sorted_syms[i]->section == sec || !want_section) + && info->symbol_is_valid (sorted_syms[i], info)) { - thisplace = i; - break; + if (newplace == sorted_symcount) + newplace = i; + + if (bfd_asymbol_value (sorted_syms[i]) + != bfd_asymbol_value (sorted_syms[newplace])) + break; + + /* Remember this symbol and keep searching until we reach + an earlier address. */ + newplace = i; } } - if (sorted_syms[thisplace]->section != sec) + if (newplace != sorted_symcount) + thisplace = newplace; + else { /* We didn't find a good symbol with a smaller value. Look for one with a larger value. */ for (i = thisplace + 1; i < sorted_symcount; i++) { - if (sorted_syms[i]->section == sec) + if ((sorted_syms[i]->section == sec || !want_section) + && info->symbol_is_valid (sorted_syms[i], info)) { thisplace = i; break; @@ -778,25 +798,12 @@ find_symbol_for_address (bfd_vma vma, } } - if (sorted_syms[thisplace]->section != sec - && (aux->require_sec - || ((abfd->flags & HAS_RELOC) != 0 - && vma >= bfd_get_section_vma (abfd, sec) - && vma < (bfd_get_section_vma (abfd, sec) - + bfd_section_size (abfd, sec))))) + if ((sorted_syms[thisplace]->section != sec && want_section) + || !info->symbol_is_valid (sorted_syms[thisplace], info)) /* There is no suitable symbol. */ return NULL; } - /* Give the target a chance to reject the symbol. */ - while (! info->symbol_is_valid (sorted_syms [thisplace], info)) - { - ++ thisplace; - if (thisplace >= sorted_symcount - || bfd_asymbol_value (sorted_syms [thisplace]) > vma) - return NULL; - } - if (place != NULL) *place = thisplace; @@ -926,8 +933,12 @@ struct print_file_list struct print_file_list *next; const char *filename; const char *modname; - unsigned int line; - FILE *f; + const char *map; + size_t mapsize; + const char **linemap; + unsigned maxline; + unsigned last_line; + int first; }; static struct print_file_list *print_files; @@ -937,6 +948,99 @@ static struct print_file_list *print_files; #define SHOW_PRECEDING_CONTEXT_LINES (5) +/* Read a complete file into memory. */ + +static const char * +slurp_file (const char *fn, size_t *size) +{ +#ifdef HAVE_MMAP + int ps = getpagesize (); + size_t msize; +#endif + const char *map; + struct stat st; + int fd = open (fn, O_RDONLY); + + if (fd < 0) + return NULL; + if (fstat (fd, &st) < 0) + return NULL; + *size = st.st_size; +#ifdef HAVE_MMAP + msize = (*size + ps - 1) & ~(ps - 1); + map = mmap (NULL, msize, PROT_READ, MAP_SHARED, fd, 0); + if (map != (char *)-1L) + { + close(fd); + return map; + } +#endif + map = malloc (*size); + if (!map || (size_t) read (fd, (char *)map, *size) != *size) + { + free ((void *)map); + map = NULL; + } + close (fd); + return map; +} + +#define line_map_decrease 5 + +/* Precompute array of lines for a mapped file. */ + +static const char ** +index_file (const char *map, size_t size, unsigned int *maxline) +{ + const char *p, *lstart, *end; + int chars_per_line = 45; /* First iteration will use 40. */ + unsigned int lineno; + const char **linemap = NULL; + unsigned long line_map_size = 0; + + lineno = 0; + lstart = map; + end = map + size; + + for (p = map; p < end; p++) + { + if (*p == '\n') + { + if (p + 1 < end && p[1] == '\r') + p++; + } + else if (*p == '\r') + { + if (p + 1 < end && p[1] == '\n') + p++; + } + else + continue; + + /* End of line found. */ + + if (linemap == NULL || line_map_size < lineno + 1) + { + unsigned long newsize; + + chars_per_line -= line_map_decrease; + if (chars_per_line <= 1) + chars_per_line = 1; + line_map_size = size / chars_per_line + 1; + if (line_map_size < lineno + 1) + line_map_size = lineno + 1; + newsize = line_map_size * sizeof (char *); + linemap = xrealloc (linemap, newsize); + } + + linemap[lineno++] = lstart; + lstart = p + 1; + } + + *maxline = lineno; + return linemap; +} + /* Tries to open MODNAME, and if successful adds a node to print_files linked list and returns that node. Returns NULL on failure. */ @@ -944,24 +1048,22 @@ static struct print_file_list * try_print_file_open (const char *origname, const char *modname) { struct print_file_list *p; - FILE *f; - f = fopen (modname, "r"); - if (f == NULL) - return NULL; + p = xmalloc (sizeof (struct print_file_list)); - if (print_files != NULL && print_files->f != NULL) + p->map = slurp_file (modname, &p->mapsize); + if (p->map == NULL) { - fclose (print_files->f); - print_files->f = NULL; + free (p); + return NULL; } - - p = xmalloc (sizeof (struct print_file_list)); + + p->linemap = index_file (p->map, p->mapsize, &p->maxline); + p->last_line = 0; p->filename = origname; p->modname = modname; - p->line = 0; - p->f = f; p->next = print_files; + p->first = 1; print_files = p; return p; } @@ -1020,29 +1122,32 @@ update_source_path (const char *filename) return NULL; } -/* Skip ahead to a given line in a file, optionally printing each - line. */ +/* Print a source file line. */ -static void -skip_to_line (struct print_file_list *p, unsigned int line, - bfd_boolean show) +static void +print_line (struct print_file_list *p, unsigned int line) { - while (p->line < line) - { - char buf[100]; - - if (fgets (buf, sizeof buf, p->f) == NULL) - { - fclose (p->f); - p->f = NULL; - break; - } + const char *l; + + --line; + if (line >= p->maxline) + return; + l = p->linemap [line]; + fwrite (l, 1, strcspn (l, "\n\r"), stdout); + putchar ('\n'); +} - if (show) - printf ("%s", buf); +/* Print a range of source code lines. */ - if (strchr (buf, '\n') != NULL) - ++p->line; +static void +dump_lines (struct print_file_list *p, unsigned int start, unsigned int end) +{ + if (p->map == NULL) + return; + while (start <= end) + { + print_line (p, start); + start++; } } @@ -1083,79 +1188,31 @@ show_line (bfd *abfd, asection *section, bfd_vma addr_offset) && line > 0) { struct print_file_list **pp, *p; + unsigned l; for (pp = &print_files; *pp != NULL; pp = &(*pp)->next) if (strcmp ((*pp)->filename, filename) == 0) break; p = *pp; - if (p != NULL) - { - if (p != print_files) - { - int l; - - /* We have reencountered a file name which we saw - earlier. This implies that either we are dumping out - code from an included file, or the same file was - linked in more than once. There are two common cases - of an included file: inline functions in a header - file, and a bison or flex skeleton file. In the - former case we want to just start printing (but we - back up a few lines to give context); in the latter - case we want to continue from where we left off. I - can't think of a good way to distinguish the cases, - so I used a heuristic based on the file name. */ - if (strcmp (p->filename + strlen (p->filename) - 2, ".h") != 0) - l = p->line; - else - { - l = line - SHOW_PRECEDING_CONTEXT_LINES; - if (l < 0) - l = 0; - } - - if (p->f == NULL) - { - p->f = fopen (p->modname, "r"); - p->line = 0; - } - if (p->f != NULL) - skip_to_line (p, l, FALSE); - - if (print_files->f != NULL) - { - fclose (print_files->f); - print_files->f = NULL; - } - } - - if (p->f != NULL) - { - skip_to_line (p, line, TRUE); - *pp = p->next; - p->next = print_files; - print_files = p; - } - } - else - { + if (p == NULL) p = update_source_path (filename); - if (p != NULL) + if (p != NULL && line != p->last_line) + { + if (file_start_context && p->first) + l = 1; + else { - int l; - - if (file_start_context) - l = 0; - else - l = line - SHOW_PRECEDING_CONTEXT_LINES; - if (l < 0) - l = 0; - skip_to_line (p, l, FALSE); - if (p->f != NULL) - skip_to_line (p, line, TRUE); + l = line - SHOW_PRECEDING_CONTEXT_LINES; + if (l >= line) + l = 1; + if (p->last_line >= l && p->last_line <= line) + l = p->last_line + 1; } + dump_lines (p, l, line); + p->last_line = line; + p->first = 0; } } @@ -1377,6 +1434,8 @@ disassemble_bytes (struct disassemble_info * info, info->flags = 0; if (info->disassembler_needs_relocs + && (bfd_get_file_flags (aux->abfd) & EXEC_P) == 0 + && (bfd_get_file_flags (aux->abfd) & DYNAMIC) == 0 && *relppp < relppend) { bfd_signed_vma distance_to_rel; @@ -1748,11 +1807,13 @@ disassemble_section (bfd *abfd, asection *section, void *info) pinfo->symbols = sorted_syms + place; pinfo->num_symbols = x - place; + pinfo->symtab_pos = place; } else { pinfo->symbols = NULL; pinfo->num_symbols = 0; + pinfo->symtab_pos = -1; } if (! prefix_addresses) @@ -1945,6 +2006,8 @@ disassemble_data (bfd *abfd) compare_relocs); } } + disasm_info.symtab = sorted_syms; + disasm_info.symtab_size = sorted_symcount; bfd_map_over_sections (abfd, disassemble_section, & disasm_info); @@ -1970,7 +2033,19 @@ load_debug_section (enum dwarf_section_display_enum debug, void *file) if (sec == NULL) return 0; - section->address = bfd_get_section_vma (abfd, sec); + /* Compute a bias to be added to offsets found within the DWARF debug + information. These offsets are meant to be relative to the start of + the dwarf section, and hence the bias should be 0. For MACH-O however + a dwarf section is really just a region of a much larger section and so + the bias is the address of the start of that area within the larger + section. This test is important for PE and COFF based targets which + use DWARF debug information, since unlike ELF, they do not allow the + dwarf sections to be placed at address 0. */ + if (bfd_get_flavour (abfd) == bfd_target_mach_o_flavour) + section->address = bfd_get_section_vma (abfd, sec); + else + section->address = 0; + section->size = bfd_get_section_size (sec); section->start = xmalloc (section->size); @@ -2015,7 +2090,7 @@ dump_dwarf_section (bfd *abfd, asection *section, const char *match; enum dwarf_section_display_enum i; - if (strncmp (name, ".gnu.linkonce.wi.", 17) == 0) + if (CONST_STRNEQ (name, ".gnu.linkonce.wi.")) match = ".debug_info"; else match = name; @@ -2511,12 +2586,16 @@ dump_symbols (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean dynamic) /* If we want to demangle the name, we demangle it here, and temporarily clobber it while calling bfd_print_symbol. FIXME: This is a gross hack. */ - alloc = demangle (cur_bfd, name); - (*current)->name = alloc; + alloc = bfd_demangle (cur_bfd, name, DMGL_ANSI | DMGL_PARAMS); + if (alloc != NULL) + (*current)->name = alloc; bfd_print_symbol (cur_bfd, stdout, *current, bfd_print_symbol_all); - (*current)->name = name; - free (alloc); + if (alloc != NULL) + { + (*current)->name = name; + free (alloc); + } } else bfd_print_symbol (cur_bfd, stdout, *current, @@ -2822,8 +2901,9 @@ dump_bfd (bfd *abfd) dhandle = read_debugging_info (abfd, syms, symcount); if (dhandle != NULL) { - if (! print_debugging_info (stdout, dhandle, abfd, syms, demangle, - dump_debugging_tags ? TRUE : FALSE)) + if (!print_debugging_info (stdout, dhandle, abfd, syms, + bfd_demangle, + dump_debugging_tags ? TRUE : FALSE)) { non_fatal (_("%s: printing debugging information failed"), bfd_get_filename (abfd)); @@ -2902,7 +2982,10 @@ display_file (char *filename, char *target) bfd *arfile = NULL; if (get_file_size (filename) < 1) - return; + { + exit_status = 1; + return; + } file = bfd_openr (filename, target); if (file == NULL) diff --git a/binutils/po/Make-in b/binutils/po/Make-in index be09b4cd788b..86ff3143b988 100644 --- a/binutils/po/Make-in +++ b/binutils/po/Make-in @@ -16,6 +16,7 @@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ +top_builddir = @top_builddir@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -72,7 +73,7 @@ INSTOBJEXT = @INSTOBJEXT@ $(MSGFMT) -o $@ $< .po.gmo: - file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: diff --git a/binutils/po/POTFILES.in b/binutils/po/POTFILES.in index d3f6cb3fa7c7..e96d8bf3ca18 100644 --- a/binutils/po/POTFILES.in +++ b/binutils/po/POTFILES.in @@ -2,13 +2,12 @@ addr2line.c ar.c arsup.c arsup.h +bin2c.c binemul.c binemul.h bucomm.c bucomm.h budbg.h -budemang.c -budemang.h coffdump.c coffgrok.c coffgrok.h @@ -29,6 +28,7 @@ is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c +mclex.c nlmconv.c nlmconv.h nm.c @@ -37,6 +37,7 @@ not-strip.c objcopy.c objdump.c prdbg.c +rclex.c rdcoff.c rdcoff.c rddbg.c @@ -54,6 +55,9 @@ stabs.c strings.c sysdump.c version.c +windint.h +windmc.c +windmc.h windres.c windres.h winduni.c diff --git a/binutils/po/binutils.pot b/binutils/po/binutils.pot index 5e5a4dc7f22a..f0801683f203 100644 --- a/binutils/po/binutils.pot +++ b/binutils/po/binutils.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-10-25 09:14+0930\n" +"POT-Creation-Date: 2007-07-02 15:55+0930\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,31 +16,32 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: addr2line.c:76 +#: addr2line.c:74 #, c-format msgid "Usage: %s [option(s)] [addr(s)]\n" msgstr "" -#: addr2line.c:77 +#: addr2line.c:75 #, c-format msgid " Convert addresses into line number/file name pairs.\n" msgstr "" -#: addr2line.c:78 +#: addr2line.c:76 #, c-format msgid "" " If no addresses are specified on the command line, they will be read from " "stdin\n" msgstr "" -#: addr2line.c:79 +#: addr2line.c:77 #, c-format msgid "" " The options are:\n" " @<file> Read options from <file>\n" " -b --target=<bfdname> Set the binary file format\n" " -e --exe=<executable> Set the input file name (default is a.out)\n" -" -i --inlines\t\t Unwind inlined functions\n" +" -i --inlines Unwind inlined functions\n" +" -j --section=<name> Read section-relative offsets instead of addresses\n" " -s --basenames Strip directory names\n" " -f --functions Show function names\n" " -C --demangle[=style] Demangle function names\n" @@ -49,169 +50,174 @@ msgid "" "\n" msgstr "" -#: addr2line.c:93 ar.c:263 coffdump.c:466 nlmconv.c:1113 objcopy.c:486 -#: objcopy.c:520 readelf.c:2622 size.c:102 srconv.c:1732 strings.c:725 -#: sysdump.c:648 windres.c:673 +#: addr2line.c:92 ar.c:264 coffdump.c:467 dlltool.c:3172 dllwrap.c:510 +#: nlmconv.c:1115 objcopy.c:515 objcopy.c:550 readelf.c:2797 size.c:103 +#: srconv.c:1734 strings.c:722 sysdump.c:647 windmc.c:232 windres.c:698 #, c-format msgid "Report bugs to %s\n" msgstr "" -#: addr2line.c:253 +#: addr2line.c:279 #, c-format -msgid "%s: can not get addresses from archive" +msgid "%s: cannot get addresses from archive" msgstr "" -#: addr2line.c:325 nm.c:1523 objdump.c:3033 +#: addr2line.c:296 +#, c-format +msgid "%s: cannot find section %s" +msgstr "" + +#: addr2line.c:362 nm.c:1534 objdump.c:3099 #, c-format msgid "unknown demangling style `%s'" msgstr "" -#: ar.c:203 +#: ar.c:204 #, c-format msgid "no entry %s in archive\n" msgstr "" -#: ar.c:219 +#: ar.c:220 #, c-format msgid "" "Usage: %s [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] " "[count] archive-file file...\n" msgstr "" -#: ar.c:222 +#: ar.c:223 #, c-format msgid " %s -M [<mri-script]\n" msgstr "" -#: ar.c:223 +#: ar.c:224 #, c-format msgid " commands:\n" msgstr "" -#: ar.c:224 +#: ar.c:225 #, c-format msgid " d - delete file(s) from the archive\n" msgstr "" -#: ar.c:225 +#: ar.c:226 #, c-format msgid " m[ab] - move file(s) in the archive\n" msgstr "" -#: ar.c:226 +#: ar.c:227 #, c-format msgid " p - print file(s) found in the archive\n" msgstr "" -#: ar.c:227 +#: ar.c:228 #, c-format msgid " q[f] - quick append file(s) to the archive\n" msgstr "" -#: ar.c:228 +#: ar.c:229 #, c-format msgid "" " r[ab][f][u] - replace existing or insert new file(s) into the archive\n" msgstr "" -#: ar.c:229 +#: ar.c:230 #, c-format msgid " t - display contents of archive\n" msgstr "" -#: ar.c:230 +#: ar.c:231 #, c-format msgid " x[o] - extract file(s) from the archive\n" msgstr "" -#: ar.c:231 +#: ar.c:232 #, c-format msgid " command specific modifiers:\n" msgstr "" -#: ar.c:232 +#: ar.c:233 #, c-format msgid " [a] - put file(s) after [member-name]\n" msgstr "" -#: ar.c:233 +#: ar.c:234 #, c-format msgid " [b] - put file(s) before [member-name] (same as [i])\n" msgstr "" -#: ar.c:234 +#: ar.c:235 #, c-format msgid " [N] - use instance [count] of name\n" msgstr "" -#: ar.c:235 +#: ar.c:236 #, c-format msgid " [f] - truncate inserted file names\n" msgstr "" -#: ar.c:236 +#: ar.c:237 #, c-format msgid " [P] - use full path names when matching\n" msgstr "" -#: ar.c:237 +#: ar.c:238 #, c-format msgid " [o] - preserve original dates\n" msgstr "" -#: ar.c:238 +#: ar.c:239 #, c-format msgid "" " [u] - only replace files that are newer than current archive " "contents\n" msgstr "" -#: ar.c:239 +#: ar.c:240 #, c-format msgid " generic modifiers:\n" msgstr "" -#: ar.c:240 +#: ar.c:241 #, c-format msgid " [c] - do not warn if the library had to be created\n" msgstr "" -#: ar.c:241 +#: ar.c:242 #, c-format msgid " [s] - create an archive index (cf. ranlib)\n" msgstr "" -#: ar.c:242 +#: ar.c:243 #, c-format msgid " [S] - do not build a symbol table\n" msgstr "" -#: ar.c:243 +#: ar.c:244 #, c-format msgid " [v] - be verbose\n" msgstr "" -#: ar.c:244 +#: ar.c:245 #, c-format msgid " [V] - display the version number\n" msgstr "" -#: ar.c:245 +#: ar.c:246 #, c-format msgid " @<file> - read options from <file>\n" msgstr "" -#: ar.c:252 +#: ar.c:253 #, c-format msgid "Usage: %s [options] archive\n" msgstr "" -#: ar.c:253 +#: ar.c:254 #, c-format msgid " Generate an index to speed access to archives\n" msgstr "" -#: ar.c:254 +#: ar.c:255 #, c-format msgid "" " The options are:\n" @@ -220,47 +226,47 @@ msgid "" " -V --version Print version information\n" msgstr "" -#: ar.c:485 +#: ar.c:487 msgid "two different operation options specified" msgstr "" -#: ar.c:560 +#: ar.c:562 #, c-format msgid "illegal option -- %c" msgstr "" -#: ar.c:606 +#: ar.c:605 msgid "no operation specified" msgstr "" -#: ar.c:609 +#: ar.c:608 msgid "`u' is only meaningful with the `r' option." msgstr "" -#: ar.c:617 +#: ar.c:616 msgid "`N' is only meaningful with the `x' and `d' options." msgstr "" -#: ar.c:620 +#: ar.c:619 msgid "Value for `N' must be positive." msgstr "" -#: ar.c:670 +#: ar.c:669 #, c-format msgid "internal error -- this option not implemented" msgstr "" -#: ar.c:739 +#: ar.c:738 #, c-format msgid "creating %s" msgstr "" -#: ar.c:788 ar.c:838 ar.c:1156 objcopy.c:1683 +#: ar.c:787 ar.c:842 ar.c:1164 objcopy.c:1869 #, c-format msgid "internal stat error on %s" msgstr "" -#: ar.c:792 +#: ar.c:791 #, c-format msgid "" "\n" @@ -268,168 +274,173 @@ msgid "" "\n" msgstr "" -#: ar.c:808 ar.c:875 +#: ar.c:807 ar.c:875 #, c-format msgid "%s is not a valid archive" msgstr "" -#: ar.c:843 -#, c-format -msgid "stat returns negative size for %s" -msgstr "" - -#: ar.c:1061 +#: ar.c:1069 #, c-format msgid "No member named `%s'\n" msgstr "" -#: ar.c:1111 +#: ar.c:1119 #, c-format msgid "no entry %s in archive %s!" msgstr "" -#: ar.c:1248 +#: ar.c:1257 #, c-format msgid "%s: no archive map to update" msgstr "" -#: arsup.c:87 +#: arsup.c:88 #, c-format msgid "No entry %s in archive.\n" msgstr "" -#: arsup.c:112 +#: arsup.c:113 #, c-format msgid "Can't open file %s\n" msgstr "" -#: arsup.c:162 +#: arsup.c:163 #, c-format msgid "%s: Can't open output archive %s\n" msgstr "" -#: arsup.c:179 +#: arsup.c:180 #, c-format msgid "%s: Can't open input archive %s\n" msgstr "" -#: arsup.c:188 +#: arsup.c:189 #, c-format msgid "%s: file %s is not an archive\n" msgstr "" -#: arsup.c:227 +#: arsup.c:228 #, c-format msgid "%s: no output archive specified yet\n" msgstr "" -#: arsup.c:247 arsup.c:285 arsup.c:327 arsup.c:347 arsup.c:413 +#: arsup.c:248 arsup.c:286 arsup.c:328 arsup.c:348 arsup.c:414 #, c-format msgid "%s: no open output archive\n" msgstr "" -#: arsup.c:258 arsup.c:368 arsup.c:394 +#: arsup.c:259 arsup.c:369 arsup.c:395 #, c-format msgid "%s: can't open file %s\n" msgstr "" -#: arsup.c:312 arsup.c:390 arsup.c:471 +#: arsup.c:313 arsup.c:391 arsup.c:472 #, c-format msgid "%s: can't find module file %s\n" msgstr "" -#: arsup.c:422 +#: arsup.c:423 #, c-format msgid "Current open archive is %s\n" msgstr "" -#: arsup.c:446 +#: arsup.c:447 #, c-format msgid "%s: no open archive\n" msgstr "" +#: bin2c.c:84 +#, c-format +msgid "Usage: %s < input_file > output_file\n" +msgstr "" + +#: bin2c.c:85 +#, c-format +msgid "Prints bytes from stdin in hex format.\n" +msgstr "" + #: binemul.c:37 #, c-format msgid " No emulation specific options\n" msgstr "" #. Macros for common output. -#: binemul.h:40 +#: binemul.h:41 #, c-format msgid " emulation options: \n" msgstr "" -#: bucomm.c:110 +#: bucomm.c:111 #, c-format msgid "can't set BFD default target to `%s': %s" msgstr "" -#: bucomm.c:121 +#: bucomm.c:122 #, c-format msgid "%s: Matching formats:" msgstr "" -#: bucomm.c:136 +#: bucomm.c:137 #, c-format msgid "Supported targets:" msgstr "" -#: bucomm.c:138 +#: bucomm.c:139 #, c-format msgid "%s: supported targets:" msgstr "" -#: bucomm.c:154 +#: bucomm.c:155 #, c-format msgid "Supported architectures:" msgstr "" -#: bucomm.c:156 +#: bucomm.c:157 #, c-format msgid "%s: supported architectures:" msgstr "" -#: bucomm.c:349 +#: bucomm.c:350 #, c-format msgid "BFD header file version %s\n" msgstr "" -#: bucomm.c:450 +#: bucomm.c:499 #, c-format msgid "%s: bad number: %s" msgstr "" -#: bucomm.c:467 strings.c:438 +#: bucomm.c:516 strings.c:435 #, c-format msgid "'%s': No such file" msgstr "" -#: bucomm.c:469 strings.c:440 +#: bucomm.c:518 strings.c:437 #, c-format msgid "Warning: could not locate '%s'. reason: %s" msgstr "" -#: bucomm.c:473 +#: bucomm.c:522 #, c-format msgid "Warning: '%s' is not an ordinary file" msgstr "" -#: coffdump.c:103 +#: coffdump.c:104 #, c-format msgid "#lines %d " msgstr "" -#: coffdump.c:457 sysdump.c:641 +#: coffdump.c:458 sysdump.c:640 #, c-format msgid "Usage: %s [option(s)] in-file\n" msgstr "" -#: coffdump.c:458 +#: coffdump.c:459 #, c-format msgid " Print a human readable interpretation of a SYSROFF object file\n" msgstr "" -#: coffdump.c:459 +#: coffdump.c:460 #, c-format msgid "" " The options are:\n" @@ -439,720 +450,732 @@ msgid "" "\n" msgstr "" -#: coffdump.c:528 srconv.c:1822 sysdump.c:705 +#: coffdump.c:529 srconv.c:1824 sysdump.c:704 msgid "no input file specified" msgstr "" -#: debug.c:648 +#: cxxfilt.c:119 nm.c:252 objdump.c:234 +#, c-format +msgid "Report bugs to %s.\n" +msgstr "" + +#: debug.c:646 msgid "debug_add_to_current_namespace: no current file" msgstr "" -#: debug.c:727 +#: debug.c:725 msgid "debug_start_source: no debug_set_filename call" msgstr "" -#: debug.c:783 +#: debug.c:781 msgid "debug_record_function: no debug_set_filename call" msgstr "" -#: debug.c:835 +#: debug.c:833 msgid "debug_record_parameter: no current function" msgstr "" -#: debug.c:867 +#: debug.c:865 msgid "debug_end_function: no current function" msgstr "" -#: debug.c:873 +#: debug.c:871 msgid "debug_end_function: some blocks were not closed" msgstr "" -#: debug.c:901 +#: debug.c:899 msgid "debug_start_block: no current block" msgstr "" -#: debug.c:937 +#: debug.c:935 msgid "debug_end_block: no current block" msgstr "" -#: debug.c:944 +#: debug.c:942 msgid "debug_end_block: attempt to close top level block" msgstr "" -#: debug.c:967 +#: debug.c:965 msgid "debug_record_line: no current unit" msgstr "" #. FIXME -#: debug.c:1020 +#: debug.c:1018 msgid "debug_start_common_block: not implemented" msgstr "" #. FIXME -#: debug.c:1031 +#: debug.c:1029 msgid "debug_end_common_block: not implemented" msgstr "" #. FIXME. -#: debug.c:1115 +#: debug.c:1113 msgid "debug_record_label: not implemented" msgstr "" -#: debug.c:1137 +#: debug.c:1135 msgid "debug_record_variable: no current file" msgstr "" -#: debug.c:1665 +#: debug.c:1663 msgid "debug_make_undefined_type: unsupported kind" msgstr "" -#: debug.c:1842 +#: debug.c:1840 msgid "debug_name_type: no current file" msgstr "" -#: debug.c:1887 +#: debug.c:1885 msgid "debug_tag_type: no current file" msgstr "" -#: debug.c:1895 +#: debug.c:1893 msgid "debug_tag_type: extra tag attempted" msgstr "" -#: debug.c:1932 +#: debug.c:1930 #, c-format msgid "Warning: changing type size from %d to %d\n" msgstr "" -#: debug.c:1954 +#: debug.c:1952 msgid "debug_find_named_type: no current compilation unit" msgstr "" -#: debug.c:2057 +#: debug.c:2055 #, c-format msgid "debug_get_real_type: circular debug information for %s\n" msgstr "" -#: debug.c:2484 +#: debug.c:2482 msgid "debug_write_type: illegal type encountered" msgstr "" -#: dlltool.c:765 dlltool.c:789 dlltool.c:818 +#: dlltool.c:797 dlltool.c:823 dlltool.c:854 #, c-format msgid "Internal error: Unknown machine type: %d" msgstr "" -#: dlltool.c:854 +#: dlltool.c:890 #, c-format msgid "Can't open def file: %s" msgstr "" -#: dlltool.c:859 +#: dlltool.c:895 #, c-format msgid "Processing def file: %s" msgstr "" -#: dlltool.c:863 +#: dlltool.c:899 msgid "Processed def file" msgstr "" -#: dlltool.c:887 +#: dlltool.c:923 #, c-format msgid "Syntax error in def file %s:%d" msgstr "" -#: dlltool.c:922 +#: dlltool.c:958 #, c-format msgid "%s: Path components stripped from image name, '%s'." msgstr "" -#: dlltool.c:931 +#: dlltool.c:967 #, c-format msgid "NAME: %s base: %x" msgstr "" -#: dlltool.c:934 dlltool.c:950 +#: dlltool.c:970 dlltool.c:986 msgid "Can't have LIBRARY and NAME" msgstr "" -#: dlltool.c:947 +#: dlltool.c:983 #, c-format msgid "LIBRARY: %s base: %x" msgstr "" -#: dlltool.c:1183 resrc.c:269 +#: dlltool.c:1219 resrc.c:293 #, c-format msgid "wait: %s" msgstr "" -#: dlltool.c:1188 dllwrap.c:413 resrc.c:274 +#: dlltool.c:1224 dllwrap.c:410 resrc.c:298 #, c-format msgid "subprocess got fatal signal %d" msgstr "" -#: dlltool.c:1194 dllwrap.c:420 resrc.c:281 +#: dlltool.c:1230 dllwrap.c:417 resrc.c:305 #, c-format msgid "%s exited with status %d" msgstr "" -#: dlltool.c:1225 +#: dlltool.c:1261 #, c-format msgid "Sucking in info from %s section in %s" msgstr "" -#: dlltool.c:1350 +#: dlltool.c:1386 #, c-format msgid "Excluding symbol: %s" msgstr "" -#: dlltool.c:1439 dlltool.c:1450 nm.c:1000 nm.c:1011 +#: dlltool.c:1475 dlltool.c:1486 nm.c:984 nm.c:995 #, c-format msgid "%s: no symbols" msgstr "" #. FIXME: we ought to read in and block out the base relocations. -#: dlltool.c:1476 +#: dlltool.c:1512 #, c-format msgid "Done reading %s" msgstr "" -#: dlltool.c:1486 +#: dlltool.c:1522 #, c-format msgid "Unable to open object file: %s" msgstr "" -#: dlltool.c:1489 +#: dlltool.c:1525 #, c-format msgid "Scanning object file %s" msgstr "" -#: dlltool.c:1504 +#: dlltool.c:1540 #, c-format msgid "Cannot produce mcore-elf dll from archive file: %s" msgstr "" -#: dlltool.c:1590 +#: dlltool.c:1626 msgid "Adding exports to output file" msgstr "" -#: dlltool.c:1638 +#: dlltool.c:1674 msgid "Added exports to output file" msgstr "" -#: dlltool.c:1759 +#: dlltool.c:1813 #, c-format msgid "Generating export file: %s" msgstr "" -#: dlltool.c:1764 +#: dlltool.c:1818 #, c-format msgid "Unable to open temporary assembler file: %s" msgstr "" -#: dlltool.c:1767 +#: dlltool.c:1821 #, c-format msgid "Opened temporary file: %s" msgstr "" -#: dlltool.c:1989 +#: dlltool.c:2043 msgid "Generated exports file" msgstr "" -#: dlltool.c:2195 +#: dlltool.c:2251 #, c-format msgid "bfd_open failed open stub file: %s" msgstr "" -#: dlltool.c:2198 +#: dlltool.c:2254 #, c-format msgid "Creating stub file: %s" msgstr "" -#: dlltool.c:2580 +#: dlltool.c:2672 #, c-format msgid "failed to open temporary head file: %s" msgstr "" -#: dlltool.c:2639 +#: dlltool.c:2734 #, c-format msgid "failed to open temporary tail file: %s" msgstr "" -#: dlltool.c:2706 +#: dlltool.c:2809 #, c-format msgid "Can't open .lib file: %s" msgstr "" -#: dlltool.c:2709 +#: dlltool.c:2812 #, c-format msgid "Creating library file: %s" msgstr "" -#: dlltool.c:2792 dlltool.c:2798 +#: dlltool.c:2895 dlltool.c:2901 #, c-format msgid "cannot delete %s: %s" msgstr "" -#: dlltool.c:2803 +#: dlltool.c:2906 msgid "Created lib file" msgstr "" -#: dlltool.c:2882 +#: dlltool.c:2985 #, c-format msgid "Warning, ignoring duplicate EXPORT %s %d,%d" msgstr "" -#: dlltool.c:2888 +#: dlltool.c:2991 #, c-format msgid "Error, duplicate EXPORT with oridinals: %s" msgstr "" -#: dlltool.c:2993 +#: dlltool.c:3096 msgid "Processing definitions" msgstr "" -#: dlltool.c:3025 +#: dlltool.c:3128 msgid "Processed definitions" msgstr "" #. xgetext:c-format -#: dlltool.c:3032 dllwrap.c:474 +#: dlltool.c:3135 dllwrap.c:471 #, c-format msgid "Usage %s <option(s)> <object-file(s)>\n" msgstr "" #. xgetext:c-format -#: dlltool.c:3034 +#: dlltool.c:3137 #, c-format msgid "" " -m --machine <machine> Create as DLL for <machine>. [default: %s]\n" msgstr "" -#: dlltool.c:3035 +#: dlltool.c:3138 #, c-format msgid "" " possible <machine>: arm[_interwork], i386, mcore[-elf]{-le|-be}, " "ppc, thumb\n" msgstr "" -#: dlltool.c:3036 +#: dlltool.c:3139 #, c-format msgid " -e --output-exp <outname> Generate an export file.\n" msgstr "" -#: dlltool.c:3037 +#: dlltool.c:3140 #, c-format msgid " -l --output-lib <outname> Generate an interface library.\n" msgstr "" -#: dlltool.c:3038 +#: dlltool.c:3141 #, c-format msgid " -a --add-indirect Add dll indirects to export file.\n" msgstr "" -#: dlltool.c:3039 +#: dlltool.c:3142 #, c-format msgid "" " -D --dllname <name> Name of input dll to put into interface lib.\n" msgstr "" -#: dlltool.c:3040 +#: dlltool.c:3143 #, c-format msgid " -d --input-def <deffile> Name of .def file to be read in.\n" msgstr "" -#: dlltool.c:3041 +#: dlltool.c:3144 #, c-format msgid " -z --output-def <deffile> Name of .def file to be created.\n" msgstr "" -#: dlltool.c:3042 +#: dlltool.c:3145 #, c-format msgid " --export-all-symbols Export all symbols to .def\n" msgstr "" -#: dlltool.c:3043 +#: dlltool.c:3146 #, c-format msgid " --no-export-all-symbols Only export listed symbols\n" msgstr "" -#: dlltool.c:3044 +#: dlltool.c:3147 #, c-format msgid " --exclude-symbols <list> Don't export <list>\n" msgstr "" -#: dlltool.c:3045 +#: dlltool.c:3148 #, c-format msgid " --no-default-excludes Clear default exclude symbols\n" msgstr "" -#: dlltool.c:3046 +#: dlltool.c:3149 #, c-format msgid " -b --base-file <basefile> Read linker generated base file.\n" msgstr "" -#: dlltool.c:3047 +#: dlltool.c:3150 #, c-format msgid " -x --no-idata4 Don't generate idata$4 section.\n" msgstr "" -#: dlltool.c:3048 +#: dlltool.c:3151 #, c-format msgid " -c --no-idata5 Don't generate idata$5 section.\n" msgstr "" -#: dlltool.c:3049 +#: dlltool.c:3152 #, c-format msgid "" -" -U --add-underscore Add underscores to symbols in interface " +" -U --add-underscore Add underscores to all symbols in interface " "library.\n" msgstr "" -#: dlltool.c:3050 +#: dlltool.c:3153 +#, c-format +msgid "" +" --add-stdcall-underscore Add underscores to stdcall symbols in " +"interface library.\n" +msgstr "" + +#: dlltool.c:3154 #, c-format msgid " -k --kill-at Kill @<n> from exported names.\n" msgstr "" -#: dlltool.c:3051 +#: dlltool.c:3155 #, c-format msgid " -A --add-stdcall-alias Add aliases without @<n>.\n" msgstr "" -#: dlltool.c:3052 +#: dlltool.c:3156 #, c-format msgid " -p --ext-prefix-alias <prefix> Add aliases with <prefix>.\n" msgstr "" -#: dlltool.c:3053 +#: dlltool.c:3157 #, c-format msgid " -S --as <name> Use <name> for assembler.\n" msgstr "" -#: dlltool.c:3054 +#: dlltool.c:3158 #, c-format msgid " -f --as-flags <flags> Pass <flags> to the assembler.\n" msgstr "" -#: dlltool.c:3055 +#: dlltool.c:3159 #, c-format msgid "" " -C --compat-implib Create backward compatible import library.\n" msgstr "" -#: dlltool.c:3056 +#: dlltool.c:3160 #, c-format msgid "" " -n --no-delete Keep temp files (repeat for extra " "preservation).\n" msgstr "" -#: dlltool.c:3057 +#: dlltool.c:3161 #, c-format msgid "" " -t --temp-prefix <prefix> Use <prefix> to construct temp file names.\n" msgstr "" -#: dlltool.c:3058 +#: dlltool.c:3162 #, c-format msgid " -v --verbose Be verbose.\n" msgstr "" -#: dlltool.c:3059 +#: dlltool.c:3163 #, c-format msgid " -V --version Display the program version.\n" msgstr "" -#: dlltool.c:3060 +#: dlltool.c:3164 #, c-format msgid " -h --help Display this information.\n" msgstr "" -#: dlltool.c:3061 +#: dlltool.c:3165 #, c-format msgid " @<file> Read options from <file>.\n" msgstr "" -#: dlltool.c:3063 +#: dlltool.c:3167 #, c-format msgid "" " -M --mcore-elf <outname> Process mcore-elf object files into <outname>.\n" msgstr "" -#: dlltool.c:3064 +#: dlltool.c:3168 #, c-format msgid " -L --linker <name> Use <name> as the linker.\n" msgstr "" -#: dlltool.c:3065 +#: dlltool.c:3169 #, c-format msgid " -F --linker-flags <flags> Pass <flags> to the linker.\n" msgstr "" -#: dlltool.c:3181 +#: dlltool.c:3292 #, c-format msgid "Path components stripped from dllname, '%s'." msgstr "" -#: dlltool.c:3226 +#: dlltool.c:3337 #, c-format msgid "Unable to open base-file: %s" msgstr "" -#: dlltool.c:3258 +#: dlltool.c:3369 #, c-format msgid "Machine '%s' not supported" msgstr "" -#: dlltool.c:3362 dllwrap.c:204 +#: dlltool.c:3473 dllwrap.c:201 #, c-format msgid "Tried file: %s" msgstr "" -#: dlltool.c:3369 dllwrap.c:211 +#: dlltool.c:3480 dllwrap.c:208 #, c-format msgid "Using file: %s" msgstr "" -#: dllwrap.c:294 +#: dllwrap.c:291 #, c-format msgid "Keeping temporary base file %s" msgstr "" -#: dllwrap.c:296 +#: dllwrap.c:293 #, c-format msgid "Deleting temporary base file %s" msgstr "" -#: dllwrap.c:310 +#: dllwrap.c:307 #, c-format msgid "Keeping temporary exp file %s" msgstr "" -#: dllwrap.c:312 +#: dllwrap.c:309 #, c-format msgid "Deleting temporary exp file %s" msgstr "" -#: dllwrap.c:325 +#: dllwrap.c:322 #, c-format msgid "Keeping temporary def file %s" msgstr "" -#: dllwrap.c:327 +#: dllwrap.c:324 #, c-format msgid "Deleting temporary def file %s" msgstr "" -#: dllwrap.c:475 +#: dllwrap.c:472 #, c-format msgid " Generic options:\n" msgstr "" -#: dllwrap.c:476 +#: dllwrap.c:473 #, c-format msgid " @<file> Read options from <file>\n" msgstr "" -#: dllwrap.c:477 +#: dllwrap.c:474 #, c-format msgid " --quiet, -q Work quietly\n" msgstr "" -#: dllwrap.c:478 +#: dllwrap.c:475 #, c-format msgid " --verbose, -v Verbose\n" msgstr "" -#: dllwrap.c:479 +#: dllwrap.c:476 #, c-format msgid " --version Print dllwrap version\n" msgstr "" -#: dllwrap.c:480 +#: dllwrap.c:477 #, c-format msgid " --implib <outname> Synonym for --output-lib\n" msgstr "" -#: dllwrap.c:481 +#: dllwrap.c:478 #, c-format msgid " Options for %s:\n" msgstr "" -#: dllwrap.c:482 +#: dllwrap.c:479 #, c-format msgid " --driver-name <driver> Defaults to \"gcc\"\n" msgstr "" -#: dllwrap.c:483 +#: dllwrap.c:480 #, c-format msgid " --driver-flags <flags> Override default ld flags\n" msgstr "" -#: dllwrap.c:484 +#: dllwrap.c:481 #, c-format msgid " --dlltool-name <dlltool> Defaults to \"dlltool\"\n" msgstr "" -#: dllwrap.c:485 +#: dllwrap.c:482 #, c-format msgid " --entry <entry> Specify alternate DLL entry point\n" msgstr "" -#: dllwrap.c:486 +#: dllwrap.c:483 #, c-format msgid " --image-base <base> Specify image base address\n" msgstr "" -#: dllwrap.c:487 +#: dllwrap.c:484 #, c-format msgid " --target <machine> i386-cygwin32 or i386-mingw32\n" msgstr "" -#: dllwrap.c:488 +#: dllwrap.c:485 #, c-format msgid " --dry-run Show what needs to be run\n" msgstr "" -#: dllwrap.c:489 +#: dllwrap.c:486 #, c-format msgid " --mno-cygwin Create Mingw DLL\n" msgstr "" -#: dllwrap.c:490 +#: dllwrap.c:487 #, c-format msgid " Options passed to DLLTOOL:\n" msgstr "" -#: dllwrap.c:491 +#: dllwrap.c:488 #, c-format msgid " --machine <machine>\n" msgstr "" -#: dllwrap.c:492 +#: dllwrap.c:489 #, c-format msgid " --output-exp <outname> Generate export file.\n" msgstr "" -#: dllwrap.c:493 +#: dllwrap.c:490 #, c-format msgid " --output-lib <outname> Generate input library.\n" msgstr "" -#: dllwrap.c:494 +#: dllwrap.c:491 #, c-format msgid " --add-indirect Add dll indirects to export file.\n" msgstr "" -#: dllwrap.c:495 +#: dllwrap.c:492 #, c-format msgid " --dllname <name> Name of input dll to put into output lib.\n" msgstr "" -#: dllwrap.c:496 +#: dllwrap.c:493 #, c-format msgid " --def <deffile> Name input .def file\n" msgstr "" -#: dllwrap.c:497 +#: dllwrap.c:494 #, c-format msgid " --output-def <deffile> Name output .def file\n" msgstr "" -#: dllwrap.c:498 +#: dllwrap.c:495 #, c-format msgid " --export-all-symbols Export all symbols to .def\n" msgstr "" -#: dllwrap.c:499 +#: dllwrap.c:496 #, c-format msgid " --no-export-all-symbols Only export .drectve symbols\n" msgstr "" -#: dllwrap.c:500 +#: dllwrap.c:497 #, c-format msgid " --exclude-symbols <list> Exclude <list> from .def\n" msgstr "" -#: dllwrap.c:501 +#: dllwrap.c:498 #, c-format msgid " --no-default-excludes Zap default exclude symbols\n" msgstr "" -#: dllwrap.c:502 +#: dllwrap.c:499 #, c-format msgid " --base-file <basefile> Read linker generated base file\n" msgstr "" -#: dllwrap.c:503 +#: dllwrap.c:500 #, c-format msgid " --no-idata4 Don't generate idata$4 section\n" msgstr "" -#: dllwrap.c:504 +#: dllwrap.c:501 #, c-format msgid " --no-idata5 Don't generate idata$5 section\n" msgstr "" -#: dllwrap.c:505 +#: dllwrap.c:502 #, c-format msgid " -U Add underscores to .lib\n" msgstr "" -#: dllwrap.c:506 +#: dllwrap.c:503 #, c-format msgid " -k Kill @<n> from exported names\n" msgstr "" -#: dllwrap.c:507 +#: dllwrap.c:504 #, c-format msgid " --add-stdcall-alias Add aliases without @<n>\n" msgstr "" -#: dllwrap.c:508 +#: dllwrap.c:505 #, c-format msgid " --as <name> Use <name> for assembler\n" msgstr "" -#: dllwrap.c:509 +#: dllwrap.c:506 #, c-format msgid " --nodelete Keep temp files.\n" msgstr "" -#: dllwrap.c:510 +#: dllwrap.c:507 #, c-format msgid " Rest are passed unmodified to the language driver\n" msgstr "" -#: dllwrap.c:782 +#: dllwrap.c:781 msgid "Must provide at least one of -o or --dllname options" msgstr "" -#: dllwrap.c:811 +#: dllwrap.c:810 msgid "" "no export definition file provided.\n" "Creating one, but that may not be what you want" msgstr "" -#: dllwrap.c:970 +#: dllwrap.c:969 #, c-format msgid "DLLTOOL name : %s\n" msgstr "" -#: dllwrap.c:971 +#: dllwrap.c:970 #, c-format msgid "DLLTOOL options : %s\n" msgstr "" -#: dllwrap.c:972 +#: dllwrap.c:971 #, c-format msgid "DRIVER name : %s\n" msgstr "" -#: dllwrap.c:973 +#: dllwrap.c:972 #, c-format msgid "DRIVER options : %s\n" msgstr "" -#: dwarf.c:93 dwarf.c:137 readelf.c:322 readelf.c:515 +#: dwarf.c:93 dwarf.c:137 readelf.c:377 readelf.c:570 #, c-format msgid "Unhandled data length: %d\n" msgstr "" @@ -1183,7 +1206,7 @@ msgstr "" msgid " define new File Table entry\n" msgstr "" -#: dwarf.c:261 dwarf.c:1944 +#: dwarf.c:261 dwarf.c:1928 #, c-format msgid " Entry\tDir\tTime\tSize\tName\n" msgstr "" @@ -1193,7 +1216,7 @@ msgstr "" msgid " %d\t" msgstr "" -#: dwarf.c:266 dwarf.c:268 dwarf.c:270 dwarf.c:1956 dwarf.c:1958 dwarf.c:1960 +#: dwarf.c:266 dwarf.c:268 dwarf.c:270 dwarf.c:1940 dwarf.c:1942 dwarf.c:1944 #, c-format msgid "%lu\t" msgstr "" @@ -1238,154 +1261,152 @@ msgstr "" msgid " %lu byte block: " msgstr "" -#: dwarf.c:907 +#: dwarf.c:910 #, c-format msgid "(User defined location op)" msgstr "" -#: dwarf.c:909 +#: dwarf.c:912 #, c-format msgid "(Unknown location op)" msgstr "" -#: dwarf.c:955 +#: dwarf.c:958 msgid "Internal error: DWARF version is not 2 or 3.\n" msgstr "" -#: dwarf.c:1053 +#: dwarf.c:1056 msgid "DW_FORM_data8 is unsupported when sizeof (unsigned long) != 8\n" msgstr "" -#: dwarf.c:1102 +#: dwarf.c:1105 #, c-format msgid " (indirect string, offset: 0x%lx): %s" msgstr "" -#: dwarf.c:1111 +#: dwarf.c:1114 #, c-format msgid "Unrecognized form: %lu\n" msgstr "" -#: dwarf.c:1196 +#: dwarf.c:1199 #, c-format msgid "(not inlined)" msgstr "" -#: dwarf.c:1199 +#: dwarf.c:1202 #, c-format msgid "(inlined)" msgstr "" -#: dwarf.c:1202 +#: dwarf.c:1205 #, c-format msgid "(declared as inline but ignored)" msgstr "" -#: dwarf.c:1205 +#: dwarf.c:1208 #, c-format msgid "(declared as inline and inlined)" msgstr "" -#: dwarf.c:1208 +#: dwarf.c:1211 #, c-format msgid " (Unknown inline attribute value: %lx)" msgstr "" -#: dwarf.c:1354 dwarf.c:2484 +#: dwarf.c:1368 dwarf.c:2462 #, c-format msgid " [without DW_AT_frame_base]" msgstr "" -#: dwarf.c:1357 +#: dwarf.c:1371 #, c-format msgid "(location list)" msgstr "" -#: dwarf.c:1475 +#: dwarf.c:1489 #, c-format msgid "Unknown AT value: %lx" msgstr "" -#: dwarf.c:1544 +#: dwarf.c:1558 #, c-format msgid "No comp units in %s section ?" msgstr "" -#: dwarf.c:1553 +#: dwarf.c:1567 #, c-format msgid "Not enough memory for a debug info array of %u entries" msgstr "" -#: dwarf.c:1561 dwarf.c:2573 +#: dwarf.c:1575 dwarf.c:2550 #, c-format msgid "" "The section %s contains:\n" "\n" msgstr "" -#: dwarf.c:1569 +#: dwarf.c:1583 #, c-format msgid "Unable to locate %s section!\n" msgstr "" -#: dwarf.c:1635 +#: dwarf.c:1646 #, c-format msgid " Compilation Unit @ offset 0x%lx:\n" msgstr "" -#: dwarf.c:1636 +#: dwarf.c:1647 #, c-format msgid " Length: %ld\n" msgstr "" -#: dwarf.c:1637 +#: dwarf.c:1648 #, c-format msgid " Version: %d\n" msgstr "" -#: dwarf.c:1638 +#: dwarf.c:1649 #, c-format msgid " Abbrev Offset: %ld\n" msgstr "" -#: dwarf.c:1639 +#: dwarf.c:1650 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: dwarf.c:1644 -msgid "Only version 2 and 3 DWARF debug information is currently supported.\n" +#: dwarf.c:1656 +#, c-format +msgid "Debug info is corrupted, length is invalid (section is %lu bytes)\n" msgstr "" -#: dwarf.c:1685 -#, c-format -msgid "Unable to locate entry %lu in the abbreviation table\n" +#: dwarf.c:1665 +msgid "Only version 2 and 3 DWARF debug information is currently supported.\n" msgstr "" -#: dwarf.c:1691 +#: dwarf.c:1674 #, c-format -msgid " <%d><%lx>: Abbrev Number: %lu (%s)\n" +msgid "" +"Debug info is corrupted, abbrev offset is invalid (section is %lu bytes)\n" msgstr "" -#: dwarf.c:1785 +#: dwarf.c:1702 #, c-format -msgid "%s section needs a populated .debug_info section\n" +msgid " <%d><%lx>: Abbrev Number: %lu" msgstr "" -#: dwarf.c:1792 +#: dwarf.c:1722 #, c-format -msgid "%s section has more comp units than .debug_info section\n" +msgid "Unable to locate entry %lu in the abbreviation table\n" msgstr "" -#: dwarf.c:1794 +#: dwarf.c:1728 #, c-format -msgid "" -"assuming that the pointer size is %d, from the last comp unit in ." -"debug_info\n" -"\n" +msgid " (%s)\n" msgstr "" -#: dwarf.c:1819 +#: dwarf.c:1813 #, c-format msgid "" "\n" @@ -1393,289 +1414,280 @@ msgid "" "\n" msgstr "" -#: dwarf.c:1858 +#: dwarf.c:1851 msgid "The line info appears to be corrupt - the section is too small\n" msgstr "" -#: dwarf.c:1867 +#: dwarf.c:1860 msgid "Only DWARF version 2 and 3 line info is currently supported.\n" msgstr "" -#: dwarf.c:1894 +#: dwarf.c:1881 #, c-format msgid " Length: %ld\n" msgstr "" -#: dwarf.c:1895 +#: dwarf.c:1882 #, c-format msgid " DWARF Version: %d\n" msgstr "" -#: dwarf.c:1896 +#: dwarf.c:1883 #, c-format msgid " Prologue Length: %d\n" msgstr "" -#: dwarf.c:1897 +#: dwarf.c:1884 #, c-format msgid " Minimum Instruction Length: %d\n" msgstr "" -#: dwarf.c:1898 +#: dwarf.c:1885 #, c-format msgid " Initial value of 'is_stmt': %d\n" msgstr "" -#: dwarf.c:1899 +#: dwarf.c:1886 #, c-format msgid " Line Base: %d\n" msgstr "" -#: dwarf.c:1900 +#: dwarf.c:1887 #, c-format msgid " Line Range: %d\n" msgstr "" -#: dwarf.c:1901 +#: dwarf.c:1888 #, c-format msgid " Opcode Base: %d\n" msgstr "" -#: dwarf.c:1902 -#, c-format -msgid " (Pointer size: %u)%s\n" -msgstr "" - -#: dwarf.c:1913 +#: dwarf.c:1897 #, c-format msgid "" "\n" " Opcodes:\n" msgstr "" -#: dwarf.c:1916 +#: dwarf.c:1900 #, c-format msgid " Opcode %d has %d args\n" msgstr "" -#: dwarf.c:1922 +#: dwarf.c:1906 #, c-format msgid "" "\n" " The Directory Table is empty.\n" msgstr "" -#: dwarf.c:1925 +#: dwarf.c:1909 #, c-format msgid "" "\n" " The Directory Table:\n" msgstr "" -#: dwarf.c:1929 +#: dwarf.c:1913 #, c-format msgid " %s\n" msgstr "" -#: dwarf.c:1940 +#: dwarf.c:1924 #, c-format msgid "" "\n" " The File Name Table is empty.\n" msgstr "" -#: dwarf.c:1943 +#: dwarf.c:1927 #, c-format msgid "" "\n" " The File Name Table:\n" msgstr "" -#: dwarf.c:1951 +#: dwarf.c:1935 #, c-format msgid " %d\t" msgstr "" -#: dwarf.c:1962 +#: dwarf.c:1946 #, c-format msgid "%s\n" msgstr "" #. Now display the statements. -#: dwarf.c:1970 +#: dwarf.c:1954 #, c-format msgid "" "\n" " Line Number Statements:\n" msgstr "" -#: dwarf.c:1986 +#: dwarf.c:1970 #, c-format msgid " Special opcode %d: advance Address by %lu to 0x%lx" msgstr "" -#: dwarf.c:1990 +#: dwarf.c:1974 #, c-format msgid " and Line by %d to %d\n" msgstr "" -#: dwarf.c:1998 -msgid "Extend line ops need a valid pointer size, guessing at 4\n" -msgstr "" - -#: dwarf.c:2007 +#: dwarf.c:1984 #, c-format msgid " Copy\n" msgstr "" -#: dwarf.c:2015 +#: dwarf.c:1992 #, c-format msgid " Advance PC by %lu to 0x%lx\n" msgstr "" -#: dwarf.c:2023 +#: dwarf.c:2000 #, c-format msgid " Advance Line by %d to %d\n" msgstr "" -#: dwarf.c:2030 +#: dwarf.c:2007 #, c-format msgid " Set File Name to entry %d in the File Name Table\n" msgstr "" -#: dwarf.c:2038 +#: dwarf.c:2015 #, c-format msgid " Set column to %lu\n" msgstr "" -#: dwarf.c:2045 +#: dwarf.c:2022 #, c-format msgid " Set is_stmt to %d\n" msgstr "" -#: dwarf.c:2050 +#: dwarf.c:2027 #, c-format msgid " Set basic block\n" msgstr "" -#: dwarf.c:2058 +#: dwarf.c:2035 #, c-format msgid " Advance PC by constant %lu to 0x%lx\n" msgstr "" -#: dwarf.c:2066 +#: dwarf.c:2043 #, c-format msgid " Advance PC by fixed size amount %lu to 0x%lx\n" msgstr "" -#: dwarf.c:2071 +#: dwarf.c:2048 #, c-format msgid " Set prologue_end to true\n" msgstr "" -#: dwarf.c:2075 +#: dwarf.c:2052 #, c-format msgid " Set epilogue_begin to true\n" msgstr "" -#: dwarf.c:2081 +#: dwarf.c:2058 #, c-format msgid " Set ISA to %lu\n" msgstr "" -#: dwarf.c:2085 +#: dwarf.c:2062 #, c-format msgid " Unknown opcode %d with operands: " msgstr "" -#: dwarf.c:2111 dwarf.c:2197 dwarf.c:2271 dwarf.c:2382 dwarf.c:2514 -#: dwarf.c:2739 +#: dwarf.c:2088 dwarf.c:2174 dwarf.c:2248 dwarf.c:2360 dwarf.c:2492 +#: dwarf.c:2731 #, c-format msgid "" "Contents of the %s section:\n" "\n" msgstr "" -#: dwarf.c:2151 +#: dwarf.c:2128 msgid "Only DWARF 2 and 3 pubnames are currently supported\n" msgstr "" -#: dwarf.c:2158 +#: dwarf.c:2135 #, c-format msgid " Length: %ld\n" msgstr "" -#: dwarf.c:2160 +#: dwarf.c:2137 #, c-format msgid " Version: %d\n" msgstr "" -#: dwarf.c:2162 +#: dwarf.c:2139 #, c-format msgid " Offset into .debug_info section: %ld\n" msgstr "" -#: dwarf.c:2164 +#: dwarf.c:2141 #, c-format msgid " Size of area in .debug_info section: %ld\n" msgstr "" -#: dwarf.c:2167 +#: dwarf.c:2144 #, c-format msgid "" "\n" " Offset\tName\n" msgstr "" -#: dwarf.c:2218 +#: dwarf.c:2195 #, c-format msgid " DW_MACINFO_start_file - lineno: %d filenum: %d\n" msgstr "" -#: dwarf.c:2224 +#: dwarf.c:2201 #, c-format msgid " DW_MACINFO_end_file\n" msgstr "" -#: dwarf.c:2232 +#: dwarf.c:2209 #, c-format msgid " DW_MACINFO_define - lineno : %d macro : %s\n" msgstr "" -#: dwarf.c:2241 +#: dwarf.c:2218 #, c-format msgid " DW_MACINFO_undef - lineno : %d macro : %s\n" msgstr "" -#: dwarf.c:2253 +#: dwarf.c:2230 #, c-format msgid " DW_MACINFO_vendor_ext - constant : %d string : %s\n" msgstr "" -#: dwarf.c:2282 +#: dwarf.c:2259 #, c-format msgid " Number TAG\n" msgstr "" -#: dwarf.c:2288 +#: dwarf.c:2265 #, c-format msgid " %ld %s [%s]\n" msgstr "" -#: dwarf.c:2291 +#: dwarf.c:2268 msgid "has children" msgstr "" -#: dwarf.c:2291 +#: dwarf.c:2268 msgid "no children" msgstr "" -#: dwarf.c:2294 +#: dwarf.c:2271 #, c-format msgid " %-18s %s\n" msgstr "" -#: dwarf.c:2327 dwarf.c:2510 dwarf.c:2684 +#: dwarf.c:2304 dwarf.c:2488 dwarf.c:2675 #, c-format msgid "" "\n" @@ -1683,148 +1695,164 @@ msgid "" msgstr "" #. FIXME: Should we handle this case? -#: dwarf.c:2372 +#: dwarf.c:2349 msgid "Location lists in .debug_info section aren't in ascending order!\n" msgstr "" -#: dwarf.c:2375 +#: dwarf.c:2352 msgid "No location lists in .debug_info section!\n" msgstr "" -#: dwarf.c:2379 +#: dwarf.c:2357 #, c-format msgid "Location lists in %s section start at 0x%lx\n" msgstr "" -#: dwarf.c:2383 +#: dwarf.c:2361 #, c-format msgid " Offset Begin End Expression\n" msgstr "" -#: dwarf.c:2414 +#: dwarf.c:2392 #, c-format msgid "There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n" msgstr "" -#: dwarf.c:2417 +#: dwarf.c:2395 #, c-format msgid "There is an overlap [0x%lx - 0x%lx] in .debug_loc section.\n" msgstr "" -#: dwarf.c:2424 +#: dwarf.c:2402 #, c-format msgid "Offset 0x%lx is bigger than .debug_loc section size.\n" msgstr "" -#: dwarf.c:2433 dwarf.c:2460 dwarf.c:2470 +#: dwarf.c:2411 dwarf.c:2438 dwarf.c:2448 #, c-format msgid "Location list starting at offset 0x%lx is not terminated.\n" msgstr "" -#: dwarf.c:2445 dwarf.c:2784 +#: dwarf.c:2423 dwarf.c:2776 #, c-format msgid " %8.8lx <End of list>\n" msgstr "" -#: dwarf.c:2453 +#: dwarf.c:2431 #, c-format msgid " %8.8lx %8.8lx %8.8lx (base address)\n" msgstr "" -#: dwarf.c:2487 dwarf.c:2801 +#: dwarf.c:2465 dwarf.c:2793 msgid " (start == end)" msgstr "" -#: dwarf.c:2489 dwarf.c:2803 +#: dwarf.c:2467 dwarf.c:2795 msgid " (start > end)" msgstr "" -#: dwarf.c:2618 +#: dwarf.c:2596 msgid "Only DWARF 2 and 3 aranges are currently supported.\n" msgstr "" -#: dwarf.c:2622 +#: dwarf.c:2600 #, c-format msgid " Length: %ld\n" msgstr "" -#: dwarf.c:2623 +#: dwarf.c:2601 #, c-format msgid " Version: %d\n" msgstr "" -#: dwarf.c:2624 +#: dwarf.c:2602 #, c-format msgid " Offset into .debug_info: %lx\n" msgstr "" -#: dwarf.c:2625 +#: dwarf.c:2603 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: dwarf.c:2626 +#: dwarf.c:2604 #, c-format msgid " Segment Size: %d\n" msgstr "" -#: dwarf.c:2628 +#: dwarf.c:2613 +msgid "Pointer size + Segment size is not a power of two.\n" +msgstr "" + +#: dwarf.c:2618 #, c-format msgid "" "\n" -" Address Length\n" +" Address Length\n" +msgstr "" + +#: dwarf.c:2620 +#, c-format +msgid "" +"\n" +" Address Length\n" msgstr "" #. FIXME: Should we handle this case? -#: dwarf.c:2729 +#: dwarf.c:2720 msgid "Range lists in .debug_info section aren't in ascending order!\n" msgstr "" -#: dwarf.c:2732 +#: dwarf.c:2723 msgid "No range lists in .debug_info section!\n" msgstr "" -#: dwarf.c:2736 +#: dwarf.c:2728 #, c-format msgid "Range lists in %s section start at 0x%lx\n" msgstr "" -#: dwarf.c:2740 +#: dwarf.c:2732 #, c-format msgid " Offset Begin End\n" msgstr "" -#: dwarf.c:2765 +#: dwarf.c:2757 #, c-format msgid "There is a hole [0x%lx - 0x%lx] in %s section.\n" msgstr "" -#: dwarf.c:2769 +#: dwarf.c:2761 #, c-format msgid "There is an overlap [0x%lx - 0x%lx] in %s section.\n" msgstr "" -#: dwarf.c:2964 +#: dwarf.c:2963 #, c-format msgid "The section %s contains:\n" msgstr "" -#: dwarf.c:3608 +#: dwarf.c:3650 +#, c-format +msgid " DW_CFA_??? (User defined call frame op: %#x)\n" +msgstr "" + +#: dwarf.c:3652 #, c-format -msgid "unsupported or unknown DW_CFA_%d\n" +msgid "unsupported or unknown Dwarf Call Frame Instruction number: %#x\n" msgstr "" -#: dwarf.c:3632 +#: dwarf.c:3676 #, c-format msgid "Displaying the debug contents of section %s is not yet supported.\n" msgstr "" -#: dwarf.c:3674 +#: dwarf.c:3718 #, c-format msgid "%s: Error: " msgstr "" -#: dwarf.c:3685 +#: dwarf.c:3729 #, c-format msgid "%s: Warning: " msgstr "" @@ -1849,223 +1877,223 @@ msgstr "" msgid " [-X32_64] - accepts 32 and 64 bit objects\n" msgstr "" -#: ieee.c:311 +#: ieee.c:309 msgid "unexpected end of debugging information" msgstr "" -#: ieee.c:398 +#: ieee.c:396 msgid "invalid number" msgstr "" -#: ieee.c:451 +#: ieee.c:449 msgid "invalid string length" msgstr "" -#: ieee.c:506 ieee.c:547 +#: ieee.c:504 ieee.c:545 msgid "expression stack overflow" msgstr "" -#: ieee.c:526 +#: ieee.c:524 msgid "unsupported IEEE expression operator" msgstr "" -#: ieee.c:541 +#: ieee.c:539 msgid "unknown section" msgstr "" -#: ieee.c:562 +#: ieee.c:560 msgid "expression stack underflow" msgstr "" -#: ieee.c:576 +#: ieee.c:574 msgid "expression stack mismatch" msgstr "" -#: ieee.c:613 +#: ieee.c:611 msgid "unknown builtin type" msgstr "" -#: ieee.c:758 +#: ieee.c:756 msgid "BCD float type not supported" msgstr "" -#: ieee.c:895 +#: ieee.c:893 msgid "unexpected number" msgstr "" -#: ieee.c:902 +#: ieee.c:900 msgid "unexpected record type" msgstr "" -#: ieee.c:935 +#: ieee.c:933 msgid "blocks left on stack at end" msgstr "" -#: ieee.c:1198 +#: ieee.c:1196 msgid "unknown BB type" msgstr "" -#: ieee.c:1207 +#: ieee.c:1205 msgid "stack overflow" msgstr "" -#: ieee.c:1230 +#: ieee.c:1228 msgid "stack underflow" msgstr "" -#: ieee.c:1342 ieee.c:1412 ieee.c:2109 +#: ieee.c:1340 ieee.c:1410 ieee.c:2107 msgid "illegal variable index" msgstr "" -#: ieee.c:1390 +#: ieee.c:1388 msgid "illegal type index" msgstr "" -#: ieee.c:1400 ieee.c:1437 +#: ieee.c:1398 ieee.c:1435 msgid "unknown TY code" msgstr "" -#: ieee.c:1419 +#: ieee.c:1417 msgid "undefined variable in TY" msgstr "" #. Pascal file name. FIXME. -#: ieee.c:1830 +#: ieee.c:1828 msgid "Pascal file name not supported" msgstr "" -#: ieee.c:1878 +#: ieee.c:1876 msgid "unsupported qualifier" msgstr "" -#: ieee.c:2147 +#: ieee.c:2145 msgid "undefined variable in ATN" msgstr "" -#: ieee.c:2190 +#: ieee.c:2188 msgid "unknown ATN type" msgstr "" #. Reserved for FORTRAN common. -#: ieee.c:2312 +#: ieee.c:2310 msgid "unsupported ATN11" msgstr "" #. We have no way to record this information. FIXME. -#: ieee.c:2339 +#: ieee.c:2337 msgid "unsupported ATN12" msgstr "" -#: ieee.c:2399 +#: ieee.c:2397 msgid "unexpected string in C++ misc" msgstr "" -#: ieee.c:2412 +#: ieee.c:2410 msgid "bad misc record" msgstr "" -#: ieee.c:2453 +#: ieee.c:2451 msgid "unrecognized C++ misc record" msgstr "" -#: ieee.c:2568 +#: ieee.c:2566 msgid "undefined C++ object" msgstr "" -#: ieee.c:2602 +#: ieee.c:2600 msgid "unrecognized C++ object spec" msgstr "" -#: ieee.c:2638 +#: ieee.c:2636 msgid "unsupported C++ object type" msgstr "" -#: ieee.c:2648 +#: ieee.c:2646 msgid "C++ base class not defined" msgstr "" -#: ieee.c:2660 ieee.c:2765 +#: ieee.c:2658 ieee.c:2763 msgid "C++ object has no fields" msgstr "" -#: ieee.c:2679 +#: ieee.c:2677 msgid "C++ base class not found in container" msgstr "" -#: ieee.c:2786 +#: ieee.c:2784 msgid "C++ data member not found in container" msgstr "" -#: ieee.c:2827 ieee.c:2977 +#: ieee.c:2825 ieee.c:2975 msgid "unknown C++ visibility" msgstr "" -#: ieee.c:2861 +#: ieee.c:2859 msgid "bad C++ field bit pos or size" msgstr "" -#: ieee.c:2953 +#: ieee.c:2951 msgid "bad type for C++ method function" msgstr "" -#: ieee.c:2963 +#: ieee.c:2961 msgid "no type information for C++ method function" msgstr "" -#: ieee.c:3002 +#: ieee.c:3000 msgid "C++ static virtual method" msgstr "" -#: ieee.c:3097 +#: ieee.c:3095 msgid "unrecognized C++ object overhead spec" msgstr "" -#: ieee.c:3136 +#: ieee.c:3134 msgid "undefined C++ vtable" msgstr "" -#: ieee.c:3205 +#: ieee.c:3203 msgid "C++ default values not in a function" msgstr "" -#: ieee.c:3245 +#: ieee.c:3243 msgid "unrecognized C++ default type" msgstr "" -#: ieee.c:3276 +#: ieee.c:3274 msgid "reference parameter is not a pointer" msgstr "" -#: ieee.c:3359 +#: ieee.c:3357 msgid "unrecognized C++ reference type" msgstr "" -#: ieee.c:3441 +#: ieee.c:3439 msgid "C++ reference not found" msgstr "" -#: ieee.c:3449 +#: ieee.c:3447 msgid "C++ reference is not pointer" msgstr "" -#: ieee.c:3475 ieee.c:3483 +#: ieee.c:3473 ieee.c:3481 msgid "missing required ASN" msgstr "" -#: ieee.c:3510 ieee.c:3518 +#: ieee.c:3508 ieee.c:3516 msgid "missing required ATN65" msgstr "" -#: ieee.c:3532 +#: ieee.c:3530 msgid "bad ATN65 record" msgstr "" -#: ieee.c:4160 +#: ieee.c:4158 #, c-format msgid "IEEE numeric overflow: 0x" msgstr "" -#: ieee.c:4204 +#: ieee.c:4202 #, c-format msgid "IEEE string length overflow: %u\n" msgstr "" @@ -2085,124 +2113,128 @@ msgstr "" msgid "IEEE unsupported complex type size %u\n" msgstr "" -#: nlmconv.c:269 srconv.c:1813 +#: mclex.c:241 +msgid "Duplicate symbol entered into keyword list." +msgstr "" + +#: nlmconv.c:271 srconv.c:1815 msgid "input and output files must be different" msgstr "" -#: nlmconv.c:316 +#: nlmconv.c:318 msgid "input file named both on command line and with INPUT" msgstr "" -#: nlmconv.c:325 +#: nlmconv.c:327 msgid "no input file" msgstr "" -#: nlmconv.c:355 +#: nlmconv.c:357 msgid "no name for output file" msgstr "" -#: nlmconv.c:369 +#: nlmconv.c:371 msgid "warning: input and output formats are not compatible" msgstr "" -#: nlmconv.c:398 +#: nlmconv.c:400 msgid "make .bss section" msgstr "" -#: nlmconv.c:407 +#: nlmconv.c:409 msgid "make .nlmsections section" msgstr "" -#: nlmconv.c:409 +#: nlmconv.c:411 msgid "set .nlmsections flags" msgstr "" -#: nlmconv.c:437 +#: nlmconv.c:439 msgid "set .bss vma" msgstr "" -#: nlmconv.c:444 +#: nlmconv.c:446 msgid "set .data size" msgstr "" -#: nlmconv.c:624 +#: nlmconv.c:626 #, c-format msgid "warning: symbol %s imported but not in import list" msgstr "" -#: nlmconv.c:644 +#: nlmconv.c:646 msgid "set start address" msgstr "" -#: nlmconv.c:693 +#: nlmconv.c:695 #, c-format msgid "warning: START procedure %s not defined" msgstr "" -#: nlmconv.c:695 +#: nlmconv.c:697 #, c-format msgid "warning: EXIT procedure %s not defined" msgstr "" -#: nlmconv.c:697 +#: nlmconv.c:699 #, c-format msgid "warning: CHECK procedure %s not defined" msgstr "" -#: nlmconv.c:718 nlmconv.c:907 +#: nlmconv.c:720 nlmconv.c:909 msgid "custom section" msgstr "" -#: nlmconv.c:739 nlmconv.c:936 +#: nlmconv.c:741 nlmconv.c:938 msgid "help section" msgstr "" -#: nlmconv.c:761 nlmconv.c:954 +#: nlmconv.c:763 nlmconv.c:956 msgid "message section" msgstr "" -#: nlmconv.c:777 nlmconv.c:987 +#: nlmconv.c:779 nlmconv.c:989 msgid "module section" msgstr "" -#: nlmconv.c:797 nlmconv.c:1003 +#: nlmconv.c:799 nlmconv.c:1005 msgid "rpc section" msgstr "" #. There is no place to record this information. -#: nlmconv.c:833 +#: nlmconv.c:835 #, c-format msgid "%s: warning: shared libraries can not have uninitialized data" msgstr "" -#: nlmconv.c:854 nlmconv.c:1022 +#: nlmconv.c:856 nlmconv.c:1024 msgid "shared section" msgstr "" -#: nlmconv.c:862 +#: nlmconv.c:864 msgid "warning: No version number given" msgstr "" -#: nlmconv.c:902 nlmconv.c:931 nlmconv.c:949 nlmconv.c:998 nlmconv.c:1017 +#: nlmconv.c:904 nlmconv.c:933 nlmconv.c:951 nlmconv.c:1000 nlmconv.c:1019 #, c-format msgid "%s: read: %s" msgstr "" -#: nlmconv.c:924 +#: nlmconv.c:926 msgid "warning: FULLMAP is not supported; try ld -M" msgstr "" -#: nlmconv.c:1100 +#: nlmconv.c:1102 #, c-format msgid "Usage: %s [option(s)] [in-file [out-file]]\n" msgstr "" -#: nlmconv.c:1101 +#: nlmconv.c:1103 #, c-format msgid " Convert an object file into a NetWare Loadable Module\n" msgstr "" -#: nlmconv.c:1102 +#: nlmconv.c:1104 #, c-format msgid "" " The options are:\n" @@ -2216,74 +2248,74 @@ msgid "" " -v --version Display the program's version\n" msgstr "" -#: nlmconv.c:1143 +#: nlmconv.c:1145 #, c-format msgid "support not compiled in for %s" msgstr "" -#: nlmconv.c:1180 +#: nlmconv.c:1182 msgid "make section" msgstr "" -#: nlmconv.c:1194 +#: nlmconv.c:1196 msgid "set section size" msgstr "" -#: nlmconv.c:1200 +#: nlmconv.c:1202 msgid "set section alignment" msgstr "" -#: nlmconv.c:1204 +#: nlmconv.c:1206 msgid "set section flags" msgstr "" -#: nlmconv.c:1215 +#: nlmconv.c:1217 msgid "set .nlmsections size" msgstr "" -#: nlmconv.c:1296 nlmconv.c:1304 nlmconv.c:1313 nlmconv.c:1318 +#: nlmconv.c:1298 nlmconv.c:1306 nlmconv.c:1315 nlmconv.c:1320 msgid "set .nlmsection contents" msgstr "" -#: nlmconv.c:1797 +#: nlmconv.c:1799 msgid "stub section sizes" msgstr "" -#: nlmconv.c:1844 +#: nlmconv.c:1846 msgid "writing stub" msgstr "" -#: nlmconv.c:1928 +#: nlmconv.c:1930 #, c-format msgid "unresolved PC relative reloc against %s" msgstr "" -#: nlmconv.c:1992 +#: nlmconv.c:1994 #, c-format msgid "overflow when adjusting relocation against %s" msgstr "" -#: nlmconv.c:2119 +#: nlmconv.c:2121 #, c-format msgid "%s: execution of %s failed: " msgstr "" -#: nlmconv.c:2134 +#: nlmconv.c:2136 #, c-format msgid "Execution of %s failed" msgstr "" -#: nm.c:224 size.c:82 strings.c:708 +#: nm.c:213 size.c:83 strings.c:705 #, c-format msgid "Usage: %s [option(s)] [file(s)]\n" msgstr "" -#: nm.c:225 +#: nm.c:214 #, c-format msgid " List symbols in [file(s)] (a.out by default).\n" msgstr "" -#: nm.c:226 +#: nm.c:215 #, c-format msgid "" " The options are:\n" @@ -2327,44 +2359,39 @@ msgid "" "\n" msgstr "" -#: nm.c:263 objdump.c:236 -#, c-format -msgid "Report bugs to %s.\n" -msgstr "" - -#: nm.c:295 +#: nm.c:276 #, c-format msgid "%s: invalid radix" msgstr "" -#: nm.c:319 +#: nm.c:300 #, c-format msgid "%s: invalid output format" msgstr "" -#: nm.c:340 readelf.c:6623 readelf.c:6659 +#: nm.c:321 readelf.c:6853 readelf.c:6891 #, c-format msgid "<processor specific>: %d" msgstr "" -#: nm.c:342 readelf.c:6626 readelf.c:6671 +#: nm.c:323 readelf.c:6856 readelf.c:6903 #, c-format msgid "<OS specific>: %d" msgstr "" -#: nm.c:344 readelf.c:6628 readelf.c:6674 +#: nm.c:325 readelf.c:6858 readelf.c:6906 #, c-format msgid "<unknown>: %d" msgstr "" -#: nm.c:381 +#: nm.c:365 #, c-format msgid "" "\n" "Archive index:\n" msgstr "" -#: nm.c:1227 +#: nm.c:1225 #, c-format msgid "" "\n" @@ -2373,7 +2400,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1229 +#: nm.c:1227 #, c-format msgid "" "\n" @@ -2382,7 +2409,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1231 nm.c:1282 +#: nm.c:1229 nm.c:1280 #, c-format msgid "" "Name Value Class Type Size Line " @@ -2390,7 +2417,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1234 nm.c:1285 +#: nm.c:1232 nm.c:1283 #, c-format msgid "" "Name Value Class Type " @@ -2398,7 +2425,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1278 +#: nm.c:1276 #, c-format msgid "" "\n" @@ -2407,7 +2434,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1280 +#: nm.c:1278 #, c-format msgid "" "\n" @@ -2416,39 +2443,44 @@ msgid "" "\n" msgstr "" -#: nm.c:1584 +#: nm.c:1370 +#, c-format +msgid "Print width has not been initialized (%d)" +msgstr "" + +#: nm.c:1595 msgid "Only -X 32_64 is supported" msgstr "" -#: nm.c:1604 +#: nm.c:1615 msgid "Using the --size-sort and --undefined-only options together" msgstr "" -#: nm.c:1605 +#: nm.c:1616 msgid "will produce no output, since undefined symbols have no size." msgstr "" -#: nm.c:1633 +#: nm.c:1644 #, c-format msgid "data size %ld" msgstr "" -#: objcopy.c:401 srconv.c:1721 +#: objcopy.c:426 srconv.c:1723 #, c-format msgid "Usage: %s [option(s)] in-file [out-file]\n" msgstr "" -#: objcopy.c:402 +#: objcopy.c:427 #, c-format msgid " Copies a binary file, possibly transforming it in the process\n" msgstr "" -#: objcopy.c:403 objcopy.c:495 +#: objcopy.c:428 objcopy.c:524 #, c-format msgid " The options are:\n" msgstr "" -#: objcopy.c:404 +#: objcopy.c:429 #, c-format msgid "" " -I --input-target <bfdname> Assume input file is in format <bfdname>\n" @@ -2478,7 +2510,10 @@ msgid "" " relocations\n" " --only-keep-debug Strip everything but the debug " "information\n" +" --extract-symbol Remove section contents but keep symbols\n" " -K --keep-symbol <name> Do not strip symbol <name>\n" +" --keep-file-symbols Do not strip file symbol(s)\n" +" --localize-hidden Turn all ELF hidden symbols into locals\n" " -L --localize-symbol <name> Force symbol <name> to be marked as a " "local\n" " --globalize-symbol <name> Force symbol <name> to be marked as a " @@ -2525,6 +2560,8 @@ msgid "" "style\n" " --remove-leading-char Remove leading character from global " "symbols\n" +" --reverse-bytes=<num> Reverse <num> bytes at a time, in output " +"sections with content\n" " --redefine-sym <old>=<new> Redefine symbol name <old> to <new>\n" " --redefine-syms <file> --redefine-sym for all symbol pairs \n" " listed in <file>\n" @@ -2542,7 +2579,8 @@ msgid "" " --globalize-symbols <file> --globalize-symbol for all in <file>\n" " --keep-global-symbols <file> -G for all symbols listed in <file>\n" " --weaken-symbols <file> -W for all symbols listed in <file>\n" -" --alt-machine-code <index> Use alternate machine code for output\n" +" --alt-machine-code <index> Use the target's <index>'th alternative " +"machine\n" " --writable-text Mark the output text as writable\n" " --readonly-text Make the output text write protected\n" " --pure Mark the output file as demand paged\n" @@ -2563,17 +2601,17 @@ msgid "" "supported\n" msgstr "" -#: objcopy.c:493 +#: objcopy.c:522 #, c-format msgid "Usage: %s <option(s)> in-file(s)\n" msgstr "" -#: objcopy.c:494 +#: objcopy.c:523 #, c-format msgid " Removes symbols and sections from files\n" msgstr "" -#: objcopy.c:496 +#: objcopy.c:525 #, c-format msgid "" " -I --input-target=<bfdname> Assume input file is in format <bfdname>\n" @@ -2593,6 +2631,7 @@ msgid "" "information\n" " -N --strip-symbol=<name> Do not copy symbol <name>\n" " -K --keep-symbol=<name> Do not strip symbol <name>\n" +" --keep-file-symbols Do not strip file symbol(s)\n" " -w --wildcard Permit wildcard in symbol comparison\n" " -x --discard-all Remove all non-global symbols\n" " -X --discard-locals Remove any compiler-generated symbols\n" @@ -2604,260 +2643,297 @@ msgid "" " -o <file> Place stripped output into <file>\n" msgstr "" -#: objcopy.c:568 +#: objcopy.c:598 #, c-format msgid "unrecognized section flag `%s'" msgstr "" -#: objcopy.c:569 +#: objcopy.c:599 #, c-format msgid "supported flags: %s" msgstr "" -#: objcopy.c:646 +#: objcopy.c:679 #, c-format msgid "cannot open '%s': %s" msgstr "" -#: objcopy.c:649 objcopy.c:2722 +#: objcopy.c:682 objcopy.c:2987 #, c-format msgid "%s: fread failed" msgstr "" -#: objcopy.c:722 +#: objcopy.c:755 #, c-format msgid "%s:%d: Ignoring rubbish found on this line" msgstr "" -#: objcopy.c:996 +#: objcopy.c:1033 +#, c-format +msgid "not stripping symbol `%s' because it is named in a relocation" +msgstr "" + +#: objcopy.c:1116 #, c-format msgid "%s: Multiple redefinition of symbol \"%s\"" msgstr "" -#: objcopy.c:1000 +#: objcopy.c:1120 #, c-format msgid "%s: Symbol \"%s\" is target of more than one redefinition" msgstr "" -#: objcopy.c:1028 +#: objcopy.c:1148 #, c-format msgid "couldn't open symbol redefinition file %s (error: %s)" msgstr "" -#: objcopy.c:1106 +#: objcopy.c:1226 #, c-format msgid "%s:%d: garbage found at end of line" msgstr "" -#: objcopy.c:1109 +#: objcopy.c:1229 #, c-format msgid "%s:%d: missing new symbol name" msgstr "" -#: objcopy.c:1119 +#: objcopy.c:1239 #, c-format msgid "%s:%d: premature end of file" msgstr "" -#: objcopy.c:1145 +#: objcopy.c:1265 #, c-format msgid "stat returns negative size for `%s'" msgstr "" -#: objcopy.c:1157 +#: objcopy.c:1277 #, c-format msgid "copy from `%s' [unknown] to `%s' [unknown]\n" msgstr "" -#: objcopy.c:1212 +#: objcopy.c:1332 msgid "Unable to change endianness of input file(s)" msgstr "" -#: objcopy.c:1221 +#: objcopy.c:1341 #, c-format msgid "copy from `%s' [%s] to `%s' [%s]\n" msgstr "" -#: objcopy.c:1258 objcopy.c:1715 +#: objcopy.c:1383 objcopy.c:1908 #, c-format msgid "Unable to recognise the format of the input file `%s'" msgstr "" -#: objcopy.c:1261 +#: objcopy.c:1386 #, c-format msgid "Warning: Output file cannot represent architecture `%s'" msgstr "" -#: objcopy.c:1305 +#: objcopy.c:1449 #, c-format -msgid "can't create section `%s': %s" +msgid "can't add section '%s' - it already exists!" msgstr "" -#: objcopy.c:1356 -msgid "there are no sections to be copied!" +#: objcopy.c:1457 +#, c-format +msgid "can't create section `%s': %s" msgstr "" -#: objcopy.c:1402 +#: objcopy.c:1593 #, c-format msgid "Can't fill gap after %s: %s" msgstr "" -#: objcopy.c:1427 +#: objcopy.c:1618 #, c-format msgid "Can't add padding to %s: %s" msgstr "" -#: objcopy.c:1594 +#: objcopy.c:1771 #, c-format msgid "%s: error copying private BFD data: %s" msgstr "" -#: objcopy.c:1605 -msgid "unknown alternate machine code, ignored" +#: objcopy.c:1784 +#, c-format +msgid "this target does not support %lu alternative machine codes" msgstr "" -#: objcopy.c:1635 objcopy.c:1665 -#, c-format -msgid "cannot mkdir %s for archive copying (error: %s)" +#: objcopy.c:1788 +msgid "treating that number as an absolute e_machine value instead" +msgstr "" + +#: objcopy.c:1792 +msgid "ignoring the alternative value" msgstr "" -#: objcopy.c:1787 +#: objcopy.c:1822 objcopy.c:1852 #, c-format -msgid "error: the input file '%s' is empty" +msgid "cannot create tempdir for archive copying (error: %s)" msgstr "" -#: objcopy.c:1889 +#: objcopy.c:2088 #, c-format msgid "Multiple renames of section %s" msgstr "" -#: objcopy.c:1940 +#: objcopy.c:2139 msgid "private header data" msgstr "" -#: objcopy.c:1948 +#: objcopy.c:2147 #, c-format msgid "%s: error in %s: %s" msgstr "" -#: objcopy.c:2007 +#: objcopy.c:2208 msgid "making" msgstr "" -#: objcopy.c:2022 +#: objcopy.c:2228 msgid "size" msgstr "" -#: objcopy.c:2036 +#: objcopy.c:2242 msgid "vma" msgstr "" -#: objcopy.c:2061 +#: objcopy.c:2267 msgid "alignment" msgstr "" -#: objcopy.c:2083 +#: objcopy.c:2289 msgid "private data" msgstr "" -#: objcopy.c:2091 +#: objcopy.c:2304 #, c-format msgid "%s: section `%s': error in %s: %s" msgstr "" -#: objcopy.c:2363 +#. User must pad the section up in order to do this. +#: objcopy.c:2429 +#, c-format +msgid "" +"cannot reverse bytes: length of section %s must be evenly divisible by %d" +msgstr "" + +#: objcopy.c:2605 #, c-format msgid "%s: can't create debugging section: %s" msgstr "" -#: objcopy.c:2377 +#: objcopy.c:2619 #, c-format msgid "%s: can't set debugging section contents: %s" msgstr "" -#: objcopy.c:2386 +#: objcopy.c:2628 #, c-format msgid "%s: don't know how to write debugging information for %s" msgstr "" -#: objcopy.c:2561 +#: objcopy.c:2769 +#, c-format +msgid "could not create temporary file to hold stripped copy of '%s'" +msgstr "" + +#: objcopy.c:2819 msgid "byte number must be non-negative" msgstr "" -#: objcopy.c:2571 +#: objcopy.c:2829 msgid "interleave must be positive" msgstr "" -#: objcopy.c:2591 objcopy.c:2599 +#: objcopy.c:2849 objcopy.c:2857 #, c-format msgid "%s both copied and removed" msgstr "" -#: objcopy.c:2696 objcopy.c:2767 objcopy.c:2867 objcopy.c:2898 objcopy.c:2922 -#: objcopy.c:2926 objcopy.c:2946 +#: objcopy.c:2958 objcopy.c:3032 objcopy.c:3132 objcopy.c:3163 objcopy.c:3187 +#: objcopy.c:3191 objcopy.c:3211 #, c-format msgid "bad format for %s" msgstr "" -#: objcopy.c:2717 +#: objcopy.c:2982 #, c-format msgid "cannot open: %s: %s" msgstr "" -#: objcopy.c:2836 +#: objcopy.c:3101 #, c-format msgid "Warning: truncating gap-fill from 0x%s to 0x%x" msgstr "" -#: objcopy.c:3000 -msgid "alternate machine code index must be positive" +#: objcopy.c:3269 +msgid "unable to parse alternative machine code" +msgstr "" + +#: objcopy.c:3314 +msgid "number of bytes to reverse must be positive and even" +msgstr "" + +#: objcopy.c:3317 +#, c-format +msgid "Warning: ignoring previous --reverse-bytes value of %d" msgstr "" -#: objcopy.c:3058 +#: objcopy.c:3345 msgid "byte number must be less than interleave" msgstr "" -#: objcopy.c:3088 +#: objcopy.c:3375 #, c-format msgid "architecture %s unknown" msgstr "" -#: objcopy.c:3092 +#: objcopy.c:3379 msgid "" "Warning: input target 'binary' required for binary architecture parameter." msgstr "" -#: objcopy.c:3093 +#: objcopy.c:3380 #, c-format msgid " Argument %s ignored" msgstr "" -#: objcopy.c:3099 +#: objcopy.c:3386 #, c-format msgid "warning: could not locate '%s'. System error message: %s" msgstr "" -#: objcopy.c:3141 objcopy.c:3155 +#: objcopy.c:3397 +#, c-format +msgid "" +"warning: could not create temporary file whilst copying '%s', (error: %s)" +msgstr "" + +#: objcopy.c:3424 objcopy.c:3438 #, c-format msgid "%s %s%c0x%s never used" msgstr "" -#: objdump.c:178 +#: objdump.c:176 #, c-format msgid "Usage: %s <option(s)> <file(s)>\n" msgstr "" -#: objdump.c:179 +#: objdump.c:177 #, c-format msgid " Display information from object <file(s)>.\n" msgstr "" -#: objdump.c:180 +#: objdump.c:178 #, c-format msgid " At least one of the following switches must be given:\n" msgstr "" -#: objdump.c:181 +#: objdump.c:179 #, c-format msgid "" " -a, --archive-headers Display archive header information\n" @@ -2887,14 +2963,14 @@ msgid "" " -H, --help Display this information\n" msgstr "" -#: objdump.c:206 +#: objdump.c:204 #, c-format msgid "" "\n" " The following switches are optional:\n" msgstr "" -#: objdump.c:207 +#: objdump.c:205 #, c-format msgid "" " -b, --target=BFDNAME Specify the target object format as " @@ -2931,347 +3007,364 @@ msgid "" "\n" msgstr "" -#: objdump.c:389 +#: objdump.c:387 #, c-format msgid "Sections:\n" msgstr "" -#: objdump.c:392 objdump.c:396 +#: objdump.c:390 objdump.c:394 #, c-format msgid "Idx Name Size VMA LMA File off Algn" msgstr "" -#: objdump.c:398 +#: objdump.c:396 #, c-format msgid "" "Idx Name Size VMA LMA File off " "Algn" msgstr "" -#: objdump.c:402 +#: objdump.c:400 #, c-format msgid " Flags" msgstr "" -#: objdump.c:404 +#: objdump.c:402 #, c-format msgid " Pg" msgstr "" -#: objdump.c:447 +#: objdump.c:445 #, c-format msgid "%s: not a dynamic object" msgstr "" -#: objdump.c:1735 +#: objdump.c:1778 #, c-format msgid "Disassembly of section %s:\n" msgstr "" -#: objdump.c:1897 +#: objdump.c:1940 #, c-format msgid "Can't use supplied machine %s" msgstr "" -#: objdump.c:1916 +#: objdump.c:1959 #, c-format msgid "Can't disassemble for architecture %s\n" msgstr "" -#: objdump.c:2006 +#: objdump.c:2064 #, c-format msgid "" "\n" "Can't get contents for section '%s'.\n" msgstr "" -#: objdump.c:2143 +#: objdump.c:2201 #, c-format msgid "" "No %s section present\n" "\n" msgstr "" -#: objdump.c:2152 +#: objdump.c:2210 #, c-format msgid "Reading %s section of %s failed: %s" msgstr "" -#: objdump.c:2196 +#: objdump.c:2254 #, c-format msgid "" "Contents of %s section:\n" "\n" msgstr "" -#: objdump.c:2323 +#: objdump.c:2381 #, c-format msgid "architecture: %s, " msgstr "" -#: objdump.c:2326 +#: objdump.c:2384 #, c-format msgid "flags 0x%08x:\n" msgstr "" -#: objdump.c:2340 +#: objdump.c:2398 #, c-format msgid "" "\n" "start address 0x" msgstr "" -#: objdump.c:2380 +#: objdump.c:2438 #, c-format msgid "Contents of section %s:\n" msgstr "" -#: objdump.c:2505 +#: objdump.c:2563 #, c-format msgid "no symbols\n" msgstr "" -#: objdump.c:2512 +#: objdump.c:2570 #, c-format msgid "no information for symbol number %ld\n" msgstr "" -#: objdump.c:2515 +#: objdump.c:2573 #, c-format msgid "could not determine the type of symbol number %ld\n" msgstr "" -#: objdump.c:2788 +#: objdump.c:2850 #, c-format msgid "" "\n" "%s: file format %s\n" msgstr "" -#: objdump.c:2845 +#: objdump.c:2908 #, c-format msgid "%s: printing debugging information failed" msgstr "" -#: objdump.c:2936 +#: objdump.c:3002 #, c-format msgid "In archive %s:\n" msgstr "" -#: objdump.c:3058 +#: objdump.c:3124 msgid "unrecognized -E option" msgstr "" -#: objdump.c:3069 +#: objdump.c:3135 #, c-format msgid "unrecognized --endian type `%s'" msgstr "" -#: rdcoff.c:196 +#: rclex.c:196 +msgid "invalid value specified for pragma code_page.\n" +msgstr "" + +#: rdcoff.c:198 #, c-format msgid "parse_coff_type: Bad type code 0x%x" msgstr "" -#: rdcoff.c:404 rdcoff.c:509 rdcoff.c:697 +#: rdcoff.c:406 rdcoff.c:511 rdcoff.c:699 #, c-format msgid "bfd_coff_get_syment failed: %s" msgstr "" -#: rdcoff.c:420 rdcoff.c:717 +#: rdcoff.c:422 rdcoff.c:719 #, c-format msgid "bfd_coff_get_auxent failed: %s" msgstr "" -#: rdcoff.c:784 +#: rdcoff.c:786 #, c-format msgid "%ld: .bf without preceding function" msgstr "" -#: rdcoff.c:834 +#: rdcoff.c:836 #, c-format msgid "%ld: unexpected .ef\n" msgstr "" -#: rddbg.c:85 +#: rddbg.c:86 #, c-format msgid "%s: no recognized debugging information" msgstr "" -#: rddbg.c:394 +#: rddbg.c:400 #, c-format msgid "Last stabs entries before error:\n" msgstr "" -#: readelf.c:264 +#: readelf.c:319 #, c-format msgid "Unable to seek to 0x%lx for %s\n" msgstr "" -#: readelf.c:279 +#: readelf.c:334 #, c-format msgid "Out of memory allocating 0x%lx bytes for %s\n" msgstr "" -#: readelf.c:289 +#: readelf.c:344 #, c-format msgid "Unable to read in 0x%lx bytes of %s\n" msgstr "" -#: readelf.c:623 +#: readelf.c:683 msgid "Don't know about relocations on this machine architecture\n" msgstr "" -#: readelf.c:643 readelf.c:671 readelf.c:715 readelf.c:743 +#: readelf.c:703 readelf.c:731 readelf.c:775 readelf.c:803 msgid "relocs" msgstr "" -#: readelf.c:654 readelf.c:682 readelf.c:726 readelf.c:754 -msgid "out of memory parsing relocs" +#: readelf.c:714 readelf.c:742 readelf.c:786 readelf.c:814 +msgid "out of memory parsing relocs\n" msgstr "" -#: readelf.c:808 +#: readelf.c:868 #, c-format msgid "" " Offset Info Type Sym. Value Symbol's Name + Addend\n" msgstr "" -#: readelf.c:810 +#: readelf.c:870 #, c-format msgid " Offset Info Type Sym.Value Sym. Name + Addend\n" msgstr "" -#: readelf.c:815 +#: readelf.c:875 #, c-format msgid " Offset Info Type Sym. Value Symbol's Name\n" msgstr "" -#: readelf.c:817 +#: readelf.c:877 #, c-format msgid " Offset Info Type Sym.Value Sym. Name\n" msgstr "" -#: readelf.c:825 +#: readelf.c:885 #, c-format msgid "" " Offset Info Type Symbol's Value " "Symbol's Name + Addend\n" msgstr "" -#: readelf.c:827 +#: readelf.c:887 #, c-format msgid "" " Offset Info Type Sym. Value Sym. Name + " "Addend\n" msgstr "" -#: readelf.c:832 +#: readelf.c:892 #, c-format msgid "" " Offset Info Type Symbol's Value " "Symbol's Name\n" msgstr "" -#: readelf.c:834 +#: readelf.c:894 #, c-format msgid "" " Offset Info Type Sym. Value Sym. Name\n" msgstr "" -#: readelf.c:1127 readelf.c:1129 readelf.c:1238 readelf.c:1240 readelf.c:1249 -#: readelf.c:1251 +#: readelf.c:1198 readelf.c:1200 readelf.c:1318 readelf.c:1320 readelf.c:1329 +#: readelf.c:1331 #, c-format msgid "unrecognized: %-7lx" msgstr "" -#: readelf.c:1154 +#: readelf.c:1226 #, c-format msgid "<unknown addend: %lx>" msgstr "" -#: readelf.c:1210 +#: readelf.c:1288 #, c-format msgid "<string table index: %3ld>" msgstr "" -#: readelf.c:1212 +#: readelf.c:1290 #, c-format msgid "<corrupt string table index: %3ld>" msgstr "" -#: readelf.c:1522 +#: readelf.c:1625 #, c-format msgid "Processor Specific: %lx" msgstr "" -#: readelf.c:1543 +#: readelf.c:1646 #, c-format msgid "Operating System specific: %lx" msgstr "" -#: readelf.c:1547 readelf.c:2349 +#: readelf.c:1650 readelf.c:2521 #, c-format msgid "<unknown>: %lx" msgstr "" -#: readelf.c:1560 +#: readelf.c:1663 msgid "NONE (None)" msgstr "" -#: readelf.c:1561 +#: readelf.c:1664 msgid "REL (Relocatable file)" msgstr "" -#: readelf.c:1562 +#: readelf.c:1665 msgid "EXEC (Executable file)" msgstr "" -#: readelf.c:1563 +#: readelf.c:1666 msgid "DYN (Shared object file)" msgstr "" -#: readelf.c:1564 +#: readelf.c:1667 msgid "CORE (Core file)" msgstr "" -#: readelf.c:1568 +#: readelf.c:1671 #, c-format msgid "Processor Specific: (%x)" msgstr "" -#: readelf.c:1570 +#: readelf.c:1673 #, c-format msgid "OS Specific: (%x)" msgstr "" -#: readelf.c:1572 readelf.c:1681 readelf.c:2541 +#: readelf.c:1675 readelf.c:2714 #, c-format msgid "<unknown>: %x" msgstr "" -#: readelf.c:1584 +#: readelf.c:1687 msgid "None" msgstr "" -#: readelf.c:2186 +#: readelf.c:1791 +#, c-format +msgid "<unknown>: 0x%x" +msgstr "" + +#: readelf.c:2048 +msgid "unknown" +msgstr "" + +#: readelf.c:2049 +msgid "unknown mac" +msgstr "" + +#: readelf.c:2358 msgid "Standalone App" msgstr "" -#: readelf.c:2189 readelf.c:2948 readelf.c:2964 +#: readelf.c:2361 readelf.c:3145 readelf.c:3161 #, c-format msgid "<unknown: %x>" msgstr "" -#: readelf.c:2586 +#: readelf.c:2759 #, c-format msgid "Usage: readelf <option(s)> elf-file(s)\n" msgstr "" -#: readelf.c:2587 +#: readelf.c:2760 #, c-format msgid " Display information about the contents of ELF format files\n" msgstr "" -#: readelf.c:2588 +#: readelf.c:2761 #, c-format msgid "" " Options are:\n" @@ -3302,14 +3395,14 @@ msgid "" " Display the contents of DWARF2 debug sections\n" msgstr "" -#: readelf.c:2612 +#: readelf.c:2785 #, c-format msgid "" " -i --instruction-dump=<number>\n" " Disassemble the contents of section <number>\n" msgstr "" -#: readelf.c:2616 +#: readelf.c:2789 #, c-format msgid "" " -I --histogram Display histogram of bucket list lengths\n" @@ -3319,382 +3412,394 @@ msgid "" " -v --version Display the version number of readelf\n" msgstr "" -#: readelf.c:2642 readelf.c:9180 -msgid "Out of memory allocating dump request table." +#: readelf.c:2817 readelf.c:2845 readelf.c:2849 readelf.c:9898 +msgid "Out of memory allocating dump request table.\n" msgstr "" -#: readelf.c:2816 readelf.c:2884 +#: readelf.c:3011 readelf.c:3079 #, c-format msgid "Unrecognized debug option '%s'\n" msgstr "" -#: readelf.c:2918 +#: readelf.c:3115 #, c-format msgid "Invalid option '-%c'\n" msgstr "" -#: readelf.c:2932 +#: readelf.c:3129 msgid "Nothing to do.\n" msgstr "" -#: readelf.c:2944 readelf.c:2960 readelf.c:6169 +#: readelf.c:3141 readelf.c:3157 readelf.c:6399 msgid "none" msgstr "" -#: readelf.c:2961 +#: readelf.c:3158 msgid "2's complement, little endian" msgstr "" -#: readelf.c:2962 +#: readelf.c:3159 msgid "2's complement, big endian" msgstr "" -#: readelf.c:2980 +#: readelf.c:3177 msgid "Not an ELF file - it has the wrong magic bytes at the start\n" msgstr "" -#: readelf.c:2988 +#: readelf.c:3185 #, c-format msgid "ELF Header:\n" msgstr "" -#: readelf.c:2989 +#: readelf.c:3186 #, c-format msgid " Magic: " msgstr "" -#: readelf.c:2993 +#: readelf.c:3190 #, c-format msgid " Class: %s\n" msgstr "" -#: readelf.c:2995 +#: readelf.c:3192 #, c-format msgid " Data: %s\n" msgstr "" -#: readelf.c:2997 +#: readelf.c:3194 #, c-format msgid " Version: %d %s\n" msgstr "" -#: readelf.c:3004 +#: readelf.c:3201 #, c-format msgid " OS/ABI: %s\n" msgstr "" -#: readelf.c:3006 +#: readelf.c:3203 #, c-format msgid " ABI Version: %d\n" msgstr "" -#: readelf.c:3008 +#: readelf.c:3205 #, c-format msgid " Type: %s\n" msgstr "" -#: readelf.c:3010 +#: readelf.c:3207 #, c-format msgid " Machine: %s\n" msgstr "" -#: readelf.c:3012 +#: readelf.c:3209 #, c-format msgid " Version: 0x%lx\n" msgstr "" -#: readelf.c:3015 +#: readelf.c:3212 #, c-format msgid " Entry point address: " msgstr "" -#: readelf.c:3017 +#: readelf.c:3214 #, c-format msgid "" "\n" " Start of program headers: " msgstr "" -#: readelf.c:3019 +#: readelf.c:3216 #, c-format msgid "" " (bytes into file)\n" " Start of section headers: " msgstr "" -#: readelf.c:3021 +#: readelf.c:3218 #, c-format msgid " (bytes into file)\n" msgstr "" -#: readelf.c:3023 +#: readelf.c:3220 #, c-format msgid " Flags: 0x%lx%s\n" msgstr "" -#: readelf.c:3026 +#: readelf.c:3223 #, c-format msgid " Size of this header: %ld (bytes)\n" msgstr "" -#: readelf.c:3028 +#: readelf.c:3225 #, c-format msgid " Size of program headers: %ld (bytes)\n" msgstr "" -#: readelf.c:3030 +#: readelf.c:3227 #, c-format msgid " Number of program headers: %ld\n" msgstr "" -#: readelf.c:3032 +#: readelf.c:3229 #, c-format msgid " Size of section headers: %ld (bytes)\n" msgstr "" -#: readelf.c:3034 +#: readelf.c:3231 #, c-format msgid " Number of section headers: %ld" msgstr "" -#: readelf.c:3039 +#: readelf.c:3236 #, c-format msgid " Section header string table index: %ld" msgstr "" -#: readelf.c:3070 readelf.c:3103 +#: readelf.c:3277 readelf.c:3310 msgid "program headers" msgstr "" -#: readelf.c:3141 readelf.c:3440 readelf.c:3481 readelf.c:3540 readelf.c:3603 -#: readelf.c:4208 readelf.c:4232 readelf.c:5510 readelf.c:5554 readelf.c:5752 -#: readelf.c:6734 readelf.c:6748 readelf.c:8564 readelf.c:8972 readelf.c:9039 +#: readelf.c:3348 readelf.c:3643 readelf.c:3684 readelf.c:3743 readelf.c:3806 +#: readelf.c:4429 readelf.c:4453 readelf.c:5731 readelf.c:5775 readelf.c:5973 +#: readelf.c:7007 readelf.c:7021 readelf.c:7378 readelf.c:7394 readelf.c:7533 +#: readelf.c:7558 readelf.c:8746 readelf.c:8938 readelf.c:9279 readelf.c:9690 +#: readelf.c:9757 msgid "Out of memory\n" msgstr "" -#: readelf.c:3168 +#: readelf.c:3375 #, c-format msgid "" "\n" "There are no program headers in this file.\n" msgstr "" -#: readelf.c:3174 +#: readelf.c:3381 #, c-format msgid "" "\n" "Elf file type is %s\n" msgstr "" -#: readelf.c:3175 +#: readelf.c:3382 #, c-format msgid "Entry point " msgstr "" -#: readelf.c:3177 +#: readelf.c:3384 #, c-format msgid "" "\n" "There are %d program headers, starting at offset " msgstr "" -#: readelf.c:3189 readelf.c:3191 +#: readelf.c:3396 readelf.c:3398 #, c-format msgid "" "\n" "Program Headers:\n" msgstr "" -#: readelf.c:3195 +#: readelf.c:3402 #, c-format msgid "" " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" msgstr "" -#: readelf.c:3198 +#: readelf.c:3405 #, c-format msgid "" " Type Offset VirtAddr PhysAddr FileSiz " "MemSiz Flg Align\n" msgstr "" -#: readelf.c:3202 +#: readelf.c:3409 #, c-format msgid " Type Offset VirtAddr PhysAddr\n" msgstr "" -#: readelf.c:3204 +#: readelf.c:3411 #, c-format msgid " FileSiz MemSiz Flags Align\n" msgstr "" -#: readelf.c:3297 +#: readelf.c:3504 msgid "more than one dynamic segment\n" msgstr "" -#: readelf.c:3308 -msgid "no .dynamic section in the dynamic segment" +#: readelf.c:3515 +msgid "no .dynamic section in the dynamic segment\n" msgstr "" -#: readelf.c:3317 -msgid "the .dynamic section is not contained within the dynamic segment" +#: readelf.c:3527 +msgid "the .dynamic section is not contained within the dynamic segment\n" msgstr "" -#: readelf.c:3319 -msgid "the .dynamic section is not the first section in the dynamic segment." +#: readelf.c:3529 +msgid "the .dynamic section is not the first section in the dynamic segment.\n" msgstr "" -#: readelf.c:3333 +#: readelf.c:3543 msgid "Unable to find program interpreter name\n" msgstr "" -#: readelf.c:3340 +#: readelf.c:3550 +msgid "" +"Internal error: failed to create format string to display program " +"interpreter\n" +msgstr "" + +#: readelf.c:3554 +msgid "Unable to read program interpreter name\n" +msgstr "" + +#: readelf.c:3557 #, c-format msgid "" "\n" " [Requesting program interpreter: %s]" msgstr "" -#: readelf.c:3352 +#: readelf.c:3569 #, c-format msgid "" "\n" " Section to Segment mapping:\n" msgstr "" -#: readelf.c:3353 +#: readelf.c:3570 #, c-format msgid " Segment Sections...\n" msgstr "" -#: readelf.c:3402 +#: readelf.c:3605 msgid "Cannot interpret virtual addresses without program headers.\n" msgstr "" -#: readelf.c:3418 +#: readelf.c:3621 #, c-format msgid "Virtual address 0x%lx not located in any PT_LOAD segment.\n" msgstr "" -#: readelf.c:3432 readelf.c:3473 +#: readelf.c:3635 readelf.c:3676 msgid "section headers" msgstr "" -#: readelf.c:3517 readelf.c:3580 +#: readelf.c:3720 readelf.c:3783 msgid "symbols" msgstr "" -#: readelf.c:3527 readelf.c:3590 +#: readelf.c:3730 readelf.c:3793 msgid "symtab shndx" msgstr "" -#: readelf.c:3817 readelf.c:4192 +#: readelf.c:4020 readelf.c:4413 #, c-format msgid "" "\n" "There are no sections in this file.\n" msgstr "" -#: readelf.c:3823 +#: readelf.c:4026 #, c-format msgid "There are %d section headers, starting at offset 0x%lx:\n" msgstr "" -#: readelf.c:3842 readelf.c:4309 readelf.c:4544 readelf.c:4852 readelf.c:5267 -#: readelf.c:6906 +#: readelf.c:4046 readelf.c:4530 readelf.c:4765 readelf.c:5073 readelf.c:5488 +#: readelf.c:7187 msgid "string table" msgstr "" -#: readelf.c:3881 +#: readelf.c:4102 #, c-format msgid "Section %d has invalid sh_entsize %lx (expected %lx)\n" msgstr "" -#: readelf.c:3901 +#: readelf.c:4122 msgid "File contains multiple dynamic symbol tables\n" msgstr "" -#: readelf.c:3914 +#: readelf.c:4135 msgid "File contains multiple dynamic string tables\n" msgstr "" -#: readelf.c:3919 +#: readelf.c:4140 msgid "dynamic strings" msgstr "" -#: readelf.c:3926 +#: readelf.c:4147 msgid "File contains multiple symtab shndx tables\n" msgstr "" -#: readelf.c:3973 +#: readelf.c:4194 #, c-format msgid "" "\n" "Section Headers:\n" msgstr "" -#: readelf.c:3975 +#: readelf.c:4196 #, c-format msgid "" "\n" "Section Header:\n" msgstr "" -#: readelf.c:3981 readelf.c:3992 readelf.c:4003 +#: readelf.c:4202 readelf.c:4213 readelf.c:4224 #, c-format msgid " [Nr] Name\n" msgstr "" -#: readelf.c:3982 +#: readelf.c:4203 #, c-format msgid " Type Addr Off Size ES Lk Inf Al\n" msgstr "" -#: readelf.c:3986 +#: readelf.c:4207 #, c-format msgid "" " [Nr] Name Type Addr Off Size ES Flg Lk " "Inf Al\n" msgstr "" -#: readelf.c:3993 +#: readelf.c:4214 #, c-format msgid " Type Address Off Size ES Lk Inf Al\n" msgstr "" -#: readelf.c:3997 +#: readelf.c:4218 #, c-format msgid "" " [Nr] Name Type Address Off Size ES " "Flg Lk Inf Al\n" msgstr "" -#: readelf.c:4004 +#: readelf.c:4225 #, c-format msgid " Type Address Offset Link\n" msgstr "" -#: readelf.c:4005 +#: readelf.c:4226 #, c-format msgid " Size EntSize Info Align\n" msgstr "" -#: readelf.c:4009 +#: readelf.c:4230 #, c-format msgid " [Nr] Name Type Address Offset\n" msgstr "" -#: readelf.c:4010 +#: readelf.c:4231 #, c-format msgid " Size EntSize Flags Link Info Align\n" msgstr "" -#: readelf.c:4015 +#: readelf.c:4236 #, c-format msgid " Flags\n" msgstr "" -#: readelf.c:4150 +#: readelf.c:4371 #, c-format msgid "" "Key to Flags:\n" @@ -3703,1030 +3808,1056 @@ msgid "" " O (extra OS processing required) o (OS specific), p (processor specific)\n" msgstr "" -#: readelf.c:4168 +#: readelf.c:4389 #, c-format msgid "[<unknown>: 0x%x]" msgstr "" -#: readelf.c:4199 +#: readelf.c:4420 msgid "Section headers are not available!\n" msgstr "" -#: readelf.c:4223 +#: readelf.c:4444 #, c-format msgid "" "\n" "There are no section groups in this file.\n" msgstr "" -#: readelf.c:4259 +#: readelf.c:4480 #, c-format msgid "Bad sh_link in group section `%s'\n" msgstr "" -#: readelf.c:4278 +#: readelf.c:4499 #, c-format msgid "Bad sh_info in group section `%s'\n" msgstr "" -#: readelf.c:4317 readelf.c:7243 +#: readelf.c:4538 readelf.c:7690 msgid "section data" msgstr "" -#: readelf.c:4329 +#: readelf.c:4550 #, c-format msgid " [Index] Name\n" msgstr "" -#: readelf.c:4343 +#: readelf.c:4564 #, c-format msgid "section [%5u] in group section [%5u] > maximum section [%5u]\n" msgstr "" -#: readelf.c:4349 +#: readelf.c:4570 #, c-format msgid "invalid section [%5u] in group section [%5u]\n" msgstr "" -#: readelf.c:4359 +#: readelf.c:4580 #, c-format msgid "section [%5u] in group section [%5u] already in group section [%5u]\n" msgstr "" -#: readelf.c:4372 +#: readelf.c:4593 #, c-format msgid "section 0 in group section [%5u]\n" msgstr "" -#: readelf.c:4468 +#: readelf.c:4689 #, c-format msgid "" "\n" "'%s' relocation section at offset 0x%lx contains %ld bytes:\n" msgstr "" -#: readelf.c:4480 +#: readelf.c:4701 #, c-format msgid "" "\n" "There are no dynamic relocations in this file.\n" msgstr "" -#: readelf.c:4504 +#: readelf.c:4725 #, c-format msgid "" "\n" "Relocation section " msgstr "" -#: readelf.c:4509 readelf.c:4928 readelf.c:4942 readelf.c:5282 +#: readelf.c:4730 readelf.c:5149 readelf.c:5163 readelf.c:5503 #, c-format msgid "'%s'" msgstr "" -#: readelf.c:4511 readelf.c:4944 readelf.c:5284 +#: readelf.c:4732 readelf.c:5165 readelf.c:5505 #, c-format msgid " at offset 0x%lx contains %lu entries:\n" msgstr "" -#: readelf.c:4563 +#: readelf.c:4784 #, c-format msgid "" "\n" "There are no relocations in this file.\n" msgstr "" -#: readelf.c:4742 readelf.c:5124 +#: readelf.c:4963 readelf.c:5345 msgid "unwind table" msgstr "" -#: readelf.c:4801 readelf.c:5214 +#: readelf.c:5022 readelf.c:5435 #, c-format msgid "Skipping unexpected relocation type %s\n" msgstr "" -#: readelf.c:4860 readelf.c:5275 readelf.c:5326 +#: readelf.c:5081 readelf.c:5496 readelf.c:5547 #, c-format msgid "" "\n" "There are no unwind sections in this file.\n" msgstr "" -#: readelf.c:4923 +#: readelf.c:5144 #, c-format msgid "" "\n" "Could not find unwind info section for " msgstr "" -#: readelf.c:4935 +#: readelf.c:5156 msgid "unwind info" msgstr "" -#: readelf.c:4937 readelf.c:5281 +#: readelf.c:5158 readelf.c:5502 #, c-format msgid "" "\n" "Unwind section " msgstr "" -#: readelf.c:5491 readelf.c:5535 +#: readelf.c:5712 readelf.c:5756 msgid "dynamic section" msgstr "" -#: readelf.c:5612 +#: readelf.c:5833 #, c-format msgid "" "\n" "There is no dynamic section in this file.\n" msgstr "" -#: readelf.c:5650 -msgid "Unable to seek to end of file!" +#: readelf.c:5871 +msgid "Unable to seek to end of file!\n" msgstr "" -#: readelf.c:5663 +#: readelf.c:5884 msgid "Unable to determine the number of symbols to load\n" msgstr "" -#: readelf.c:5698 +#: readelf.c:5919 msgid "Unable to seek to end of file\n" msgstr "" -#: readelf.c:5705 +#: readelf.c:5926 msgid "Unable to determine the length of the dynamic string table\n" msgstr "" -#: readelf.c:5710 +#: readelf.c:5931 msgid "dynamic string table" msgstr "" -#: readelf.c:5745 +#: readelf.c:5966 msgid "symbol information" msgstr "" -#: readelf.c:5770 +#: readelf.c:5991 #, c-format msgid "" "\n" "Dynamic section at offset 0x%lx contains %u entries:\n" msgstr "" -#: readelf.c:5773 +#: readelf.c:5994 #, c-format msgid " Tag Type Name/Value\n" msgstr "" -#: readelf.c:5809 +#: readelf.c:6030 #, c-format msgid "Auxiliary library" msgstr "" -#: readelf.c:5813 +#: readelf.c:6034 #, c-format msgid "Filter library" msgstr "" -#: readelf.c:5817 +#: readelf.c:6038 #, c-format msgid "Configuration file" msgstr "" -#: readelf.c:5821 +#: readelf.c:6042 #, c-format msgid "Dependency audit library" msgstr "" -#: readelf.c:5825 +#: readelf.c:6046 #, c-format msgid "Audit library" msgstr "" -#: readelf.c:5843 readelf.c:5871 readelf.c:5899 +#: readelf.c:6064 readelf.c:6092 readelf.c:6120 #, c-format msgid "Flags:" msgstr "" -#: readelf.c:5846 readelf.c:5874 readelf.c:5901 +#: readelf.c:6067 readelf.c:6095 readelf.c:6122 #, c-format msgid " None\n" msgstr "" -#: readelf.c:6022 +#: readelf.c:6243 #, c-format msgid "Shared library: [%s]" msgstr "" -#: readelf.c:6025 +#: readelf.c:6246 #, c-format msgid " program interpreter" msgstr "" -#: readelf.c:6029 +#: readelf.c:6250 #, c-format msgid "Library soname: [%s]" msgstr "" -#: readelf.c:6033 +#: readelf.c:6254 #, c-format msgid "Library rpath: [%s]" msgstr "" -#: readelf.c:6037 +#: readelf.c:6258 #, c-format msgid "Library runpath: [%s]" msgstr "" -#: readelf.c:6100 +#: readelf.c:6321 #, c-format msgid "Not needed object: [%s]\n" msgstr "" -#: readelf.c:6214 +#: readelf.c:6444 #, c-format msgid "" "\n" "Version definition section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:6217 +#: readelf.c:6447 #, c-format msgid " Addr: 0x" msgstr "" -#: readelf.c:6219 readelf.c:6426 +#: readelf.c:6449 readelf.c:6656 #, c-format msgid " Offset: %#08lx Link: %lx (%s)\n" msgstr "" -#: readelf.c:6228 +#: readelf.c:6458 msgid "version definition section" msgstr "" -#: readelf.c:6254 +#: readelf.c:6484 #, c-format msgid " %#06x: Rev: %d Flags: %s" msgstr "" -#: readelf.c:6257 +#: readelf.c:6487 #, c-format msgid " Index: %d Cnt: %d " msgstr "" -#: readelf.c:6268 +#: readelf.c:6498 #, c-format msgid "Name: %s\n" msgstr "" -#: readelf.c:6270 +#: readelf.c:6500 #, c-format msgid "Name index: %ld\n" msgstr "" -#: readelf.c:6285 +#: readelf.c:6515 #, c-format msgid " %#06x: Parent %d: %s\n" msgstr "" -#: readelf.c:6288 +#: readelf.c:6518 #, c-format msgid " %#06x: Parent %d, name index: %ld\n" msgstr "" -#: readelf.c:6307 +#: readelf.c:6537 #, c-format msgid "" "\n" "Version needs section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:6310 +#: readelf.c:6540 #, c-format msgid " Addr: 0x" msgstr "" -#: readelf.c:6312 +#: readelf.c:6542 #, c-format msgid " Offset: %#08lx Link to section: %ld (%s)\n" msgstr "" -#: readelf.c:6321 +#: readelf.c:6551 msgid "version need section" msgstr "" -#: readelf.c:6343 +#: readelf.c:6573 #, c-format msgid " %#06x: Version: %d" msgstr "" -#: readelf.c:6346 +#: readelf.c:6576 #, c-format msgid " File: %s" msgstr "" -#: readelf.c:6348 +#: readelf.c:6578 #, c-format msgid " File: %lx" msgstr "" -#: readelf.c:6350 +#: readelf.c:6580 #, c-format msgid " Cnt: %d\n" msgstr "" -#: readelf.c:6368 +#: readelf.c:6598 #, c-format msgid " %#06x: Name: %s" msgstr "" -#: readelf.c:6371 +#: readelf.c:6601 #, c-format msgid " %#06x: Name index: %lx" msgstr "" -#: readelf.c:6374 +#: readelf.c:6604 #, c-format msgid " Flags: %s Version: %d\n" msgstr "" -#: readelf.c:6417 +#: readelf.c:6647 msgid "version string table" msgstr "" -#: readelf.c:6421 +#: readelf.c:6651 #, c-format msgid "" "\n" "Version symbols section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:6424 +#: readelf.c:6654 #, c-format msgid " Addr: " msgstr "" -#: readelf.c:6434 +#: readelf.c:6664 msgid "version symbol data" msgstr "" -#: readelf.c:6461 +#: readelf.c:6691 msgid " 0 (*local*) " msgstr "" -#: readelf.c:6465 +#: readelf.c:6695 msgid " 1 (*global*) " msgstr "" -#: readelf.c:6503 readelf.c:6969 +#: readelf.c:6733 readelf.c:7255 msgid "version need" msgstr "" -#: readelf.c:6513 +#: readelf.c:6743 msgid "version need aux (2)" msgstr "" -#: readelf.c:6555 readelf.c:7034 +#: readelf.c:6785 readelf.c:7320 msgid "version def" msgstr "" -#: readelf.c:6575 readelf.c:7049 +#: readelf.c:6805 readelf.c:7335 msgid "version def aux" msgstr "" -#: readelf.c:6606 +#: readelf.c:6836 #, c-format msgid "" "\n" "No version information found in this file.\n" msgstr "" -#: readelf.c:6740 +#: readelf.c:6955 +#, c-format +msgid "<other>: %x" +msgstr "" + +#: readelf.c:7013 msgid "Unable to read in dynamic data\n" msgstr "" -#: readelf.c:6793 -msgid "Unable to seek to start of dynamic information" +#: readelf.c:7069 readelf.c:7443 readelf.c:7467 readelf.c:7497 readelf.c:7521 +msgid "Unable to seek to start of dynamic information\n" msgstr "" -#: readelf.c:6799 +#: readelf.c:7075 readelf.c:7449 msgid "Failed to read in number of buckets\n" msgstr "" -#: readelf.c:6805 +#: readelf.c:7081 msgid "Failed to read in number of chains\n" msgstr "" -#: readelf.c:6825 +#: readelf.c:7101 #, c-format msgid "" "\n" "Symbol table for image:\n" msgstr "" -#: readelf.c:6827 +#: readelf.c:7103 #, c-format msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:6829 +#: readelf.c:7105 #, c-format msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:6882 +#: readelf.c:7163 #, c-format msgid "" "\n" "Symbol table '%s' contains %lu entries:\n" msgstr "" -#: readelf.c:6886 +#: readelf.c:7167 #, c-format msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:6888 +#: readelf.c:7169 #, c-format msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:6939 +#: readelf.c:7225 msgid "version data" msgstr "" -#: readelf.c:6982 +#: readelf.c:7268 msgid "version need aux (3)" msgstr "" -#: readelf.c:7009 -msgid "bad dynamic symbol" +#: readelf.c:7295 +msgid "bad dynamic symbol\n" msgstr "" -#: readelf.c:7073 +#: readelf.c:7359 #, c-format msgid "" "\n" "Dynamic symbol information is not available for displaying symbols.\n" msgstr "" -#: readelf.c:7085 +#: readelf.c:7371 #, c-format msgid "" "\n" "Histogram for bucket list length (total of %lu buckets):\n" msgstr "" -#: readelf.c:7087 +#: readelf.c:7373 readelf.c:7539 #, c-format msgid " Length Number %% of total Coverage\n" msgstr "" -#: readelf.c:7092 readelf.c:7108 readelf.c:8031 readelf.c:8223 -msgid "Out of memory" +#: readelf.c:7505 +msgid "Failed to determine last chain length\n" +msgstr "" + +#: readelf.c:7537 +#, c-format +msgid "" +"\n" +"Histogram for `.gnu.hash' bucket list length (total of %lu buckets):\n" msgstr "" -#: readelf.c:7157 +#: readelf.c:7603 #, c-format msgid "" "\n" "Dynamic info segment at offset 0x%lx contains %d entries:\n" msgstr "" -#: readelf.c:7160 +#: readelf.c:7606 #, c-format msgid " Num: Name BoundTo Flags\n" msgstr "" -#: readelf.c:7212 +#: readelf.c:7658 #, c-format msgid "" "\n" "Assembly dump of section %s\n" msgstr "" -#: readelf.c:7233 +#: readelf.c:7680 #, c-format msgid "" "\n" "Section '%s' has no data to dump.\n" msgstr "" -#: readelf.c:7238 +#: readelf.c:7685 #, c-format msgid "" "\n" "Hex dump of section '%s':\n" msgstr "" -#: readelf.c:7359 +#: readelf.c:7710 +#, c-format +msgid "" +" NOTE: This section has relocations against it, but these have NOT been " +"applied to this dump.\n" +msgstr "" + +#: readelf.c:7845 +#, c-format +msgid "" +"skipping relocation of unknown size against offset 0x%lx in section %s\n" +msgstr "" + +#: readelf.c:7854 #, c-format msgid "skipping invalid relocation offset 0x%lx in section %s\n" msgstr "" -#: readelf.c:7376 +#: readelf.c:7875 #, c-format msgid "skipping unexpected symbol type %s in relocation in section .rela%s\n" msgstr "" -#: readelf.c:7402 +#: readelf.c:7902 #, c-format msgid "skipping unexpected symbol type %s in relocation in section .rela.%s\n" msgstr "" -#: readelf.c:7435 +#: readelf.c:7935 #, c-format msgid "%s section data" msgstr "" -#: readelf.c:7472 +#: readelf.c:7972 #, c-format msgid "" "\n" "Section '%s' has no debugging data.\n" msgstr "" -#: readelf.c:7498 +#: readelf.c:7998 #, c-format msgid "Unrecognized debug section: %s\n" msgstr "" -#: readelf.c:7533 +#: readelf.c:8026 +#, c-format +msgid "Section '%s' was not dumped because it does not exist!\n" +msgstr "" + +#: readelf.c:8061 #, c-format msgid "Section %d was not dumped because it does not exist!\n" msgstr "" -#: readelf.c:7791 +#: readelf.c:8478 msgid "attributes" msgstr "" -#: readelf.c:7809 +#: readelf.c:8497 #, c-format msgid "ERROR: Bad section length (%d > %d)\n" msgstr "" -#: readelf.c:7830 +#: readelf.c:8522 #, c-format msgid "ERROR: Bad subsection length (%d > %d)\n" msgstr "" -#: readelf.c:7880 +#: readelf.c:8578 #, c-format msgid "Unknown format '%c'\n" msgstr "" -#: readelf.c:7936 readelf.c:8304 +#: readelf.c:8651 readelf.c:9019 msgid "liblist" msgstr "" -#: readelf.c:8025 +#: readelf.c:8740 msgid "options" msgstr "" -#: readelf.c:8055 +#: readelf.c:8770 #, c-format msgid "" "\n" "Section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:8216 -msgid "conflict list found without a dynamic symbol table" +#: readelf.c:8931 +msgid "conflict list found without a dynamic symbol table\n" msgstr "" -#: readelf.c:8232 readelf.c:8246 +#: readelf.c:8947 readelf.c:8961 msgid "conflict" msgstr "" -#: readelf.c:8256 +#: readelf.c:8971 #, c-format msgid "" "\n" "Section '.conflict' contains %lu entries:\n" msgstr "" -#: readelf.c:8258 +#: readelf.c:8973 msgid " Num: Index Value Name" msgstr "" -#: readelf.c:8311 +#: readelf.c:9026 msgid "liblist string table" msgstr "" -#: readelf.c:8321 +#: readelf.c:9036 #, c-format msgid "" "\n" "Library list section '%s' contains %lu entries:\n" msgstr "" -#: readelf.c:8374 +#: readelf.c:9089 msgid "NT_AUXV (auxiliary vector)" msgstr "" -#: readelf.c:8376 +#: readelf.c:9091 msgid "NT_PRSTATUS (prstatus structure)" msgstr "" -#: readelf.c:8378 +#: readelf.c:9093 msgid "NT_FPREGSET (floating point registers)" msgstr "" -#: readelf.c:8380 +#: readelf.c:9095 msgid "NT_PRPSINFO (prpsinfo structure)" msgstr "" -#: readelf.c:8382 +#: readelf.c:9097 msgid "NT_TASKSTRUCT (task structure)" msgstr "" -#: readelf.c:8384 +#: readelf.c:9099 msgid "NT_PRXFPREG (user_xfpregs structure)" msgstr "" -#: readelf.c:8386 +#: readelf.c:9101 msgid "NT_PSTATUS (pstatus structure)" msgstr "" -#: readelf.c:8388 +#: readelf.c:9103 msgid "NT_FPREGS (floating point registers)" msgstr "" -#: readelf.c:8390 +#: readelf.c:9105 msgid "NT_PSINFO (psinfo structure)" msgstr "" -#: readelf.c:8392 +#: readelf.c:9107 msgid "NT_LWPSTATUS (lwpstatus_t structure)" msgstr "" -#: readelf.c:8394 +#: readelf.c:9109 msgid "NT_LWPSINFO (lwpsinfo_t structure)" msgstr "" -#: readelf.c:8396 +#: readelf.c:9111 msgid "NT_WIN32PSTATUS (win32_pstatus structure)" msgstr "" -#: readelf.c:8404 +#: readelf.c:9119 msgid "NT_VERSION (version)" msgstr "" -#: readelf.c:8406 +#: readelf.c:9121 msgid "NT_ARCH (architecture)" msgstr "" -#: readelf.c:8411 readelf.c:8433 +#: readelf.c:9126 readelf.c:9148 #, c-format msgid "Unknown note type: (0x%08x)" msgstr "" #. NetBSD core "procinfo" structure. -#: readelf.c:8423 +#: readelf.c:9138 msgid "NetBSD procinfo structure" msgstr "" -#: readelf.c:8450 readelf.c:8464 +#: readelf.c:9165 readelf.c:9179 msgid "PT_GETREGS (reg structure)" msgstr "" -#: readelf.c:8452 readelf.c:8466 +#: readelf.c:9167 readelf.c:9181 msgid "PT_GETFPREGS (fpreg structure)" msgstr "" -#: readelf.c:8472 +#: readelf.c:9187 #, c-format msgid "PT_FIRSTMACH+%d" msgstr "" -#: readelf.c:8518 +#: readelf.c:9233 msgid "notes" msgstr "" -#: readelf.c:8524 +#: readelf.c:9239 #, c-format msgid "" "\n" "Notes at offset 0x%08lx with length 0x%08lx:\n" msgstr "" -#: readelf.c:8526 +#: readelf.c:9241 #, c-format msgid " Owner\t\tData size\tDescription\n" msgstr "" -#: readelf.c:8545 +#: readelf.c:9260 #, c-format msgid "corrupt note found at offset %lx into core notes\n" msgstr "" -#: readelf.c:8547 +#: readelf.c:9262 #, c-format msgid " type: %lx, namesize: %08lx, descsize: %08lx\n" msgstr "" -#: readelf.c:8645 +#: readelf.c:9360 #, c-format msgid "No note segments present in the core file.\n" msgstr "" -#: readelf.c:8726 +#: readelf.c:9444 msgid "" "This instance of readelf has been built without support for a\n" "64 bit data type and so it cannot read 64 bit ELF files.\n" msgstr "" -#: readelf.c:8775 readelf.c:9119 +#: readelf.c:9493 readelf.c:9837 #, c-format msgid "%s: Failed to read file header\n" msgstr "" -#: readelf.c:8788 +#: readelf.c:9506 #, c-format msgid "" "\n" "File: %s\n" msgstr "" -#: readelf.c:8936 readelf.c:8957 readelf.c:8994 readelf.c:9074 +#: readelf.c:9654 readelf.c:9675 readelf.c:9712 readelf.c:9792 #, c-format msgid "%s: failed to read archive header\n" msgstr "" -#: readelf.c:8947 +#: readelf.c:9665 #, c-format msgid "%s: failed to skip archive symbol table\n" msgstr "" -#: readelf.c:8979 +#: readelf.c:9697 #, c-format msgid "%s: failed to read string table\n" msgstr "" -#: readelf.c:9015 +#: readelf.c:9733 #, c-format msgid "%s: invalid archive string table offset %lu\n" msgstr "" -#: readelf.c:9031 +#: readelf.c:9749 #, c-format msgid "%s: bad archive file name\n" msgstr "" -#: readelf.c:9063 +#: readelf.c:9781 #, c-format msgid "%s: failed to seek to next archive header\n" msgstr "" -#: readelf.c:9097 +#: readelf.c:9815 #, c-format msgid "'%s': No such file\n" msgstr "" -#: readelf.c:9099 +#: readelf.c:9817 #, c-format msgid "Could not locate '%s'. System error message: %s\n" msgstr "" -#: readelf.c:9106 +#: readelf.c:9824 #, c-format msgid "'%s' is not an ordinary file\n" msgstr "" -#: readelf.c:9113 +#: readelf.c:9831 #, c-format msgid "Input file '%s' is not readable.\n" msgstr "" -#: rename.c:129 +#: rename.c:130 #, c-format msgid "%s: cannot set time: %s" msgstr "" #. We have to clean up here. -#: rename.c:164 rename.c:202 +#: rename.c:165 rename.c:203 #, c-format msgid "unable to rename '%s' reason: %s" msgstr "" -#: rename.c:210 +#: rename.c:211 #, c-format msgid "unable to copy file '%s' reason: %s" msgstr "" -#: resbin.c:132 +#: resbin.c:119 #, c-format msgid "%s: not enough binary data" msgstr "" -#: resbin.c:148 +#: resbin.c:135 msgid "null terminated unicode string" msgstr "" -#: resbin.c:175 resbin.c:181 +#: resbin.c:162 resbin.c:168 msgid "resource ID" msgstr "" -#: resbin.c:221 +#: resbin.c:207 msgid "cursor" msgstr "" -#: resbin.c:253 resbin.c:260 +#: resbin.c:238 resbin.c:245 msgid "menu header" msgstr "" -#: resbin.c:270 +#: resbin.c:254 msgid "menuex header" msgstr "" -#: resbin.c:274 +#: resbin.c:258 msgid "menuex offset" msgstr "" -#: resbin.c:281 +#: resbin.c:263 #, c-format msgid "unsupported menu version %d" msgstr "" -#: resbin.c:306 resbin.c:321 resbin.c:384 +#: resbin.c:288 resbin.c:303 resbin.c:365 msgid "menuitem header" msgstr "" -#: resbin.c:414 +#: resbin.c:395 msgid "menuitem" msgstr "" -#: resbin.c:453 resbin.c:481 +#: resbin.c:432 resbin.c:460 msgid "dialog header" msgstr "" -#: resbin.c:471 +#: resbin.c:450 #, c-format msgid "unexpected DIALOGEX version %d" msgstr "" -#: resbin.c:516 +#: resbin.c:495 msgid "dialog font point size" msgstr "" -#: resbin.c:524 +#: resbin.c:503 msgid "dialogex font information" msgstr "" -#: resbin.c:550 resbin.c:568 +#: resbin.c:529 resbin.c:547 msgid "dialog control" msgstr "" -#: resbin.c:560 +#: resbin.c:539 msgid "dialogex control" msgstr "" -#: resbin.c:589 +#: resbin.c:568 msgid "dialog control end" msgstr "" -#: resbin.c:601 +#: resbin.c:580 msgid "dialog control data" msgstr "" -#: resbin.c:642 +#: resbin.c:620 msgid "stringtable string length" msgstr "" -#: resbin.c:652 +#: resbin.c:630 msgid "stringtable string" msgstr "" -#: resbin.c:683 +#: resbin.c:660 msgid "fontdir header" msgstr "" -#: resbin.c:696 +#: resbin.c:674 msgid "fontdir" msgstr "" -#: resbin.c:712 +#: resbin.c:691 msgid "fontdir device name" msgstr "" -#: resbin.c:718 +#: resbin.c:697 msgid "fontdir face name" msgstr "" -#: resbin.c:759 +#: resbin.c:737 msgid "accelerator" msgstr "" -#: resbin.c:819 +#: resbin.c:796 msgid "group cursor header" msgstr "" -#: resbin.c:823 +#: resbin.c:800 resrc.c:1306 #, c-format msgid "unexpected group cursor type %d" msgstr "" -#: resbin.c:838 +#: resbin.c:815 msgid "group cursor" msgstr "" -#: resbin.c:875 +#: resbin.c:851 msgid "group icon header" msgstr "" -#: resbin.c:879 +#: resbin.c:855 resrc.c:1253 #, c-format msgid "unexpected group icon type %d" msgstr "" -#: resbin.c:894 +#: resbin.c:870 msgid "group icon" msgstr "" -#: resbin.c:957 resbin.c:1174 +#: resbin.c:934 resbin.c:1150 msgid "unexpected version string" msgstr "" -#: resbin.c:989 +#: resbin.c:965 #, c-format msgid "version length %d does not match resource length %lu" msgstr "" -#: resbin.c:993 +#: resbin.c:969 #, c-format msgid "unexpected version type %d" msgstr "" -#: resbin.c:1005 +#: resbin.c:981 #, c-format -msgid "unexpected fixed version information length %d" +msgid "unexpected fixed version information length %ld" msgstr "" -#: resbin.c:1008 +#: resbin.c:984 msgid "fixed version info" msgstr "" -#: resbin.c:1012 +#: resbin.c:988 #, c-format msgid "unexpected fixed version signature %lu" msgstr "" -#: resbin.c:1016 +#: resbin.c:992 #, c-format msgid "unexpected fixed version info version %lu" msgstr "" -#: resbin.c:1045 +#: resbin.c:1021 msgid "version var info" msgstr "" -#: resbin.c:1062 +#: resbin.c:1038 #, c-format -msgid "unexpected stringfileinfo value length %d" +msgid "unexpected stringfileinfo value length %ld" msgstr "" -#: resbin.c:1072 +#: resbin.c:1048 #, c-format -msgid "unexpected version stringtable value length %d" +msgid "unexpected version stringtable value length %ld" msgstr "" -#: resbin.c:1106 +#: resbin.c:1082 #, c-format -msgid "unexpected version string length %d != %d + %d" +msgid "unexpected version string length %ld != %ld + %ld" msgstr "" -#: resbin.c:1117 +#: resbin.c:1093 #, c-format -msgid "unexpected version string length %d < %d" +msgid "unexpected version string length %ld < %ld" msgstr "" -#: resbin.c:1134 +#: resbin.c:1110 #, c-format -msgid "unexpected varfileinfo value length %d" +msgid "unexpected varfileinfo value length %ld" msgstr "" -#: resbin.c:1153 +#: resbin.c:1129 msgid "version varfileinfo" msgstr "" -#: resbin.c:1168 +#: resbin.c:1144 #, c-format -msgid "unexpected version value length %d" +msgid "unexpected version value length %ld" msgstr "" -#: rescoff.c:126 +#: rescoff.c:124 msgid "filename required for COFF input" msgstr "" -#: rescoff.c:143 +#: rescoff.c:141 #, c-format msgid "%s: no resource section" msgstr "" -#: rescoff.c:150 -msgid "can't read resource section" -msgstr "" - -#: rescoff.c:174 +#: rescoff.c:173 #, c-format msgid "%s: %s: address out of bounds" msgstr "" @@ -4763,144 +4894,144 @@ msgstr "" msgid "ID resource" msgstr "" -#: rescoff.c:318 +#: rescoff.c:320 msgid "resource type unknown" msgstr "" -#: rescoff.c:321 +#: rescoff.c:323 msgid "data entry" msgstr "" -#: rescoff.c:329 +#: rescoff.c:331 msgid "resource data" msgstr "" -#: rescoff.c:334 +#: rescoff.c:336 msgid "resource data size" msgstr "" -#: rescoff.c:427 +#: rescoff.c:431 msgid "filename required for COFF output" msgstr "" -#: rescoff.c:719 +#: rescoff.c:718 msgid "can't get BFD_RELOC_RVA relocation type" msgstr "" -#: resrc.c:238 resrc.c:309 +#: resrc.c:262 resrc.c:333 #, c-format msgid "can't open temporary file `%s': %s" msgstr "" -#: resrc.c:244 +#: resrc.c:268 #, c-format msgid "can't redirect stdout: `%s': %s" msgstr "" -#: resrc.c:260 +#: resrc.c:284 #, c-format msgid "%s %s: %s" msgstr "" -#: resrc.c:305 +#: resrc.c:329 #, c-format msgid "can't execute `%s': %s" msgstr "" -#: resrc.c:314 +#: resrc.c:338 #, c-format msgid "Using temporary file `%s' to read preprocessor output\n" msgstr "" -#: resrc.c:321 +#: resrc.c:345 #, c-format msgid "can't popen `%s': %s" msgstr "" -#: resrc.c:323 +#: resrc.c:347 #, c-format msgid "Using popen to read preprocessor output\n" msgstr "" -#: resrc.c:362 +#: resrc.c:413 #, c-format msgid "Tried `%s'\n" msgstr "" -#: resrc.c:373 +#: resrc.c:424 #, c-format msgid "Using `%s'\n" msgstr "" -#: resrc.c:529 +#: resrc.c:583 #, c-format msgid "%s:%d: %s\n" msgstr "" -#: resrc.c:537 +#: resrc.c:591 #, c-format msgid "%s: unexpected EOF" msgstr "" -#: resrc.c:586 +#: resrc.c:640 #, c-format msgid "%s: read of %lu returned %lu" msgstr "" -#: resrc.c:624 resrc.c:1134 +#: resrc.c:678 resrc.c:1453 #, c-format msgid "stat failed on bitmap file `%s': %s" msgstr "" -#: resrc.c:675 +#: resrc.c:729 #, c-format msgid "cursor file `%s' does not contain cursor data" msgstr "" -#: resrc.c:707 resrc.c:1003 +#: resrc.c:761 resrc.c:1161 #, c-format msgid "%s: fseek to %lu failed: %s" msgstr "" -#: resrc.c:831 +#: resrc.c:887 msgid "help ID requires DIALOGEX" msgstr "" -#: resrc.c:833 +#: resrc.c:889 msgid "control data requires DIALOGEX" msgstr "" -#: resrc.c:861 +#: resrc.c:917 #, c-format msgid "stat failed on font file `%s': %s" msgstr "" -#: resrc.c:972 +#: resrc.c:1130 #, c-format msgid "icon file `%s' does not contain icon data" msgstr "" -#: resrc.c:1273 resrc.c:1308 +#: resrc.c:1675 resrc.c:1710 #, c-format msgid "stat failed on file `%s': %s" msgstr "" -#: resrc.c:1494 +#: resrc.c:1891 #, c-format msgid "can't open `%s' for output: %s" msgstr "" -#: size.c:83 +#: size.c:84 #, c-format msgid " Displays the sizes of sections inside binary files\n" msgstr "" -#: size.c:84 +#: size.c:85 #, c-format msgid " If no input file(s) are specified, a.out is assumed\n" msgstr "" -#: size.c:85 +#: size.c:86 #, c-format msgid "" " The options are:\n" @@ -4916,22 +5047,22 @@ msgid "" "\n" msgstr "" -#: size.c:158 +#: size.c:159 #, c-format msgid "invalid argument to --format: %s" msgstr "" -#: size.c:185 +#: size.c:186 #, c-format msgid "Invalid radix: %s\n" msgstr "" -#: srconv.c:1722 +#: srconv.c:1724 #, c-format msgid "Convert a COFF object file into a SYSROFF object file\n" msgstr "" -#: srconv.c:1723 +#: srconv.c:1725 #, c-format msgid "" " The options are:\n" @@ -4943,160 +5074,160 @@ msgid "" " -v --version Print the program's version number\n" msgstr "" -#: srconv.c:1869 +#: srconv.c:1871 #, c-format msgid "unable to open output file %s" msgstr "" -#: stabs.c:330 stabs.c:1708 +#: stabs.c:328 stabs.c:1706 msgid "numeric overflow" msgstr "" -#: stabs.c:340 +#: stabs.c:338 #, c-format msgid "Bad stab: %s\n" msgstr "" -#: stabs.c:348 +#: stabs.c:346 #, c-format msgid "Warning: %s: %s\n" msgstr "" -#: stabs.c:458 +#: stabs.c:456 #, c-format msgid "N_LBRAC not within function\n" msgstr "" -#: stabs.c:497 +#: stabs.c:495 #, c-format msgid "Too many N_RBRACs\n" msgstr "" -#: stabs.c:738 +#: stabs.c:736 msgid "unknown C++ encoded name" msgstr "" #. Complain and keep going, so compilers can invent new #. cross-reference types. -#: stabs.c:1253 +#: stabs.c:1251 msgid "unrecognized cross reference type" msgstr "" #. Does this actually ever happen? Is that why we are worrying #. about dealing with it rather than just calling error_type? -#: stabs.c:1800 +#: stabs.c:1798 msgid "missing index type" msgstr "" -#: stabs.c:2114 +#: stabs.c:2112 msgid "unknown virtual character for baseclass" msgstr "" -#: stabs.c:2132 +#: stabs.c:2130 msgid "unknown visibility character for baseclass" msgstr "" -#: stabs.c:2318 +#: stabs.c:2316 msgid "unnamed $vb type" msgstr "" -#: stabs.c:2324 +#: stabs.c:2322 msgid "unrecognized C++ abbreviation" msgstr "" -#: stabs.c:2400 +#: stabs.c:2398 msgid "unknown visibility character for field" msgstr "" -#: stabs.c:2652 +#: stabs.c:2650 msgid "const/volatile indicator missing" msgstr "" -#: stabs.c:2888 +#: stabs.c:2886 #, c-format msgid "No mangling for \"%s\"\n" msgstr "" -#: stabs.c:3188 +#: stabs.c:3186 msgid "Undefined N_EXCL" msgstr "" -#: stabs.c:3268 +#: stabs.c:3266 #, c-format msgid "Type file number %d out of range\n" msgstr "" -#: stabs.c:3273 +#: stabs.c:3271 #, c-format msgid "Type index number %d out of range\n" msgstr "" -#: stabs.c:3352 +#: stabs.c:3350 #, c-format msgid "Unrecognized XCOFF type %d\n" msgstr "" -#: stabs.c:3644 +#: stabs.c:3642 #, c-format msgid "bad mangled name `%s'\n" msgstr "" -#: stabs.c:3739 +#: stabs.c:3737 #, c-format msgid "no argument types in mangled string\n" msgstr "" -#: stabs.c:5093 +#: stabs.c:5091 #, c-format msgid "Demangled name is not a function\n" msgstr "" -#: stabs.c:5135 +#: stabs.c:5133 #, c-format msgid "Unexpected type in v3 arglist demangling\n" msgstr "" -#: stabs.c:5202 +#: stabs.c:5200 #, c-format msgid "Unrecognized demangle component %d\n" msgstr "" -#: stabs.c:5254 +#: stabs.c:5252 #, c-format msgid "Failed to print demangled template\n" msgstr "" -#: stabs.c:5334 +#: stabs.c:5332 #, c-format msgid "Couldn't get demangled builtin type\n" msgstr "" -#: stabs.c:5383 +#: stabs.c:5381 #, c-format msgid "Unexpected demangled varargs\n" msgstr "" -#: stabs.c:5390 +#: stabs.c:5388 #, c-format msgid "Unrecognized demangled builtin type\n" msgstr "" -#: strings.c:218 +#: strings.c:215 #, c-format msgid "invalid number %s" msgstr "" -#: strings.c:700 +#: strings.c:697 #, c-format msgid "invalid integer argument %s" msgstr "" -#: strings.c:709 +#: strings.c:706 #, c-format msgid " Display printable strings in [file(s)] (stdin by default)\n" msgstr "" -#: strings.c:710 +#: strings.c:707 #, c-format msgid "" " The options are:\n" @@ -5117,12 +5248,12 @@ msgid "" " -v --version Print the program's version number\n" msgstr "" -#: sysdump.c:642 +#: sysdump.c:641 #, c-format msgid "Print a human readable interpretation of a SYSROFF object file\n" msgstr "" -#: sysdump.c:643 +#: sysdump.c:642 #, c-format msgid "" " The options are:\n" @@ -5130,70 +5261,139 @@ msgid "" " -v --version Print the program's version number\n" msgstr "" -#: sysdump.c:710 +#: sysdump.c:709 #, c-format msgid "cannot open input file %s" msgstr "" -#: version.c:35 +#: version.c:34 #, c-format -msgid "Copyright 2005 Free Software Foundation, Inc.\n" +msgid "Copyright 2007 Free Software Foundation, Inc.\n" msgstr "" -#: version.c:36 +#: version.c:35 #, c-format msgid "" "This program is free software; you may redistribute it under the terms of\n" "the GNU General Public License. This program has absolutely no warranty.\n" msgstr "" -#: windres.c:204 +#: windmc.c:194 #, c-format -msgid "can't open %s `%s': %s" +msgid "can't create %s file ,%s' for output.\n" msgstr "" -#: windres.c:370 +#: windmc.c:202 #, c-format -msgid ": expected to be a directory\n" +msgid "Usage: %s [option(s)] [input-file]\n" msgstr "" -#: windres.c:382 +#: windmc.c:204 #, c-format -msgid ": expected to be a leaf\n" +msgid "" +" The options are:\n" +" -a --ascii_in Read input file as ASCII file\n" +" -A --ascii_out Write binary messages as ASCII\n" +" -b --binprefix .bin filename is prefixed by .mc filename_ " +"for uniqueness.\n" +" -c --customflag Set custom flags for messages\n" +" -C --codepage_in=<val> Set codepage when reading mc text file\n" +" -d --decimal_values Print values to text files decimal\n" +" -e --extension=<extension> Set header extension used on export header " +"file\n" +" -F --target <target> Specify output target for endianess.\n" +" -h --headerdir=<directory> Set the export directory for headers\n" +" -u --unicode_in Read input file as UTF16 file\n" +" -U --unicode_out Write binary messages as UFT16\n" +" -m --maxlength=<val> Set the maximal allowed message length\n" +" -n --nullterminate Automatic add a zero termination to strings\n" +" -o --hresult_use Use HRESULT definition instead of status code " +"definition\n" +" -O --codepage_out=<val> Set codepage used for writing text file\n" +" -r --rcdir=<directory> Set the export directory for rc files\n" +" -x --xdbg=<directory> Where to create the .dbg C include file\n" +" that maps message ID's to their symbolic " +"name.\n" +msgstr "" + +#: windmc.c:224 +#, c-format +msgid "" +" -H --help Print this help message\n" +" -v --verbose Verbose - tells you what it's doing\n" +" -V --version Print version information\n" msgstr "" -#: windres.c:391 +#: windmc.c:287 windres.c:415 #, c-format msgid "%s: warning: " msgstr "" -#: windres.c:393 +#: windmc.c:288 +#, c-format +msgid "A codepage was specified switch ,%s' and UTF16.\n" +msgstr "" + +#: windmc.c:289 +#, c-format +msgid "\tcodepage settings are ignored.\n" +msgstr "" + +#: windmc.c:333 +msgid "try to add a ill language." +msgstr "" + +#: windmc.c:1142 +#, c-format +msgid "unable to open file ,%s' for input.\n" +msgstr "" + +#: windmc.c:1161 +msgid "input file does not seems to be UFT16.\n" +msgstr "" + +#: windres.c:220 +#, c-format +msgid "can't open %s `%s': %s" +msgstr "" + +#: windres.c:394 +#, c-format +msgid ": expected to be a directory\n" +msgstr "" + +#: windres.c:406 +#, c-format +msgid ": expected to be a leaf\n" +msgstr "" + +#: windres.c:417 #, c-format msgid ": duplicate value\n" msgstr "" -#: windres.c:543 +#: windres.c:567 #, c-format msgid "unknown format type `%s'" msgstr "" -#: windres.c:544 +#: windres.c:568 #, c-format msgid "%s: supported formats:" msgstr "" #. Otherwise, we give up. -#: windres.c:627 +#: windres.c:651 #, c-format msgid "can not determine type of file `%s'; use the -J option" msgstr "" -#: windres.c:639 +#: windres.c:663 #, c-format msgid "Usage: %s [option(s)] [input-file] [output-file]\n" msgstr "" -#: windres.c:641 +#: windres.c:665 #, c-format msgid "" " The options are:\n" @@ -5207,6 +5407,7 @@ msgid "" " -D --define <sym>[=<val>] Define SYM when preprocessing rc file\n" " -U --undefine <sym> Undefine SYM when preprocessing rc file\n" " -v --verbose Verbose - tells you what it's doing\n" +" -c --codepage=<codepage> Specify default codepage\n" " -l --language=<val> Set language when reading rc file\n" " --use-temp-file Use a temporary file instead of popen to " "read\n" @@ -5214,12 +5415,12 @@ msgid "" " --no-use-temp-file Use popen (default)\n" msgstr "" -#: windres.c:657 +#: windres.c:682 #, c-format msgid " --yydebug Turn on parser debugging\n" msgstr "" -#: windres.c:660 +#: windres.c:685 #, c-format msgid "" " -r Ignored for compatibility with rc\n" @@ -5228,7 +5429,7 @@ msgid "" " -V --version Print version information\n" msgstr "" -#: windres.c:665 +#: windres.c:690 #, c-format msgid "" "FORMAT is one of rc, res, or coff, and is deduced from the file name\n" @@ -5236,36 +5437,40 @@ msgid "" "No input-file is stdin, default rc. No output-file is stdout, default rc.\n" msgstr "" -#: windres.c:803 +#: windres.c:828 +msgid "invalid codepage specified.\n" +msgstr "" + +#: windres.c:843 msgid "invalid option -f\n" msgstr "" -#: windres.c:808 +#: windres.c:848 msgid "No filename following the -fo option.\n" msgstr "" -#: windres.c:866 +#: windres.c:907 #, c-format msgid "" "Option -I is deprecated for setting the input format, please use -J " "instead.\n" msgstr "" -#: windres.c:984 +#: windres.c:1027 msgid "no resources" msgstr "" -#: wrstabs.c:354 wrstabs.c:1915 +#: wrstabs.c:353 wrstabs.c:1916 #, c-format msgid "string_hash_lookup failed: %s" msgstr "" -#: wrstabs.c:635 +#: wrstabs.c:636 #, c-format msgid "stab_int_type: bad size %u" msgstr "" -#: wrstabs.c:1393 +#: wrstabs.c:1394 #, c-format msgid "%s: warning: unknown size for field `%s' in struct" msgstr "" diff --git a/binutils/po/da.gmo b/binutils/po/da.gmo Binary files differdeleted file mode 100644 index 8f9b965b6edf..000000000000 --- a/binutils/po/da.gmo +++ /dev/null diff --git a/binutils/po/es.gmo b/binutils/po/es.gmo Binary files differdeleted file mode 100644 index f5f43fabe671..000000000000 --- a/binutils/po/es.gmo +++ /dev/null diff --git a/binutils/po/fi.gmo b/binutils/po/fi.gmo Binary files differdeleted file mode 100644 index 55d819ee4c76..000000000000 --- a/binutils/po/fi.gmo +++ /dev/null diff --git a/binutils/po/fr.gmo b/binutils/po/fr.gmo Binary files differdeleted file mode 100644 index 214c0998cf4b..000000000000 --- a/binutils/po/fr.gmo +++ /dev/null diff --git a/binutils/po/ja.gmo b/binutils/po/ja.gmo Binary files differdeleted file mode 100644 index 5152d33babf8..000000000000 --- a/binutils/po/ja.gmo +++ /dev/null diff --git a/binutils/po/ro.gmo b/binutils/po/ro.gmo Binary files differdeleted file mode 100644 index f1c1e0e13add..000000000000 --- a/binutils/po/ro.gmo +++ /dev/null diff --git a/binutils/po/ru.gmo b/binutils/po/ru.gmo Binary files differdeleted file mode 100644 index 88eb5d3023c4..000000000000 --- a/binutils/po/ru.gmo +++ /dev/null diff --git a/binutils/po/rw.gmo b/binutils/po/rw.gmo Binary files differdeleted file mode 100644 index 6d5d7b9ef17e..000000000000 --- a/binutils/po/rw.gmo +++ /dev/null diff --git a/binutils/po/sv.gmo b/binutils/po/sv.gmo Binary files differdeleted file mode 100644 index 16e644399493..000000000000 --- a/binutils/po/sv.gmo +++ /dev/null diff --git a/binutils/po/tr.gmo b/binutils/po/tr.gmo Binary files differdeleted file mode 100644 index 71904464e412..000000000000 --- a/binutils/po/tr.gmo +++ /dev/null diff --git a/binutils/po/vi.gmo b/binutils/po/vi.gmo Binary files differdeleted file mode 100644 index c63cb5d00420..000000000000 --- a/binutils/po/vi.gmo +++ /dev/null diff --git a/binutils/po/zh_CN.gmo b/binutils/po/zh_CN.gmo Binary files differdeleted file mode 100644 index 04e985e361fd..000000000000 --- a/binutils/po/zh_CN.gmo +++ /dev/null diff --git a/binutils/po/zh_TW.gmo b/binutils/po/zh_TW.gmo Binary files differdeleted file mode 100644 index b02a71ee6b1e..000000000000 --- a/binutils/po/zh_TW.gmo +++ /dev/null diff --git a/binutils/prdbg.c b/binutils/prdbg.c index 87a49341b016..529903d790c0 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -1,5 +1,5 @@ /* prdbg.c -- Print out generic debugging information. - Copyright 1995, 1996, 1999, 2002, 2003, 2004 + Copyright 1995, 1996, 1999, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. Tags style generation written by Salvador E. Tropea <set@computer.org>. @@ -24,12 +24,11 @@ /* This file prints out the generic debugging information, by supplying a set of routines to debug_write. */ -#include <stdio.h> +#include "sysdep.h" #include <assert.h> - #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" +#include "demangle.h" #include "debug.h" #include "budbg.h" @@ -53,7 +52,7 @@ struct pr_handle /* The symbols table for this BFD. */ asymbol **syms; /* Pointer to a function to demangle symbols. */ - char *(*demangler) (bfd *, const char *); + char *(*demangler) (bfd *, const char *, int); }; /* The type stack. */ @@ -724,8 +723,8 @@ pr_function_type (void *p, int argcount, bfd_boolean varargs) /* Now the return type is on the top of the stack. */ - s = (char *) xmalloc (len); - strcpy (s, "(|) ("); + s = xmalloc (len); + LITSTRCPY (s, "(|) ("); if (argcount < 0) strcat (s, "/* unknown */"); @@ -910,11 +909,10 @@ pr_method_type (void *p, bfd_boolean domain, int argcount, bfd_boolean varargs) domain_type = pop_type (info); if (domain_type == NULL) return FALSE; - if (strncmp (domain_type, "class ", sizeof "class " - 1) == 0 + if (CONST_STRNEQ (domain_type, "class ") && strchr (domain_type + sizeof "class " - 1, ' ') == NULL) domain_type += sizeof "class " - 1; - else if (strncmp (domain_type, "union class ", - sizeof "union class ") == 0 + else if (CONST_STRNEQ (domain_type, "union class ") && (strchr (domain_type + sizeof "union class " - 1, ' ') == NULL)) domain_type += sizeof "union class " - 1; @@ -1317,7 +1315,7 @@ pr_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean virtual, if (t == NULL) return FALSE; - if (strncmp (t, "class ", sizeof "class " - 1) == 0) + if (CONST_STRNEQ (t, "class ")) t += sizeof "class " - 1; /* Push it back on to take advantage of the prepend_type and @@ -2154,12 +2152,10 @@ tg_class_static_member (void *p, const char *name, len_var = strlen (name); len_class = strlen (info->stack->next->type); - full_name = (char *) xmalloc (len_var + len_class + 3); + full_name = xmalloc (len_var + len_class + 3); if (! full_name) return FALSE; - memcpy (full_name, info->stack->next->type, len_class); - memcpy (full_name + len_class, "::", 2); - memcpy (full_name + len_class + 2, name, len_var + 1); + sprintf (full_name, "%s::%s", info->stack->next->type, name); if (! substitute_type (info, full_name)) return FALSE; @@ -2199,7 +2195,7 @@ tg_class_baseclass (void *p, bfd_vma bitpos ATTRIBUTE_UNUSED, if (t == NULL) return FALSE; - if (strncmp (t, "class ", sizeof "class " - 1) == 0) + if (CONST_STRNEQ (t, "class ")) t += sizeof "class " - 1; /* Push it back on to take advantage of the prepend_type and @@ -2529,25 +2525,18 @@ tg_variable (void *p, const char *name, enum debug_var_kind kind, bfd_vma val ATTRIBUTE_UNUSED) { struct pr_handle *info = (struct pr_handle *) p; - char *t; - const char *dname, *from_class; + char *t, *dname, *from_class; t = pop_type (info); if (t == NULL) return FALSE; - dname = name; + dname = NULL; if (info->demangler) - { - dname = info->demangler (info->abfd, name); - if (strcmp (name, dname) == 0) - { - free ((char *) dname); - dname = name; - } - } + dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS); - if (dname != name) + from_class = NULL; + if (dname != NULL) { char *sep; sep = strstr (dname, "::"); @@ -2558,14 +2547,9 @@ tg_variable (void *p, const char *name, enum debug_var_kind kind, from_class = dname; } else - { - /* Obscure types as vts and type_info nodes. */ - name = dname; - from_class = NULL; - } + /* Obscure types as vts and type_info nodes. */ + name = dname; } - else - from_class = NULL; fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:%s", name, info->filename, t); @@ -2583,10 +2567,10 @@ tg_variable (void *p, const char *name, enum debug_var_kind kind, } if (from_class) - { - fprintf (info->f, "\tclass:%s",from_class); - free ((char *) dname); - } + fprintf (info->f, "\tclass:%s", from_class); + + if (dname) + free (dname); fprintf (info->f, "\n"); @@ -2601,28 +2585,22 @@ static bfd_boolean tg_start_function (void *p, const char *name, bfd_boolean global) { struct pr_handle *info = (struct pr_handle *) p; - const char *dname; + char *dname; if (! global) info->stack->flavor = "static"; else info->stack->flavor = NULL; - dname = name; + dname = NULL; if (info->demangler) - { - dname = info->demangler (info->abfd, name); - if (strcmp (name, dname) == 0) - { - free ((char *) dname); - dname = name; - } - } + dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS); - if (! substitute_type (info, dname)) + if (! substitute_type (info, dname ? dname : name)) return FALSE; - if (dname != name) + info->stack->method = NULL; + if (dname != NULL) { char *sep; sep = strstr (dname, "::"); @@ -2642,8 +2620,6 @@ tg_start_function (void *p, const char *name, bfd_boolean global) *sep = 0; /* Obscure functions as type_info function. */ } - else - info->stack->method = NULL; info->stack->parents = strdup (name); diff --git a/binutils/rclex.c b/binutils/rclex.c index b546335b1abc..ef0961b61ca6 100644 --- a/binutils/rclex.c +++ b/binutils/rclex.c @@ -1,646 +1,9 @@ -/* A lexical scanner generated by flex */ +/* rclex.c -- lexer for Windows rc files parser */ -/* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/rclex.c,v 1.1.16.1 2006/04/16 18:36:40 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include <stdio.h> -#include <errno.h> - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include <stdlib.h> -#ifndef _WIN32 -#include <unistd.h> -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include <io.h> -#include <stdlib.h> -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 86 -#define YY_END_OF_BUFFER 87 -static yyconst short int yy_accept[470] = - { 0, - 0, 0, 87, 85, 84, 83, 85, 78, 80, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 2, 4, 84, - 0, 81, 78, 80, 79, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 81, 0, 82, 11, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - - 82, 82, 82, 82, 82, 3, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 76, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 41, 82, 82, - 82, 53, 42, 82, 82, 82, 82, 82, 82, 82, - 46, 82, 82, 82, 82, 82, 82, 71, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - - 82, 82, 82, 7, 82, 82, 82, 38, 1, 82, - 82, 82, 82, 82, 18, 82, 82, 25, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 70, - 82, 82, 39, 40, 82, 82, 82, 82, 82, 30, - 82, 82, 82, 82, 82, 82, 50, 82, 82, 82, - 82, 82, 34, 82, 82, 9, 82, 82, 19, 82, - 68, 82, 82, 82, 82, 82, 82, 12, 0, 82, - 82, 82, 82, 82, 82, 82, 13, 82, 14, 82, - 82, 82, 82, 65, 82, 82, 82, 52, 82, 72, - 82, 82, 82, 82, 82, 82, 47, 82, 82, 82, - - 82, 82, 82, 82, 82, 82, 58, 82, 82, 36, - 82, 82, 82, 82, 82, 82, 82, 82, 0, 82, - 0, 77, 17, 82, 82, 51, 82, 10, 82, 82, - 82, 82, 16, 82, 82, 82, 82, 82, 82, 82, - 29, 82, 82, 82, 82, 82, 82, 82, 73, 82, - 31, 82, 82, 82, 82, 82, 82, 45, 6, 82, - 82, 82, 82, 77, 82, 23, 24, 82, 15, 82, - 27, 82, 82, 66, 82, 28, 54, 43, 82, 82, - 82, 48, 82, 69, 8, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - - 64, 82, 82, 82, 82, 56, 82, 82, 82, 82, - 35, 49, 82, 82, 82, 82, 20, 82, 82, 82, - 82, 82, 82, 82, 82, 74, 82, 82, 82, 32, - 82, 82, 37, 82, 82, 82, 82, 82, 82, 75, - 82, 67, 61, 82, 82, 82, 33, 59, 60, 5, - 21, 82, 82, 82, 82, 55, 57, 82, 82, 82, - 26, 63, 82, 82, 82, 62, 22, 44, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 5, 6, 1, 1, 1, 1, 1, - 1, 1, 1, 7, 1, 1, 1, 8, 8, 8, - 9, 8, 8, 8, 8, 8, 8, 1, 1, 1, - 1, 1, 1, 1, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 19, 26, 27, 28, 29, 30, 19, 31, 32, 19, - 1, 1, 1, 1, 1, 1, 33, 33, 33, 33, - - 33, 33, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 33, - 19, 19, 34, 1, 35, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[36] = - { 0, - 1, 2, 3, 2, 1, 4, 2, 5, 5, 5, - 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, - 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 5, 1, 1 - } ; - -static yyconst short int yy_base[476] = - { 0, - 0, 0, 517, 518, 34, 518, 511, 0, 494, 25, - 26, 45, 25, 28, 24, 488, 499, 49, 0, 40, - 43, 488, 51, 66, 67, 484, 35, 518, 518, 81, - 505, 84, 0, 488, 518, 0, 496, 479, 494, 477, - 75, 476, 479, 477, 46, 491, 70, 486, 473, 483, - 55, 479, 483, 468, 69, 471, 86, 84, 469, 479, - 466, 480, 466, 461, 477, 472, 75, 455, 81, 459, - 87, 77, 470, 469, 467, 454, 454, 460, 96, 463, - 455, 449, 448, 110, 468, 458, 0, 453, 446, 451, - 450, 445, 454, 437, 438, 451, 435, 450, 432, 428, - - 431, 432, 435, 443, 426, 0, 425, 438, 437, 422, - 417, 419, 429, 421, 422, 426, 414, 430, 425, 412, - 426, 407, 408, 409, 421, 411, 0, 404, 411, 418, - 416, 412, 410, 417, 395, 401, 414, 408, 394, 403, - 399, 393, 389, 390, 388, 394, 396, 105, 385, 389, - 401, 390, 391, 398, 387, 379, 381, 378, 375, 378, - 372, 376, 389, 370, 365, 105, 383, 0, 381, 369, - 365, 0, 0, 364, 365, 362, 360, 377, 363, 358, - 105, 375, 374, 353, 357, 357, 351, 0, 368, 354, - 349, 348, 354, 348, 345, 358, 348, 356, 358, 354, - - 349, 346, 351, 0, 337, 346, 352, 0, 0, 336, - 122, 336, 347, 107, 0, 347, 333, 0, 330, 328, - 338, 327, 338, 330, 329, 322, 319, 315, 332, 0, - 332, 333, 0, 0, 329, 324, 331, 316, 316, 0, - 116, 307, 309, 320, 324, 320, 0, 323, 320, 110, - 320, 320, 0, 308, 318, 0, 318, 310, 0, 296, - 0, 300, 309, 296, 293, 306, 306, 0, 135, 139, - 295, 289, 292, 302, 290, 292, 0, 295, 297, 297, - 278, 294, 297, 0, 295, 280, 278, 0, 279, 0, - 272, 285, 269, 287, 272, 283, 0, 282, 281, 273, - - 267, 279, 263, 259, 261, 259, 0, 276, 258, 0, - 257, 256, 260, 250, 271, 270, 267, 260, 272, 145, - 271, 151, 0, 261, 243, 0, 242, 0, 261, 240, - 260, 241, 0, 252, 239, 252, 238, 233, 249, 248, - 0, 251, 249, 249, 236, 229, 242, 227, 0, 224, - 0, 225, 224, 241, 226, 239, 220, 229, 0, 218, - 217, 224, 219, 237, 215, 0, 0, 211, 0, 228, - 0, 211, 205, 0, 218, 0, 0, 0, 214, 208, - 213, 0, 222, 0, 0, 217, 206, 201, 202, 201, - 215, 201, 201, 199, 208, 210, 209, 201, 190, 196, - - 194, 190, 190, 192, 198, 0, 200, 184, 186, 184, - 0, 0, 186, 183, 190, 178, 0, 179, 173, 174, - 172, 185, 188, 183, 173, 0, 185, 173, 166, 0, - 169, 177, 0, 166, 162, 157, 159, 158, 161, 0, - 157, 0, 0, 162, 167, 158, 0, 0, 0, 0, - 0, 143, 152, 143, 141, 0, 0, 130, 124, 124, - 0, 0, 107, 85, 80, 0, 0, 0, 518, 158, - 163, 65, 168, 173, 178 - } ; - -static yyconst short int yy_def[476] = - { 0, - 469, 1, 469, 469, 469, 469, 470, 471, 472, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 469, 469, 469, - 470, 469, 471, 472, 469, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 469, 470, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 469, 474, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 475, 474, - 475, 474, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 475, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 0, 469, - 469, 469, 469, 469, 469 - } ; - -static yyconst short int yy_nxt[554] = - { 0, - 4, 5, 6, 5, 7, 8, 4, 9, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, - 20, 21, 22, 19, 23, 24, 25, 19, 26, 27, - 19, 19, 19, 28, 29, 30, 37, 30, 50, 41, - 52, 55, 51, 42, 81, 38, 43, 56, 82, 63, - 53, 39, 83, 40, 44, 95, 67, 64, 54, 96, - 59, 45, 60, 65, 103, 46, 68, 66, 47, 34, - 61, 62, 48, 49, 70, 73, 71, 74, 76, 72, - 77, 104, 30, 78, 30, 84, 84, 90, 85, 108, - 91, 98, 99, 75, 79, 111, 113, 123, 126, 109, - - 129, 124, 131, 132, 114, 139, 468, 467, 127, 112, - 130, 84, 84, 205, 85, 241, 206, 273, 242, 225, - 274, 140, 243, 269, 269, 295, 270, 141, 226, 466, - 207, 227, 228, 304, 229, 465, 269, 269, 305, 319, - 321, 296, 321, 322, 36, 321, 321, 464, 321, 322, - 36, 321, 321, 463, 321, 322, 36, 321, 31, 31, - 462, 31, 31, 33, 33, 461, 33, 33, 36, 460, - 459, 36, 36, 320, 320, 458, 320, 320, 321, 321, - 457, 456, 321, 455, 454, 453, 452, 451, 450, 449, - 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, - - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, - 398, 364, 397, 396, 395, 394, 393, 392, 391, 390, - 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, - 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, - 369, 368, 367, 366, 365, 364, 364, 363, 362, 361, - 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, - 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, - - 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, - 330, 329, 328, 327, 326, 325, 324, 323, 318, 317, - 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, - 306, 303, 302, 301, 300, 299, 298, 297, 294, 293, - 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, - 282, 281, 280, 279, 278, 277, 276, 275, 272, 271, - 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, - 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, - 248, 247, 246, 245, 244, 240, 239, 238, 237, 236, - 235, 234, 233, 232, 231, 230, 224, 223, 222, 221, - - 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, - 210, 209, 208, 204, 203, 202, 201, 200, 199, 198, - 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, - 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, - 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, - 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 146, 32, 145, 144, 143, 142, 138, 137, 136, - 135, 134, 133, 128, 125, 122, 121, 120, 119, 118, - 117, 116, 115, 110, 107, 106, 105, 102, 101, 100, - - 97, 94, 93, 92, 89, 88, 87, 86, 35, 32, - 80, 69, 58, 57, 35, 32, 469, 3, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469 - } ; - -static yyconst short int yy_chk[554] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 10, 5, 13, 11, - 14, 15, 13, 11, 27, 10, 11, 15, 27, 20, - 14, 10, 27, 10, 12, 45, 21, 20, 14, 45, - 18, 12, 18, 20, 51, 12, 21, 20, 12, 472, - 18, 18, 12, 12, 23, 24, 23, 24, 25, 23, - 25, 51, 30, 25, 30, 32, 32, 41, 32, 55, - 41, 47, 47, 24, 25, 57, 58, 67, 69, 55, - - 71, 67, 72, 72, 58, 79, 465, 464, 69, 57, - 71, 84, 84, 148, 84, 181, 148, 214, 181, 166, - 214, 79, 181, 211, 211, 241, 211, 79, 166, 463, - 148, 166, 166, 250, 166, 460, 269, 269, 250, 269, - 270, 241, 270, 270, 270, 270, 320, 459, 320, 320, - 320, 320, 322, 458, 322, 322, 322, 322, 470, 470, - 455, 470, 470, 471, 471, 454, 471, 471, 473, 453, - 452, 473, 473, 474, 474, 446, 474, 474, 475, 475, - 445, 444, 475, 441, 439, 438, 437, 436, 435, 434, - 432, 431, 429, 428, 427, 425, 424, 423, 422, 421, - - 420, 419, 418, 416, 415, 414, 413, 410, 409, 408, - 407, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, - 386, 383, 381, 380, 379, 375, 373, 372, 370, 368, - 365, 364, 363, 362, 361, 360, 358, 357, 356, 355, - 354, 353, 352, 350, 348, 347, 346, 345, 344, 343, - 342, 340, 339, 338, 337, 336, 335, 334, 332, 331, - 330, 329, 327, 325, 324, 321, 319, 318, 317, 316, - 315, 314, 313, 312, 311, 309, 308, 306, 305, 304, - 303, 302, 301, 300, 299, 298, 296, 295, 294, 293, - - 292, 291, 289, 287, 286, 285, 283, 282, 281, 280, - 279, 278, 276, 275, 274, 273, 272, 271, 267, 266, - 265, 264, 263, 262, 260, 258, 257, 255, 254, 252, - 251, 249, 248, 246, 245, 244, 243, 242, 239, 238, - 237, 236, 235, 232, 231, 229, 228, 227, 226, 225, - 224, 223, 222, 221, 220, 219, 217, 216, 213, 212, - 210, 207, 206, 205, 203, 202, 201, 200, 199, 198, - 197, 196, 195, 194, 193, 192, 191, 190, 189, 187, - 186, 185, 184, 183, 182, 180, 179, 178, 177, 176, - 175, 174, 171, 170, 169, 167, 165, 164, 163, 162, - - 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, - 151, 150, 149, 147, 146, 145, 144, 143, 142, 141, - 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, - 130, 129, 128, 126, 125, 124, 123, 122, 121, 120, - 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, - 109, 108, 107, 105, 104, 103, 102, 101, 100, 99, - 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, - 88, 86, 85, 83, 82, 81, 80, 78, 77, 76, - 75, 74, 73, 70, 68, 66, 65, 64, 63, 62, - 61, 60, 59, 56, 54, 53, 52, 50, 49, 48, - - 46, 44, 43, 42, 40, 39, 38, 37, 34, 31, - 26, 22, 17, 16, 9, 7, 3, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "rclex.l" -#define INITIAL 0 -#line 2 "rclex.l" -/* Copyright 1997, 1998, 1999, 2001, 2002, 2003, 2005 +/* Copyright 1997, 1998, 1999, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Support. + + Written by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -659,10 +22,10 @@ char *yytext; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -/* This is a lex input file which generates a lexer used by the - Windows rc file parser. It basically just recognized a bunch of - keywords. */ +/* This is a lexer used by the Windows rc file parser. It basically + just recognized a bunch of keywords. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -672,8 +35,6 @@ char *yytext; #include <assert.h> -#define YY_NO_UNPUT - /* Whether we are in rcdata mode, in which we returns the lengths of strings. */ @@ -689,7 +50,7 @@ static int rcdata_mode; static int suppress_cpp_data; -#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x) +#define IGNORE_CPP(x) (suppress_cpp_data ? IGNORED_TOKEN : (x)) /* The first filename we detect in the cpp output. We use this to tell included files from the original file. */ @@ -706,1668 +67,139 @@ struct alloc_string static struct alloc_string *strings; -/* Local functions. */ - -static void cpp_line (const char *); -static char *handle_quotes (const char *, unsigned long *); -static char *get_string (int); - -#line 716 "rclex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 78 "rclex.l" - - -#line 881 "rclex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 470 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 518 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 80 "rclex.l" -{ MAYBE_RETURN (BEG); } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 81 "rclex.l" -{ MAYBE_RETURN (BEG); } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 82 "rclex.l" -{ MAYBE_RETURN (END); } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 83 "rclex.l" -{ MAYBE_RETURN (END); } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 84 "rclex.l" -{ MAYBE_RETURN (ACCELERATORS); } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 85 "rclex.l" -{ MAYBE_RETURN (VIRTKEY); } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 86 "rclex.l" -{ MAYBE_RETURN (ASCII); } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 87 "rclex.l" -{ MAYBE_RETURN (NOINVERT); } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 88 "rclex.l" -{ MAYBE_RETURN (SHIFT); } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 89 "rclex.l" -{ MAYBE_RETURN (CONTROL); } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 90 "rclex.l" -{ MAYBE_RETURN (ALT); } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 91 "rclex.l" -{ MAYBE_RETURN (BITMAP); } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 92 "rclex.l" -{ MAYBE_RETURN (CURSOR); } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 93 "rclex.l" -{ MAYBE_RETURN (DIALOG); } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 94 "rclex.l" -{ MAYBE_RETURN (DIALOGEX); } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 95 "rclex.l" -{ MAYBE_RETURN (EXSTYLE); } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 96 "rclex.l" -{ MAYBE_RETURN (CAPTION); } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 97 "rclex.l" -{ MAYBE_RETURN (CLASS); } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 98 "rclex.l" -{ MAYBE_RETURN (STYLE); } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 99 "rclex.l" -{ MAYBE_RETURN (AUTO3STATE); } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 100 "rclex.l" -{ MAYBE_RETURN (AUTOCHECKBOX); } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 101 "rclex.l" -{ MAYBE_RETURN (AUTORADIOBUTTON); } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 102 "rclex.l" -{ MAYBE_RETURN (CHECKBOX); } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 103 "rclex.l" -{ MAYBE_RETURN (COMBOBOX); } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 104 "rclex.l" -{ MAYBE_RETURN (CTEXT); } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 105 "rclex.l" -{ MAYBE_RETURN (DEFPUSHBUTTON); } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 106 "rclex.l" -{ MAYBE_RETURN (EDITTEXT); } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 107 "rclex.l" -{ MAYBE_RETURN (GROUPBOX); } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 108 "rclex.l" -{ MAYBE_RETURN (LISTBOX); } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 109 "rclex.l" -{ MAYBE_RETURN (LTEXT); } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 110 "rclex.l" -{ MAYBE_RETURN (PUSHBOX); } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 111 "rclex.l" -{ MAYBE_RETURN (PUSHBUTTON); } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 112 "rclex.l" -{ MAYBE_RETURN (RADIOBUTTON); } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 113 "rclex.l" -{ MAYBE_RETURN (RTEXT); } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 114 "rclex.l" -{ MAYBE_RETURN (SCROLLBAR); } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 115 "rclex.l" -{ MAYBE_RETURN (STATE3); } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 116 "rclex.l" -{ MAYBE_RETURN (USERBUTTON); } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 117 "rclex.l" -{ MAYBE_RETURN (BEDIT); } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 118 "rclex.l" -{ MAYBE_RETURN (HEDIT); } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 119 "rclex.l" -{ MAYBE_RETURN (IEDIT); } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 120 "rclex.l" -{ MAYBE_RETURN (FONT); } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 121 "rclex.l" -{ MAYBE_RETURN (ICON); } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 122 "rclex.l" -{ MAYBE_RETURN (LANGUAGE); } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 123 "rclex.l" -{ MAYBE_RETURN (CHARACTERISTICS); } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 124 "rclex.l" -{ MAYBE_RETURN (VERSIONK); } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 125 "rclex.l" -{ MAYBE_RETURN (MENU); } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 126 "rclex.l" -{ MAYBE_RETURN (MENUEX); } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 127 "rclex.l" -{ MAYBE_RETURN (MENUITEM); } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 128 "rclex.l" -{ MAYBE_RETURN (SEPARATOR); } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 129 "rclex.l" -{ MAYBE_RETURN (POPUP); } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 130 "rclex.l" -{ MAYBE_RETURN (CHECKED); } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 131 "rclex.l" -{ MAYBE_RETURN (GRAYED); } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 132 "rclex.l" -{ MAYBE_RETURN (HELP); } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 133 "rclex.l" -{ MAYBE_RETURN (INACTIVE); } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 134 "rclex.l" -{ MAYBE_RETURN (MENUBARBREAK); } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 135 "rclex.l" -{ MAYBE_RETURN (MENUBREAK); } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 136 "rclex.l" -{ MAYBE_RETURN (MESSAGETABLE); } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 137 "rclex.l" -{ MAYBE_RETURN (RCDATA); } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 138 "rclex.l" -{ MAYBE_RETURN (STRINGTABLE); } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 139 "rclex.l" -{ MAYBE_RETURN (VERSIONINFO); } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 140 "rclex.l" -{ MAYBE_RETURN (FILEVERSION); } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 141 "rclex.l" -{ MAYBE_RETURN (PRODUCTVERSION); } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 142 "rclex.l" -{ MAYBE_RETURN (FILEFLAGSMASK); } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 143 "rclex.l" -{ MAYBE_RETURN (FILEFLAGS); } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 144 "rclex.l" -{ MAYBE_RETURN (FILEOS); } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 145 "rclex.l" -{ MAYBE_RETURN (FILETYPE); } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 146 "rclex.l" -{ MAYBE_RETURN (FILESUBTYPE); } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 147 "rclex.l" -{ MAYBE_RETURN (VALUE); } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 148 "rclex.l" -{ MAYBE_RETURN (MOVEABLE); } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 149 "rclex.l" -{ MAYBE_RETURN (FIXED); } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 150 "rclex.l" -{ MAYBE_RETURN (PURE); } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 151 "rclex.l" -{ MAYBE_RETURN (IMPURE); } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 152 "rclex.l" -{ MAYBE_RETURN (PRELOAD); } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 153 "rclex.l" -{ MAYBE_RETURN (LOADONCALL); } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 154 "rclex.l" -{ MAYBE_RETURN (DISCARDABLE); } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 155 "rclex.l" -{ MAYBE_RETURN (NOT); } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 157 "rclex.l" -{ - char *s, *send; - - /* This is a hack to let us parse version - information easily. */ - - s = strchr (yytext, '"'); - ++s; - send = strchr (s, '"'); - if (strncmp (s, "StringFileInfo", - sizeof "StringFileInfo" - 1) == 0 - && s + sizeof "StringFileInfo" - 1 == send) - MAYBE_RETURN (BLOCKSTRINGFILEINFO); - else if (strncmp (s, "VarFileInfo", - sizeof "VarFileInfo" - 1) == 0 - && s + sizeof "VarFileInfo" - 1 == send) - MAYBE_RETURN (BLOCKVARFILEINFO); - else - { - char *r; - - r = get_string (send - s + 1); - strncpy (r, s, send - s); - r[send - s] = '\0'; - yylval.s = r; - MAYBE_RETURN (BLOCK); - } - } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 186 "rclex.l" +struct rclex_keywords { - cpp_line (yytext); - } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 190 "rclex.l" -{ - yylval.i.val = strtoul (yytext, 0, 0); - yylval.i.dword = 1; - MAYBE_RETURN (NUMBER); - } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 196 "rclex.l" -{ - yylval.i.val = strtoul (yytext, 0, 0); - yylval.i.dword = 0; - MAYBE_RETURN (NUMBER); - } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 202 "rclex.l" -{ - char *s; - unsigned long length; - - s = handle_quotes (yytext, &length); - if (! rcdata_mode) - { - yylval.s = s; - MAYBE_RETURN (QUOTEDSTRING); - } - else - { - yylval.ss.length = length; - yylval.ss.s = s; - MAYBE_RETURN (SIZEDSTRING); - } - } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 220 "rclex.l" -{ - char *s; - - /* I rejected comma in a string in order to - handle VIRTKEY, CONTROL in an accelerator - resource. This means that an unquoted - file name can not contain a comma. I - don't know what rc permits. */ - - s = get_string (strlen (yytext) + 1); - strcpy (s, yytext); - yylval.s = s; - MAYBE_RETURN (STRING); - } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 235 "rclex.l" -{ ++rc_lineno; } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 236 "rclex.l" -{ /* ignore whitespace */ } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 237 "rclex.l" -{ MAYBE_RETURN (*yytext); } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 239 "rclex.l" -ECHO; - YY_BREAK -#line 1460 "rclex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 470 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 470 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 469); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include <unistd.h> -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - + const char *name; + int tok; +}; -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } +#define K(KEY) { #KEY, KEY } +#define KRT(KEY) { #KEY, RT_##KEY } -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } +static const struct rclex_keywords keywds[] = +{ + K(ACCELERATORS), K(ALT), K(ANICURSOR), K(ANIICON), K(ASCII), + K(AUTO3STATE), K(AUTOCHECKBOX), K(AUTORADIOBUTTON), + K(BEDIT), { "BEGIN", BEG }, K(BITMAP), K(BLOCK), K(BUTTON), + K(CAPTION), K(CHARACTERISTICS), K(CHECKBOX), K(CHECKED), + K(CLASS), K(COMBOBOX), K(CONTROL), K(CTEXT), K(CURSOR), + K(DEFPUSHBUTTON), K(DIALOG), K(DIALOGEX), K(DISCARDABLE), + K(DLGINCLUDE), K(DLGINIT), + K(EDITTEXT), K(END), K(EXSTYLE), + K(FILEFLAGS), K(FILEFLAGSMASK), K(FILEOS), K(FILESUBTYPE), + K(FILETYPE), K(FILEVERSION), K(FIXED), K(FONT), K(FONTDIR), + K(GRAYED), KRT(GROUP_CURSOR), KRT(GROUP_ICON), K(GROUPBOX), + K(HEDIT), K(HELP), K(HTML), + K(ICON), K(IEDIT), K(IMPURE), K(INACTIVE), + K(LANGUAGE), K(LISTBOX), K(LOADONCALL), K(LTEXT), + K(MANIFEST), K(MENU), K(MENUBARBREAK), K(MENUBREAK), + K(MENUEX), K(MENUITEM), K(MESSAGETABLE), K(MOVEABLE), + K(NOINVERT), K(NOT), + K(PLUGPLAY), K(POPUP), K(PRELOAD), K(PRODUCTVERSION), + K(PURE), K(PUSHBOX), K(PUSHBUTTON), + K(RADIOBUTTON), K(RCDATA), K(RTEXT), + K(SCROLLBAR), K(SEPARATOR), K(SHIFT), K(STATE3), + K(STRINGTABLE), K(STYLE), + K(TOOLBAR), + K(USERBUTTON), + K(VALUE), { "VERSION", VERSIONK }, K(VERSIONINFO), + K(VIRTKEY), K(VXD), + { NULL, 0 }, +}; -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } +/* External input stream from resrc */ +extern FILE *cpp_pipe; -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 239 "rclex.l" +/* Lexical scanner helpers. */ +static int rclex_lastch = -1; +static size_t rclex_tok_max = 0; +static size_t rclex_tok_pos = 0; +static char *rclex_tok = NULL; -#ifndef yywrap -/* This is needed for some versions of lex. */ -int yywrap (void) +static int +rclex_translatekeyword (const char *key) { - return 1; + if (key && ISUPPER (key[0])) + { + const struct rclex_keywords *kw = &keywds[0]; + + do + { + if (! strcmp (kw->name, key)) + return kw->tok; + ++kw; + } + while (kw->name != NULL); + } + return STRING; } -#endif /* Handle a C preprocessor line. */ static void -cpp_line (const char *s) +cpp_line (void) { + const char *s = rclex_tok; int line; char *send, *fn; + size_t len, mlen; ++s; while (ISSPACE (*s)) ++s; + /* Check for #pragma code_page ( DEFAULT | <nr>). */ + len = strlen (s); + mlen = strlen ("pragma"); + if (len > mlen && memcmp (s, "pragma", mlen) == 0 && ISSPACE (s[mlen])) + { + const char *end; + + s += mlen + 1; + while (ISSPACE (*s)) + ++s; + len = strlen (s); + mlen = strlen ("code_page"); + if (len <= mlen || memcmp (s, "code_page", mlen) != 0) + /* FIXME: We ought to issue a warning message about an unrecognised pragma. */ + return; + s += mlen; + while (ISSPACE (*s)) + ++s; + if (*s != '(') + /* FIXME: We ought to issue an error message about a malformed pragma. */ + return; + ++s; + while (ISSPACE (*s)) + ++s; + if (*s == 0 || (end = strchr (s, ')')) == NULL) + /* FIXME: We ought to issue an error message about a malformed pragma. */ + return; + len = (size_t) (end - s); + fn = xmalloc (len + 1); + if (len) + memcpy (fn, s, len); + fn[len] = 0; + while (len > 0 && (fn[len - 1] > 0 && fn[len - 1] <= 0x20)) + fn[--len] = 0; + if (! len || (len == strlen ("DEFAULT") && strcasecmp (fn, "DEFAULT") == 0)) + wind_current_codepage = wind_default_codepage; + else if (len > 0) + { + rc_uint_type ncp; + + if (fn[0] == '0' && (fn[1] == 'x' || fn[1] == 'X')) + ncp = (rc_uint_type) strtol (fn + 2, NULL, 16); + else + ncp = (rc_uint_type) strtol (fn, NULL, 10); + if (ncp == CP_UTF16 || ! unicode_is_valid_codepage (ncp)) + fatal (_("invalid value specified for pragma code_page.\n")); + wind_current_codepage = ncp; + } + free (fn); + return; + } + line = strtol (s, &send, 0); if (*send != '\0' && ! ISSPACE (*send)) return; @@ -2387,14 +219,14 @@ cpp_line (const char *s) if (send == NULL) return; - fn = (char *) xmalloc (send - s + 1); + fn = xmalloc (send - s + 1); strncpy (fn, s, send - s); fn[send - s] = '\0'; free (rc_filename); rc_filename = fn; - if (!initial_fn) + if (! initial_fn) { initial_fn = xmalloc (strlen (fn) + 1); strcpy (initial_fn, fn); @@ -2409,13 +241,30 @@ cpp_line (const char *s) suppress_cpp_data = 1; } +/* Allocate a string of a given length. */ + +static char * +get_string (int len) +{ + struct alloc_string *as; + + as = xmalloc (sizeof *as); + as->s = xmalloc (len); + + as->next = strings; + strings = as; + + return as->s; +} + /* Handle a quoted string. The quotes are stripped. A pair of quotes in a string are turned into a single quote. Adjacent strings are merged separated by whitespace are merged, as in C. */ static char * -handle_quotes (const char *input, unsigned long *len) +handle_quotes (rc_uint_type *len) { + const char *input = rclex_tok; char *ret, *s; const char *t; int ch; @@ -2440,6 +289,8 @@ handle_quotes (const char *input, unsigned long *len) case '\"': rcparse_warning ("use \"\" to put \" in a string"); + *s++ = '"'; + ++t; break; case 'a': @@ -2498,7 +349,7 @@ handle_quotes (const char *input, unsigned long *len) *s++ = ch; break; - case 'x': + case 'x': case 'X': ++t; ch = 0; /* We only handle single byte chars here. Make sure @@ -2538,6 +389,7 @@ handle_quotes (const char *input, unsigned long *len) } else { + rcparse_warning ("unexpected character after '\"'"); ++t; assert (ISSPACE (*t)); while (ISSPACE (*t)) @@ -2560,20 +412,166 @@ handle_quotes (const char *input, unsigned long *len) return ret; } -/* Allocate a string of a given length. */ +/* Allocate a unicode string of a given length. */ -static char * -get_string (int len) +static unichar * +get_unistring (int len) { - struct alloc_string *as; + return (unichar *) get_string (len * sizeof (unichar)); +} - as = (struct alloc_string *) xmalloc (sizeof *as); - as->s = xmalloc (len); +/* Handle a quoted unicode string. The quotes are stripped. A pair of quotes + in a string are turned into a single quote. Adjacent strings are + merged separated by whitespace are merged, as in C. */ - as->next = strings; - strings = as; +static unichar * +handle_uniquotes (rc_uint_type *len) +{ + const char *input = rclex_tok; + unichar *ret, *s; + const char *t; + int ch; + int num_xdigits; - return as->s; + ret = get_unistring (strlen (input) + 1); + + s = ret; + t = input; + if ((*t == 'L' || *t == 'l') && t[1] == '"') + t += 2; + else if (*t == '"') + ++t; + while (*t != '\0') + { + if (*t == '\\') + { + ++t; + switch (*t) + { + case '\0': + rcparse_warning ("backslash at end of string"); + break; + + case '\"': + rcparse_warning ("use \"\" to put \" in a string"); + break; + + case 'a': + *s++ = ESCAPE_B; /* Strange, but true... */ + ++t; + break; + + case 'b': + *s++ = ESCAPE_B; + ++t; + break; + + case 'f': + *s++ = ESCAPE_F; + ++t; + break; + + case 'n': + *s++ = ESCAPE_N; + ++t; + break; + + case 'r': + *s++ = ESCAPE_R; + ++t; + break; + + case 't': + *s++ = ESCAPE_T; + ++t; + break; + + case 'v': + *s++ = ESCAPE_V; + ++t; + break; + + case '\\': + *s++ = (unichar) *t++; + break; + + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + ch = *t - '0'; + ++t; + if (*t >= '0' && *t <= '7') + { + ch = (ch << 3) | (*t - '0'); + ++t; + if (*t >= '0' && *t <= '7') + { + ch = (ch << 3) | (*t - '0'); + ++t; + } + } + *s++ = (unichar) ch; + break; + + case 'x': case 'X': + ++t; + ch = 0; + /* We only handle two byte chars here. Make sure + we finish an escape sequence like "/xB0ABC" after + the first two digits. */ + num_xdigits = 4; + while (num_xdigits--) + { + if (*t >= '0' && *t <= '9') + ch = (ch << 4) | (*t - '0'); + else if (*t >= 'a' && *t <= 'f') + ch = (ch << 4) | (*t - 'a' + 10); + else if (*t >= 'A' && *t <= 'F') + ch = (ch << 4) | (*t - 'A' + 10); + else + break; + ++t; + } + *s++ = (unichar) ch; + break; + + default: + rcparse_warning ("unrecognized escape sequence"); + *s++ = '\\'; + *s++ = (unichar) *t++; + break; + } + } + else if (*t != '"') + *s++ = (unichar) *t++; + else if (t[1] == '\0') + break; + else if (t[1] == '"') + { + *s++ = '"'; + t += 2; + } + else + { + ++t; + assert (ISSPACE (*t)); + while (ISSPACE (*t)) + { + if ((*t) == '\n') + ++rc_lineno; + ++t; + } + if (*t == '\0') + break; + assert (*t == '"'); + ++t; + } + } + + *s = '\0'; + + *len = s - ret; + + return ret; } /* Discard all the strings we have allocated. The parser calls this @@ -2599,7 +597,6 @@ rcparse_discard_strings (void) } /* Enter rcdata mode. */ - void rcparse_rcdata (void) { @@ -2607,9 +604,285 @@ rcparse_rcdata (void) } /* Go back to normal mode from rcdata mode. */ - void rcparse_normal (void) { rcdata_mode = 0; } + +static void +rclex_tok_add_char (int ch) +{ + if (! rclex_tok || rclex_tok_max <= rclex_tok_pos) + { + char *h = xmalloc (rclex_tok_max + 9); + + if (! h) + abort (); + if (rclex_tok) + { + memcpy (h, rclex_tok, rclex_tok_pos + 1); + free (rclex_tok); + } + else + rclex_tok_pos = 0; + rclex_tok_max += 8; + rclex_tok = h; + } + if (ch != -1) + rclex_tok[rclex_tok_pos++] = (char) ch; + rclex_tok[rclex_tok_pos] = 0; +} + +static int +rclex_readch (void) +{ + int r = -1; + + if ((r = rclex_lastch) != -1) + rclex_lastch = -1; + else + { + char ch; + do + { + if (! cpp_pipe || feof (cpp_pipe) + || fread (&ch, 1, 1,cpp_pipe) != 1) + break; + r = ((int) ch) & 0xff; + } + while (r == 0 || r == '\r'); + } + rclex_tok_add_char (r); + return r; +} + +static int +rclex_peekch (void) +{ + int r; + + if ((r = rclex_lastch) == -1) + { + if ((r = rclex_readch ()) != -1) + { + rclex_lastch = r; + if (rclex_tok_pos > 0) + rclex_tok[--rclex_tok_pos] = 0; + } + } + return r; +} + +static void +rclex_string (void) +{ + int c; + + while ((c = rclex_peekch ()) != -1) + { + if (c == '\n') + break; + if (c == '\\') + { + rclex_readch (); + if ((c = rclex_peekch ()) == -1 || c == '\n') + break; + rclex_readch (); + } + else if (rclex_readch () == '"') + { + if (rclex_peekch () == '"') + rclex_readch (); + else + break; + } + } +} + +static rc_uint_type +read_digit (int ch) +{ + rc_uint_type base = 10; + rc_uint_type ret, val; + int warned = 0; + + ret = 0; + if (ch == '0') + { + base = 8; + switch (rclex_peekch ()) + { + case 'o': case 'O': + rclex_readch (); + base = 8; + break; + + case 'x': case 'X': + rclex_readch (); + base = 16; + break; + } + } + else + ret = (rc_uint_type) (ch - '0'); + while ((ch = rclex_peekch ()) != -1) + { + if (ISDIGIT (ch)) + val = (rc_uint_type) (ch - '0'); + else if (ch >= 'a' && ch <= 'f') + val = (rc_uint_type) ((ch - 'a') + 10); + else if (ch >= 'A' && ch <= 'F') + val = (rc_uint_type) ((ch - 'A') + 10); + else + break; + rclex_readch (); + if (! warned && val >= base) + { + warned = 1; + rcparse_warning ("digit exceeds base"); + } + ret *= base; + ret += val; + } + return ret; +} + +/* yyparser entry method. */ + +int +yylex (void) +{ + char *s; + unichar *us; + rc_uint_type length; + int ch; + + /* Make sure that rclex_tok is initialized. */ + if (! rclex_tok) + rclex_tok_add_char (-1); + + do + { + do + { + /* Clear token. */ + rclex_tok_pos = 0; + rclex_tok[0] = 0; + + if ((ch = rclex_readch ()) == -1) + return -1; + if (ch == '\n') + ++rc_lineno; + } + while (ch <= 0x20); + + switch (ch) + { + case '#': + while ((ch = rclex_peekch ()) != -1 && ch != '\n') + rclex_readch (); + cpp_line (); + ch = IGNORED_TOKEN; + break; + + case '{': + ch = IGNORE_CPP (BEG); + break; + + case '}': + ch = IGNORE_CPP (END); + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + yylval.i.val = read_digit (ch); + yylval.i.dword = 0; + switch (rclex_peekch ()) + { + case 'l': case 'L': + rclex_readch (); + yylval.i.dword = 1; + break; + } + ch = IGNORE_CPP (NUMBER); + break; + case '"': + rclex_string (); + ch = IGNORE_CPP ((! rcdata_mode ? QUOTEDSTRING : SIZEDSTRING)); + if (ch == IGNORED_TOKEN) + break; + s = handle_quotes (&length); + if (! rcdata_mode) + yylval.s = s; + else + { + yylval.ss.length = length; + yylval.ss.s = s; + } + break; + case 'L': case 'l': + if (rclex_peekch () == '"') + { + rclex_readch (); + rclex_string (); + ch = IGNORE_CPP ((! rcdata_mode ? QUOTEDUNISTRING : SIZEDUNISTRING)); + if (ch == IGNORED_TOKEN) + break; + us = handle_uniquotes (&length); + if (! rcdata_mode) + yylval.uni = us; + else + { + yylval.suni.length = length; + yylval.suni.s = us; + } + break; + } + /* Fall through. */ + default: + if (ISIDST (ch) || ch=='$') + { + while ((ch = rclex_peekch ()) != -1 && (ISIDNUM (ch) || ch == '$' || ch == '.')) + rclex_readch (); + ch = IGNORE_CPP (rclex_translatekeyword (rclex_tok)); + if (ch == STRING) + { + s = get_string (strlen (rclex_tok) + 1); + strcpy (s, rclex_tok); + yylval.s = s; + } + else if (ch == BLOCK) + { + const char *hs = NULL; + + switch (yylex ()) + { + case STRING: + case QUOTEDSTRING: + hs = yylval.s; + break; + case SIZEDSTRING: + hs = yylval.s = yylval.ss.s; + break; + } + if (! hs) + { + rcparse_warning ("BLOCK expects a string as argument."); + ch = IGNORED_TOKEN; + } + else if (! strcmp (hs, "StringFileInfo")) + ch = BLOCKSTRINGFILEINFO; + else if (! strcmp (hs, "VarFileInfo")) + ch = BLOCKVARFILEINFO; + } + break; + } + ch = IGNORE_CPP (ch); + break; + } + } + while (ch == IGNORED_TOKEN); + + return ch; +} diff --git a/binutils/rclex.l b/binutils/rclex.l deleted file mode 100644 index 92b1ec738526..000000000000 --- a/binutils/rclex.l +++ /dev/null @@ -1,504 +0,0 @@ -%{ /* rclex.l -- lexer for Windows rc files parser */ -/* Copyright 1997, 1998, 1999, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Support. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* This is a lex input file which generates a lexer used by the - Windows rc file parser. It basically just recognized a bunch of - keywords. */ - -#include "bfd.h" -#include "bucomm.h" -#include "libiberty.h" -#include "safe-ctype.h" -#include "windres.h" -#include "rcparse.h" - -#include <assert.h> - -#define YY_NO_UNPUT - -/* Whether we are in rcdata mode, in which we returns the lengths of - strings. */ - -static int rcdata_mode; - -/* Whether we are supressing lines from cpp (including windows.h or - headers from your C sources may bring in externs and typedefs). - When active, we return IGNORED_TOKEN, which lets us ignore these - outside of resource constructs. Thus, it isn't required to protect - all the non-preprocessor lines in your header files with #ifdef - RC_INVOKED. It also means your RC file can't include other RC - files if they're named "*.h". Sorry. Name them *.rch or whatever. */ - -static int suppress_cpp_data; - -#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x) - -/* The first filename we detect in the cpp output. We use this to - tell included files from the original file. */ - -static char *initial_fn; - -/* List of allocated strings. */ - -struct alloc_string -{ - struct alloc_string *next; - char *s; -}; - -static struct alloc_string *strings; - -/* Local functions. */ - -static void cpp_line (const char *); -static char *handle_quotes (const char *, unsigned long *); -static char *get_string (int); - -%} - -%% - -"BEGIN" { MAYBE_RETURN (BEG); } -"{" { MAYBE_RETURN (BEG); } -"END" { MAYBE_RETURN (END); } -"}" { MAYBE_RETURN (END); } -"ACCELERATORS" { MAYBE_RETURN (ACCELERATORS); } -"VIRTKEY" { MAYBE_RETURN (VIRTKEY); } -"ASCII" { MAYBE_RETURN (ASCII); } -"NOINVERT" { MAYBE_RETURN (NOINVERT); } -"SHIFT" { MAYBE_RETURN (SHIFT); } -"CONTROL" { MAYBE_RETURN (CONTROL); } -"ALT" { MAYBE_RETURN (ALT); } -"BITMAP" { MAYBE_RETURN (BITMAP); } -"CURSOR" { MAYBE_RETURN (CURSOR); } -"DIALOG" { MAYBE_RETURN (DIALOG); } -"DIALOGEX" { MAYBE_RETURN (DIALOGEX); } -"EXSTYLE" { MAYBE_RETURN (EXSTYLE); } -"CAPTION" { MAYBE_RETURN (CAPTION); } -"CLASS" { MAYBE_RETURN (CLASS); } -"STYLE" { MAYBE_RETURN (STYLE); } -"AUTO3STATE" { MAYBE_RETURN (AUTO3STATE); } -"AUTOCHECKBOX" { MAYBE_RETURN (AUTOCHECKBOX); } -"AUTORADIOBUTTON" { MAYBE_RETURN (AUTORADIOBUTTON); } -"CHECKBOX" { MAYBE_RETURN (CHECKBOX); } -"COMBOBOX" { MAYBE_RETURN (COMBOBOX); } -"CTEXT" { MAYBE_RETURN (CTEXT); } -"DEFPUSHBUTTON" { MAYBE_RETURN (DEFPUSHBUTTON); } -"EDITTEXT" { MAYBE_RETURN (EDITTEXT); } -"GROUPBOX" { MAYBE_RETURN (GROUPBOX); } -"LISTBOX" { MAYBE_RETURN (LISTBOX); } -"LTEXT" { MAYBE_RETURN (LTEXT); } -"PUSHBOX" { MAYBE_RETURN (PUSHBOX); } -"PUSHBUTTON" { MAYBE_RETURN (PUSHBUTTON); } -"RADIOBUTTON" { MAYBE_RETURN (RADIOBUTTON); } -"RTEXT" { MAYBE_RETURN (RTEXT); } -"SCROLLBAR" { MAYBE_RETURN (SCROLLBAR); } -"STATE3" { MAYBE_RETURN (STATE3); } -"USERBUTTON" { MAYBE_RETURN (USERBUTTON); } -"BEDIT" { MAYBE_RETURN (BEDIT); } -"HEDIT" { MAYBE_RETURN (HEDIT); } -"IEDIT" { MAYBE_RETURN (IEDIT); } -"FONT" { MAYBE_RETURN (FONT); } -"ICON" { MAYBE_RETURN (ICON); } -"LANGUAGE" { MAYBE_RETURN (LANGUAGE); } -"CHARACTERISTICS" { MAYBE_RETURN (CHARACTERISTICS); } -"VERSION" { MAYBE_RETURN (VERSIONK); } -"MENU" { MAYBE_RETURN (MENU); } -"MENUEX" { MAYBE_RETURN (MENUEX); } -"MENUITEM" { MAYBE_RETURN (MENUITEM); } -"SEPARATOR" { MAYBE_RETURN (SEPARATOR); } -"POPUP" { MAYBE_RETURN (POPUP); } -"CHECKED" { MAYBE_RETURN (CHECKED); } -"GRAYED" { MAYBE_RETURN (GRAYED); } -"HELP" { MAYBE_RETURN (HELP); } -"INACTIVE" { MAYBE_RETURN (INACTIVE); } -"MENUBARBREAK" { MAYBE_RETURN (MENUBARBREAK); } -"MENUBREAK" { MAYBE_RETURN (MENUBREAK); } -"MESSAGETABLE" { MAYBE_RETURN (MESSAGETABLE); } -"RCDATA" { MAYBE_RETURN (RCDATA); } -"STRINGTABLE" { MAYBE_RETURN (STRINGTABLE); } -"VERSIONINFO" { MAYBE_RETURN (VERSIONINFO); } -"FILEVERSION" { MAYBE_RETURN (FILEVERSION); } -"PRODUCTVERSION" { MAYBE_RETURN (PRODUCTVERSION); } -"FILEFLAGSMASK" { MAYBE_RETURN (FILEFLAGSMASK); } -"FILEFLAGS" { MAYBE_RETURN (FILEFLAGS); } -"FILEOS" { MAYBE_RETURN (FILEOS); } -"FILETYPE" { MAYBE_RETURN (FILETYPE); } -"FILESUBTYPE" { MAYBE_RETURN (FILESUBTYPE); } -"VALUE" { MAYBE_RETURN (VALUE); } -"MOVEABLE" { MAYBE_RETURN (MOVEABLE); } -"FIXED" { MAYBE_RETURN (FIXED); } -"PURE" { MAYBE_RETURN (PURE); } -"IMPURE" { MAYBE_RETURN (IMPURE); } -"PRELOAD" { MAYBE_RETURN (PRELOAD); } -"LOADONCALL" { MAYBE_RETURN (LOADONCALL); } -"DISCARDABLE" { MAYBE_RETURN (DISCARDABLE); } -"NOT" { MAYBE_RETURN (NOT); } - -"BLOCK"[ \t\n]*"\""[^\#\n]*"\"" { - char *s, *send; - - /* This is a hack to let us parse version - information easily. */ - - s = strchr (yytext, '"'); - ++s; - send = strchr (s, '"'); - if (strncmp (s, "StringFileInfo", - sizeof "StringFileInfo" - 1) == 0 - && s + sizeof "StringFileInfo" - 1 == send) - MAYBE_RETURN (BLOCKSTRINGFILEINFO); - else if (strncmp (s, "VarFileInfo", - sizeof "VarFileInfo" - 1) == 0 - && s + sizeof "VarFileInfo" - 1 == send) - MAYBE_RETURN (BLOCKVARFILEINFO); - else - { - char *r; - - r = get_string (send - s + 1); - strncpy (r, s, send - s); - r[send - s] = '\0'; - yylval.s = r; - MAYBE_RETURN (BLOCK); - } - } - -"#"[^\n]* { - cpp_line (yytext); - } - -[0-9][x0-9A-Fa-f]*L { - yylval.i.val = strtoul (yytext, 0, 0); - yylval.i.dword = 1; - MAYBE_RETURN (NUMBER); - } - -[0-9][x0-9A-Fa-f]* { - yylval.i.val = strtoul (yytext, 0, 0); - yylval.i.dword = 0; - MAYBE_RETURN (NUMBER); - } - -("\""[^\"\n]*"\""[ \t\n]*)+ { - char *s; - unsigned long length; - - s = handle_quotes (yytext, &length); - if (! rcdata_mode) - { - yylval.s = s; - MAYBE_RETURN (QUOTEDSTRING); - } - else - { - yylval.ss.length = length; - yylval.ss.s = s; - MAYBE_RETURN (SIZEDSTRING); - } - } - -[A-Za-z][^ ,\t\r\n]* { - char *s; - - /* I rejected comma in a string in order to - handle VIRTKEY, CONTROL in an accelerator - resource. This means that an unquoted - file name can not contain a comma. I - don't know what rc permits. */ - - s = get_string (strlen (yytext) + 1); - strcpy (s, yytext); - yylval.s = s; - MAYBE_RETURN (STRING); - } - -[\n] { ++rc_lineno; } -[ \t\r]+ { /* ignore whitespace */ } -. { MAYBE_RETURN (*yytext); } - -%% -#ifndef yywrap -/* This is needed for some versions of lex. */ -int yywrap (void) -{ - return 1; -} -#endif - -/* Handle a C preprocessor line. */ - -static void -cpp_line (const char *s) -{ - int line; - char *send, *fn; - - ++s; - while (ISSPACE (*s)) - ++s; - - line = strtol (s, &send, 0); - if (*send != '\0' && ! ISSPACE (*send)) - return; - - /* Subtract 1 because we are about to count the newline. */ - rc_lineno = line - 1; - - s = send; - while (ISSPACE (*s)) - ++s; - - if (*s != '"') - return; - - ++s; - send = strchr (s, '"'); - if (send == NULL) - return; - - fn = (char *) xmalloc (send - s + 1); - strncpy (fn, s, send - s); - fn[send - s] = '\0'; - - free (rc_filename); - rc_filename = fn; - - if (!initial_fn) - { - initial_fn = xmalloc (strlen (fn) + 1); - strcpy (initial_fn, fn); - } - - /* Allow the initial file, regardless of name. Suppress all other - files if they end in ".h" (this allows included "*.rc"). */ - if (strcmp (initial_fn, fn) == 0 - || strcmp (fn + strlen (fn) - 2, ".h") != 0) - suppress_cpp_data = 0; - else - suppress_cpp_data = 1; -} - -/* Handle a quoted string. The quotes are stripped. A pair of quotes - in a string are turned into a single quote. Adjacent strings are - merged separated by whitespace are merged, as in C. */ - -static char * -handle_quotes (const char *input, unsigned long *len) -{ - char *ret, *s; - const char *t; - int ch; - int num_xdigits; - - ret = get_string (strlen (input) + 1); - - s = ret; - t = input; - if (*t == '"') - ++t; - while (*t != '\0') - { - if (*t == '\\') - { - ++t; - switch (*t) - { - case '\0': - rcparse_warning ("backslash at end of string"); - break; - - case '\"': - rcparse_warning ("use \"\" to put \" in a string"); - break; - - case 'a': - *s++ = ESCAPE_B; /* Strange, but true... */ - ++t; - break; - - case 'b': - *s++ = ESCAPE_B; - ++t; - break; - - case 'f': - *s++ = ESCAPE_F; - ++t; - break; - - case 'n': - *s++ = ESCAPE_N; - ++t; - break; - - case 'r': - *s++ = ESCAPE_R; - ++t; - break; - - case 't': - *s++ = ESCAPE_T; - ++t; - break; - - case 'v': - *s++ = ESCAPE_V; - ++t; - break; - - case '\\': - *s++ = *t++; - break; - - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - ch = *t - '0'; - ++t; - if (*t >= '0' && *t <= '7') - { - ch = (ch << 3) | (*t - '0'); - ++t; - if (*t >= '0' && *t <= '7') - { - ch = (ch << 3) | (*t - '0'); - ++t; - } - } - *s++ = ch; - break; - - case 'x': - ++t; - ch = 0; - /* We only handle single byte chars here. Make sure - we finish an escape sequence like "/xB0ABC" after - the first two digits. */ - num_xdigits = 2; - while (num_xdigits--) - { - if (*t >= '0' && *t <= '9') - ch = (ch << 4) | (*t - '0'); - else if (*t >= 'a' && *t <= 'f') - ch = (ch << 4) | (*t - 'a' + 10); - else if (*t >= 'A' && *t <= 'F') - ch = (ch << 4) | (*t - 'A' + 10); - else - break; - ++t; - } - *s++ = ch; - break; - - default: - rcparse_warning ("unrecognized escape sequence"); - *s++ = '\\'; - *s++ = *t++; - break; - } - } - else if (*t != '"') - *s++ = *t++; - else if (t[1] == '\0') - break; - else if (t[1] == '"') - { - *s++ = '"'; - t += 2; - } - else - { - ++t; - assert (ISSPACE (*t)); - while (ISSPACE (*t)) - { - if ((*t) == '\n') - ++rc_lineno; - ++t; - } - if (*t == '\0') - break; - assert (*t == '"'); - ++t; - } - } - - *s = '\0'; - - *len = s - ret; - - return ret; -} - -/* Allocate a string of a given length. */ - -static char * -get_string (int len) -{ - struct alloc_string *as; - - as = (struct alloc_string *) xmalloc (sizeof *as); - as->s = xmalloc (len); - - as->next = strings; - strings = as; - - return as->s; -} - -/* Discard all the strings we have allocated. The parser calls this - when it no longer needs them. */ - -void -rcparse_discard_strings (void) -{ - struct alloc_string *as; - - as = strings; - while (as != NULL) - { - struct alloc_string *n; - - free (as->s); - n = as->next; - free (as); - as = n; - } - - strings = NULL; -} - -/* Enter rcdata mode. */ - -void -rcparse_rcdata (void) -{ - rcdata_mode = 1; -} - -/* Go back to normal mode from rcdata mode. */ - -void -rcparse_normal (void) -{ - rcdata_mode = 0; -} diff --git a/binutils/rcparse.c b/binutils/rcparse.c deleted file mode 100644 index a34e0bfca5b5..000000000000 --- a/binutils/rcparse.c +++ /dev/null @@ -1,4144 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BEG = 258, - END = 259, - ACCELERATORS = 260, - VIRTKEY = 261, - ASCII = 262, - NOINVERT = 263, - SHIFT = 264, - CONTROL = 265, - ALT = 266, - BITMAP = 267, - CURSOR = 268, - DIALOG = 269, - DIALOGEX = 270, - EXSTYLE = 271, - CAPTION = 272, - CLASS = 273, - STYLE = 274, - AUTO3STATE = 275, - AUTOCHECKBOX = 276, - AUTORADIOBUTTON = 277, - CHECKBOX = 278, - COMBOBOX = 279, - CTEXT = 280, - DEFPUSHBUTTON = 281, - EDITTEXT = 282, - GROUPBOX = 283, - LISTBOX = 284, - LTEXT = 285, - PUSHBOX = 286, - PUSHBUTTON = 287, - RADIOBUTTON = 288, - RTEXT = 289, - SCROLLBAR = 290, - STATE3 = 291, - USERBUTTON = 292, - BEDIT = 293, - HEDIT = 294, - IEDIT = 295, - FONT = 296, - ICON = 297, - LANGUAGE = 298, - CHARACTERISTICS = 299, - VERSIONK = 300, - MENU = 301, - MENUEX = 302, - MENUITEM = 303, - SEPARATOR = 304, - POPUP = 305, - CHECKED = 306, - GRAYED = 307, - HELP = 308, - INACTIVE = 309, - MENUBARBREAK = 310, - MENUBREAK = 311, - MESSAGETABLE = 312, - RCDATA = 313, - STRINGTABLE = 314, - VERSIONINFO = 315, - FILEVERSION = 316, - PRODUCTVERSION = 317, - FILEFLAGSMASK = 318, - FILEFLAGS = 319, - FILEOS = 320, - FILETYPE = 321, - FILESUBTYPE = 322, - BLOCKSTRINGFILEINFO = 323, - BLOCKVARFILEINFO = 324, - VALUE = 325, - BLOCK = 326, - MOVEABLE = 327, - FIXED = 328, - PURE = 329, - IMPURE = 330, - PRELOAD = 331, - LOADONCALL = 332, - DISCARDABLE = 333, - NOT = 334, - QUOTEDSTRING = 335, - STRING = 336, - NUMBER = 337, - SIZEDSTRING = 338, - IGNORED_TOKEN = 339, - NEG = 340 - }; -#endif -/* Tokens. */ -#define BEG 258 -#define END 259 -#define ACCELERATORS 260 -#define VIRTKEY 261 -#define ASCII 262 -#define NOINVERT 263 -#define SHIFT 264 -#define CONTROL 265 -#define ALT 266 -#define BITMAP 267 -#define CURSOR 268 -#define DIALOG 269 -#define DIALOGEX 270 -#define EXSTYLE 271 -#define CAPTION 272 -#define CLASS 273 -#define STYLE 274 -#define AUTO3STATE 275 -#define AUTOCHECKBOX 276 -#define AUTORADIOBUTTON 277 -#define CHECKBOX 278 -#define COMBOBOX 279 -#define CTEXT 280 -#define DEFPUSHBUTTON 281 -#define EDITTEXT 282 -#define GROUPBOX 283 -#define LISTBOX 284 -#define LTEXT 285 -#define PUSHBOX 286 -#define PUSHBUTTON 287 -#define RADIOBUTTON 288 -#define RTEXT 289 -#define SCROLLBAR 290 -#define STATE3 291 -#define USERBUTTON 292 -#define BEDIT 293 -#define HEDIT 294 -#define IEDIT 295 -#define FONT 296 -#define ICON 297 -#define LANGUAGE 298 -#define CHARACTERISTICS 299 -#define VERSIONK 300 -#define MENU 301 -#define MENUEX 302 -#define MENUITEM 303 -#define SEPARATOR 304 -#define POPUP 305 -#define CHECKED 306 -#define GRAYED 307 -#define HELP 308 -#define INACTIVE 309 -#define MENUBARBREAK 310 -#define MENUBREAK 311 -#define MESSAGETABLE 312 -#define RCDATA 313 -#define STRINGTABLE 314 -#define VERSIONINFO 315 -#define FILEVERSION 316 -#define PRODUCTVERSION 317 -#define FILEFLAGSMASK 318 -#define FILEFLAGS 319 -#define FILEOS 320 -#define FILETYPE 321 -#define FILESUBTYPE 322 -#define BLOCKSTRINGFILEINFO 323 -#define BLOCKVARFILEINFO 324 -#define VALUE 325 -#define BLOCK 326 -#define MOVEABLE 327 -#define FIXED 328 -#define PURE 329 -#define IMPURE 330 -#define PRELOAD 331 -#define LOADONCALL 332 -#define DISCARDABLE 333 -#define NOT 334 -#define QUOTEDSTRING 335 -#define STRING 336 -#define NUMBER 337 -#define SIZEDSTRING 338 -#define IGNORED_TOKEN 339 -#define NEG 340 - - - - -/* Copy the first part of user declarations. */ -#line 1 "rcparse.y" - /* rcparse.y -- parser for Windows rc files - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Support. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* This is a parser for Windows rc files. It is based on the parser - by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */ - -#include "bfd.h" -#include "bucomm.h" -#include "libiberty.h" -#include "windres.h" -#include "safe-ctype.h" - -/* The current language. */ - -static unsigned short language; - -/* The resource information during a sub statement. */ - -static struct res_res_info sub_res_info; - -/* Dialog information. This is built by the nonterminals styles and - controls. */ - -static struct dialog dialog; - -/* This is used when building a style. It is modified by the - nonterminal styleexpr. */ - -static unsigned long style; - -/* These are used when building a control. They are set before using - control_params. */ - -static unsigned long base_style; -static unsigned long default_style; -static unsigned long class; -static struct res_id res_text_field; -static unichar null_unichar; - -/* This is used for COMBOBOX, LISTBOX and EDITTEXT which - do not allow resource 'text' field in control definition. */ -static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 66 "rcparse.y" -typedef union YYSTYPE { - struct accelerator acc; - struct accelerator *pacc; - struct dialog_control *dialog_control; - struct menuitem *menuitem; - struct - { - struct rcdata_item *first; - struct rcdata_item *last; - } rcdata; - struct rcdata_item *rcdata_item; - struct stringtable_data *stringtable; - struct fixed_versioninfo *fixver; - struct ver_info *verinfo; - struct ver_stringinfo *verstring; - struct ver_varinfo *vervar; - struct res_id id; - struct res_res_info res_info; - struct - { - unsigned short on; - unsigned short off; - } memflags; - struct - { - unsigned long val; - /* Nonzero if this number was explicitly specified as long. */ - int dword; - } i; - unsigned long il; - unsigned short is; - const char *s; - struct - { - unsigned long length; - const char *s; - } ss; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 358 "rcparse.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 370 "rcparse.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 792 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 99 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 91 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 247 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 500 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 340 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 92, 87, 2, - 97, 98, 90, 88, 95, 89, 2, 91, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 96, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 86, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 85, 2, 93, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 94 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short int yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 13, 16, 19, 22, - 25, 28, 31, 34, 37, 40, 43, 46, 49, 56, - 57, 60, 63, 68, 70, 72, 74, 78, 81, 83, - 85, 87, 89, 91, 93, 98, 103, 104, 118, 119, - 133, 134, 149, 150, 154, 155, 159, 163, 167, 171, - 175, 181, 188, 196, 205, 209, 213, 218, 222, 223, - 226, 227, 232, 233, 238, 239, 244, 245, 250, 251, - 256, 257, 261, 273, 286, 299, 313, 314, 319, 320, - 325, 326, 330, 331, 336, 337, 342, 349, 358, 369, - 381, 382, 387, 388, 392, 393, 398, 399, 404, 405, - 410, 411, 416, 417, 422, 423, 427, 428, 433, 434, - 450, 457, 466, 476, 477, 480, 482, 485, 486, 490, - 491, 495, 496, 500, 501, 505, 510, 515, 519, 526, - 527, 530, 535, 538, 545, 546, 550, 553, 555, 557, - 559, 561, 563, 565, 572, 573, 576, 579, 583, 589, - 592, 598, 605, 613, 623, 628, 635, 640, 641, 644, - 645, 647, 649, 651, 655, 659, 660, 667, 668, 672, - 677, 684, 689, 696, 697, 704, 711, 715, 719, 723, - 727, 731, 732, 741, 749, 750, 756, 757, 761, 763, - 765, 767, 770, 773, 776, 778, 779, 782, 786, 791, - 795, 796, 799, 800, 803, 805, 807, 809, 811, 813, - 815, 817, 819, 821, 823, 826, 830, 835, 837, 841, - 842, 844, 847, 849, 851, 855, 858, 861, 865, 869, - 873, 877, 881, 885, 889, 893, 896, 898, 900, 904, - 907, 911, 915, 919, 923, 927, 931, 935 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = -{ - 100, 0, -1, -1, 100, 101, -1, 100, 107, -1, - 100, 108, -1, 100, 109, -1, 100, 147, -1, 100, - 148, -1, 100, 149, -1, 100, 150, -1, 100, 155, - -1, 100, 158, -1, 100, 159, -1, 100, 164, -1, - 100, 167, -1, 100, 168, -1, 100, 84, -1, 173, - 5, 176, 3, 102, 4, -1, -1, 102, 103, -1, - 104, 187, -1, 104, 187, 95, 105, -1, 80, -1, - 188, -1, 106, -1, 105, 95, 106, -1, 105, 106, - -1, 6, -1, 7, -1, 8, -1, 9, -1, 10, - -1, 11, -1, 173, 12, 178, 180, -1, 173, 13, - 177, 180, -1, -1, 173, 14, 178, 113, 188, 184, - 184, 184, 110, 114, 3, 115, 4, -1, -1, 173, - 15, 178, 113, 188, 184, 184, 184, 111, 114, 3, - 115, 4, -1, -1, 173, 15, 178, 113, 188, 184, - 184, 184, 184, 112, 114, 3, 115, 4, -1, -1, - 16, 96, 185, -1, -1, 114, 17, 80, -1, 114, - 18, 173, -1, 114, 19, 181, -1, 114, 16, 185, - -1, 114, 18, 80, -1, 114, 41, 185, 95, 80, - -1, 114, 41, 185, 95, 80, 184, -1, 114, 41, - 185, 95, 80, 184, 184, -1, 114, 41, 185, 95, - 80, 184, 184, 184, -1, 114, 46, 173, -1, 114, - 44, 185, -1, 114, 43, 185, 184, -1, 114, 45, - 185, -1, -1, 115, 116, -1, -1, 20, 139, 117, - 138, -1, -1, 21, 139, 118, 138, -1, -1, 22, - 139, 119, 138, -1, -1, 38, 139, 120, 138, -1, - -1, 23, 139, 121, 138, -1, -1, 24, 122, 138, - -1, 10, 139, 185, 184, 141, 184, 184, 184, 184, - 183, 140, -1, 10, 139, 185, 184, 141, 184, 184, - 184, 184, 184, 184, 140, -1, 10, 139, 185, 95, - 80, 141, 184, 184, 184, 184, 183, 140, -1, 10, - 139, 185, 95, 80, 141, 184, 184, 184, 184, 184, - 184, 140, -1, -1, 25, 139, 123, 138, -1, -1, - 26, 139, 124, 138, -1, -1, 27, 125, 138, -1, - -1, 28, 139, 126, 138, -1, -1, 39, 139, 127, - 138, -1, 42, 175, 185, 184, 184, 140, -1, 42, - 175, 185, 184, 184, 184, 184, 140, -1, 42, 175, - 185, 184, 184, 184, 184, 143, 183, 140, -1, 42, - 175, 185, 184, 184, 184, 184, 143, 184, 184, 140, - -1, -1, 40, 139, 128, 138, -1, -1, 29, 129, - 138, -1, -1, 30, 139, 130, 138, -1, -1, 31, - 139, 131, 138, -1, -1, 32, 139, 132, 138, -1, - -1, 33, 139, 133, 138, -1, -1, 34, 139, 134, - 138, -1, -1, 35, 135, 138, -1, -1, 36, 139, - 136, 138, -1, -1, 37, 175, 185, 95, 185, 95, - 185, 95, 185, 95, 185, 95, 137, 181, 183, -1, - 185, 184, 184, 184, 184, 140, -1, 185, 184, 184, - 184, 184, 145, 183, 140, -1, 185, 184, 184, 184, - 184, 145, 184, 184, 140, -1, -1, 188, 95, -1, - 80, -1, 80, 95, -1, -1, 3, 160, 4, -1, - -1, 95, 142, 181, -1, -1, 95, 144, 181, -1, - -1, 95, 146, 181, -1, 173, 41, 177, 180, -1, - 173, 42, 177, 180, -1, 43, 185, 184, -1, 173, - 46, 176, 3, 151, 4, -1, -1, 151, 152, -1, - 48, 80, 184, 153, -1, 48, 49, -1, 50, 80, - 153, 3, 151, 4, -1, -1, 153, 95, 154, -1, - 153, 154, -1, 51, -1, 52, -1, 53, -1, 54, - -1, 55, -1, 56, -1, 173, 47, 176, 3, 156, - 4, -1, -1, 156, 157, -1, 48, 80, -1, 48, - 80, 184, -1, 48, 80, 184, 184, 183, -1, 48, - 49, -1, 50, 80, 3, 156, 4, -1, 50, 80, - 184, 3, 156, 4, -1, 50, 80, 184, 184, 3, - 156, 4, -1, 50, 80, 184, 184, 184, 183, 3, - 156, 4, -1, 173, 57, 178, 180, -1, 173, 58, - 176, 3, 160, 4, -1, 173, 58, 176, 180, -1, - -1, 161, 162, -1, -1, 163, -1, 83, -1, 186, - -1, 163, 95, 83, -1, 163, 95, 186, -1, -1, - 59, 176, 3, 165, 166, 4, -1, -1, 166, 185, - 80, -1, 166, 185, 95, 80, -1, 173, 173, 176, - 3, 160, 4, -1, 173, 173, 176, 180, -1, 173, - 60, 169, 3, 170, 4, -1, -1, 169, 61, 185, - 184, 184, 184, -1, 169, 62, 185, 184, 184, 184, - -1, 169, 63, 185, -1, 169, 64, 185, -1, 169, - 65, 185, -1, 169, 66, 185, -1, 169, 67, 185, - -1, -1, 170, 68, 3, 71, 3, 171, 4, 4, - -1, 170, 69, 3, 70, 80, 172, 4, -1, -1, - 171, 70, 80, 95, 80, -1, -1, 172, 184, 184, - -1, 188, -1, 81, -1, 80, -1, 80, 95, -1, - 81, 95, -1, 188, 95, -1, 174, -1, -1, 176, - 179, -1, 176, 44, 185, -1, 176, 43, 185, 184, - -1, 176, 45, 185, -1, -1, 177, 179, -1, -1, - 178, 179, -1, 72, -1, 73, -1, 74, -1, 75, - -1, 76, -1, 77, -1, 78, -1, 80, -1, 81, - -1, 182, -1, 79, 182, -1, 181, 85, 182, -1, - 181, 85, 79, 182, -1, 82, -1, 97, 185, 98, - -1, -1, 184, -1, 95, 185, -1, 186, -1, 82, - -1, 97, 186, 98, -1, 93, 186, -1, 89, 186, - -1, 186, 90, 186, -1, 186, 91, 186, -1, 186, - 92, 186, -1, 186, 88, 186, -1, 186, 89, 186, - -1, 186, 87, 186, -1, 186, 86, 186, -1, 186, - 85, 186, -1, 95, 188, -1, 189, -1, 82, -1, - 97, 186, 98, -1, 93, 186, -1, 189, 90, 186, - -1, 189, 91, 186, -1, 189, 92, 186, -1, 189, - 88, 186, -1, 189, 89, 186, -1, 189, 87, 186, - -1, 189, 86, 186, -1, 189, 85, 186, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 161, 161, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 183, 194, - 197, 218, 223, 235, 256, 266, 270, 275, 282, 286, - 291, 295, 299, 303, 312, 324, 338, 336, 363, 361, - 390, 388, 420, 423, 429, 431, 437, 441, 446, 450, - 454, 467, 482, 497, 512, 516, 520, 524, 530, 532, - 544, 543, 555, 554, 566, 565, 577, 576, 591, 590, - 602, 601, 614, 625, 634, 647, 659, 658, 670, 669, - 681, 680, 692, 691, 703, 702, 716, 721, 727, 733, - 740, 739, 754, 753, 765, 764, 776, 775, 786, 785, - 797, 796, 808, 807, 819, 818, 830, 829, 842, 840, - 858, 869, 880, 893, 896, 901, 905, 913, 916, 926, - 925, 932, 931, 938, 937, 945, 957, 970, 979, 990, - 993, 1010, 1014, 1018, 1026, 1029, 1033, 1040, 1044, 1048, - 1052, 1056, 1060, 1069, 1080, 1083, 1100, 1104, 1108, 1112, - 1116, 1120, 1124, 1128, 1138, 1150, 1157, 1170, 1170, 1182, - 1186, 1193, 1201, 1209, 1218, 1233, 1232, 1237, 1239, 1246, - 1259, 1266, 1278, 1289, 1294, 1300, 1306, 1311, 1316, 1321, - 1326, 1341, 1344, 1348, 1356, 1359, 1367, 1370, 1379, 1384, - 1400, 1404, 1408, 1416, 1421, 1439, 1445, 1451, 1456, 1461, - 1472, 1477, 1489, 1494, 1506, 1511, 1516, 1521, 1526, 1531, - 1536, 1546, 1550, 1567, 1571, 1575, 1579, 1586, 1590, 1600, - 1603, 1612, 1621, 1630, 1634, 1638, 1643, 1648, 1653, 1658, - 1663, 1668, 1673, 1678, 1683, 1694, 1703, 1714, 1718, 1722, - 1727, 1732, 1737, 1742, 1747, 1752, 1757, 1762 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "BEG", "END", "ACCELERATORS", "VIRTKEY", - "ASCII", "NOINVERT", "SHIFT", "CONTROL", "ALT", "BITMAP", "CURSOR", - "DIALOG", "DIALOGEX", "EXSTYLE", "CAPTION", "CLASS", "STYLE", - "AUTO3STATE", "AUTOCHECKBOX", "AUTORADIOBUTTON", "CHECKBOX", "COMBOBOX", - "CTEXT", "DEFPUSHBUTTON", "EDITTEXT", "GROUPBOX", "LISTBOX", "LTEXT", - "PUSHBOX", "PUSHBUTTON", "RADIOBUTTON", "RTEXT", "SCROLLBAR", "STATE3", - "USERBUTTON", "BEDIT", "HEDIT", "IEDIT", "FONT", "ICON", "LANGUAGE", - "CHARACTERISTICS", "VERSIONK", "MENU", "MENUEX", "MENUITEM", "SEPARATOR", - "POPUP", "CHECKED", "GRAYED", "HELP", "INACTIVE", "MENUBARBREAK", - "MENUBREAK", "MESSAGETABLE", "RCDATA", "STRINGTABLE", "VERSIONINFO", - "FILEVERSION", "PRODUCTVERSION", "FILEFLAGSMASK", "FILEFLAGS", "FILEOS", - "FILETYPE", "FILESUBTYPE", "BLOCKSTRINGFILEINFO", "BLOCKVARFILEINFO", - "VALUE", "BLOCK", "MOVEABLE", "FIXED", "PURE", "IMPURE", "PRELOAD", - "LOADONCALL", "DISCARDABLE", "NOT", "QUOTEDSTRING", "STRING", "NUMBER", - "SIZEDSTRING", "IGNORED_TOKEN", "'|'", "'^'", "'&'", "'+'", "'-'", "'*'", - "'/'", "'%'", "'~'", "NEG", "','", "'='", "'('", "')'", "$accept", - "input", "accelerator", "acc_entries", "acc_entry", "acc_event", - "acc_options", "acc_option", "bitmap", "cursor", "dialog", "@1", "@2", - "@3", "exstyle", "styles", "controls", "control", "@4", "@5", "@6", "@7", - "@8", "@9", "@10", "@11", "@12", "@13", "@14", "@15", "@16", "@17", - "@18", "@19", "@20", "@21", "@22", "@23", "@24", "control_params", - "optresidc", "opt_control_data", "control_styleexpr", "@25", - "icon_styleexpr", "@26", "control_params_styleexpr", "@27", "font", - "icon", "language", "menu", "menuitems", "menuitem", "menuitem_flags", - "menuitem_flag", "menuex", "menuexitems", "menuexitem", "messagetable", - "rcdata", "optrcdata_data", "@28", "optrcdata_data_int", "rcdata_data", - "stringtable", "@29", "string_data", "user", "versioninfo", - "fixedverinfo", "verblocks", "vervals", "vertrans", "id", "resname", - "resref", "suboptions", "memflags_move_discard", "memflags_move", - "memflag", "file_name", "styleexpr", "parennumber", "optcnumexpr", - "cnumexpr", "numexpr", "sizednumexpr", "cposnumexpr", "posnumexpr", - "sizedposnumexpr", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 124, 94, 38, 43, 45, - 42, 47, 37, 126, 340, 44, 61, 40, 41 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 99, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 101, 102, - 102, 103, 103, 104, 104, 105, 105, 105, 106, 106, - 106, 106, 106, 106, 107, 108, 110, 109, 111, 109, - 112, 109, 113, 113, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, - 117, 116, 118, 116, 119, 116, 120, 116, 121, 116, - 122, 116, 116, 116, 116, 116, 123, 116, 124, 116, - 125, 116, 126, 116, 127, 116, 116, 116, 116, 116, - 128, 116, 129, 116, 130, 116, 131, 116, 132, 116, - 133, 116, 134, 116, 135, 116, 136, 116, 137, 116, - 138, 138, 138, 139, 139, 139, 139, 140, 140, 142, - 141, 144, 143, 146, 145, 147, 148, 149, 150, 151, - 151, 152, 152, 152, 153, 153, 153, 154, 154, 154, - 154, 154, 154, 155, 156, 156, 157, 157, 157, 157, - 157, 157, 157, 157, 158, 159, 159, 161, 160, 162, - 162, 163, 163, 163, 163, 165, 164, 166, 166, 166, - 167, 167, 168, 169, 169, 169, 169, 169, 169, 169, - 169, 170, 170, 170, 171, 171, 172, 172, 173, 173, - 174, 174, 174, 175, 175, 176, 176, 176, 176, 176, - 177, 177, 178, 178, 179, 179, 179, 179, 179, 179, - 179, 180, 180, 181, 181, 181, 181, 182, 182, 183, - 183, 184, 185, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 187, 188, 189, 189, 189, - 189, 189, 189, 189, 189, 189, 189, 189 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 6, 0, - 2, 2, 4, 1, 1, 1, 3, 2, 1, 1, - 1, 1, 1, 1, 4, 4, 0, 13, 0, 13, - 0, 14, 0, 3, 0, 3, 3, 3, 3, 3, - 5, 6, 7, 8, 3, 3, 4, 3, 0, 2, - 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, - 0, 3, 11, 12, 12, 13, 0, 4, 0, 4, - 0, 3, 0, 4, 0, 4, 6, 8, 10, 11, - 0, 4, 0, 3, 0, 4, 0, 4, 0, 4, - 0, 4, 0, 4, 0, 3, 0, 4, 0, 15, - 6, 8, 9, 0, 2, 1, 2, 0, 3, 0, - 3, 0, 3, 0, 3, 4, 4, 3, 6, 0, - 2, 4, 2, 6, 0, 3, 2, 1, 1, 1, - 1, 1, 1, 6, 0, 2, 2, 3, 5, 2, - 5, 6, 7, 9, 4, 6, 4, 0, 2, 0, - 1, 1, 1, 3, 3, 0, 6, 0, 3, 4, - 6, 4, 6, 0, 6, 6, 3, 3, 3, 3, - 3, 0, 8, 7, 0, 5, 0, 3, 1, 1, - 1, 2, 2, 2, 1, 0, 2, 3, 4, 3, - 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 3, 4, 1, 3, 0, - 1, 2, 1, 1, 3, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 2, 1, 1, 3, 2, - 3, 3, 3, 3, 3, 3, 3, 3 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 2, 0, 1, 0, 195, 189, 237, 17, 0, 0, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 0, 188, 236, 223, 0, 0, - 0, 0, 222, 0, 239, 0, 195, 202, 200, 202, - 202, 200, 200, 195, 195, 202, 195, 173, 195, 0, - 0, 0, 0, 0, 0, 0, 0, 226, 225, 0, - 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, - 165, 0, 0, 0, 204, 205, 206, 207, 208, 209, - 210, 196, 238, 0, 0, 0, 42, 42, 0, 0, - 0, 0, 0, 0, 0, 0, 247, 246, 245, 243, - 244, 240, 241, 242, 224, 221, 234, 233, 232, 230, - 231, 227, 228, 229, 167, 0, 197, 199, 19, 211, - 212, 203, 34, 201, 35, 0, 0, 0, 125, 126, - 129, 144, 154, 157, 156, 181, 0, 0, 0, 0, - 0, 0, 0, 157, 171, 0, 198, 0, 0, 0, - 0, 0, 0, 0, 159, 0, 0, 0, 176, 177, - 178, 179, 180, 0, 166, 0, 18, 23, 20, 0, - 24, 43, 0, 0, 128, 0, 0, 130, 143, 0, - 0, 145, 155, 161, 158, 160, 162, 172, 0, 0, - 0, 0, 170, 168, 0, 0, 21, 0, 0, 132, - 0, 134, 149, 146, 0, 0, 0, 0, 0, 0, - 169, 235, 0, 36, 38, 134, 0, 147, 144, 0, - 163, 164, 0, 0, 174, 175, 28, 29, 30, 31, - 32, 33, 22, 25, 44, 44, 40, 131, 129, 137, - 138, 139, 140, 141, 142, 0, 136, 219, 0, 144, - 0, 184, 186, 0, 27, 0, 0, 44, 0, 135, - 148, 220, 150, 0, 144, 219, 0, 0, 26, 58, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, - 0, 133, 151, 0, 0, 0, 0, 183, 0, 0, - 48, 45, 49, 46, 0, 217, 0, 47, 213, 0, - 0, 55, 57, 54, 0, 58, 152, 144, 182, 0, - 187, 37, 113, 113, 113, 113, 113, 70, 113, 113, - 80, 113, 92, 113, 113, 113, 113, 113, 104, 113, - 0, 113, 113, 113, 0, 59, 214, 0, 0, 0, - 56, 39, 0, 0, 0, 115, 0, 0, 60, 62, - 64, 68, 0, 76, 78, 0, 82, 0, 94, 96, - 98, 100, 102, 0, 106, 190, 0, 194, 0, 0, - 66, 84, 90, 0, 218, 0, 215, 50, 41, 153, - 185, 116, 0, 114, 0, 0, 0, 0, 71, 0, - 0, 0, 81, 0, 93, 0, 0, 0, 0, 0, - 105, 0, 191, 192, 0, 193, 0, 0, 0, 0, - 216, 51, 0, 0, 61, 63, 65, 69, 0, 77, - 79, 83, 95, 97, 99, 101, 103, 107, 0, 67, - 85, 91, 0, 52, 0, 119, 0, 0, 0, 117, - 53, 0, 0, 0, 0, 0, 157, 86, 0, 0, - 120, 0, 117, 0, 0, 117, 0, 0, 123, 110, - 219, 0, 118, 121, 87, 219, 0, 219, 0, 117, - 220, 0, 0, 117, 220, 219, 117, 220, 124, 111, - 117, 0, 122, 88, 117, 117, 220, 72, 117, 112, - 0, 89, 74, 117, 73, 108, 75, 0, 219, 109 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = -{ - -1, 1, 10, 147, 168, 169, 232, 233, 11, 12, - 13, 234, 235, 257, 126, 255, 289, 335, 384, 385, - 386, 406, 387, 352, 390, 391, 355, 393, 407, 408, - 357, 395, 396, 397, 398, 399, 363, 401, 497, 388, - 346, 447, 436, 442, 465, 472, 460, 468, 14, 15, - 16, 17, 151, 177, 216, 246, 18, 152, 181, 19, - 20, 153, 154, 184, 185, 21, 114, 145, 22, 23, - 94, 155, 266, 267, 24, 367, 368, 33, 85, 84, - 81, 122, 297, 298, 260, 261, 389, 32, 196, 347, - 26 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -426 -static const short int yypact[] = -{ - -426, 12, -426, 287, -426, -426, -426, -426, 287, 287, - -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, - -426, -426, -426, -426, 106, -426, 585, -426, 287, 287, - 287, -80, 675, 83, -426, 637, -426, -426, -426, -426, - -426, -426, -426, -426, -426, -426, -426, -426, -426, 287, - 287, 287, 287, 287, 287, 287, 287, -426, -426, 651, - 287, -426, 287, 287, 287, 287, 287, 287, 287, 287, - -426, 287, 287, 287, -426, -426, -426, -426, -426, -426, - -426, -426, -426, 286, 678, 678, 188, 188, 678, 678, - 323, 375, 678, 210, 128, 274, 682, 688, 302, 89, - 89, -426, -426, -426, -426, -426, 682, 688, 302, 89, - 89, -426, -426, -426, -426, -80, -426, -426, -426, -426, - -426, -426, -426, -426, -426, -70, 142, 142, -426, -426, - -426, -426, -426, -426, -426, -426, 287, 287, 287, 287, - 287, 287, 287, -426, -426, 2, -426, 5, 287, -80, - -80, 33, 40, 47, 373, 38, -80, -80, -426, -426, - -426, -426, -426, 49, -426, 17, -426, -426, -426, -41, - -426, -426, -80, -80, -426, -44, -24, -426, -426, -35, - 36, -426, -426, -426, -426, -13, 675, -426, 129, 138, - -80, -80, -426, -426, 69, 142, 73, -80, -80, -426, - -80, -426, -426, -80, 8, 454, 111, 97, -80, -80, - -426, -426, 775, -426, -80, -426, 119, -80, -426, 13, - -426, 675, 183, 116, -426, -426, -426, -426, -426, -426, - -426, -426, 22, -426, -426, -426, -426, 245, -426, -426, - -426, -426, -426, -426, -426, 736, -426, -80, 96, -426, - 15, -426, -426, 775, -426, 370, 512, -426, 158, -426, - -426, -426, -426, 172, -426, -80, 34, 6, -426, -426, - 287, 125, 227, 72, 287, 287, 287, 287, 260, -426, - 523, -426, -426, 179, 207, 229, 131, -426, -80, 584, - -426, -426, -426, -426, 43, -426, 287, 159, -426, 151, - -80, -426, -426, -426, 621, -426, -426, -426, -426, 153, - -426, -426, 141, 141, 141, 141, 141, -426, 141, 141, - -426, 141, -426, 141, 141, 141, 141, 141, -426, 141, - 230, 141, 141, 141, 230, -426, -426, 160, 133, 169, - -426, -426, 658, 193, 189, 164, 287, 173, -426, -426, - -426, -426, 287, -426, -426, 287, -426, 287, -426, -426, - -426, -426, -426, 287, -426, 175, 181, -426, 287, 184, - -426, -426, -426, 287, -426, 43, -426, -80, -426, -426, - -426, -426, 185, -426, 287, 287, 287, 287, -426, -80, - 287, 287, -426, 287, -426, 287, 287, 287, 287, 287, - -426, 287, -426, -426, 197, -426, 287, 287, 287, -80, - -426, -80, 341, 199, -426, -426, -426, -426, -80, -426, - -426, -426, -426, -426, -426, -426, -426, -426, 287, -426, - -426, -426, -80, -80, 199, -426, -80, -80, 208, 18, - -426, -80, 72, -80, -80, 287, -426, -426, -80, -80, - 159, -80, 19, 211, 298, 20, -80, -80, -426, -426, - -80, 287, -426, -426, -426, -80, -80, -80, 72, 310, - -80, 219, 72, 310, -80, -80, 310, -80, 159, -426, - 310, 287, 159, -426, 310, 310, -80, -426, 310, -426, - 220, -426, -426, 310, -426, -426, -426, 72, -37, -426 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = -{ - -426, -426, -426, -426, -426, -426, -426, -207, -426, -426, - -426, -426, -426, -426, 218, -222, -255, -426, -426, -426, - -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, - -426, -426, -426, -426, -426, -426, -426, -426, -426, 126, - 388, 107, -113, -426, -426, -426, -426, -426, -426, -426, - -426, -426, 84, -426, 110, 87, -426, -215, -426, -426, - -426, -142, -426, -426, -426, -426, -426, -426, -426, -426, - -426, -426, -426, -426, -22, -426, 0, 397, 82, 212, - 548, 486, -425, -286, -258, 28, -3, 11, -426, 3, - -426 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const unsigned short int yytable[] = -{ - 31, 163, 48, 248, 25, 199, 164, 284, 336, 166, - 287, 218, 2, 256, 202, 60, 249, 450, 264, 34, - 35, 446, 446, 446, 304, 254, 148, 25, 226, 227, - 228, 229, 230, 231, 263, 280, 200, 174, 285, 57, - 58, 59, 187, 478, 178, 203, 268, 482, 338, 283, - 342, 182, 376, 192, 195, 3, 201, 105, 60, 61, - 96, 97, 98, 99, 100, 101, 102, 103, 115, 116, - 117, 4, 498, 106, 107, 108, 109, 110, 111, 112, - 113, 175, 205, 176, 27, 167, 70, 6, 179, 410, - 180, 28, 343, 5, 6, 29, 7, 193, 8, 30, - 262, 60, 9, 60, 286, 8, 188, 189, 60, 9, - 60, 36, 194, 60, 458, 463, 204, 253, 37, 38, - 39, 40, 238, 88, 89, 295, 71, 72, 73, 149, - 150, 135, 206, 156, 157, 158, 159, 160, 161, 162, - 296, 207, 165, 146, 179, 171, 180, 41, 42, 210, - 170, 294, 43, 44, 295, 74, 75, 76, 77, 78, - 79, 80, 281, 45, 46, 186, 47, 223, 212, 296, - 239, 240, 241, 242, 243, 244, 282, 172, 173, 67, - 68, 69, 222, 306, 190, 191, 251, 5, 6, 136, - 137, 138, 139, 140, 141, 142, 252, 379, 211, 8, - 197, 198, 469, 9, 125, 291, 175, 473, 176, 476, - 307, 309, 375, 133, 245, 295, 221, 485, 208, 209, - 179, 345, 180, 6, 6, 213, 214, 179, 215, 180, - 296, 217, 219, 308, 8, 8, 224, 225, 9, 9, - 499, 179, 236, 180, 338, 247, 339, 250, 344, 377, - 293, 86, 87, 71, 72, 73, 303, 92, 374, 381, - 74, 75, 76, 77, 78, 79, 80, 290, 383, 380, - 402, 299, 300, 301, 302, 25, 403, 143, 265, 405, - 412, 25, 74, 75, 76, 77, 78, 79, 80, 118, - 119, 120, 428, 337, 435, 288, 239, 240, 241, 242, - 243, 244, 462, 445, 454, 127, 461, 292, 5, 6, - 365, 366, 6, 446, 481, 495, 310, 71, 72, 73, - 8, 441, 258, 8, 9, 237, 130, 9, 340, 71, - 72, 73, 259, 369, 373, 0, 0, 369, 0, 0, - 245, 5, 6, 382, 0, 0, 74, 75, 76, 77, - 78, 79, 80, 8, 119, 120, 0, 9, 74, 75, - 76, 77, 78, 79, 80, 404, 71, 72, 73, 27, - 409, 0, 0, 269, 0, 0, 28, 0, 131, 0, - 29, 0, 0, 0, 30, 0, 270, 271, 272, 273, - 65, 66, 67, 68, 69, 74, 75, 76, 77, 78, - 79, 80, 0, 0, 0, 411, 0, 0, 0, 105, - 413, 274, 0, 275, 276, 277, 278, 418, 71, 72, - 73, 434, 0, 27, 0, 438, 0, 0, 0, 0, - 28, 0, 0, 83, 29, 0, 0, 432, 30, 433, - 90, 91, 453, 93, 0, 95, 437, 74, 75, 76, - 77, 78, 79, 80, 0, 27, 183, 0, 471, 0, - 439, 440, 28, 0, 443, 444, 29, 448, 0, 449, - 30, 451, 452, 0, 0, 0, 455, 456, 490, 457, - 0, 392, 0, 394, 466, 467, 0, 0, 470, 400, - 0, 0, 0, 474, 475, 477, 0, 0, 480, 0, - 0, 0, 484, 486, 0, 488, 0, 0, 0, 0, - 414, 415, 416, 417, 493, 279, 419, 420, 0, 421, - 0, 422, 423, 424, 425, 426, 305, 427, 270, 271, - 272, 273, 429, 430, 431, 0, 27, 220, 0, 270, - 271, 272, 273, 28, 0, 0, 0, 29, 0, 0, - 0, 30, 0, 274, 0, 275, 276, 277, 278, 459, - 0, 0, 464, 0, 274, 0, 275, 276, 277, 278, - 0, 124, 0, 0, 128, 129, 479, 0, 132, 134, - 483, 144, 0, 487, 0, 0, 0, 489, 311, 0, - 0, 491, 492, 0, 312, 494, 0, 0, 0, 0, - 496, 0, 0, 0, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 341, 334, 0, 0, 0, - 0, 312, 121, 123, 121, 121, 123, 123, 0, 0, - 121, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 378, 334, 0, 0, 0, 0, 312, 0, - 49, 50, 51, 52, 53, 54, 55, 56, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 0, - 334, 348, 349, 350, 351, 0, 353, 354, 0, 356, - 0, 358, 359, 360, 361, 362, 0, 364, 0, 370, - 371, 372, 62, 63, 64, 65, 66, 67, 68, 69, - 0, 0, 0, 0, 0, 82, 62, 63, 64, 65, - 66, 67, 68, 69, 0, 0, 0, 0, 0, 104, - 74, 75, 76, 77, 78, 79, 80, 0, 119, 120, - 62, 63, 64, 65, 66, 67, 68, 69, 63, 64, - 65, 66, 67, 68, 69, 64, 65, 66, 67, 68, - 69, 226, 227, 228, 229, 230, 231, 239, 240, 241, - 242, 243, 244 -}; - -static const short int yycheck[] = -{ - 3, 143, 24, 218, 1, 49, 4, 265, 294, 4, - 4, 3, 0, 235, 49, 95, 3, 442, 3, 8, - 9, 3, 3, 3, 279, 232, 96, 24, 6, 7, - 8, 9, 10, 11, 249, 257, 80, 4, 4, 28, - 29, 30, 4, 468, 4, 80, 253, 472, 85, 264, - 305, 4, 338, 4, 95, 43, 80, 60, 95, 31, - 49, 50, 51, 52, 53, 54, 55, 56, 71, 72, - 73, 59, 497, 62, 63, 64, 65, 66, 67, 68, - 69, 48, 95, 50, 82, 80, 3, 82, 48, 375, - 50, 89, 307, 81, 82, 93, 84, 80, 93, 97, - 4, 95, 97, 95, 70, 93, 68, 69, 95, 97, - 95, 5, 95, 95, 95, 95, 80, 95, 12, 13, - 14, 15, 3, 41, 42, 82, 43, 44, 45, 126, - 127, 3, 3, 136, 137, 138, 139, 140, 141, 142, - 97, 3, 145, 115, 48, 148, 50, 41, 42, 80, - 147, 79, 46, 47, 82, 72, 73, 74, 75, 76, - 77, 78, 4, 57, 58, 154, 60, 70, 95, 97, - 51, 52, 53, 54, 55, 56, 4, 149, 150, 90, - 91, 92, 71, 4, 156, 157, 3, 81, 82, 61, - 62, 63, 64, 65, 66, 67, 80, 4, 195, 93, - 172, 173, 460, 97, 16, 80, 48, 465, 50, 467, - 3, 80, 79, 3, 95, 82, 205, 475, 190, 191, - 48, 80, 50, 82, 82, 197, 198, 48, 200, 50, - 97, 203, 204, 4, 93, 93, 208, 209, 97, 97, - 498, 48, 214, 50, 85, 217, 95, 219, 95, 80, - 272, 39, 40, 43, 44, 45, 278, 45, 98, 95, - 72, 73, 74, 75, 76, 77, 78, 270, 95, 80, - 95, 274, 275, 276, 277, 272, 95, 3, 250, 95, - 95, 278, 72, 73, 74, 75, 76, 77, 78, 3, - 80, 81, 95, 296, 95, 267, 51, 52, 53, 54, - 55, 56, 4, 95, 446, 87, 95, 80, 81, 82, - 80, 81, 82, 3, 95, 95, 288, 43, 44, 45, - 93, 434, 238, 93, 97, 215, 3, 97, 300, 43, - 44, 45, 245, 330, 334, -1, -1, 334, -1, -1, - 95, 81, 82, 346, -1, -1, 72, 73, 74, 75, - 76, 77, 78, 93, 80, 81, -1, 97, 72, 73, - 74, 75, 76, 77, 78, 368, 43, 44, 45, 82, - 373, -1, -1, 3, -1, -1, 89, -1, 3, -1, - 93, -1, -1, -1, 97, -1, 16, 17, 18, 19, - 88, 89, 90, 91, 92, 72, 73, 74, 75, 76, - 77, 78, -1, -1, -1, 377, -1, -1, -1, 412, - 382, 41, -1, 43, 44, 45, 46, 389, 43, 44, - 45, 80, -1, 82, -1, 428, -1, -1, -1, -1, - 89, -1, -1, 36, 93, -1, -1, 409, 97, 411, - 43, 44, 445, 46, -1, 48, 418, 72, 73, 74, - 75, 76, 77, 78, -1, 82, 83, -1, 461, -1, - 432, 433, 89, -1, 436, 437, 93, 439, -1, 441, - 97, 443, 444, -1, -1, -1, 448, 449, 481, 451, - -1, 355, -1, 357, 456, 457, -1, -1, 460, 363, - -1, -1, -1, 465, 466, 467, -1, -1, 470, -1, - -1, -1, 474, 475, -1, 477, -1, -1, -1, -1, - 384, 385, 386, 387, 486, 3, 390, 391, -1, 393, - -1, 395, 396, 397, 398, 399, 3, 401, 16, 17, - 18, 19, 406, 407, 408, -1, 82, 83, -1, 16, - 17, 18, 19, 89, -1, -1, -1, 93, -1, -1, - -1, 97, -1, 41, -1, 43, 44, 45, 46, 452, - -1, -1, 455, -1, 41, -1, 43, 44, 45, 46, - -1, 85, -1, -1, 88, 89, 469, -1, 92, 93, - 473, 95, -1, 476, -1, -1, -1, 480, 4, -1, - -1, 484, 485, -1, 10, 488, -1, -1, -1, -1, - 493, -1, -1, -1, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 4, 42, -1, -1, -1, - -1, 10, 84, 85, 86, 87, 88, 89, -1, -1, - 92, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 4, 42, -1, -1, -1, -1, 10, -1, - 85, 86, 87, 88, 89, 90, 91, 92, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, -1, - 42, 313, 314, 315, 316, -1, 318, 319, -1, 321, - -1, 323, 324, 325, 326, 327, -1, 329, -1, 331, - 332, 333, 85, 86, 87, 88, 89, 90, 91, 92, - -1, -1, -1, -1, -1, 98, 85, 86, 87, 88, - 89, 90, 91, 92, -1, -1, -1, -1, -1, 98, - 72, 73, 74, 75, 76, 77, 78, -1, 80, 81, - 85, 86, 87, 88, 89, 90, 91, 92, 86, 87, - 88, 89, 90, 91, 92, 87, 88, 89, 90, 91, - 92, 6, 7, 8, 9, 10, 11, 51, 52, 53, - 54, 55, 56 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 100, 0, 43, 59, 81, 82, 84, 93, 97, - 101, 107, 108, 109, 147, 148, 149, 150, 155, 158, - 159, 164, 167, 168, 173, 188, 189, 82, 89, 93, - 97, 185, 186, 176, 186, 186, 5, 12, 13, 14, - 15, 41, 42, 46, 47, 57, 58, 60, 173, 85, - 86, 87, 88, 89, 90, 91, 92, 186, 186, 186, - 95, 184, 85, 86, 87, 88, 89, 90, 91, 92, - 3, 43, 44, 45, 72, 73, 74, 75, 76, 77, - 78, 179, 98, 176, 178, 177, 178, 178, 177, 177, - 176, 176, 178, 176, 169, 176, 186, 186, 186, 186, - 186, 186, 186, 186, 98, 185, 186, 186, 186, 186, - 186, 186, 186, 186, 165, 185, 185, 185, 3, 80, - 81, 179, 180, 179, 180, 16, 113, 113, 180, 180, - 3, 3, 180, 3, 180, 3, 61, 62, 63, 64, - 65, 66, 67, 3, 180, 166, 184, 102, 96, 188, - 188, 151, 156, 160, 161, 170, 185, 185, 185, 185, - 185, 185, 185, 160, 4, 185, 4, 80, 103, 104, - 188, 185, 184, 184, 4, 48, 50, 152, 4, 48, - 50, 157, 4, 83, 162, 163, 186, 4, 68, 69, - 184, 184, 4, 80, 95, 95, 187, 184, 184, 49, - 80, 80, 49, 80, 80, 95, 3, 3, 184, 184, - 80, 188, 95, 184, 184, 184, 153, 184, 3, 184, - 83, 186, 71, 70, 184, 184, 6, 7, 8, 9, - 10, 11, 105, 106, 110, 111, 184, 153, 3, 51, - 52, 53, 54, 55, 56, 95, 154, 184, 156, 3, - 184, 3, 80, 95, 106, 114, 114, 112, 151, 154, - 183, 184, 4, 156, 3, 184, 171, 172, 106, 3, - 16, 17, 18, 19, 41, 43, 44, 45, 46, 3, - 114, 4, 4, 156, 183, 4, 70, 4, 184, 115, - 185, 80, 80, 173, 79, 82, 97, 181, 182, 185, - 185, 185, 185, 173, 115, 3, 4, 3, 4, 80, - 184, 4, 10, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 42, 116, 182, 185, 85, 95, - 184, 4, 115, 156, 95, 80, 139, 188, 139, 139, - 139, 139, 122, 139, 139, 125, 139, 129, 139, 139, - 139, 139, 139, 135, 139, 80, 81, 174, 175, 188, - 139, 139, 139, 175, 98, 79, 182, 80, 4, 4, - 80, 95, 185, 95, 117, 118, 119, 121, 138, 185, - 123, 124, 138, 126, 138, 130, 131, 132, 133, 134, - 138, 136, 95, 95, 185, 95, 120, 127, 128, 185, - 182, 184, 95, 184, 138, 138, 138, 138, 184, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 95, 138, - 138, 138, 184, 184, 80, 95, 141, 184, 185, 184, - 184, 141, 142, 184, 184, 95, 3, 140, 184, 184, - 181, 184, 184, 185, 160, 184, 184, 184, 95, 140, - 145, 95, 4, 95, 140, 143, 184, 184, 146, 183, - 184, 185, 144, 183, 184, 184, 183, 184, 181, 140, - 184, 95, 181, 140, 184, 183, 184, 140, 184, 140, - 185, 140, 140, 184, 140, 95, 140, 137, 181, 183 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 18: -#line 184 "rcparse.y" - { - define_accelerator ((yyvsp[-5].id), &(yyvsp[-3].res_info), (yyvsp[-1].pacc)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 19: -#line 194 "rcparse.y" - { - (yyval.pacc) = NULL; - } - break; - - case 20: -#line 198 "rcparse.y" - { - struct accelerator *a; - - a = (struct accelerator *) res_alloc (sizeof *a); - *a = (yyvsp[0].acc); - if ((yyvsp[-1].pacc) == NULL) - (yyval.pacc) = a; - else - { - struct accelerator **pp; - - for (pp = &(yyvsp[-1].pacc)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = a; - (yyval.pacc) = (yyvsp[-1].pacc); - } - } - break; - - case 21: -#line 219 "rcparse.y" - { - (yyval.acc) = (yyvsp[-1].acc); - (yyval.acc).id = (yyvsp[0].il); - } - break; - - case 22: -#line 224 "rcparse.y" - { - (yyval.acc) = (yyvsp[-3].acc); - (yyval.acc).id = (yyvsp[-2].il); - (yyval.acc).flags |= (yyvsp[0].is); - if (((yyval.acc).flags & ACC_VIRTKEY) == 0 - && ((yyval.acc).flags & (ACC_SHIFT | ACC_CONTROL)) != 0) - rcparse_warning (_("inappropriate modifiers for non-VIRTKEY")); - } - break; - - case 23: -#line 236 "rcparse.y" - { - const char *s = (yyvsp[0].s); - char ch; - - (yyval.acc).next = NULL; - (yyval.acc).id = 0; - ch = *s; - if (ch != '^') - (yyval.acc).flags = 0; - else - { - (yyval.acc).flags = ACC_CONTROL | ACC_VIRTKEY; - ++s; - ch = *s; - ch = TOUPPER (ch); - } - (yyval.acc).key = ch; - if (s[1] != '\0') - rcparse_warning (_("accelerator should only be one character")); - } - break; - - case 24: -#line 257 "rcparse.y" - { - (yyval.acc).next = NULL; - (yyval.acc).flags = 0; - (yyval.acc).id = 0; - (yyval.acc).key = (yyvsp[0].il); - } - break; - - case 25: -#line 267 "rcparse.y" - { - (yyval.is) = (yyvsp[0].is); - } - break; - - case 26: -#line 271 "rcparse.y" - { - (yyval.is) = (yyvsp[-2].is) | (yyvsp[0].is); - } - break; - - case 27: -#line 276 "rcparse.y" - { - (yyval.is) = (yyvsp[-1].is) | (yyvsp[0].is); - } - break; - - case 28: -#line 283 "rcparse.y" - { - (yyval.is) = ACC_VIRTKEY; - } - break; - - case 29: -#line 287 "rcparse.y" - { - /* This is just the absence of VIRTKEY. */ - (yyval.is) = 0; - } - break; - - case 30: -#line 292 "rcparse.y" - { - (yyval.is) = ACC_NOINVERT; - } - break; - - case 31: -#line 296 "rcparse.y" - { - (yyval.is) = ACC_SHIFT; - } - break; - - case 32: -#line 300 "rcparse.y" - { - (yyval.is) = ACC_CONTROL; - } - break; - - case 33: -#line 304 "rcparse.y" - { - (yyval.is) = ACC_ALT; - } - break; - - case 34: -#line 313 "rcparse.y" - { - define_bitmap ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 35: -#line 325 "rcparse.y" - { - define_cursor ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 36: -#line 338 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[-3].il); - dialog.y = (yyvsp[-2].il); - dialog.width = (yyvsp[-1].il); - dialog.height = (yyvsp[0].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[-4].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = NULL; - dialog.controls = NULL; - sub_res_info = (yyvsp[-5].res_info); - style = 0; - } - break; - - case 37: -#line 355 "rcparse.y" - { - define_dialog ((yyvsp[-12].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 38: -#line 363 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[-3].il); - dialog.y = (yyvsp[-2].il); - dialog.width = (yyvsp[-1].il); - dialog.height = (yyvsp[0].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[-4].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = ((struct dialog_ex *) - res_alloc (sizeof (struct dialog_ex))); - memset (dialog.ex, 0, sizeof (struct dialog_ex)); - dialog.controls = NULL; - sub_res_info = (yyvsp[-5].res_info); - style = 0; - } - break; - - case 39: -#line 382 "rcparse.y" - { - define_dialog ((yyvsp[-12].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 40: -#line 390 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[-4].il); - dialog.y = (yyvsp[-3].il); - dialog.width = (yyvsp[-2].il); - dialog.height = (yyvsp[-1].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[-5].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = ((struct dialog_ex *) - res_alloc (sizeof (struct dialog_ex))); - memset (dialog.ex, 0, sizeof (struct dialog_ex)); - dialog.ex->help = (yyvsp[0].il); - dialog.controls = NULL; - sub_res_info = (yyvsp[-6].res_info); - style = 0; - } - break; - - case 41: -#line 410 "rcparse.y" - { - define_dialog ((yyvsp[-13].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 42: -#line 420 "rcparse.y" - { - (yyval.il) = 0; - } - break; - - case 43: -#line 424 "rcparse.y" - { - (yyval.il) = (yyvsp[0].il); - } - break; - - case 45: -#line 432 "rcparse.y" - { - dialog.style |= WS_CAPTION; - style |= WS_CAPTION; - unicode_from_ascii ((int *) NULL, &dialog.caption, (yyvsp[0].s)); - } - break; - - case 46: -#line 438 "rcparse.y" - { - dialog.class = (yyvsp[0].id); - } - break; - - case 47: -#line 443 "rcparse.y" - { - dialog.style = style; - } - break; - - case 48: -#line 447 "rcparse.y" - { - dialog.exstyle = (yyvsp[0].il); - } - break; - - case 49: -#line 451 "rcparse.y" - { - res_string_to_id (& dialog.class, (yyvsp[0].s)); - } - break; - - case 50: -#line 455 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[-2].il); - unicode_from_ascii ((int *) NULL, &dialog.font, (yyvsp[0].s)); - if (dialog.ex != NULL) - { - dialog.ex->weight = 0; - dialog.ex->italic = 0; - dialog.ex->charset = 1; - } - } - break; - - case 51: -#line 468 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[-3].il); - unicode_from_ascii ((int *) NULL, &dialog.font, (yyvsp[-1].s)); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[0].il); - dialog.ex->italic = 0; - dialog.ex->charset = 1; - } - } - break; - - case 52: -#line 483 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[-4].il); - unicode_from_ascii ((int *) NULL, &dialog.font, (yyvsp[-2].s)); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[-1].il); - dialog.ex->italic = (yyvsp[0].il); - dialog.ex->charset = 1; - } - } - break; - - case 53: -#line 498 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[-5].il); - unicode_from_ascii ((int *) NULL, &dialog.font, (yyvsp[-3].s)); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[-2].il); - dialog.ex->italic = (yyvsp[-1].il); - dialog.ex->charset = (yyvsp[0].il); - } - } - break; - - case 54: -#line 513 "rcparse.y" - { - dialog.menu = (yyvsp[0].id); - } - break; - - case 55: -#line 517 "rcparse.y" - { - sub_res_info.characteristics = (yyvsp[0].il); - } - break; - - case 56: -#line 521 "rcparse.y" - { - sub_res_info.language = (yyvsp[-1].il) | ((yyvsp[0].il) << SUBLANG_SHIFT); - } - break; - - case 57: -#line 525 "rcparse.y" - { - sub_res_info.version = (yyvsp[0].il); - } - break; - - case 59: -#line 533 "rcparse.y" - { - struct dialog_control **pp; - - for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[0].dialog_control); - } - break; - - case 60: -#line 544 "rcparse.y" - { - default_style = BS_AUTO3STATE | WS_TABSTOP; - base_style = BS_AUTO3STATE; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 61: -#line 551 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 62: -#line 555 "rcparse.y" - { - default_style = BS_AUTOCHECKBOX | WS_TABSTOP; - base_style = BS_AUTOCHECKBOX; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 63: -#line 562 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 64: -#line 566 "rcparse.y" - { - default_style = BS_AUTORADIOBUTTON | WS_TABSTOP; - base_style = BS_AUTORADIOBUTTON; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 65: -#line 573 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 66: -#line 577 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; - res_text_field = (yyvsp[0].id); - } - break; - - case 67: -#line 584 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("BEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "BEDIT"); - } - break; - - case 68: -#line 591 "rcparse.y" - { - default_style = BS_CHECKBOX | WS_TABSTOP; - base_style = BS_CHECKBOX | WS_TABSTOP; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 69: -#line 598 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 70: -#line 602 "rcparse.y" - { - /* This is as per MSDN documentation. With some (???) - versions of MS rc.exe their is no default style. */ - default_style = CBS_SIMPLE | WS_TABSTOP; - base_style = 0; - class = CTL_COMBOBOX; - res_text_field = res_null_text; - } - break; - - case 71: -#line 611 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 72: -#line 616 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-9].id), (yyvsp[-8].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-2].il), (yyvsp[-7].il), style, (yyvsp[-1].il)); - if ((yyvsp[0].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - } - break; - - case 73: -#line 627 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-10].id), (yyvsp[-9].il), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-8].il), style, (yyvsp[-2].il)); - if (dialog.ex == NULL) - rcparse_warning (_("help ID requires DIALOGEX")); - (yyval.dialog_control)->help = (yyvsp[-1].il); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - break; - - case 74: -#line 636 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-10].id), (yyvsp[-9].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-2].il), 0, style, (yyvsp[-1].il)); - if ((yyvsp[0].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning ("control data requires DIALOGEX"); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - (yyval.dialog_control)->class.named = 1; - unicode_from_ascii (&(yyval.dialog_control)->class.u.n.length, &(yyval.dialog_control)->class.u.n.name, (yyvsp[-7].s)); - } - break; - - case 75: -#line 649 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-11].id), (yyvsp[-10].il), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), 0, style, (yyvsp[-2].il)); - if (dialog.ex == NULL) - rcparse_warning ("help ID requires DIALOGEX"); - (yyval.dialog_control)->help = (yyvsp[-1].il); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - (yyval.dialog_control)->class.named = 1; - unicode_from_ascii (&(yyval.dialog_control)->class.u.n.length, &(yyval.dialog_control)->class.u.n.name, (yyvsp[-8].s)); - } - break; - - case 76: -#line 659 "rcparse.y" - { - default_style = SS_CENTER | WS_GROUP; - base_style = SS_CENTER; - class = CTL_STATIC; - res_text_field = (yyvsp[0].id); - } - break; - - case 77: -#line 666 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 78: -#line 670 "rcparse.y" - { - default_style = BS_DEFPUSHBUTTON | WS_TABSTOP; - base_style = BS_DEFPUSHBUTTON | WS_TABSTOP; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 79: -#line 677 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 80: -#line 681 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; - res_text_field = res_null_text; - } - break; - - case 81: -#line 688 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 82: -#line 692 "rcparse.y" - { - default_style = BS_GROUPBOX; - base_style = BS_GROUPBOX; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 83: -#line 699 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 84: -#line 703 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; - res_text_field = (yyvsp[0].id); - } - break; - - case 85: -#line 710 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("IEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "HEDIT"); - } - break; - - case 86: -#line 717 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[-4].id), (yyvsp[-3].il), (yyvsp[-2].il), (yyvsp[-1].il), 0, 0, 0, (yyvsp[0].rcdata_item), - dialog.ex); - } - break; - - case 87: -#line 723 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[-6].id), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), 0, 0, 0, (yyvsp[0].rcdata_item), - dialog.ex); - } - break; - - case 88: -#line 729 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[-8].id), (yyvsp[-7].il), (yyvsp[-6].il), (yyvsp[-5].il), style, (yyvsp[-1].il), 0, (yyvsp[0].rcdata_item), - dialog.ex); - } - break; - - case 89: -#line 735 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[-9].id), (yyvsp[-8].il), (yyvsp[-7].il), (yyvsp[-6].il), style, (yyvsp[-2].il), (yyvsp[-1].il), (yyvsp[0].rcdata_item), - dialog.ex); - } - break; - - case 90: -#line 740 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; - res_text_field = (yyvsp[0].id); - } - break; - - case 91: -#line 747 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("IEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "IEDIT"); - } - break; - - case 92: -#line 754 "rcparse.y" - { - default_style = LBS_NOTIFY | WS_BORDER; - base_style = LBS_NOTIFY | WS_BORDER; - class = CTL_LISTBOX; - res_text_field = res_null_text; - } - break; - - case 93: -#line 761 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 94: -#line 765 "rcparse.y" - { - default_style = SS_LEFT | WS_GROUP; - base_style = SS_LEFT; - class = CTL_STATIC; - res_text_field = (yyvsp[0].id); - } - break; - - case 95: -#line 772 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 96: -#line 776 "rcparse.y" - { - default_style = BS_PUSHBOX | WS_TABSTOP; - base_style = BS_PUSHBOX; - class = CTL_BUTTON; - } - break; - - case 97: -#line 782 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 98: -#line 786 "rcparse.y" - { - default_style = BS_PUSHBUTTON | WS_TABSTOP; - base_style = BS_PUSHBUTTON | WS_TABSTOP; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 99: -#line 793 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 100: -#line 797 "rcparse.y" - { - default_style = BS_RADIOBUTTON | WS_TABSTOP; - base_style = BS_RADIOBUTTON; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 101: -#line 804 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 102: -#line 808 "rcparse.y" - { - default_style = SS_RIGHT | WS_GROUP; - base_style = SS_RIGHT; - class = CTL_STATIC; - res_text_field = (yyvsp[0].id); - } - break; - - case 103: -#line 815 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 104: -#line 819 "rcparse.y" - { - default_style = SBS_HORZ; - base_style = 0; - class = CTL_SCROLLBAR; - res_text_field = res_null_text; - } - break; - - case 105: -#line 826 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 106: -#line 830 "rcparse.y" - { - default_style = BS_3STATE | WS_TABSTOP; - base_style = BS_3STATE; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 107: -#line 837 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 108: -#line 842 "rcparse.y" - { style = WS_CHILD | WS_VISIBLE; } - break; - - case 109: -#line 844 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-13].id), (yyvsp[-12].il), (yyvsp[-10].il), (yyvsp[-8].il), (yyvsp[-6].il), (yyvsp[-4].il), CTL_BUTTON, - style, (yyvsp[0].il)); - } - break; - - case 110: -#line 859 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-2].il), (yyvsp[-1].il), class, - default_style | WS_CHILD | WS_VISIBLE, 0); - if ((yyvsp[0].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - } - break; - - case 111: -#line 871 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[-7].il), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), class, style, (yyvsp[-1].il)); - if ((yyvsp[0].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - } - break; - - case 112: -#line 882 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[-8].il), (yyvsp[-7].il), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), class, style, (yyvsp[-2].il)); - if (dialog.ex == NULL) - rcparse_warning (_("help ID requires DIALOGEX")); - (yyval.dialog_control)->help = (yyvsp[-1].il); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - break; - - case 113: -#line 893 "rcparse.y" - { - res_string_to_id (&(yyval.id), ""); - } - break; - - case 114: -#line 897 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[-1].il); - } - break; - - case 115: -#line 902 "rcparse.y" - { - res_string_to_id (&(yyval.id), (yyvsp[0].s)); - } - break; - - case 116: -#line 906 "rcparse.y" - { - res_string_to_id (&(yyval.id), (yyvsp[-1].s)); - } - break; - - case 117: -#line 913 "rcparse.y" - { - (yyval.rcdata_item) = NULL; - } - break; - - case 118: -#line 917 "rcparse.y" - { - (yyval.rcdata_item) = (yyvsp[-1].rcdata).first; - } - break; - - case 119: -#line 926 "rcparse.y" - { style = WS_CHILD | WS_VISIBLE; } - break; - - case 121: -#line 932 "rcparse.y" - { style = SS_ICON | WS_CHILD | WS_VISIBLE; } - break; - - case 123: -#line 938 "rcparse.y" - { style = base_style | WS_CHILD | WS_VISIBLE; } - break; - - case 125: -#line 946 "rcparse.y" - { - define_font ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 126: -#line 958 "rcparse.y" - { - define_icon ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 127: -#line 971 "rcparse.y" - { - language = (yyvsp[-1].il) | ((yyvsp[0].il) << SUBLANG_SHIFT); - } - break; - - case 128: -#line 980 "rcparse.y" - { - define_menu ((yyvsp[-5].id), &(yyvsp[-3].res_info), (yyvsp[-1].menuitem)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 129: -#line 990 "rcparse.y" - { - (yyval.menuitem) = NULL; - } - break; - - case 130: -#line 994 "rcparse.y" - { - if ((yyvsp[-1].menuitem) == NULL) - (yyval.menuitem) = (yyvsp[0].menuitem); - else - { - struct menuitem **pp; - - for (pp = &(yyvsp[-1].menuitem)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[0].menuitem); - (yyval.menuitem) = (yyvsp[-1].menuitem); - } - } - break; - - case 131: -#line 1011 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-2].s), (yyvsp[-1].il), (yyvsp[0].is), 0, 0, NULL); - } - break; - - case 132: -#line 1015 "rcparse.y" - { - (yyval.menuitem) = define_menuitem (NULL, 0, 0, 0, 0, NULL); - } - break; - - case 133: -#line 1019 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-4].s), 0, (yyvsp[-3].is), 0, 0, (yyvsp[-1].menuitem)); - } - break; - - case 134: -#line 1026 "rcparse.y" - { - (yyval.is) = 0; - } - break; - - case 135: -#line 1030 "rcparse.y" - { - (yyval.is) = (yyvsp[-2].is) | (yyvsp[0].is); - } - break; - - case 136: -#line 1034 "rcparse.y" - { - (yyval.is) = (yyvsp[-1].is) | (yyvsp[0].is); - } - break; - - case 137: -#line 1041 "rcparse.y" - { - (yyval.is) = MENUITEM_CHECKED; - } - break; - - case 138: -#line 1045 "rcparse.y" - { - (yyval.is) = MENUITEM_GRAYED; - } - break; - - case 139: -#line 1049 "rcparse.y" - { - (yyval.is) = MENUITEM_HELP; - } - break; - - case 140: -#line 1053 "rcparse.y" - { - (yyval.is) = MENUITEM_INACTIVE; - } - break; - - case 141: -#line 1057 "rcparse.y" - { - (yyval.is) = MENUITEM_MENUBARBREAK; - } - break; - - case 142: -#line 1061 "rcparse.y" - { - (yyval.is) = MENUITEM_MENUBREAK; - } - break; - - case 143: -#line 1070 "rcparse.y" - { - define_menu ((yyvsp[-5].id), &(yyvsp[-3].res_info), (yyvsp[-1].menuitem)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 144: -#line 1080 "rcparse.y" - { - (yyval.menuitem) = NULL; - } - break; - - case 145: -#line 1084 "rcparse.y" - { - if ((yyvsp[-1].menuitem) == NULL) - (yyval.menuitem) = (yyvsp[0].menuitem); - else - { - struct menuitem **pp; - - for (pp = &(yyvsp[-1].menuitem)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[0].menuitem); - (yyval.menuitem) = (yyvsp[-1].menuitem); - } - } - break; - - case 146: -#line 1101 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[0].s), 0, 0, 0, 0, NULL); - } - break; - - case 147: -#line 1105 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-1].s), (yyvsp[0].il), 0, 0, 0, NULL); - } - break; - - case 148: -#line 1109 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-3].s), (yyvsp[-2].il), (yyvsp[-1].il), (yyvsp[0].il), 0, NULL); - } - break; - - case 149: -#line 1113 "rcparse.y" - { - (yyval.menuitem) = define_menuitem (NULL, 0, 0, 0, 0, NULL); - } - break; - - case 150: -#line 1117 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-3].s), 0, 0, 0, 0, (yyvsp[-1].menuitem)); - } - break; - - case 151: -#line 1121 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-4].s), (yyvsp[-3].il), 0, 0, 0, (yyvsp[-1].menuitem)); - } - break; - - case 152: -#line 1125 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-5].s), (yyvsp[-4].il), (yyvsp[-3].il), 0, 0, (yyvsp[-1].menuitem)); - } - break; - - case 153: -#line 1130 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-7].s), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-1].menuitem)); - } - break; - - case 154: -#line 1139 "rcparse.y" - { - define_messagetable ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 155: -#line 1151 "rcparse.y" - { - define_rcdata ((yyvsp[-5].id), &(yyvsp[-3].res_info), (yyvsp[-1].rcdata).first); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 156: -#line 1158 "rcparse.y" - { - define_rcdata_file ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 157: -#line 1170 "rcparse.y" - { - rcparse_rcdata (); - } - break; - - case 158: -#line 1174 "rcparse.y" - { - rcparse_normal (); - (yyval.rcdata) = (yyvsp[0].rcdata); - } - break; - - case 159: -#line 1182 "rcparse.y" - { - (yyval.rcdata).first = NULL; - (yyval.rcdata).last = NULL; - } - break; - - case 160: -#line 1187 "rcparse.y" - { - (yyval.rcdata) = (yyvsp[0].rcdata); - } - break; - - case 161: -#line 1194 "rcparse.y" - { - struct rcdata_item *ri; - - ri = define_rcdata_string ((yyvsp[0].ss).s, (yyvsp[0].ss).length); - (yyval.rcdata).first = ri; - (yyval.rcdata).last = ri; - } - break; - - case 162: -#line 1202 "rcparse.y" - { - struct rcdata_item *ri; - - ri = define_rcdata_number ((yyvsp[0].i).val, (yyvsp[0].i).dword); - (yyval.rcdata).first = ri; - (yyval.rcdata).last = ri; - } - break; - - case 163: -#line 1210 "rcparse.y" - { - struct rcdata_item *ri; - - ri = define_rcdata_string ((yyvsp[0].ss).s, (yyvsp[0].ss).length); - (yyval.rcdata).first = (yyvsp[-2].rcdata).first; - (yyvsp[-2].rcdata).last->next = ri; - (yyval.rcdata).last = ri; - } - break; - - case 164: -#line 1219 "rcparse.y" - { - struct rcdata_item *ri; - - ri = define_rcdata_number ((yyvsp[0].i).val, (yyvsp[0].i).dword); - (yyval.rcdata).first = (yyvsp[-2].rcdata).first; - (yyvsp[-2].rcdata).last->next = ri; - (yyval.rcdata).last = ri; - } - break; - - case 165: -#line 1233 "rcparse.y" - { sub_res_info = (yyvsp[-1].res_info); } - break; - - case 168: -#line 1240 "rcparse.y" - { - define_stringtable (&sub_res_info, (yyvsp[-1].il), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 169: -#line 1247 "rcparse.y" - { - define_stringtable (&sub_res_info, (yyvsp[-2].il), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 170: -#line 1260 "rcparse.y" - { - define_user_data ((yyvsp[-5].id), (yyvsp[-4].id), &(yyvsp[-3].res_info), (yyvsp[-1].rcdata).first); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 171: -#line 1267 "rcparse.y" - { - define_user_file ((yyvsp[-3].id), (yyvsp[-2].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 172: -#line 1279 "rcparse.y" - { - define_versioninfo ((yyvsp[-5].id), language, (yyvsp[-3].fixver), (yyvsp[-1].verinfo)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 173: -#line 1289 "rcparse.y" - { - (yyval.fixver) = ((struct fixed_versioninfo *) - res_alloc (sizeof (struct fixed_versioninfo))); - memset ((yyval.fixver), 0, sizeof (struct fixed_versioninfo)); - } - break; - - case 174: -#line 1295 "rcparse.y" - { - (yyvsp[-5].fixver)->file_version_ms = ((yyvsp[-3].il) << 16) | (yyvsp[-2].il); - (yyvsp[-5].fixver)->file_version_ls = ((yyvsp[-1].il) << 16) | (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-5].fixver); - } - break; - - case 175: -#line 1301 "rcparse.y" - { - (yyvsp[-5].fixver)->product_version_ms = ((yyvsp[-3].il) << 16) | (yyvsp[-2].il); - (yyvsp[-5].fixver)->product_version_ls = ((yyvsp[-1].il) << 16) | (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-5].fixver); - } - break; - - case 176: -#line 1307 "rcparse.y" - { - (yyvsp[-2].fixver)->file_flags_mask = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 177: -#line 1312 "rcparse.y" - { - (yyvsp[-2].fixver)->file_flags = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 178: -#line 1317 "rcparse.y" - { - (yyvsp[-2].fixver)->file_os = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 179: -#line 1322 "rcparse.y" - { - (yyvsp[-2].fixver)->file_type = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 180: -#line 1327 "rcparse.y" - { - (yyvsp[-2].fixver)->file_subtype = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 181: -#line 1341 "rcparse.y" - { - (yyval.verinfo) = NULL; - } - break; - - case 182: -#line 1345 "rcparse.y" - { - (yyval.verinfo) = append_ver_stringfileinfo ((yyvsp[-7].verinfo), (yyvsp[-4].s), (yyvsp[-2].verstring)); - } - break; - - case 183: -#line 1349 "rcparse.y" - { - (yyval.verinfo) = append_ver_varfileinfo ((yyvsp[-6].verinfo), (yyvsp[-2].s), (yyvsp[-1].vervar)); - } - break; - - case 184: -#line 1356 "rcparse.y" - { - (yyval.verstring) = NULL; - } - break; - - case 185: -#line 1360 "rcparse.y" - { - (yyval.verstring) = append_verval ((yyvsp[-4].verstring), (yyvsp[-2].s), (yyvsp[0].s)); - } - break; - - case 186: -#line 1367 "rcparse.y" - { - (yyval.vervar) = NULL; - } - break; - - case 187: -#line 1371 "rcparse.y" - { - (yyval.vervar) = append_vertrans ((yyvsp[-2].vervar), (yyvsp[-1].il), (yyvsp[0].il)); - } - break; - - case 188: -#line 1380 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[0].il); - } - break; - - case 189: -#line 1385 "rcparse.y" - { - char *copy, *s; - - /* It seems that resource ID's are forced to upper case. */ - copy = xstrdup ((yyvsp[0].s)); - for (s = copy; *s != '\0'; s++) - *s = TOUPPER (*s); - res_string_to_id (&(yyval.id), copy); - free (copy); - } - break; - - case 190: -#line 1401 "rcparse.y" - { - (yyval.s) = (yyvsp[0].s); - } - break; - - case 191: -#line 1405 "rcparse.y" - { - (yyval.s) = (yyvsp[-1].s); - } - break; - - case 192: -#line 1409 "rcparse.y" - { - (yyval.s) = (yyvsp[-1].s); - } - break; - - case 193: -#line 1417 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[-1].il); - } - break; - - case 194: -#line 1422 "rcparse.y" - { - char *copy, *s; - - /* It seems that resource ID's are forced to upper case. */ - copy = xstrdup ((yyvsp[0].s)); - for (s = copy; *s != '\0'; s++) - *s = TOUPPER (*s); - res_string_to_id (&(yyval.id), copy); - free (copy); - } - break; - - case 195: -#line 1439 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (struct res_res_info)); - (yyval.res_info).language = language; - /* FIXME: Is this the right default? */ - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; - } - break; - - case 196: -#line 1446 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-1].res_info); - (yyval.res_info).memflags |= (yyvsp[0].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[0].memflags).off; - } - break; - - case 197: -#line 1452 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-2].res_info); - (yyval.res_info).characteristics = (yyvsp[0].il); - } - break; - - case 198: -#line 1457 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-3].res_info); - (yyval.res_info).language = (yyvsp[-1].il) | ((yyvsp[0].il) << SUBLANG_SHIFT); - } - break; - - case 199: -#line 1462 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-2].res_info); - (yyval.res_info).version = (yyvsp[0].il); - } - break; - - case 200: -#line 1472 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (struct res_res_info)); - (yyval.res_info).language = language; - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE; - } - break; - - case 201: -#line 1478 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-1].res_info); - (yyval.res_info).memflags |= (yyvsp[0].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[0].memflags).off; - } - break; - - case 202: -#line 1489 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (struct res_res_info)); - (yyval.res_info).language = language; - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; - } - break; - - case 203: -#line 1495 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-1].res_info); - (yyval.res_info).memflags |= (yyvsp[0].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[0].memflags).off; - } - break; - - case 204: -#line 1507 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_MOVEABLE; - (yyval.memflags).off = 0; - } - break; - - case 205: -#line 1512 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_MOVEABLE; - } - break; - - case 206: -#line 1517 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_PURE; - (yyval.memflags).off = 0; - } - break; - - case 207: -#line 1522 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_PURE; - } - break; - - case 208: -#line 1527 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_PRELOAD; - (yyval.memflags).off = 0; - } - break; - - case 209: -#line 1532 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_PRELOAD; - } - break; - - case 210: -#line 1537 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_DISCARDABLE; - (yyval.memflags).off = 0; - } - break; - - case 211: -#line 1547 "rcparse.y" - { - (yyval.s) = (yyvsp[0].s); - } - break; - - case 212: -#line 1551 "rcparse.y" - { - (yyval.s) = (yyvsp[0].s); - } - break; - - case 213: -#line 1568 "rcparse.y" - { - style |= (yyvsp[0].il); - } - break; - - case 214: -#line 1572 "rcparse.y" - { - style &=~ (yyvsp[0].il); - } - break; - - case 215: -#line 1576 "rcparse.y" - { - style |= (yyvsp[0].il); - } - break; - - case 216: -#line 1580 "rcparse.y" - { - style &=~ (yyvsp[0].il); - } - break; - - case 217: -#line 1587 "rcparse.y" - { - (yyval.il) = (yyvsp[0].i).val; - } - break; - - case 218: -#line 1591 "rcparse.y" - { - (yyval.il) = (yyvsp[-1].il); - } - break; - - case 219: -#line 1600 "rcparse.y" - { - (yyval.il) = 0; - } - break; - - case 220: -#line 1604 "rcparse.y" - { - (yyval.il) = (yyvsp[0].il); - } - break; - - case 221: -#line 1613 "rcparse.y" - { - (yyval.il) = (yyvsp[0].il); - } - break; - - case 222: -#line 1622 "rcparse.y" - { - (yyval.il) = (yyvsp[0].i).val; - } - break; - - case 223: -#line 1631 "rcparse.y" - { - (yyval.i) = (yyvsp[0].i); - } - break; - - case 224: -#line 1635 "rcparse.y" - { - (yyval.i) = (yyvsp[-1].i); - } - break; - - case 225: -#line 1639 "rcparse.y" - { - (yyval.i).val = ~ (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[0].i).dword; - } - break; - - case 226: -#line 1644 "rcparse.y" - { - (yyval.i).val = - (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[0].i).dword; - } - break; - - case 227: -#line 1649 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val * (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 228: -#line 1654 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val / (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 229: -#line 1659 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val % (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 230: -#line 1664 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val + (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 231: -#line 1669 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val - (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 232: -#line 1674 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val & (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 233: -#line 1679 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val ^ (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 234: -#line 1684 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val | (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 235: -#line 1695 "rcparse.y" - { - (yyval.il) = (yyvsp[0].il); - } - break; - - case 236: -#line 1704 "rcparse.y" - { - (yyval.il) = (yyvsp[0].i).val; - } - break; - - case 237: -#line 1715 "rcparse.y" - { - (yyval.i) = (yyvsp[0].i); - } - break; - - case 238: -#line 1719 "rcparse.y" - { - (yyval.i) = (yyvsp[-1].i); - } - break; - - case 239: -#line 1723 "rcparse.y" - { - (yyval.i).val = ~ (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[0].i).dword; - } - break; - - case 240: -#line 1728 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val * (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 241: -#line 1733 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val / (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 242: -#line 1738 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val % (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 243: -#line 1743 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val + (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 244: -#line 1748 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val - (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 245: -#line 1753 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val & (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 246: -#line 1758 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val ^ (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 247: -#line 1763 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val | (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 3867 "rcparse.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 1769 "rcparse.y" - - -/* Set the language from the command line. */ - -void -rcparse_set_language (int lang) -{ - language = lang; -} - diff --git a/binutils/rcparse.h b/binutils/rcparse.h deleted file mode 100644 index f61d200ae7db..000000000000 --- a/binutils/rcparse.h +++ /dev/null @@ -1,255 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BEG = 258, - END = 259, - ACCELERATORS = 260, - VIRTKEY = 261, - ASCII = 262, - NOINVERT = 263, - SHIFT = 264, - CONTROL = 265, - ALT = 266, - BITMAP = 267, - CURSOR = 268, - DIALOG = 269, - DIALOGEX = 270, - EXSTYLE = 271, - CAPTION = 272, - CLASS = 273, - STYLE = 274, - AUTO3STATE = 275, - AUTOCHECKBOX = 276, - AUTORADIOBUTTON = 277, - CHECKBOX = 278, - COMBOBOX = 279, - CTEXT = 280, - DEFPUSHBUTTON = 281, - EDITTEXT = 282, - GROUPBOX = 283, - LISTBOX = 284, - LTEXT = 285, - PUSHBOX = 286, - PUSHBUTTON = 287, - RADIOBUTTON = 288, - RTEXT = 289, - SCROLLBAR = 290, - STATE3 = 291, - USERBUTTON = 292, - BEDIT = 293, - HEDIT = 294, - IEDIT = 295, - FONT = 296, - ICON = 297, - LANGUAGE = 298, - CHARACTERISTICS = 299, - VERSIONK = 300, - MENU = 301, - MENUEX = 302, - MENUITEM = 303, - SEPARATOR = 304, - POPUP = 305, - CHECKED = 306, - GRAYED = 307, - HELP = 308, - INACTIVE = 309, - MENUBARBREAK = 310, - MENUBREAK = 311, - MESSAGETABLE = 312, - RCDATA = 313, - STRINGTABLE = 314, - VERSIONINFO = 315, - FILEVERSION = 316, - PRODUCTVERSION = 317, - FILEFLAGSMASK = 318, - FILEFLAGS = 319, - FILEOS = 320, - FILETYPE = 321, - FILESUBTYPE = 322, - BLOCKSTRINGFILEINFO = 323, - BLOCKVARFILEINFO = 324, - VALUE = 325, - BLOCK = 326, - MOVEABLE = 327, - FIXED = 328, - PURE = 329, - IMPURE = 330, - PRELOAD = 331, - LOADONCALL = 332, - DISCARDABLE = 333, - NOT = 334, - QUOTEDSTRING = 335, - STRING = 336, - NUMBER = 337, - SIZEDSTRING = 338, - IGNORED_TOKEN = 339, - NEG = 340 - }; -#endif -/* Tokens. */ -#define BEG 258 -#define END 259 -#define ACCELERATORS 260 -#define VIRTKEY 261 -#define ASCII 262 -#define NOINVERT 263 -#define SHIFT 264 -#define CONTROL 265 -#define ALT 266 -#define BITMAP 267 -#define CURSOR 268 -#define DIALOG 269 -#define DIALOGEX 270 -#define EXSTYLE 271 -#define CAPTION 272 -#define CLASS 273 -#define STYLE 274 -#define AUTO3STATE 275 -#define AUTOCHECKBOX 276 -#define AUTORADIOBUTTON 277 -#define CHECKBOX 278 -#define COMBOBOX 279 -#define CTEXT 280 -#define DEFPUSHBUTTON 281 -#define EDITTEXT 282 -#define GROUPBOX 283 -#define LISTBOX 284 -#define LTEXT 285 -#define PUSHBOX 286 -#define PUSHBUTTON 287 -#define RADIOBUTTON 288 -#define RTEXT 289 -#define SCROLLBAR 290 -#define STATE3 291 -#define USERBUTTON 292 -#define BEDIT 293 -#define HEDIT 294 -#define IEDIT 295 -#define FONT 296 -#define ICON 297 -#define LANGUAGE 298 -#define CHARACTERISTICS 299 -#define VERSIONK 300 -#define MENU 301 -#define MENUEX 302 -#define MENUITEM 303 -#define SEPARATOR 304 -#define POPUP 305 -#define CHECKED 306 -#define GRAYED 307 -#define HELP 308 -#define INACTIVE 309 -#define MENUBARBREAK 310 -#define MENUBREAK 311 -#define MESSAGETABLE 312 -#define RCDATA 313 -#define STRINGTABLE 314 -#define VERSIONINFO 315 -#define FILEVERSION 316 -#define PRODUCTVERSION 317 -#define FILEFLAGSMASK 318 -#define FILEFLAGS 319 -#define FILEOS 320 -#define FILETYPE 321 -#define FILESUBTYPE 322 -#define BLOCKSTRINGFILEINFO 323 -#define BLOCKVARFILEINFO 324 -#define VALUE 325 -#define BLOCK 326 -#define MOVEABLE 327 -#define FIXED 328 -#define PURE 329 -#define IMPURE 330 -#define PRELOAD 331 -#define LOADONCALL 332 -#define DISCARDABLE 333 -#define NOT 334 -#define QUOTEDSTRING 335 -#define STRING 336 -#define NUMBER 337 -#define SIZEDSTRING 338 -#define IGNORED_TOKEN 339 -#define NEG 340 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 66 "rcparse.y" -typedef union YYSTYPE { - struct accelerator acc; - struct accelerator *pacc; - struct dialog_control *dialog_control; - struct menuitem *menuitem; - struct - { - struct rcdata_item *first; - struct rcdata_item *last; - } rcdata; - struct rcdata_item *rcdata_item; - struct stringtable_data *stringtable; - struct fixed_versioninfo *fixver; - struct ver_info *verinfo; - struct ver_stringinfo *verstring; - struct ver_varinfo *vervar; - struct res_id id; - struct res_res_info res_info; - struct - { - unsigned short on; - unsigned short off; - } memflags; - struct - { - unsigned long val; - /* Nonzero if this number was explicitly specified as long. */ - int dword; - } i; - unsigned long il; - unsigned short is; - const char *s; - struct - { - unsigned long length; - const char *s; - } ss; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 247 "rcparse.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/rcparse.y b/binutils/rcparse.y index fbc5bef6f8ae..ac72ee777789 100644 --- a/binutils/rcparse.y +++ b/binutils/rcparse.y @@ -1,7 +1,8 @@ %{ /* rcparse.y -- parser for Windows rc files - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Extended by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -23,6 +24,7 @@ /* This is a parser for Windows rc files. It is based on the parser by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -35,12 +37,12 @@ static unsigned short language; /* The resource information during a sub statement. */ -static struct res_res_info sub_res_info; +static rc_res_res_info sub_res_info; /* Dialog information. This is built by the nonterminals styles and controls. */ -static struct dialog dialog; +static rc_dialog dialog; /* This is used when building a style. It is modified by the nonterminal styleexpr. */ @@ -50,56 +52,62 @@ static unsigned long style; /* These are used when building a control. They are set before using control_params. */ -static unsigned long base_style; -static unsigned long default_style; -static unsigned long class; -static struct res_id res_text_field; +static rc_uint_type base_style; +static rc_uint_type default_style; +static rc_res_id class; +static rc_res_id res_text_field; static unichar null_unichar; /* This is used for COMBOBOX, LISTBOX and EDITTEXT which do not allow resource 'text' field in control definition. */ -static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; +static const rc_res_id res_null_text = { 1, {{0, &null_unichar}}}; %} %union { - struct accelerator acc; - struct accelerator *pacc; - struct dialog_control *dialog_control; - struct menuitem *menuitem; + rc_accelerator acc; + rc_accelerator *pacc; + rc_dialog_control *dialog_control; + rc_menuitem *menuitem; struct { - struct rcdata_item *first; - struct rcdata_item *last; + rc_rcdata_item *first; + rc_rcdata_item *last; } rcdata; - struct rcdata_item *rcdata_item; - struct stringtable_data *stringtable; - struct fixed_versioninfo *fixver; - struct ver_info *verinfo; - struct ver_stringinfo *verstring; - struct ver_varinfo *vervar; - struct res_id id; - struct res_res_info res_info; + rc_rcdata_item *rcdata_item; + rc_fixed_versioninfo *fixver; + rc_ver_info *verinfo; + rc_ver_stringinfo *verstring; + rc_ver_varinfo *vervar; + rc_toolbar_item *toobar_item; + rc_res_id id; + rc_res_res_info res_info; struct { - unsigned short on; - unsigned short off; + rc_uint_type on; + rc_uint_type off; } memflags; struct { - unsigned long val; + rc_uint_type val; /* Nonzero if this number was explicitly specified as long. */ int dword; } i; - unsigned long il; - unsigned short is; + rc_uint_type il; + rc_uint_type is; const char *s; struct { - unsigned long length; + rc_uint_type length; const char *s; } ss; + unichar *uni; + struct + { + rc_uint_type length; + const unichar *s; + } suni; }; %token BEG END @@ -113,6 +121,7 @@ static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; %token BEDIT HEDIT IEDIT %token FONT %token ICON +%token ANICURSOR ANIICON DLGINCLUDE DLGINIT FONTDIR HTML MANIFEST PLUGPLAY VXD TOOLBAR BUTTON %token LANGUAGE CHARACTERISTICS VERSIONK %token MENU MENUEX MENUITEM SEPARATOR POPUP CHECKED GRAYED HELP INACTIVE %token MENUBARBREAK MENUBREAK @@ -125,8 +134,10 @@ static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; %token <s> BLOCK %token MOVEABLE FIXED PURE IMPURE PRELOAD LOADONCALL DISCARDABLE %token NOT +%token <uni> QUOTEDUNISTRING %token <s> QUOTEDSTRING STRING %token <i> NUMBER +%token <suni> SIZEDUNISTRING %token <ss> SIZEDSTRING %token IGNORED_TOKEN @@ -140,13 +151,17 @@ static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; %type <verinfo> verblocks %type <verstring> vervals %type <vervar> vertrans +%type <toobar_item> toolbar_data %type <res_info> suboptions memflags_move_discard memflags_move %type <memflags> memflag -%type <id> id optresidc resref +%type <id> id rcdata_id optresidc resref resid cresid %type <il> exstyle parennumber %type <il> numexpr posnumexpr cnumexpr optcnumexpr cposnumexpr %type <is> acc_options acc_option menuitem_flags menuitem_flag -%type <s> file_name resname +%type <s> file_name +%type <uni> res_unicode_string resname res_unicode_string_concat +%type <ss> sizedstring +%type <suni> sizedunistring %type <i> sizednumexpr sizedposnumexpr %left '|' @@ -170,8 +185,8 @@ input: | input menu | input menuex | input messagetable - | input rcdata | input stringtable + | input toolbar | input user | input versioninfo | input IGNORED_TOKEN @@ -196,15 +211,15 @@ acc_entries: } | acc_entries acc_entry { - struct accelerator *a; + rc_accelerator *a; - a = (struct accelerator *) res_alloc (sizeof *a); + a = (rc_accelerator *) res_alloc (sizeof *a); *a = $2; if ($1 == NULL) $$ = a; else { - struct accelerator **pp; + rc_accelerator **pp; for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next) ; @@ -246,8 +261,7 @@ acc_event: { $$.flags = ACC_CONTROL | ACC_VIRTKEY; ++s; - ch = *s; - ch = TOUPPER (ch); + ch = TOUPPER (s[0]); } $$.key = ch; if (s[1] != '\0') @@ -371,9 +385,9 @@ dialog: dialog.menu.named = 1; dialog.class.named = 1; dialog.font = NULL; - dialog.ex = ((struct dialog_ex *) - res_alloc (sizeof (struct dialog_ex))); - memset (dialog.ex, 0, sizeof (struct dialog_ex)); + dialog.ex = ((rc_dialog_ex *) + res_alloc (sizeof (rc_dialog_ex))); + memset (dialog.ex, 0, sizeof (rc_dialog_ex)); dialog.controls = NULL; sub_res_info = $3; style = 0; @@ -398,9 +412,9 @@ dialog: dialog.menu.named = 1; dialog.class.named = 1; dialog.font = NULL; - dialog.ex = ((struct dialog_ex *) - res_alloc (sizeof (struct dialog_ex))); - memset (dialog.ex, 0, sizeof (struct dialog_ex)); + dialog.ex = ((rc_dialog_ex *) + res_alloc (sizeof (rc_dialog_ex))); + memset (dialog.ex, 0, sizeof (rc_dialog_ex)); dialog.ex->help = $9; dialog.controls = NULL; sub_res_info = $3; @@ -428,11 +442,11 @@ exstyle: styles: /* empty */ - | styles CAPTION QUOTEDSTRING + | styles CAPTION res_unicode_string_concat { dialog.style |= WS_CAPTION; style |= WS_CAPTION; - unicode_from_ascii ((int *) NULL, &dialog.caption, $3); + dialog.caption = $3; } | styles CLASS id { @@ -447,16 +461,16 @@ styles: { dialog.exstyle = $3; } - | styles CLASS QUOTEDSTRING + | styles CLASS res_unicode_string_concat { - res_string_to_id (& dialog.class, $3); + res_unistring_to_id (& dialog.class, $3); } - | styles FONT numexpr ',' QUOTEDSTRING + | styles FONT numexpr ',' res_unicode_string_concat { dialog.style |= DS_SETFONT; style |= DS_SETFONT; dialog.pointsize = $3; - unicode_from_ascii ((int *) NULL, &dialog.font, $5); + dialog.font = $5; if (dialog.ex != NULL) { dialog.ex->weight = 0; @@ -464,12 +478,12 @@ styles: dialog.ex->charset = 1; } } - | styles FONT numexpr ',' QUOTEDSTRING cnumexpr + | styles FONT numexpr ',' res_unicode_string_concat cnumexpr { dialog.style |= DS_SETFONT; style |= DS_SETFONT; dialog.pointsize = $3; - unicode_from_ascii ((int *) NULL, &dialog.font, $5); + dialog.font = $5; if (dialog.ex == NULL) rcparse_warning (_("extended FONT requires DIALOGEX")); else @@ -479,12 +493,12 @@ styles: dialog.ex->charset = 1; } } - | styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr + | styles FONT numexpr ',' res_unicode_string_concat cnumexpr cnumexpr { dialog.style |= DS_SETFONT; style |= DS_SETFONT; dialog.pointsize = $3; - unicode_from_ascii ((int *) NULL, &dialog.font, $5); + dialog.font = $5; if (dialog.ex == NULL) rcparse_warning (_("extended FONT requires DIALOGEX")); else @@ -494,12 +508,12 @@ styles: dialog.ex->charset = 1; } } - | styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr cnumexpr + | styles FONT numexpr ',' res_unicode_string_concat cnumexpr cnumexpr cnumexpr { dialog.style |= DS_SETFONT; style |= DS_SETFONT; dialog.pointsize = $3; - unicode_from_ascii ((int *) NULL, &dialog.font, $5); + dialog.font = $5; if (dialog.ex == NULL) rcparse_warning (_("extended FONT requires DIALOGEX")); else @@ -531,7 +545,7 @@ controls: /* empty */ | controls control { - struct dialog_control **pp; + rc_dialog_control **pp; for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next) ; @@ -544,7 +558,8 @@ control: { default_style = BS_AUTO3STATE | WS_TABSTOP; base_style = BS_AUTO3STATE; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -555,7 +570,8 @@ control: { default_style = BS_AUTOCHECKBOX | WS_TABSTOP; base_style = BS_AUTOCHECKBOX; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -566,7 +582,8 @@ control: { default_style = BS_AUTORADIOBUTTON | WS_TABSTOP; base_style = BS_AUTORADIOBUTTON; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -577,7 +594,8 @@ control: { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; + class.named = 0; + class.u.id = CTL_EDIT; res_text_field = $2; } control_params @@ -591,7 +609,8 @@ control: { default_style = BS_CHECKBOX | WS_TABSTOP; base_style = BS_CHECKBOX | WS_TABSTOP; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -604,14 +623,15 @@ control: versions of MS rc.exe their is no default style. */ default_style = CBS_SIMPLE | WS_TABSTOP; base_style = 0; - class = CTL_COMBOBOX; + class.named = 0; + class.u.id = CTL_COMBOBOX; res_text_field = res_null_text; } control_params { $$ = $3; } - | CONTROL optresidc numexpr cnumexpr control_styleexpr cnumexpr + | CONTROL optresidc numexpr cresid control_styleexpr cnumexpr cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data { $$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10); @@ -622,7 +642,7 @@ control: $$->data = $11; } } - | CONTROL optresidc numexpr cnumexpr control_styleexpr cnumexpr + | CONTROL optresidc numexpr cresid control_styleexpr cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data { $$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10); @@ -631,35 +651,12 @@ control: $$->help = $11; $$->data = $12; } - | CONTROL optresidc numexpr ',' QUOTEDSTRING control_styleexpr - cnumexpr cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data - { - $$ = define_control ($2, $3, $7, $8, $9, $10, 0, style, $11); - if ($12 != NULL) - { - if (dialog.ex == NULL) - rcparse_warning ("control data requires DIALOGEX"); - $$->data = $12; - } - $$->class.named = 1; - unicode_from_ascii (&$$->class.u.n.length, &$$->class.u.n.name, $5); - } - | CONTROL optresidc numexpr ',' QUOTEDSTRING control_styleexpr - cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data - { - $$ = define_control ($2, $3, $7, $8, $9, $10, 0, style, $11); - if (dialog.ex == NULL) - rcparse_warning ("help ID requires DIALOGEX"); - $$->help = $12; - $$->data = $13; - $$->class.named = 1; - unicode_from_ascii (&$$->class.u.n.length, &$$->class.u.n.name, $5); - } | CTEXT optresidc { default_style = SS_CENTER | WS_GROUP; base_style = SS_CENTER; - class = CTL_STATIC; + class.named = 0; + class.u.id = CTL_STATIC; res_text_field = $2; } control_params @@ -670,7 +667,8 @@ control: { default_style = BS_DEFPUSHBUTTON | WS_TABSTOP; base_style = BS_DEFPUSHBUTTON | WS_TABSTOP; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -681,7 +679,8 @@ control: { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; + class.named = 0; + class.u.id = CTL_EDIT; res_text_field = res_null_text; } control_params @@ -692,7 +691,8 @@ control: { default_style = BS_GROUPBOX; base_style = BS_GROUPBOX; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -703,7 +703,8 @@ control: { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; + class.named = 0; + class.u.id = CTL_EDIT; res_text_field = $2; } control_params @@ -740,7 +741,8 @@ control: { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; + class.named = 0; + class.u.id = CTL_EDIT; res_text_field = $2; } control_params @@ -754,7 +756,8 @@ control: { default_style = LBS_NOTIFY | WS_BORDER; base_style = LBS_NOTIFY | WS_BORDER; - class = CTL_LISTBOX; + class.named = 0; + class.u.id = CTL_LISTBOX; res_text_field = res_null_text; } control_params @@ -765,7 +768,8 @@ control: { default_style = SS_LEFT | WS_GROUP; base_style = SS_LEFT; - class = CTL_STATIC; + class.named = 0; + class.u.id = CTL_STATIC; res_text_field = $2; } control_params @@ -776,7 +780,8 @@ control: { default_style = BS_PUSHBOX | WS_TABSTOP; base_style = BS_PUSHBOX; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; } control_params { @@ -786,7 +791,8 @@ control: { default_style = BS_PUSHBUTTON | WS_TABSTOP; base_style = BS_PUSHBUTTON | WS_TABSTOP; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -797,7 +803,8 @@ control: { default_style = BS_RADIOBUTTON | WS_TABSTOP; base_style = BS_RADIOBUTTON; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -808,7 +815,8 @@ control: { default_style = SS_RIGHT | WS_GROUP; base_style = SS_RIGHT; - class = CTL_STATIC; + class.named = 0; + class.u.id = CTL_STATIC; res_text_field = $2; } control_params @@ -819,7 +827,8 @@ control: { default_style = SBS_HORZ; base_style = 0; - class = CTL_SCROLLBAR; + class.named = 0; + class.u.id = CTL_SCROLLBAR; res_text_field = res_null_text; } control_params @@ -830,7 +839,8 @@ control: { default_style = BS_3STATE | WS_TABSTOP; base_style = BS_3STATE; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -842,7 +852,10 @@ control: { style = WS_CHILD | WS_VISIBLE; } styleexpr optcnumexpr { - $$ = define_control ($2, $3, $5, $7, $9, $11, CTL_BUTTON, + rc_res_id cid; + cid.named = 0; + cid.u.id = CTL_BUTTON; + $$ = define_control ($2, $3, $5, $7, $9, $11, cid, style, $15); } ; @@ -888,23 +901,35 @@ control_params: } ; +cresid: + ',' resid + { + if ($2.named) + res_unistring_to_id (&$$, $2.u.n.name); + else + $$=$2; + } + ; + optresidc: /* empty */ { res_string_to_id (&$$, ""); } - | posnumexpr ',' + | resid ',' { $$=$1; } + ; + +resid: + posnumexpr { $$.named = 0; $$.u.id = $1; } - | QUOTEDSTRING - { - res_string_to_id (&$$, $1); - } - | QUOTEDSTRING ',' + | res_unicode_string { - res_string_to_id (&$$, $1); + $$.named = 1; + $$.u.n.name = $1; + $$.u.n.length = unichar_len ($1); } ; @@ -996,7 +1021,7 @@ menuitems: $$ = $2; else { - struct menuitem **pp; + rc_menuitem **pp; for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next) ; @@ -1007,7 +1032,7 @@ menuitems: ; menuitem: - MENUITEM QUOTEDSTRING cnumexpr menuitem_flags + MENUITEM res_unicode_string_concat cnumexpr menuitem_flags { $$ = define_menuitem ($2, $3, $4, 0, 0, NULL); } @@ -1015,7 +1040,7 @@ menuitem: { $$ = define_menuitem (NULL, 0, 0, 0, 0, NULL); } - | POPUP QUOTEDSTRING menuitem_flags BEG menuitems END + | POPUP res_unicode_string_concat menuitem_flags BEG menuitems END { $$ = define_menuitem ($2, 0, $3, 0, 0, $5); } @@ -1086,7 +1111,7 @@ menuexitems: $$ = $2; else { - struct menuitem **pp; + rc_menuitem **pp; for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next) ; @@ -1097,15 +1122,15 @@ menuexitems: ; menuexitem: - MENUITEM QUOTEDSTRING + MENUITEM res_unicode_string_concat { $$ = define_menuitem ($2, 0, 0, 0, 0, NULL); } - | MENUITEM QUOTEDSTRING cnumexpr + | MENUITEM res_unicode_string_concat cnumexpr { $$ = define_menuitem ($2, $3, 0, 0, 0, NULL); } - | MENUITEM QUOTEDSTRING cnumexpr cnumexpr optcnumexpr + | MENUITEM res_unicode_string_concat cnumexpr cnumexpr optcnumexpr { $$ = define_menuitem ($2, $3, $4, $5, 0, NULL); } @@ -1113,19 +1138,19 @@ menuexitem: { $$ = define_menuitem (NULL, 0, 0, 0, 0, NULL); } - | POPUP QUOTEDSTRING BEG menuexitems END + | POPUP res_unicode_string_concat BEG menuexitems END { $$ = define_menuitem ($2, 0, 0, 0, 0, $4); } - | POPUP QUOTEDSTRING cnumexpr BEG menuexitems END + | POPUP res_unicode_string_concat cnumexpr BEG menuexitems END { $$ = define_menuitem ($2, $3, 0, 0, 0, $5); } - | POPUP QUOTEDSTRING cnumexpr cnumexpr BEG menuexitems END + | POPUP res_unicode_string_concat cnumexpr cnumexpr BEG menuexitems END { $$ = define_menuitem ($2, $3, $4, 0, 0, $6); } - | POPUP QUOTEDSTRING cnumexpr cnumexpr cnumexpr optcnumexpr + | POPUP res_unicode_string_concat cnumexpr cnumexpr cnumexpr optcnumexpr BEG menuexitems END { $$ = define_menuitem ($2, $3, $4, $5, $6, $8); @@ -1144,25 +1169,6 @@ messagetable: } ; -/* Rcdata resources. */ - -rcdata: - id RCDATA suboptions BEG optrcdata_data END - { - define_rcdata ($1, &$3, $5.first); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - | id RCDATA suboptions file_name - { - define_rcdata_file ($1, &$3, $4); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - ; - /* We use a different lexing algorithm, because rcdata strings may contain embedded null bytes, and we need to know the length to use. */ @@ -1190,34 +1196,51 @@ optrcdata_data_int: ; rcdata_data: - SIZEDSTRING + sizedstring { - struct rcdata_item *ri; + rc_rcdata_item *ri; ri = define_rcdata_string ($1.s, $1.length); $$.first = ri; $$.last = ri; } + | sizedunistring + { + rc_rcdata_item *ri; + + ri = define_rcdata_unistring ($1.s, $1.length); + $$.first = ri; + $$.last = ri; + } | sizednumexpr { - struct rcdata_item *ri; + rc_rcdata_item *ri; ri = define_rcdata_number ($1.val, $1.dword); $$.first = ri; $$.last = ri; } - | rcdata_data ',' SIZEDSTRING + | rcdata_data ',' sizedstring { - struct rcdata_item *ri; + rc_rcdata_item *ri; ri = define_rcdata_string ($3.s, $3.length); $$.first = $1.first; $1.last->next = ri; $$.last = ri; } + | rcdata_data ',' sizedunistring + { + rc_rcdata_item *ri; + + ri = define_rcdata_unistring ($3.s, $3.length); + $$.first = $1.first; + $1.last->next = ri; + $$.last = ri; + } | rcdata_data ',' sizednumexpr { - struct rcdata_item *ri; + rc_rcdata_item *ri; ri = define_rcdata_number ($3.val, $3.dword); $$.first = $1.first; @@ -1236,14 +1259,14 @@ stringtable: string_data: /* empty */ - | string_data numexpr QUOTEDSTRING + | string_data numexpr res_unicode_string_concat { define_stringtable (&sub_res_info, $2, $3); if (yychar != YYEMPTY) YYERROR; rcparse_discard_strings (); } - | string_data numexpr ',' QUOTEDSTRING + | string_data numexpr ',' res_unicode_string_concat { define_stringtable (&sub_res_info, $2, $4); if (yychar != YYEMPTY) @@ -1252,18 +1275,70 @@ string_data: } ; +rcdata_id: + id + { + $$=$1; + } + | HTML + { + $$.named = 0; + $$.u.id = 23; + } + | RCDATA + { + $$.named = 0; + $$.u.id = RT_RCDATA; + } + | MANIFEST + { + $$.named = 0; + $$.u.id = RT_MANIFEST; + } + | PLUGPLAY + { + $$.named = 0; + $$.u.id = RT_PLUGPLAY; + } + | VXD + { + $$.named = 0; + $$.u.id = RT_VXD; + } + | DLGINCLUDE + { + $$.named = 0; + $$.u.id = RT_DLGINCLUDE; + } + | DLGINIT + { + $$.named = 0; + $$.u.id = RT_DLGINIT; + } + | ANICURSOR + { + $$.named = 0; + $$.u.id = RT_ANICURSOR; + } + | ANIICON + { + $$.named = 0; + $$.u.id = RT_ANIICON; + } + ; + /* User defined resources. We accept general suboptions in the file_name case to keep the parser happy. */ user: - id id suboptions BEG optrcdata_data END + id rcdata_id suboptions BEG optrcdata_data END { define_user_data ($1, $2, &$3, $5.first); if (yychar != YYEMPTY) YYERROR; rcparse_discard_strings (); } - | id id suboptions file_name + | id rcdata_id suboptions file_name { define_user_file ($1, $2, &$3, $4); if (yychar != YYEMPTY) @@ -1272,6 +1347,55 @@ user: } ; +toolbar: + id TOOLBAR suboptions numexpr cnumexpr BEG toolbar_data END + { + define_toolbar ($1, &$3, $4, $5, $7); + } + ; + +toolbar_data: /* empty */ { $$= NULL; } + | toolbar_data BUTTON id + { + rc_toolbar_item *c,*n; + c = $1; + n= (rc_toolbar_item *) + res_alloc (sizeof (rc_toolbar_item)); + if (c != NULL) + while (c->next != NULL) + c = c->next; + n->prev = c; + n->next = NULL; + if (c != NULL) + c->next = n; + n->id = $3; + if ($1 == NULL) + $$ = n; + else + $$ = $1; + } + | toolbar_data SEPARATOR + { + rc_toolbar_item *c,*n; + c = $1; + n= (rc_toolbar_item *) + res_alloc (sizeof (rc_toolbar_item)); + if (c != NULL) + while (c->next != NULL) + c = c->next; + n->prev = c; + n->next = NULL; + if (c != NULL) + c->next = n; + n->id.named = 0; + n->id.u.id = 0; + if ($1 == NULL) + $$ = n; + else + $$ = $1; + } + ; + /* Versioninfo resources. */ versioninfo: @@ -1287,9 +1411,9 @@ versioninfo: fixedverinfo: /* empty */ { - $$ = ((struct fixed_versioninfo *) - res_alloc (sizeof (struct fixed_versioninfo))); - memset ($$, 0, sizeof (struct fixed_versioninfo)); + $$ = ((rc_fixed_versioninfo *) + res_alloc (sizeof (rc_fixed_versioninfo))); + memset ($$, 0, sizeof (rc_fixed_versioninfo)); } | fixedverinfo FILEVERSION numexpr cnumexpr cnumexpr cnumexpr { @@ -1345,7 +1469,7 @@ verblocks: { $$ = append_ver_stringfileinfo ($1, $4, $6); } - | verblocks BLOCKVARFILEINFO BEG VALUE QUOTEDSTRING vertrans END + | verblocks BLOCKVARFILEINFO BEG VALUE res_unicode_string_concat vertrans END { $$ = append_ver_varfileinfo ($1, $5, $6); } @@ -1356,7 +1480,7 @@ vervals: { $$ = NULL; } - | vervals VALUE QUOTEDSTRING ',' QUOTEDSTRING + | vervals VALUE res_unicode_string_concat ',' res_unicode_string_concat { $$ = append_verval ($1, $3, $5); } @@ -1381,33 +1505,24 @@ id: $$.named = 0; $$.u.id = $1; } - | STRING + | resname { - char *copy, *s; - - /* It seems that resource ID's are forced to upper case. */ - copy = xstrdup ($1); - for (s = copy; *s != '\0'; s++) - *s = TOUPPER (*s); - res_string_to_id (&$$, copy); - free (copy); + res_unistring_to_id (&$$, $1); } ; /* A resource reference. */ resname: - QUOTEDSTRING - { - $$ = $1; - } - | QUOTEDSTRING ',' + res_unicode_string { $$ = $1; } - | STRING ',' + | STRING { - $$ = $1; + unichar *h = NULL; + unicode_from_ascii ((rc_uint_type *) NULL, &h, $1); + $$ = h; } ; @@ -1420,14 +1535,11 @@ resref: } | resname { - char *copy, *s; - - /* It seems that resource ID's are forced to upper case. */ - copy = xstrdup ($1); - for (s = copy; *s != '\0'; s++) - *s = TOUPPER (*s); - res_string_to_id (&$$, copy); - free (copy); + res_unistring_to_id (&$$, $1); + } + | resname ',' + { + res_unistring_to_id (&$$, $1); } ; @@ -1437,7 +1549,7 @@ resref: suboptions: /* empty */ { - memset (&$$, 0, sizeof (struct res_res_info)); + memset (&$$, 0, sizeof (rc_res_res_info)); $$.language = language; /* FIXME: Is this the right default? */ $$.memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; @@ -1470,7 +1582,7 @@ suboptions: memflags_move_discard: /* empty */ { - memset (&$$, 0, sizeof (struct res_res_info)); + memset (&$$, 0, sizeof (rc_res_res_info)); $$.language = language; $$.memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE; } @@ -1487,7 +1599,7 @@ memflags_move_discard: memflags_move: /* empty */ { - memset (&$$, 0, sizeof (struct res_res_info)); + memset (&$$, 0, sizeof (rc_res_res_info)); $$.language = language; $$.memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; } @@ -1553,6 +1665,72 @@ file_name: } ; +/* Concat string */ +res_unicode_string_concat: + res_unicode_string + { + $$ = $1; + } + | + res_unicode_string_concat res_unicode_string + { + rc_uint_type l1 = unichar_len ($1); + rc_uint_type l2 = unichar_len ($2); + unichar *h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); + if (l1 != 0) + memcpy (h, $1, l1 * sizeof (unichar)); + if (l2 != 0) + memcpy (h + l1, $2, l2 * sizeof (unichar)); + h[l1 + l2] = 0; + $$ = h; + } + ; + +res_unicode_string: + QUOTEDUNISTRING + { + $$ = unichar_dup ($1); + } + | QUOTEDSTRING + { + unichar *h = NULL; + unicode_from_ascii ((rc_uint_type *) NULL, &h, $1); + $$ = h; + } + ; + +sizedstring: + SIZEDSTRING + { + $$ = $1; + } + | sizedstring SIZEDSTRING + { + rc_uint_type l = $1.length + $2.length; + char *h = (char *) res_alloc (l); + memcpy (h, $1.s, $1.length); + memcpy (h + $1.length, $2.s, $2.length); + $$.s = h; + $$.length = l; + } + ; + +sizedunistring: + SIZEDUNISTRING + { + $$ = $1; + } + | sizedunistring SIZEDUNISTRING + { + rc_uint_type l = $1.length + $2.length; + unichar *h = (unichar *) res_alloc (l * sizeof (unichar)); + memcpy (h, $1.s, $1.length * sizeof (unichar)); + memcpy (h + $1.length, $2.s, $2.length * sizeof (unichar)); + $$.s = h; + $$.length = l; + } + ; + /* A style expression. This changes the static variable STYLE. We do it this way because rc appears to permit a style to be set to something like diff --git a/binutils/rdcoff.c b/binutils/rdcoff.c index 1eda3af195d1..70bf8425a1ba 100644 --- a/binutils/rdcoff.c +++ b/binutils/rdcoff.c @@ -1,5 +1,6 @@ /* stabs.c -- Parse COFF debugging information - Copyright 1996, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright 1996, 1999, 2000, 2002, 2003, 2007 + Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. This file is part of GNU Binutils. @@ -21,10 +22,11 @@ /* This file contains code which parses COFF debugging information. */ +#include "sysdep.h" #include "bfd.h" #include "coff/internal.h" -#include "bucomm.h" #include "libiberty.h" +#include "bucomm.h" #include "debug.h" #include "budbg.h" diff --git a/binutils/rddbg.c b/binutils/rddbg.c index e977d8b5ef14..b9953d43f375 100644 --- a/binutils/rddbg.c +++ b/binutils/rddbg.c @@ -1,5 +1,5 @@ /* rddbg.c -- Read debugging information into a generic form. - Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2005 + Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. @@ -24,9 +24,10 @@ file knows how to dig the debugging information out of an object file. */ +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" +#include "bucomm.h" #include "debug.h" #include "budbg.h" diff --git a/binutils/readelf.c b/binutils/readelf.c index d8bd54f440f3..ab41e28828b1 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -1,5 +1,5 @@ /* readelf.c -- display contents of an ELF format file - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Originally developed by Eric Youngdale <eric@andante.jic.com> @@ -41,12 +41,30 @@ ELF file than is provided by objdump. In particular it can display DWARF debugging information which (at the moment) objdump cannot. */ +#include "sysdep.h" #include <assert.h> -#include <sys/types.h> #include <sys/stat.h> -#include <stdio.h> #include <time.h> +/* for PATH_MAX */ +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif + +#ifndef PATH_MAX +/* for MAXPATHLEN */ +# ifdef HAVE_SYS_PARAM_H +# include <sys/param.h> +# endif +# ifndef PATH_MAX +# ifdef MAXPATHLEN +# define PATH_MAX MAXPATHLEN +# else +# define PATH_MAX 1024 +# endif +# endif +#endif + #if __GNUC__ >= 2 /* Define BFD64 here, even if our default architecture is 32 bit ELF as this will allow us to read in and parse 64bit and 32bit ELF files. @@ -55,12 +73,32 @@ #define BFD64 #endif +#include "bfd.h" +#include "bucomm.h" #include "dwarf.h" #include "elf/common.h" #include "elf/external.h" #include "elf/internal.h" + +/* Included here, before RELOC_MACROS_GEN_FUNC is defined, so that + we can obtain the H8 reloc numbers. We need these for the + get_reloc_size() function. We include h8.h again after defining + RELOC_MACROS_GEN_FUNC so that we get the naming function as well. */ + +#include "elf/h8.h" +#undef _ELF_H8_H + +/* Undo the effects of #including reloc-macros.h. */ + +#undef START_RELOC_NUMBERS +#undef RELOC_NUMBER +#undef FAKE_RELOC +#undef EMPTY_RELOC +#undef END_RELOC_NUMBERS +#undef _RELOC_MACROS_H + /* The following headers use the elf/reloc-macros.h file to automatically generate relocation recognition functions such as elf_mips_reloc_type() */ @@ -73,6 +111,7 @@ #include "elf/avr.h" #include "elf/bfin.h" #include "elf/cris.h" +#include "elf/crx.h" #include "elf/d10v.h" #include "elf/d30v.h" #include "elf/dlx.h" @@ -86,11 +125,13 @@ #include "elf/i960.h" #include "elf/ia64.h" #include "elf/ip2k.h" +#include "elf/iq2000.h" #include "elf/m32c.h" #include "elf/m32r.h" #include "elf/m68k.h" #include "elf/m68hc11.h" #include "elf/mcore.h" +#include "elf/mep.h" #include "elf/mips.h" #include "elf/mmix.h" #include "elf/mn10200.h" @@ -102,19 +143,18 @@ #include "elf/ppc.h" #include "elf/ppc64.h" #include "elf/s390.h" +#include "elf/score.h" #include "elf/sh.h" #include "elf/sparc.h" +#include "elf/spu.h" #include "elf/v850.h" #include "elf/vax.h" #include "elf/x86-64.h" #include "elf/xstormy16.h" -#include "elf/crx.h" -#include "elf/iq2000.h" #include "elf/xtensa.h" #include "aout/ar.h" -#include "bucomm.h" #include "getopt.h" #include "libiberty.h" @@ -133,8 +173,9 @@ static Elf_Internal_Sym *dynamic_symbols; static Elf_Internal_Syminfo *dynamic_syminfo; static unsigned long dynamic_syminfo_offset; static unsigned int dynamic_syminfo_nent; -static char program_interpreter[64]; +static char program_interpreter[PATH_MAX]; static bfd_vma dynamic_info[DT_JMPREL + 1]; +static bfd_vma dynamic_info_DT_GNU_HASH; static bfd_vma version_info[16]; static Elf_Internal_Ehdr elf_header; static Elf_Internal_Shdr *section_headers; @@ -222,9 +263,11 @@ static void (*byte_put) (unsigned char *, bfd_vma, int); #define UNKNOWN -1 -#define SECTION_NAME(X) ((X) == NULL ? "<none>" : \ - ((X)->sh_name >= string_table_length \ - ? "<corrupt>" : string_table + (X)->sh_name)) +#define SECTION_NAME(X) \ + ((X) == NULL ? "<none>" \ + : string_table == NULL ? "<no-name>" \ + : ((X)->sh_name >= string_table_length ? "<corrupt>" \ + : string_table + (X)->sh_name)) /* Given st_shndx I, map to section_headers index. */ #define SECTION_HEADER_INDEX(I) \ @@ -260,6 +303,7 @@ static void (*byte_put) (unsigned char *, bfd_vma, int); /* This is just a bit of syntatic sugar. */ #define streq(a,b) (strcmp ((a), (b)) == 0) #define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0) +#define const_strneq(a,b) (strncmp ((a), (b), sizeof (b) - 1) == 0) static void * get_data (void *var, FILE *file, long offset, size_t size, size_t nmemb, @@ -550,88 +594,91 @@ guess_is_rela (unsigned long e_machine) switch (e_machine) { /* Targets that use REL relocations. */ - case EM_ARM: case EM_386: case EM_486: case EM_960: - case EM_DLX: - case EM_OPENRISC: - case EM_OR32: - case EM_CYGNUS_M32R: + case EM_ARM: case EM_D10V: case EM_CYGNUS_D10V: + case EM_DLX: case EM_MIPS: case EM_MIPS_RS3_LE: + case EM_CYGNUS_M32R: + case EM_OPENRISC: + case EM_OR32: + case EM_SCORE: return FALSE; /* Targets that use RELA relocations. */ case EM_68K: - case EM_H8_300: - case EM_H8_300H: - case EM_H8S: - case EM_SPARC32PLUS: - case EM_SPARCV9: - case EM_SPARC: - case EM_PPC: - case EM_PPC64: - case EM_V850: - case EM_CYGNUS_V850: + case EM_860: + case EM_ALPHA: + case EM_ALTERA_NIOS2: + case EM_AVR: + case EM_AVR_OLD: + case EM_BLACKFIN: + case EM_CRIS: + case EM_CRX: case EM_D30V: case EM_CYGNUS_D30V: - case EM_MN10200: - case EM_CYGNUS_MN10200: - case EM_MN10300: - case EM_CYGNUS_MN10300: case EM_FR30: case EM_CYGNUS_FR30: case EM_CYGNUS_FRV: - case EM_SH: - case EM_ALPHA: - case EM_MCORE: + case EM_H8S: + case EM_H8_300: + case EM_H8_300H: case EM_IA_64: - case EM_AVR: - case EM_AVR_OLD: - case EM_CRIS: - case EM_860: - case EM_X86_64: - case EM_S390: - case EM_S390_OLD: - case EM_MMIX: - case EM_MSP430: - case EM_MSP430_OLD: - case EM_XSTORMY16: - case EM_CRX: - case EM_VAX: case EM_IP2K: case EM_IP2K_OLD: case EM_IQ2000: - case EM_XTENSA: - case EM_XTENSA_OLD: - case EM_M32R: case EM_M32C: + case EM_M32R: + case EM_MCORE: + case EM_CYGNUS_MEP: + case EM_MMIX: + case EM_MN10200: + case EM_CYGNUS_MN10200: + case EM_MN10300: + case EM_CYGNUS_MN10300: + case EM_MSP430: + case EM_MSP430_OLD: case EM_MT: - case EM_BLACKFIN: case EM_NIOS32: - case EM_ALTERA_NIOS2: + case EM_PPC64: + case EM_PPC: + case EM_S390: + case EM_S390_OLD: + case EM_SH: + case EM_SPARC: + case EM_SPARC32PLUS: + case EM_SPARCV9: + case EM_SPU: + case EM_V850: + case EM_CYGNUS_V850: + case EM_VAX: + case EM_X86_64: + case EM_XSTORMY16: + case EM_XTENSA: + case EM_XTENSA_OLD: return TRUE; + case EM_68HC05: + case EM_68HC08: + case EM_68HC11: + case EM_68HC16: + case EM_FX66: + case EM_ME16: case EM_MMA: - case EM_PCP: case EM_NCPU: case EM_NDR1: - case EM_STARCORE: - case EM_ME16: + case EM_PCP: case EM_ST100: - case EM_TINYJ: - case EM_FX66: - case EM_ST9PLUS: + case EM_ST19: case EM_ST7: - case EM_68HC16: - case EM_68HC11: - case EM_68HC08: - case EM_68HC05: + case EM_ST9PLUS: + case EM_STARCORE: case EM_SVX: - case EM_ST19: + case EM_TINYJ: default: warn (_("Don't know about relocations on this machine architecture\n")); return FALSE; @@ -664,7 +711,7 @@ slurp_rela_relocs (FILE *file, if (relas == NULL) { free (erelas); - error (_("out of memory parsing relocs")); + error (_("out of memory parsing relocs\n")); return 0; } @@ -692,7 +739,7 @@ slurp_rela_relocs (FILE *file, if (relas == NULL) { free (erelas); - error (_("out of memory parsing relocs")); + error (_("out of memory parsing relocs\n")); return 0; } @@ -736,7 +783,7 @@ slurp_rel_relocs (FILE *file, if (rels == NULL) { free (erels); - error (_("out of memory parsing relocs")); + error (_("out of memory parsing relocs\n")); return 0; } @@ -764,7 +811,7 @@ slurp_rel_relocs (FILE *file, if (rels == NULL) { free (erels); - error (_("out of memory parsing relocs")); + error (_("out of memory parsing relocs\n")); return 0; } @@ -966,6 +1013,10 @@ dump_relocations (FILE *file, rtype = elf_sparc_reloc_type (type); break; + case EM_SPU: + rtype = elf_spu_reloc_type (type); + break; + case EM_V850: case EM_CYGNUS_V850: rtype = v850_reloc_type (type); @@ -1095,6 +1146,10 @@ dump_relocations (FILE *file, rtype = elf_s390_reloc_type (type); break; + case EM_SCORE: + rtype = elf_score_reloc_type (type); + break; + case EM_XSTORMY16: rtype = elf_xstormy16_reloc_type (type); break; @@ -1133,6 +1188,9 @@ dump_relocations (FILE *file, rtype = elf_bfin_reloc_type (type); break; + case EM_CYGNUS_MEP: + rtype = elf_mep_reloc_type (type); + break; } if (rtype == NULL) @@ -1145,6 +1203,7 @@ dump_relocations (FILE *file, printf (do_wide ? "%-22.22s" : "%-17.17s", rtype); if (elf_header.e_machine == EM_ALPHA + && rtype != NULL && streq (rtype, "R_ALPHA_LITUSE") && is_rela) { @@ -1203,6 +1262,12 @@ dump_relocations (FILE *file, sec_name = "ABS"; else if (psym->st_shndx == SHN_COMMON) sec_name = "COMMON"; + else if (elf_header.e_machine == EM_MIPS + && psym->st_shndx == SHN_MIPS_SCOMMON) + sec_name = "SCOMMON"; + else if (elf_header.e_machine == EM_MIPS + && psym->st_shndx == SHN_MIPS_SUNDEFINED) + sec_name = "SUNDEF"; else if (elf_header.e_machine == EM_X86_64 && psym->st_shndx == SHN_X86_64_LCOMMON) sec_name = "LARGE_COMMON"; @@ -1237,7 +1302,9 @@ dump_relocations (FILE *file, print_vma (rels[i].r_addend, LONG_HEX); } - if (elf_header.e_machine == EM_SPARCV9 && streq (rtype, "R_SPARC_OLO10")) + if (elf_header.e_machine == EM_SPARCV9 + && rtype != NULL + && streq (rtype, "R_SPARC_OLO10")) printf (" + %lx", (unsigned long) ELF64_R_TYPE_DATA (info)); putchar ('\n'); @@ -1420,6 +1487,23 @@ get_alpha_dynamic_type (unsigned long type) } static const char * +get_score_dynamic_type (unsigned long type) +{ + switch (type) + { + case DT_SCORE_BASE_ADDRESS: return "SCORE_BASE_ADDRESS"; + case DT_SCORE_LOCAL_GOTNO: return "SCORE_LOCAL_GOTNO"; + case DT_SCORE_SYMTABNO: return "SCORE_SYMTABNO"; + case DT_SCORE_GOTSYM: return "SCORE_GOTSYM"; + case DT_SCORE_UNREFEXTNO: return "SCORE_UNREFEXTNO"; + case DT_SCORE_HIPAGENO: return "SCORE_HIPAGENO"; + default: + return NULL; + } +} + + +static const char * get_dynamic_type (unsigned long type) { static char buff[64]; @@ -1499,6 +1583,7 @@ get_dynamic_type (unsigned long type) case DT_GNU_CONFLICTSZ: return "GNU_CONFLICTSZ"; case DT_GNU_LIBLIST: return "GNU_LIBLIST"; case DT_GNU_LIBLISTSZ: return "GNU_LIBLISTSZ"; + case DT_GNU_HASH: return "GNU_HASH"; default: if ((type >= DT_LOPROC) && (type <= DT_HIPROC)) @@ -1526,6 +1611,9 @@ get_dynamic_type (unsigned long type) case EM_ALPHA: result = get_alpha_dynamic_type (type); break; + case EM_SCORE: + result = get_score_dynamic_type (type); + break; default: result = NULL; break; @@ -1599,6 +1687,7 @@ get_machine_name (unsigned e_machine) case EM_NONE: return _("None"); case EM_M32: return "WE32100"; case EM_SPARC: return "Sparc"; + case EM_SPU: return "SPU"; case EM_386: return "Intel 80386"; case EM_68K: return "MC68000"; case EM_88K: return "MC88000"; @@ -1680,6 +1769,7 @@ get_machine_name (unsigned e_machine) case EM_X86_64: return "Advanced Micro Devices X86-64"; case EM_S390_OLD: case EM_S390: return "IBM S/390"; + case EM_SCORE: return "SUNPLUS S+Core"; case EM_XSTORMY16: return "Sanyo Xstormy16 CPU core"; case EM_OPENRISC: case EM_OR32: return "OpenRISC"; @@ -1696,8 +1786,9 @@ get_machine_name (unsigned e_machine) case EM_NIOS32: return "Altera Nios"; case EM_ALTERA_NIOS2: return "Altera Nios II"; case EM_XC16X: return "Infineon Technologies xc16x"; + case EM_CYGNUS_MEP: return "Toshiba MeP Media Engine"; default: - snprintf (buff, sizeof (buff), _("<unknown>: %x"), e_machine); + snprintf (buff, sizeof (buff), _("<unknown>: 0x%x"), e_machine); return buff; } } @@ -1946,33 +2037,35 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) break; case EM_68K: - if (e_flags & EF_M68K_CPU32) - strcat (buf, ", cpu32"); - if (e_flags & EF_M68K_M68000) + if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) strcat (buf, ", m68000"); - if (e_flags & EF_M68K_ISA_MASK) + else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) + strcat (buf, ", cpu32"); + else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + strcat (buf, ", fido_a"); + else { char const *isa = _("unknown"); char const *mac = _("unknown mac"); char const *additional = NULL; - - switch (e_flags & EF_M68K_ISA_MASK) + + switch (e_flags & EF_M68K_CF_ISA_MASK) { - case EF_M68K_ISA_A_NODIV: + case EF_M68K_CF_ISA_A_NODIV: isa = "A"; additional = ", nodiv"; break; - case EF_M68K_ISA_A: + case EF_M68K_CF_ISA_A: isa = "A"; break; - case EF_M68K_ISA_A_PLUS: + case EF_M68K_CF_ISA_A_PLUS: isa = "A+"; break; - case EF_M68K_ISA_B_NOUSP: + case EF_M68K_CF_ISA_B_NOUSP: isa = "B"; additional = ", nousp"; break; - case EF_M68K_ISA_B: + case EF_M68K_CF_ISA_B: isa = "B"; break; } @@ -1980,17 +2073,17 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) strcat (buf, isa); if (additional) strcat (buf, additional); - if (e_flags & EF_M68K_FLOAT) + if (e_flags & EF_M68K_CF_FLOAT) strcat (buf, ", float"); - switch (e_flags & EF_M68K_MAC_MASK) + switch (e_flags & EF_M68K_CF_MAC_MASK) { case 0: mac = NULL; break; - case EF_M68K_MAC: + case EF_M68K_CF_MAC: mac = "mac"; break; - case EF_M68K_EMAC: + case EF_M68K_CF_EMAC: mac = "emac"; break; } @@ -2036,7 +2129,6 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) case EM_CYGNUS_M32R: if ((e_flags & EF_M32R_ARCH) == E_M32R_ARCH) strcat (buf, ", m32r"); - break; case EM_MIPS: @@ -2569,6 +2661,7 @@ get_section_type_name (unsigned int sh_type) case SHT_INIT_ARRAY: return "INIT_ARRAY"; case SHT_FINI_ARRAY: return "FINI_ARRAY"; case SHT_PREINIT_ARRAY: return "PREINIT_ARRAY"; + case SHT_GNU_HASH: return "GNU_HASH"; case SHT_GROUP: return "GROUP"; case SHT_SYMTAB_SHNDX: return "SYMTAB SECTION INDICIES"; case SHT_GNU_verdef: return "VERDEF"; @@ -2661,11 +2754,11 @@ static struct option options[] = }; static void -usage (void) +usage (FILE *stream) { - fprintf (stdout, _("Usage: readelf <option(s)> elf-file(s)\n")); - fprintf (stdout, _(" Display information about the contents of ELF format files\n")); - fprintf (stdout, _(" Options are:\n\ + fprintf (stream, _("Usage: readelf <option(s)> elf-file(s)\n")); + fprintf (stream, _(" Display information about the contents of ELF format files\n")); + fprintf (stream, _(" Options are:\n\ -a --all Equivalent to: -h -l -S -s -r -d -V -A -I\n\ -h --file-header Display the ELF file header\n\ -l --program-headers Display the program headers\n\ @@ -2689,19 +2782,21 @@ usage (void) --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges]\n\ Display the contents of DWARF2 debug sections\n")); #ifdef SUPPORT_DISASSEMBLY - fprintf (stdout, _("\ + fprintf (stream, _("\ -i --instruction-dump=<number>\n\ Disassemble the contents of section <number>\n")); #endif - fprintf (stdout, _("\ + fprintf (stream, _("\ -I --histogram Display histogram of bucket list lengths\n\ -W --wide Allow output width to exceed 80 characters\n\ @<file> Read options from <file>\n\ -H --help Display this information\n\ -v --version Display the version number of readelf\n")); - fprintf (stdout, _("Report bugs to %s\n"), REPORT_BUGS_TO); + + if (REPORT_BUGS_TO[0] && stream == stdout) + fprintf (stdout, _("Report bugs to %s\n"), REPORT_BUGS_TO); - exit (0); + exit (stream == stdout ? 0 : 1); } /* Record the fact that the user wants the contents of section number @@ -2719,7 +2814,7 @@ request_dump (unsigned int section, int type) new_dump_sects = calloc (section + 1, 1); if (new_dump_sects == NULL) - error (_("Out of memory allocating dump request table.")); + error (_("Out of memory allocating dump request table.\n")); else { /* Copy current flag settings. */ @@ -2747,11 +2842,11 @@ request_dump_byname (const char *section, int type) new_request = malloc (sizeof (struct dump_list_entry)); if (!new_request) - error (_("Out of memory allocating dump request table.")); + error (_("Out of memory allocating dump request table.\n")); new_request->name = strdup (section); if (!new_request->name) - error (_("Out of memory allocating dump request table.")); + error (_("Out of memory allocating dump request table.\n")); new_request->type = type; @@ -2765,7 +2860,7 @@ parse_args (int argc, char **argv) int c; if (argc < 2) - usage (); + usage (stderr); while ((c = getopt_long (argc, argv, "ersuahnldSDAINtgw::x:i:vVWH", options, NULL)) != EOF) @@ -2779,7 +2874,7 @@ parse_args (int argc, char **argv) /* Long options. */ break; case 'H': - usage (); + usage (stdout); break; case 'a': @@ -3020,7 +3115,7 @@ parse_args (int argc, char **argv) error (_("Invalid option '-%c'\n"), c); /* Drop through. */ case '?': - usage (); + usage (stderr); } } @@ -3028,11 +3123,11 @@ parse_args (int argc, char **argv) && !do_segments && !do_header && !do_dump && !do_version && !do_histogram && !do_debugging && !do_arch && !do_notes && !do_section_groups) - usage (); + usage (stderr); else if (argc < 3) { warn (_("Nothing to do.\n")); - usage (); + usage (stderr); } } @@ -3142,6 +3237,11 @@ process_file_header (void) (long) elf_header.e_shstrndx); if (section_headers != NULL && elf_header.e_shstrndx == SHN_XINDEX) printf (" (%ld)", (long) section_headers[0].sh_link); + else if (elf_header.e_shstrndx != SHN_UNDEF + && (elf_header.e_shstrndx >= elf_header.e_shnum + || (elf_header.e_shstrndx >= SHN_LORESERVE + && elf_header.e_shstrndx <= SHN_HIRESERVE))) + printf (" <corrupt: out of range>"); putc ('\n', stdout); } @@ -3151,6 +3251,11 @@ process_file_header (void) elf_header.e_shnum = section_headers[0].sh_size; if (elf_header.e_shstrndx == SHN_XINDEX) elf_header.e_shstrndx = section_headers[0].sh_link; + else if (elf_header.e_shstrndx != SHN_UNDEF + && (elf_header.e_shstrndx >= elf_header.e_shnum + || (elf_header.e_shstrndx >= SHN_LORESERVE + && elf_header.e_shstrndx <= SHN_HIRESERVE))) + elf_header.e_shstrndx = SHN_UNDEF; free (section_headers); section_headers = NULL; } @@ -3407,18 +3512,21 @@ process_program_headers (FILE *file) sec = find_section (".dynamic"); if (sec == NULL || sec->sh_size == 0) { - error (_("no .dynamic section in the dynamic segment")); + error (_("no .dynamic section in the dynamic segment\n")); break; } + if (sec->sh_type == SHT_NOBITS) + break; + dynamic_addr = sec->sh_offset; dynamic_size = sec->sh_size; if (dynamic_addr < segment->p_offset || dynamic_addr > segment->p_offset + segment->p_filesz) - warn (_("the .dynamic section is not contained within the dynamic segment")); + warn (_("the .dynamic section is not contained within the dynamic segment\n")); else if (dynamic_addr > segment->p_offset) - warn (_("the .dynamic section is not the first section in the dynamic segment.")); + warn (_("the .dynamic section is not the first section in the dynamic segment.\n")); } else { @@ -3435,8 +3543,15 @@ process_program_headers (FILE *file) error (_("Unable to find program interpreter name\n")); else { + char fmt [32]; + int ret = snprintf (fmt, sizeof (fmt), "%%%ds", PATH_MAX); + + if (ret >= (int) sizeof (fmt) || ret < 0) + error (_("Internal error: failed to create format string to display program interpreter\n")); + program_interpreter[0] = 0; - fscanf (file, "%63s", program_interpreter); + if (fscanf (file, fmt, program_interpreter) <= 0) + error (_("Unable to read program interpreter name\n")); if (do_segments) printf (_("\n [Requesting program interpreter: %s]"), @@ -3920,7 +4035,8 @@ process_section_headers (FILE *file) return 0; /* Read in the string table, so that we have names to display. */ - if (SECTION_HEADER_INDEX (elf_header.e_shstrndx) < elf_header.e_shnum) + if (elf_header.e_shstrndx != SHN_UNDEF + && SECTION_HEADER_INDEX (elf_header.e_shstrndx) < elf_header.e_shnum) { section = SECTION_HEADER (elf_header.e_shstrndx); @@ -3958,6 +4074,23 @@ process_section_headers (FILE *file) && find_section (".gcc_compiled_long32") == NULL) eh_addr_size = 8; break; + + case EM_H8_300: + case EM_H8_300H: + switch (elf_header.e_flags & EF_H8_MACH) + { + case E_H8_MACH_H8300: + case E_H8_MACH_H8300HN: + case E_H8_MACH_H8300SN: + case E_H8_MACH_H8300SXN: + eh_addr_size = 2; + break; + case E_H8_MACH_H8300H: + case E_H8_MACH_H8300S: + case E_H8_MACH_H8300SX: + eh_addr_size = 4; + break; + } } #define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \ @@ -4028,7 +4161,7 @@ process_section_headers (FILE *file) || do_debug_lines || do_debug_pubnames || do_debug_aranges || do_debug_frames || do_debug_macinfo || do_debug_str || do_debug_loc || do_debug_ranges) - && strneq (name, ".debug_", 7)) + && const_strneq (name, ".debug_")) { name += 7; @@ -4048,7 +4181,7 @@ process_section_headers (FILE *file) } /* linkonce section to be combined with .debug_info at link time. */ else if ((do_debugging || do_debug_info) - && strneq (name, ".gnu.linkonce.wi.", 17)) + && const_strneq (name, ".gnu.linkonce.wi.")) request_dump (i, DEBUG_DUMP); else if (do_debug_frames && streq (name, ".eh_frame")) request_dump (i, DEBUG_DUMP); @@ -4884,7 +5017,7 @@ slurp_ia64_unwind_table (FILE *file, sym = aux->symtab + ELF64_R_SYM (rp->r_info); } - if (! strneq (relname, "R_IA64_SEGREL", 13)) + if (! const_strneq (relname, "R_IA64_SEGREL")) { warn (_("Skipping unexpected relocation type %s\n"), relname); continue; @@ -5297,7 +5430,7 @@ slurp_hppa_unwind_table (FILE *file, } /* R_PARISC_SEGREL32 or R_PARISC_SEGREL64. */ - if (strncmp (relname, "R_PARISC_SEGREL", 15) != 0) + if (! const_strneq (relname, "R_PARISC_SEGREL")) { warn (_("Skipping unexpected relocation type %s\n"), relname); continue; @@ -5735,7 +5868,7 @@ process_dynamic_section (FILE *file) else { if (fseek (file, 0, SEEK_END)) - error (_("Unable to seek to end of file!")); + error (_("Unable to seek to end of file!\n")); section.sh_size = ftell (file) - section.sh_offset; } @@ -6215,6 +6348,15 @@ process_dynamic_section (FILE *file) } break; + case DT_GNU_HASH: + dynamic_info_DT_GNU_HASH = entry->d_un.d_val; + if (do_dynamic) + { + print_vma (entry->d_un.d_val, PREFIX_HEX); + putchar ('\n'); + } + break; + default: if ((entry->d_tag >= DT_VERSYM) && (entry->d_tag <= DT_VERNEEDNUM)) version_info[DT_VERSIONTAGIDX (entry->d_tag)] = @@ -6732,6 +6874,8 @@ get_symbol_type (unsigned int type) case STT_FILE: return "FILE"; case STT_COMMON: return "COMMON"; case STT_TLS: return "TLS"; + case STT_RELC: return "RELC"; + case STT_SRELC: return "SRELC"; default: if (type >= STT_LOPROC && type <= STT_HIPROC) { @@ -6830,6 +6974,12 @@ get_symbol_index_type (unsigned int type) else if (elf_header.e_machine == EM_X86_64 && type == SHN_X86_64_LCOMMON) return "LARGE_COM"; + else if (type == SHN_MIPS_SCOMMON + && elf_header.e_machine == EM_MIPS) + return "SCOM"; + else if (type == SHN_MIPS_SUNDEFINED + && elf_header.e_machine == EM_MIPS) + return "SUND"; else if (type >= SHN_LOPROC && type <= SHN_HIPROC) sprintf (buff, "PRC[0x%04x]", type); else if (type >= SHN_LOOS && type <= SHN_HIOS) @@ -6890,6 +7040,9 @@ process_symbol_table (FILE *file) bfd_vma nchains = 0; bfd_vma *buckets = NULL; bfd_vma *chains = NULL; + bfd_vma ngnubuckets = 0; + bfd_vma *gnubuckets = NULL; + bfd_vma *gnuchains = NULL; if (! do_syms && !do_histogram) return 1; @@ -6913,7 +7066,7 @@ process_symbol_table (FILE *file) sizeof nb + sizeof nc)), SEEK_SET)) { - error (_("Unable to seek to start of dynamic information")); + error (_("Unable to seek to start of dynamic information\n")); return 0; } @@ -7139,7 +7292,7 @@ process_symbol_table (FILE *file) check_def = 0; } else if (! is_nobits) - error (_("bad dynamic symbol")); + error (_("bad dynamic symbol\n")); else check_def = 1; } @@ -7222,7 +7375,7 @@ process_symbol_table (FILE *file) lengths = calloc (nbuckets, sizeof (*lengths)); if (lengths == NULL) { - error (_("Out of memory")); + error (_("Out of memory\n")); return 0; } for (hn = 0; hn < nbuckets; ++hn) @@ -7238,7 +7391,7 @@ process_symbol_table (FILE *file) counts = calloc (maxlength + 1, sizeof (*counts)); if (counts == NULL) { - error (_("Out of memory")); + error (_("Out of memory\n")); return 0; } @@ -7269,6 +7422,166 @@ process_symbol_table (FILE *file) free (chains); } + if (do_histogram && dynamic_info_DT_GNU_HASH) + { + unsigned char nb[16]; + bfd_vma i, maxchain = 0xffffffff, symidx, bitmaskwords; + unsigned long *lengths; + unsigned long *counts; + unsigned long hn; + unsigned long maxlength = 0; + unsigned long nzero_counts = 0; + unsigned long nsyms = 0; + bfd_vma buckets_vma; + + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, dynamic_info_DT_GNU_HASH, + sizeof nb)), + SEEK_SET)) + { + error (_("Unable to seek to start of dynamic information\n")); + return 0; + } + + if (fread (nb, 16, 1, file) != 1) + { + error (_("Failed to read in number of buckets\n")); + return 0; + } + + ngnubuckets = byte_get (nb, 4); + symidx = byte_get (nb + 4, 4); + bitmaskwords = byte_get (nb + 8, 4); + buckets_vma = dynamic_info_DT_GNU_HASH + 16; + if (is_32bit_elf) + buckets_vma += bitmaskwords * 4; + else + buckets_vma += bitmaskwords * 8; + + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, buckets_vma, 4)), + SEEK_SET)) + { + error (_("Unable to seek to start of dynamic information\n")); + return 0; + } + + gnubuckets = get_dynamic_data (file, ngnubuckets, 4); + + if (gnubuckets == NULL) + return 0; + + for (i = 0; i < ngnubuckets; i++) + if (gnubuckets[i] != 0) + { + if (gnubuckets[i] < symidx) + return 0; + + if (maxchain == 0xffffffff || gnubuckets[i] > maxchain) + maxchain = gnubuckets[i]; + } + + if (maxchain == 0xffffffff) + return 0; + + maxchain -= symidx; + + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, buckets_vma + + 4 * (ngnubuckets + maxchain), 4)), + SEEK_SET)) + { + error (_("Unable to seek to start of dynamic information\n")); + return 0; + } + + do + { + if (fread (nb, 4, 1, file) != 1) + { + error (_("Failed to determine last chain length\n")); + return 0; + } + + if (maxchain + 1 == 0) + return 0; + + ++maxchain; + } + while ((byte_get (nb, 4) & 1) == 0); + + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, buckets_vma + 4 * ngnubuckets, 4)), + SEEK_SET)) + { + error (_("Unable to seek to start of dynamic information\n")); + return 0; + } + + gnuchains = get_dynamic_data (file, maxchain, 4); + + if (gnuchains == NULL) + return 0; + + lengths = calloc (ngnubuckets, sizeof (*lengths)); + if (lengths == NULL) + { + error (_("Out of memory\n")); + return 0; + } + + printf (_("\nHistogram for `.gnu.hash' bucket list length (total of %lu buckets):\n"), + (unsigned long) ngnubuckets); + printf (_(" Length Number %% of total Coverage\n")); + + for (hn = 0; hn < ngnubuckets; ++hn) + if (gnubuckets[hn] != 0) + { + bfd_vma off, length = 1; + + for (off = gnubuckets[hn] - symidx; + (gnuchains[off] & 1) == 0; ++off) + ++length; + lengths[hn] = length; + if (length > maxlength) + maxlength = length; + nsyms += length; + } + + counts = calloc (maxlength + 1, sizeof (*counts)); + if (counts == NULL) + { + error (_("Out of memory\n")); + return 0; + } + + for (hn = 0; hn < ngnubuckets; ++hn) + ++counts[lengths[hn]]; + + if (ngnubuckets > 0) + { + unsigned long j; + printf (" 0 %-10lu (%5.1f%%)\n", + counts[0], (counts[0] * 100.0) / ngnubuckets); + for (j = 1; j <= maxlength; ++j) + { + nzero_counts += counts[j] * j; + printf ("%7lu %-10lu (%5.1f%%) %5.1f%%\n", + j, counts[j], (counts[j] * 100.0) / ngnubuckets, + (nzero_counts * 100.0) / nsyms); + } + } + + free (counts); + free (lengths); + free (gnubuckets); + free (gnuchains); + } + return 1; } @@ -7354,6 +7667,7 @@ disassemble_section (Elf_Internal_Shdr *section, FILE *file) static int dump_section (Elf_Internal_Shdr *section, FILE *file) { + Elf_Internal_Shdr *relsec; bfd_size_type bytes; bfd_vma addr; unsigned char *data; @@ -7377,6 +7691,26 @@ dump_section (Elf_Internal_Shdr *section, FILE *file) if (!start) return 0; + /* If the section being dumped has relocations against it the user might + be expecting these relocations to have been applied. Check for this + case and issue a warning message in order to avoid confusion. + FIXME: Maybe we ought to have an option that dumps a section with + relocs applied ? */ + for (relsec = section_headers; + relsec < section_headers + elf_header.e_shnum; + ++relsec) + { + if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL) + || SECTION_HEADER_INDEX (relsec->sh_info) >= elf_header.e_shnum + || SECTION_HEADER (relsec->sh_info) != section + || relsec->sh_size == 0 + || SECTION_HEADER_INDEX (relsec->sh_link) >= elf_header.e_shnum) + continue; + + printf (_(" NOTE: This section has relocations against it, but these have NOT been applied to this dump.\n")); + break; + } + data = start; while (bytes) @@ -7389,34 +7723,15 @@ dump_section (Elf_Internal_Shdr *section, FILE *file) printf (" 0x%8.8lx ", (unsigned long) addr); - switch (elf_header.e_ident[EI_DATA]) + for (j = 0; j < 16; j++) { - default: - case ELFDATA2LSB: - for (j = 15; j >= 0; j --) - { - if (j < lbytes) - printf ("%2.2x", data[j]); - else - printf (" "); - - if (!(j & 0x3)) - printf (" "); - } - break; - - case ELFDATA2MSB: - for (j = 0; j < 16; j++) - { - if (j < lbytes) - printf ("%2.2x", data[j]); - else - printf (" "); + if (j < lbytes) + printf ("%2.2x", data[j]); + else + printf (" "); - if ((j & 3) == 3) - printf (" "); - } - break; + if ((j & 3) == 3) + printf (" "); } for (j = 0; j < lbytes; j++) @@ -7437,9 +7752,47 @@ dump_section (Elf_Internal_Shdr *section, FILE *file) free (start); + putchar ('\n'); return 1; } +/* Return the number of bytes affected by a given reloc. + This information is architecture and reloc dependent. + Returns 4 by default, although this is not always correct. + It should return 0 if a decision cannot be made. + FIXME: This is not the correct way to solve this problem. + The proper way is to have target specific reloc sizing functions + created by the reloc-macros.h header, in the same way that it + already creates the reloc naming functions. */ + +static unsigned int +get_reloc_size (Elf_Internal_Rela * reloc) +{ + switch (elf_header.e_machine) + { + case EM_H8S: + case EM_H8_300: + case EM_H8_300H: + case EM_H8_500: + switch (ELF32_R_TYPE (reloc->r_info)) + { + /* PR gas/3800 - without this information we do not correctly + decode the debug information generated by the h8300 assembler. */ + case R_H8_DIR16: + return 2; + default: + return 4; + } + default: + /* FIXME: We need to extend this switch statement to cope with other + architecture's relocs. (When those relocs are used against debug + sections, and when their size is not 4). But see the multiple + inclusions of <elf/h8.h> for an example of the hoops that we need + to jump through in order to obtain the reloc numbers. */ + return 4; + } +} + /* Apply addends of RELA relocations. */ static int @@ -7449,14 +7802,13 @@ debug_apply_rela_addends (void *file, { Elf_Internal_Shdr *relsec; unsigned char *end = start + section->sh_size; - /* FIXME: The relocation field size is relocation type dependent. */ - unsigned int reloc_size = 4; if (!is_relocatable) return 1; - if (section->sh_size < reloc_size) - return 1; + /* SH uses RELA but uses in place value instead of the addend field. */ + if (elf_header.e_machine == EM_SH) + return 0; for (relsec = section_headers; relsec < section_headers + elf_header.e_shnum; @@ -7485,6 +7837,16 @@ debug_apply_rela_addends (void *file, for (rp = rela; rp < rela + nrelas; ++rp) { unsigned char *loc; + unsigned int reloc_size; + + reloc_size = get_reloc_size (rp); + if (reloc_size == 0) + { + warn (_("skipping relocation of unknown size against offset 0x%lx in section %s\n"), + (unsigned long) rp->r_offset, + SECTION_NAME (section)); + continue; + } loc = start + rp->r_offset; if ((loc + reloc_size) > end) @@ -7501,6 +7863,10 @@ debug_apply_rela_addends (void *file, if (ELF32_R_SYM (rp->r_info) != 0 && ELF32_ST_TYPE (sym->st_info) != STT_SECTION + /* Relocations against symbols without type can happen. + Gcc -feliminate-dwarf2-dups may generate symbols + without type for debug info. */ + && ELF32_ST_TYPE (sym->st_info) != STT_NOTYPE /* Relocations against object symbols can happen, eg when referencing a global array. For an example of this see the _clz.o binary in libgcc.a. */ @@ -7530,6 +7896,7 @@ debug_apply_rela_addends (void *file, if (ELF64_R_SYM (rp->r_info) != 0 && ELF64_ST_TYPE (sym->st_info) != STT_SECTION + && ELF64_ST_TYPE (sym->st_info) != STT_NOTYPE && ELF64_ST_TYPE (sym->st_info) != STT_OBJECT) { warn (_("skipping unexpected symbol type %s in relocation in section .rela.%s\n"), @@ -7606,7 +7973,7 @@ display_debug_section (Elf_Internal_Shdr *section, FILE *file) return 0; } - if (strneq (name, ".gnu.linkonce.wi.", 17)) + if (const_strneq (name, ".gnu.linkonce.wi.")) name = ".debug_info"; /* See if we know how to display the contents of this section. */ @@ -7731,7 +8098,8 @@ static const char *arm_attr_tag_CPU_arch[] = static const char *arm_attr_tag_ARM_ISA_use[] = {"No", "Yes"}; static const char *arm_attr_tag_THUMB_ISA_use[] = {"No", "Thumb-1", "Thumb-2"}; -static const char *arm_attr_tag_VFP_arch[] = {"No", "VFPv1", "VFPv2"}; +/* FIXME: VFPv3 encoding was extrapolated! */ +static const char *arm_attr_tag_VFP_arch[] = {"No", "VFPv1", "VFPv2", "VFPv3"}; static const char *arm_attr_tag_WMMX_arch[] = {"No", "WMMXv1"}; static const char *arm_attr_tag_NEON_arch[] = {"No", "NEONv1"}; static const char *arm_attr_tag_ABI_PCS_config[] = @@ -7929,8 +8297,166 @@ display_arm_attribute (unsigned char *p) return p; } + +static unsigned char * +display_gnu_attribute (unsigned char *p, + unsigned char *(*display_proc_gnu_attribute) + (unsigned char *, int)) +{ + int tag; + unsigned int len; + int val; + int type; + + tag = read_uleb128 (p, &len); + p += len; + + /* Tag_compatibility is the only generic GNU attribute defined at + present. */ + if (tag == 32) + { + val = read_uleb128 (p, &len); + p += len; + printf ("flag = %d, vendor = %s\n", val, p); + p += strlen((char *)p) + 1; + return p; + } + + if ((tag & 2) == 0 && display_proc_gnu_attribute) + return display_proc_gnu_attribute (p, tag); + + if (tag & 1) + type = 1; /* String. */ + else + type = 2; /* uleb128. */ + printf (" Tag_unknown_%d: ", tag); + + if (type == 1) + { + printf ("\"%s\"\n", p); + p += strlen ((char *)p) + 1; + } + else + { + val = read_uleb128 (p, &len); + p += len; + printf ("%d (0x%x)\n", val, val); + } + + return p; +} + +static unsigned char * +display_power_gnu_attribute (unsigned char *p, int tag) +{ + int type; + unsigned int len; + int val; + + if (tag == Tag_GNU_Power_ABI_FP) + { + val = read_uleb128 (p, &len); + p += len; + printf (" Tag_GNU_Power_ABI_FP: "); + switch (val) + { + case 0: + printf ("Hard or soft float\n"); + break; + case 1: + printf ("Hard float\n"); + break; + case 2: + printf ("Soft float\n"); + break; + default: + printf ("??? (%d)\n", val); + break; + } + return p; + } + + if (tag & 1) + type = 1; /* String. */ + else + type = 2; /* uleb128. */ + printf (" Tag_unknown_%d: ", tag); + + if (type == 1) + { + printf ("\"%s\"\n", p); + p += strlen ((char *)p) + 1; + } + else + { + val = read_uleb128 (p, &len); + p += len; + printf ("%d (0x%x)\n", val, val); + } + + return p; +} + +static unsigned char * +display_mips_gnu_attribute (unsigned char *p, int tag) +{ + int type; + unsigned int len; + int val; + + if (tag == Tag_GNU_MIPS_ABI_FP) + { + val = read_uleb128 (p, &len); + p += len; + printf (" Tag_GNU_MIPS_ABI_FP: "); + switch (val) + { + case 0: + printf ("Hard or soft float\n"); + break; + case 1: + printf ("Hard float (-mdouble-float)\n"); + break; + case 2: + printf ("Hard float (-msingle-float)\n"); + break; + case 3: + printf ("Soft float\n"); + break; + default: + printf ("??? (%d)\n", val); + break; + } + return p; + } + + if (tag & 1) + type = 1; /* String. */ + else + type = 2; /* uleb128. */ + printf (" Tag_unknown_%d: ", tag); + + if (type == 1) + { + printf ("\"%s\"\n", p); + p += strlen ((char *)p) + 1; + } + else + { + val = read_uleb128 (p, &len); + p += len; + printf ("%d (0x%x)\n", val, val); + } + + return p; +} + static int -process_arm_specific (FILE *file) +process_attributes (FILE *file, const char *public_name, + unsigned int proc_type, + unsigned char *(*display_pub_attribute) (unsigned char *), + unsigned char *(*display_proc_gnu_attribute) + (unsigned char *, int)) { Elf_Internal_Shdr *sect; unsigned char *contents; @@ -7945,7 +8471,7 @@ process_arm_specific (FILE *file) i < elf_header.e_shnum; i++, sect++) { - if (sect->sh_type != SHT_ARM_ATTRIBUTES) + if (sect->sh_type != proc_type && sect->sh_type != SHT_GNU_ATTRIBUTES) continue; contents = get_data (NULL, file, sect->sh_offset, 1, sect->sh_size, @@ -7962,6 +8488,7 @@ process_arm_specific (FILE *file) { int namelen; bfd_boolean public_section; + bfd_boolean gnu_section; section_len = byte_get (p, 4); p += 4; @@ -7973,10 +8500,14 @@ process_arm_specific (FILE *file) } len -= section_len; printf ("Attribute Section: %s\n", p); - if (strcmp ((char *)p, "aeabi") == 0) + if (public_name && strcmp ((char *)p, public_name) == 0) public_section = TRUE; else public_section = FALSE; + if (strcmp ((char *)p, "gnu") == 0) + gnu_section = TRUE; + else + gnu_section = FALSE; namelen = strlen ((char *)p) + 1; p += namelen; section_len -= namelen + 4; @@ -8025,7 +8556,13 @@ process_arm_specific (FILE *file) if (public_section) { while (p < end) - p = display_arm_attribute(p); + p = display_pub_attribute (p); + } + else if (gnu_section) + { + while (p < end) + p = display_gnu_attribute (p, + display_proc_gnu_attribute); } else { @@ -8047,6 +8584,20 @@ process_arm_specific (FILE *file) } static int +process_arm_specific (FILE *file) +{ + return process_attributes (file, "aeabi", SHT_ARM_ATTRIBUTES, + display_arm_attribute, NULL); +} + +static int +process_power_specific (FILE *file) +{ + return process_attributes (file, NULL, SHT_GNU_ATTRIBUTES, NULL, + display_power_gnu_attribute); +} + +static int process_mips_specific (FILE *file) { Elf_Internal_Dyn *entry; @@ -8056,6 +8607,9 @@ process_mips_specific (FILE *file) size_t options_offset = 0; size_t conflicts_offset = 0; + process_attributes (file, NULL, SHT_GNU_ATTRIBUTES, NULL, + display_mips_gnu_attribute); + /* We have a lot of special sections. Thanks SGI! */ if (dynamic_section == NULL) /* No information available. */ @@ -8189,7 +8743,7 @@ process_mips_specific (FILE *file) iopt = cmalloc ((sect->sh_size / sizeof (eopt)), sizeof (*iopt)); if (iopt == NULL) { - error (_("Out of memory")); + error (_("Out of memory\n")); return 0; } @@ -8374,14 +8928,14 @@ process_mips_specific (FILE *file) if (dynamic_symbols == NULL) { - error (_("conflict list found without a dynamic symbol table")); + error (_("conflict list found without a dynamic symbol table\n")); return 0; } iconf = cmalloc (conflictsno, sizeof (*iconf)); if (iconf == NULL) { - error (_("Out of memory")); + error (_("Out of memory\n")); return 0; } @@ -8650,7 +9204,7 @@ process_note (Elf_Internal_Note *pnote) note type strings. */ nt = get_note_type (pnote->type); - else if (strneq (pnote->namedata, "NetBSD-CORE", 11)) + else if (const_strneq (pnote->namedata, "NetBSD-CORE")) /* NetBSD-specific core file notes. */ nt = get_netbsd_elfcore_note_type (pnote->type); @@ -8821,6 +9375,9 @@ process_arch_specific (FILE *file) case EM_MIPS_RS3_LE: return process_mips_specific (file); break; + case EM_PPC: + return process_power_specific (file); + break; default: break; } @@ -9098,7 +9655,7 @@ process_archive (char *file_name, FILE *file) return 1; } - if (memcmp (arhdr.ar_name, "/ ", 16) == 0) + if (const_strneq (arhdr.ar_name, "/ ")) { /* This is the archive symbol table. Skip it. FIXME: We should have an option to dump it. */ @@ -9120,7 +9677,7 @@ process_archive (char *file_name, FILE *file) } } - if (memcmp (arhdr.ar_name, "// ", 16) == 0) + if (const_strneq (arhdr.ar_name, "// ")) { /* This is the archive string table holding long member names. */ @@ -9338,7 +9895,7 @@ main (int argc, char **argv) /* Make a copy of the dump_sects array. */ cmdline_dump_sects = malloc (num_dump_sects); if (cmdline_dump_sects == NULL) - error (_("Out of memory allocating dump request table.")); + error (_("Out of memory allocating dump request table.\n")); else { memcpy (cmdline_dump_sects, dump_sects, num_dump_sects); diff --git a/binutils/rename.c b/binutils/rename.c index 7d21cb34c046..25329d140508 100644 --- a/binutils/rename.c +++ b/binutils/rename.c @@ -1,5 +1,5 @@ /* rename.c -- rename a file, preserving symlinks. - Copyright 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright 1999, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" diff --git a/binutils/resbin.c b/binutils/resbin.c index 80c2596a70b7..7c8f5019641b 100644 --- a/binutils/resbin.c +++ b/binutils/resbin.c @@ -1,7 +1,8 @@ /* resbin.c -- manipulate the Windows binary resource format. - Copyright 1997, 1998, 1999, 2002, 2003 + Copyright 1997, 1998, 1999, 2002, 2003, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -24,102 +25,88 @@ format and the internal structures that we want to use. The same binary resource format is used in both res and COFF files. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" #include "windres.h" -/* Macros to swap in values. */ - -#define get_8(s) (*((unsigned char *)(s))) -#define get_16(be, s) ((be) ? bfd_getb16 (s) : bfd_getl16 (s)) -#define get_32(be, s) ((be) ? bfd_getb32 (s) : bfd_getl32 (s)) - /* Local functions. */ static void toosmall (const char *); -static unichar *get_unicode - (const unsigned char *, unsigned long, int, int *); -static int get_resid - (struct res_id *, const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_generic - (enum res_type, const unsigned char *, unsigned long); -static struct res_resource *bin_to_res_cursor - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_menu - (const unsigned char *, unsigned long, int); -static struct menuitem *bin_to_res_menuitems - (const unsigned char *, unsigned long, int, int *); -static struct menuitem *bin_to_res_menuexitems - (const unsigned char *, unsigned long, int, int *); -static struct res_resource *bin_to_res_dialog - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_string - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_fontdir - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_accelerators - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_rcdata - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_group_cursor - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_group_icon - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_version - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_userdata - (const unsigned char *, unsigned long, int); -static void get_version_header - (const unsigned char *, unsigned long, int, const char *, - unichar **, int *, int *, int *, int *); +static unichar *get_unicode (windres_bfd *, const bfd_byte *, rc_uint_type, rc_uint_type *); +static int get_resid (windres_bfd *, rc_res_id *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_generic (windres_bfd *, enum rc_res_type, + const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_cursor (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_menu (windres_bfd *,const bfd_byte *, rc_uint_type); +static rc_menuitem *bin_to_res_menuitems (windres_bfd *, const bfd_byte *, rc_uint_type, + rc_uint_type *); +static rc_menuitem *bin_to_res_menuexitems (windres_bfd *, const bfd_byte *, rc_uint_type, + rc_uint_type *); +static rc_res_resource *bin_to_res_dialog (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_string (windres_bfd *,const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_fontdir (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_accelerators (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_rcdata (windres_bfd *, const bfd_byte *, rc_uint_type, int); +static rc_res_resource *bin_to_res_group_cursor (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_group_icon (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_version (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_userdata (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_toolbar (windres_bfd *, const bfd_byte *, rc_uint_type); +static void get_version_header (windres_bfd *, const bfd_byte *, rc_uint_type, const char *, + unichar **, rc_uint_type *, rc_uint_type *, rc_uint_type *, + rc_uint_type *); /* Given a resource type ID, a pointer to data, a length, return a - res_resource structure which represents that resource. The caller + rc_res_resource structure which represents that resource. The caller is responsible for initializing the res_info and coff_info fields of the returned structure. */ -struct res_resource * -bin_to_res (struct res_id type, const unsigned char *data, - unsigned long length, int big_endian) +rc_res_resource * +bin_to_res (windres_bfd *wrbfd, rc_res_id type, const bfd_byte *data, + rc_uint_type length) { if (type.named) - return bin_to_res_userdata (data, length, big_endian); + return bin_to_res_userdata (wrbfd, data, length); else { switch (type.u.id) { default: - return bin_to_res_userdata (data, length, big_endian); + return bin_to_res_userdata (wrbfd, data, length); case RT_CURSOR: - return bin_to_res_cursor (data, length, big_endian); + return bin_to_res_cursor (wrbfd, data, length); case RT_BITMAP: - return bin_to_res_generic (RES_TYPE_BITMAP, data, length); + return bin_to_res_generic (wrbfd, RES_TYPE_BITMAP, data, length); case RT_ICON: - return bin_to_res_generic (RES_TYPE_ICON, data, length); + return bin_to_res_generic (wrbfd, RES_TYPE_ICON, data, length); case RT_MENU: - return bin_to_res_menu (data, length, big_endian); + return bin_to_res_menu (wrbfd, data, length); case RT_DIALOG: - return bin_to_res_dialog (data, length, big_endian); + return bin_to_res_dialog (wrbfd, data, length); case RT_STRING: - return bin_to_res_string (data, length, big_endian); + return bin_to_res_string (wrbfd, data, length); case RT_FONTDIR: - return bin_to_res_fontdir (data, length, big_endian); + return bin_to_res_fontdir (wrbfd, data, length); case RT_FONT: - return bin_to_res_generic (RES_TYPE_FONT, data, length); + return bin_to_res_generic (wrbfd, RES_TYPE_FONT, data, length); case RT_ACCELERATOR: - return bin_to_res_accelerators (data, length, big_endian); + return bin_to_res_accelerators (wrbfd, data, length); case RT_RCDATA: - return bin_to_res_rcdata (data, length, big_endian); + return bin_to_res_rcdata (wrbfd, data, length, RES_TYPE_RCDATA); case RT_MESSAGETABLE: - return bin_to_res_generic (RES_TYPE_MESSAGETABLE, data, length); + return bin_to_res_generic (wrbfd, RES_TYPE_MESSAGETABLE, data, length); case RT_GROUP_CURSOR: - return bin_to_res_group_cursor (data, length, big_endian); + return bin_to_res_group_cursor (wrbfd, data, length); case RT_GROUP_ICON: - return bin_to_res_group_icon (data, length, big_endian); + return bin_to_res_group_icon (wrbfd, data, length); case RT_VERSION: - return bin_to_res_version (data, length, big_endian); + return bin_to_res_version (wrbfd, data, length); + case RT_TOOLBAR: + return bin_to_res_toolbar (wrbfd, data, length); + } } } @@ -135,18 +122,18 @@ toosmall (const char *msg) /* Swap in a NULL terminated unicode string. */ static unichar * -get_unicode (const unsigned char *data, unsigned long length, - int big_endian, int *retlen) +get_unicode (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length, + rc_uint_type *retlen) { - int c, i; + rc_uint_type c, i; unichar *ret; c = 0; while (1) { - if (length < (unsigned long) c * 2 + 2) + if (length < c * 2 + 2) toosmall (_("null terminated unicode string")); - if (get_16 (big_endian, data + c * 2) == 0) + if (windres_get_16 (wrbfd, data + c * 2, 2) == 0) break; ++c; } @@ -154,7 +141,7 @@ get_unicode (const unsigned char *data, unsigned long length, ret = (unichar *) res_alloc ((c + 1) * sizeof (unichar)); for (i = 0; i < c; i++) - ret[i] = get_16 (big_endian, data + i * 2); + ret[i] = windres_get_16 (wrbfd, data + i * 2, 2); ret[i] = 0; if (retlen != NULL) @@ -166,27 +153,27 @@ get_unicode (const unsigned char *data, unsigned long length, /* Get a resource identifier. This returns the number of bytes used. */ static int -get_resid (struct res_id *id, const unsigned char *data, - unsigned long length, int big_endian) +get_resid (windres_bfd *wrbfd, rc_res_id *id, const bfd_byte *data, + rc_uint_type length) { - int first; + rc_uint_type first; if (length < 2) toosmall (_("resource ID")); - first = get_16 (big_endian, data); + first = windres_get_16 (wrbfd, data, 2); if (first == 0xffff) { if (length < 4) toosmall (_("resource ID")); id->named = 0; - id->u.id = get_16 (big_endian, data + 2); + id->u.id = windres_get_16 (wrbfd, data + 2, 2); return 4; } else { id->named = 1; - id->u.n.name = get_unicode (data, length, big_endian, &id->u.n.length); + id->u.n.name = get_unicode (wrbfd, data, length, &id->u.n.length); return id->u.n.length * 2 + 2; } } @@ -194,13 +181,13 @@ get_resid (struct res_id *id, const unsigned char *data, /* Convert a resource which just stores uninterpreted data from binary. */ -struct res_resource * -bin_to_res_generic (enum res_type type, const unsigned char *data, - unsigned long length) +rc_res_resource * +bin_to_res_generic (windres_bfd *wrbfd ATTRIBUTE_UNUSED, enum rc_res_type type, + const bfd_byte *data, rc_uint_type length) { - struct res_resource *r; + rc_res_resource *r; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof (rc_res_resource)); r->type = type; r->u.data.data = data; r->u.data.length = length; @@ -210,23 +197,22 @@ bin_to_res_generic (enum res_type type, const unsigned char *data, /* Convert a cursor resource from binary. */ -struct res_resource * -bin_to_res_cursor (const unsigned char *data, unsigned long length, - int big_endian) +rc_res_resource * +bin_to_res_cursor (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - struct cursor *c; - struct res_resource *r; + rc_cursor *c; + rc_res_resource *r; if (length < 4) toosmall (_("cursor")); - c = (struct cursor *) res_alloc (sizeof *c); - c->xhotspot = get_16 (big_endian, data); - c->yhotspot = get_16 (big_endian, data + 2); + c = (rc_cursor *) res_alloc (sizeof (rc_cursor)); + c->xhotspot = windres_get_16 (wrbfd, data, 2); + c->yhotspot = windres_get_16 (wrbfd, data + 2, 2); c->length = length - 4; c->data = data + 4; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_CURSOR; r->u.cursor = c; @@ -235,61 +221,57 @@ bin_to_res_cursor (const unsigned char *data, unsigned long length, /* Convert a menu resource from binary. */ -struct res_resource * -bin_to_res_menu (const unsigned char *data, unsigned long length, - int big_endian) +rc_res_resource * +bin_to_res_menu (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - struct res_resource *r; - struct menu *m; - int version, read; + rc_res_resource *r; + rc_menu *m; + rc_uint_type version, read; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_MENU; - m = (struct menu *) res_alloc (sizeof *m); + m = (rc_menu *) res_alloc (sizeof (rc_menu)); r->u.menu = m; if (length < 2) toosmall (_("menu header")); - version = get_16 (big_endian, data); + version = windres_get_16 (wrbfd, data, 2); if (version == 0) { if (length < 4) toosmall (_("menu header")); m->help = 0; - m->items = bin_to_res_menuitems (data + 4, length - 4, big_endian, - &read); + m->items = bin_to_res_menuitems (wrbfd, data + 4, length - 4, &read); } else if (version == 1) { - unsigned int offset; + rc_uint_type offset; if (length < 8) toosmall (_("menuex header")); - m->help = get_32 (big_endian, data + 4); - offset = get_16 (big_endian, data + 2); + m->help = windres_get_32 (wrbfd, data + 4, 4); + offset = windres_get_16 (wrbfd, data + 2, 2); if (offset + 4 >= length) toosmall (_("menuex offset")); - m->items = bin_to_res_menuexitems (data + 4 + offset, - length - (4 + offset), - big_endian, - &read); + m->items = bin_to_res_menuexitems (wrbfd, data + 4 + offset, + length - (4 + offset), &read); } else - fatal (_("unsupported menu version %d"), version); + fatal (_("unsupported menu version %d"), (int) version); return r; } /* Convert menu items from binary. */ -static struct menuitem * -bin_to_res_menuitems (const unsigned char *data, unsigned long length, - int big_endian, int *read) +static rc_menuitem * +bin_to_res_menuitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length, + rc_uint_type *read) { - struct menuitem *first, **pp; + rc_menuitem *first, **pp; first = NULL; pp = &first; @@ -298,18 +280,18 @@ bin_to_res_menuitems (const unsigned char *data, unsigned long length, while (length > 0) { - int flags, slen, itemlen; - unsigned int stroff; - struct menuitem *mi; + rc_uint_type flags, slen, itemlen; + rc_uint_type stroff; + rc_menuitem *mi; if (length < 4) toosmall (_("menuitem header")); - mi = (struct menuitem *) res_alloc (sizeof *mi); + mi = (rc_menuitem *) res_alloc (sizeof *mi); mi->state = 0; mi->help = 0; - flags = get_16 (big_endian, data); + flags = windres_get_16 (wrbfd, data, 2); mi->type = flags &~ (MENUITEM_POPUP | MENUITEM_ENDMENU); if ((flags & MENUITEM_POPUP) == 0) @@ -320,29 +302,28 @@ bin_to_res_menuitems (const unsigned char *data, unsigned long length, if (length < stroff + 2) toosmall (_("menuitem header")); - if (get_16 (big_endian, data + stroff) == 0) + if (windres_get_16 (wrbfd, data + stroff, 2) == 0) { slen = 0; mi->text = NULL; } else - mi->text = get_unicode (data + stroff, length - stroff, big_endian, - &slen); + mi->text = get_unicode (wrbfd, data + stroff, length - stroff, &slen); itemlen = stroff + slen * 2 + 2; if ((flags & MENUITEM_POPUP) == 0) { mi->popup = NULL; - mi->id = get_16 (big_endian, data + 2); + mi->id = windres_get_16 (wrbfd, data + 2, 2); } else { - int subread; + rc_uint_type subread; mi->id = 0; - mi->popup = bin_to_res_menuitems (data + itemlen, length - itemlen, - big_endian, &subread); + mi->popup = bin_to_res_menuitems (wrbfd, data + itemlen, length - itemlen, + &subread); itemlen += subread; } @@ -363,11 +344,11 @@ bin_to_res_menuitems (const unsigned char *data, unsigned long length, /* Convert menuex items from binary. */ -static struct menuitem * -bin_to_res_menuexitems (const unsigned char *data, unsigned long length, - int big_endian, int *read) +static rc_menuitem * +bin_to_res_menuexitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length, + rc_uint_type *read) { - struct menuitem *first, **pp; + rc_menuitem *first, **pp; first = NULL; pp = &first; @@ -376,29 +357,29 @@ bin_to_res_menuexitems (const unsigned char *data, unsigned long length, while (length > 0) { - int flags, slen; - unsigned int itemlen; - struct menuitem *mi; + rc_uint_type flags, slen; + rc_uint_type itemlen; + rc_menuitem *mi; - if (length < 14) + if (length < 16) toosmall (_("menuitem header")); - mi = (struct menuitem *) res_alloc (sizeof *mi); - mi->type = get_32 (big_endian, data); - mi->state = get_32 (big_endian, data + 4); - mi->id = get_16 (big_endian, data + 8); + mi = (rc_menuitem *) res_alloc (sizeof (rc_menuitem)); + mi->type = windres_get_32 (wrbfd, data, 4); + mi->state = windres_get_32 (wrbfd, data + 4, 4); + mi->id = windres_get_32 (wrbfd, data + 8, 4); - flags = get_16 (big_endian, data + 10); + flags = windres_get_16 (wrbfd, data + 12, 2); - if (get_16 (big_endian, data + 12) == 0) + if (windres_get_16 (wrbfd, data + 14, 2) == 0) { slen = 0; mi->text = NULL; } else - mi->text = get_unicode (data + 12, length - 12, big_endian, &slen); + mi->text = get_unicode (wrbfd, data + 14, length - 14, &slen); - itemlen = 12 + slen * 2 + 2; + itemlen = 14 + slen * 2 + 2; itemlen = (itemlen + 3) &~ 3; if ((flags & 1) == 0) @@ -408,16 +389,15 @@ bin_to_res_menuexitems (const unsigned char *data, unsigned long length, } else { - int subread; + rc_uint_type subread; if (length < itemlen + 4) toosmall (_("menuitem")); - mi->help = get_32 (big_endian, data + itemlen); + mi->help = windres_get_32 (wrbfd, data + itemlen, 4); itemlen += 4; - mi->popup = bin_to_res_menuexitems (data + itemlen, - length - itemlen, - big_endian, &subread); + mi->popup = bin_to_res_menuexitems (wrbfd, data + itemlen, + length - itemlen, &subread); itemlen += subread; } @@ -438,63 +418,62 @@ bin_to_res_menuexitems (const unsigned char *data, unsigned long length, /* Convert a dialog resource from binary. */ -static struct res_resource * -bin_to_res_dialog (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_dialog (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - int signature; - struct dialog *d; - int c, sublen, i; - unsigned int off; - struct dialog_control **pp; - struct res_resource *r; + rc_uint_type signature; + rc_dialog *d; + rc_uint_type c, sublen, i; + rc_uint_type off; + rc_dialog_control **pp; + rc_res_resource *r; if (length < 18) toosmall (_("dialog header")); - d = (struct dialog *) res_alloc (sizeof *d); + d = (rc_dialog *) res_alloc (sizeof (rc_dialog)); - signature = get_16 (big_endian, data + 2); + signature = windres_get_16 (wrbfd, data + 2, 2); if (signature != 0xffff) { d->ex = NULL; - d->style = get_32 (big_endian, data); - d->exstyle = get_32 (big_endian, data + 4); + d->style = windres_get_32 (wrbfd, data, 4); + d->exstyle = windres_get_32 (wrbfd, data + 4, 4); off = 8; } else { int version; - version = get_16 (big_endian, data); + version = windres_get_16 (wrbfd, data, 2); if (version != 1) fatal (_("unexpected DIALOGEX version %d"), version); - d->ex = (struct dialog_ex *) res_alloc (sizeof (struct dialog_ex)); - d->ex->help = get_32 (big_endian, data + 4); - d->exstyle = get_32 (big_endian, data + 8); - d->style = get_32 (big_endian, data + 12); + d->ex = (rc_dialog_ex *) res_alloc (sizeof (rc_dialog_ex)); + d->ex->help = windres_get_32 (wrbfd, data + 4, 4); + d->exstyle = windres_get_32 (wrbfd, data + 8, 4); + d->style = windres_get_32 (wrbfd, data + 12, 4); off = 16; } if (length < off + 10) toosmall (_("dialog header")); - c = get_16 (big_endian, data + off); - d->x = get_16 (big_endian, data + off + 2); - d->y = get_16 (big_endian, data + off + 4); - d->width = get_16 (big_endian, data + off + 6); - d->height = get_16 (big_endian, data + off + 8); + c = windres_get_16 (wrbfd, data + off, 2); + d->x = windres_get_16 (wrbfd, data + off + 2, 2); + d->y = windres_get_16 (wrbfd, data + off + 4, 2); + d->width = windres_get_16 (wrbfd, data + off + 6, 2); + d->height = windres_get_16 (wrbfd, data + off + 8, 2); off += 10; - sublen = get_resid (&d->menu, data + off, length - off, big_endian); + sublen = get_resid (wrbfd, &d->menu, data + off, length - off); off += sublen; - sublen = get_resid (&d->class, data + off, length - off, big_endian); + sublen = get_resid (wrbfd, &d->class, data + off, length - off); off += sublen; - d->caption = get_unicode (data + off, length - off, big_endian, &sublen); + d->caption = get_unicode (wrbfd, data + off, length - off, &sublen); off += sublen * 2 + 2; if (sublen == 0) d->caption = NULL; @@ -515,20 +494,20 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, if (length < off + 2) toosmall (_("dialog font point size")); - d->pointsize = get_16 (big_endian, data + off); + d->pointsize = windres_get_16 (wrbfd, data + off, 2); off += 2; if (d->ex != NULL) { if (length < off + 4) toosmall (_("dialogex font information")); - d->ex->weight = get_16 (big_endian, data + off); - d->ex->italic = get_8 (data + off + 2); - d->ex->charset = get_8 (data + off + 3); + d->ex->weight = windres_get_16 (wrbfd, data + off, 2); + d->ex->italic = windres_get_8 (wrbfd, data + off + 2, 1); + d->ex->charset = windres_get_8 (wrbfd, data + off + 3, 1); off += 4; } - d->font = get_unicode (data + off, length - off, big_endian, &sublen); + d->font = get_unicode (wrbfd, data + off, length - off, &sublen); off += sublen * 2 + 2; } @@ -537,20 +516,20 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, for (i = 0; i < c; i++) { - struct dialog_control *dc; + rc_dialog_control *dc; int datalen; off = (off + 3) &~ 3; - dc = (struct dialog_control *) res_alloc (sizeof *dc); + dc = (rc_dialog_control *) res_alloc (sizeof (rc_dialog_control)); if (d->ex == NULL) { if (length < off + 8) toosmall (_("dialog control")); - dc->style = get_32 (big_endian, data + off); - dc->exstyle = get_32 (big_endian, data + off + 4); + dc->style = windres_get_32 (wrbfd, data + off, 4); + dc->exstyle = windres_get_32 (wrbfd, data + off + 4, 4); dc->help = 0; off += 8; } @@ -558,37 +537,37 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, { if (length < off + 12) toosmall (_("dialogex control")); - dc->help = get_32 (big_endian, data + off); - dc->exstyle = get_32 (big_endian, data + off + 4); - dc->style = get_32 (big_endian, data + off + 8); + dc->help = windres_get_32 (wrbfd, data + off, 4); + dc->exstyle = windres_get_32 (wrbfd, data + off + 4, 4); + dc->style = windres_get_32 (wrbfd, data + off + 8, 4); off += 12; } - if (length < off + 10) + if (length < off + (d->ex != NULL ? 2 : 0) + 10) toosmall (_("dialog control")); - dc->x = get_16 (big_endian, data + off); - dc->y = get_16 (big_endian, data + off + 2); - dc->width = get_16 (big_endian, data + off + 4); - dc->height = get_16 (big_endian, data + off + 6); + dc->x = windres_get_16 (wrbfd, data + off, 2); + dc->y = windres_get_16 (wrbfd, data + off + 2, 2); + dc->width = windres_get_16 (wrbfd, data + off + 4, 2); + dc->height = windres_get_16 (wrbfd, data + off + 6, 2); if (d->ex != NULL) - dc->id = get_32 (big_endian, data + off + 8); + dc->id = windres_get_32 (wrbfd, data + off + 8, 4); else - dc->id = get_16 (big_endian, data + off + 8); + dc->id = windres_get_16 (wrbfd, data + off + 8, 2); off += 10 + (d->ex != NULL ? 2 : 0); - sublen = get_resid (&dc->class, data + off, length - off, big_endian); + sublen = get_resid (wrbfd, &dc->class, data + off, length - off); off += sublen; - sublen = get_resid (&dc->text, data + off, length - off, big_endian); + sublen = get_resid (wrbfd, &dc->text, data + off, length - off); off += sublen; if (length < off + 2) toosmall (_("dialog control end")); - datalen = get_16 (big_endian, data + off); + datalen = windres_get_16 (wrbfd, data + off, 2); off += 2; if (datalen == 0) @@ -600,8 +579,8 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, if (length < off + datalen) toosmall (_("dialog control data")); - dc->data = ((struct rcdata_item *) - res_alloc (sizeof (struct rcdata_item))); + dc->data = ((rc_rcdata_item *) + res_alloc (sizeof (rc_rcdata_item))); dc->data->next = NULL; dc->data->type = RCDATA_BUFFER; dc->data->u.buffer.length = datalen; @@ -615,7 +594,7 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, pp = &dc->next; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_DIALOG; r->u.dialog = d; @@ -624,15 +603,14 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, /* Convert a stringtable resource from binary. */ -static struct res_resource * -bin_to_res_string (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_string (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - struct stringtable *st; + rc_stringtable *st; int i; - struct res_resource *r; + rc_res_resource *r; - st = (struct stringtable *) res_alloc (sizeof *st); + st = (rc_stringtable *) res_alloc (sizeof (rc_stringtable)); for (i = 0; i < 16; i++) { @@ -640,7 +618,7 @@ bin_to_res_string (const unsigned char *data, unsigned long length, if (length < 2) toosmall (_("stringtable string length")); - slen = get_16 (big_endian, data); + slen = windres_get_16 (wrbfd, data, 2); st->strings[i].length = slen; if (slen > 0) @@ -655,14 +633,14 @@ bin_to_res_string (const unsigned char *data, unsigned long length, st->strings[i].string = s; for (j = 0; j < slen; j++) - s[j] = get_16 (big_endian, data + 2 + j * 2); + s[j] = windres_get_16 (wrbfd, data + 2 + j * 2, 2); } data += 2 + 2 * slen; length -= 2 + 2 * slen; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_STRINGTABLE; r->u.stringtable = st; @@ -671,36 +649,37 @@ bin_to_res_string (const unsigned char *data, unsigned long length, /* Convert a fontdir resource from binary. */ -static struct res_resource * -bin_to_res_fontdir (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_fontdir (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - int c, i; - struct fontdir *first, **pp; - struct res_resource *r; + rc_uint_type c, i; + rc_fontdir *first, **pp; + rc_res_resource *r; if (length < 2) toosmall (_("fontdir header")); - c = get_16 (big_endian, data); + c = windres_get_16 (wrbfd, data, 2); first = NULL; pp = &first; for (i = 0; i < c; i++) { - struct fontdir *fd; + const struct bin_fontdir_item *bfi; + rc_fontdir *fd; unsigned int off; if (length < 56) toosmall (_("fontdir")); - fd = (struct fontdir *) res_alloc (sizeof *fd); - fd->index = get_16 (big_endian, data); + bfi = (const struct bin_fontdir_item *) data; + fd = (rc_fontdir *) res_alloc (sizeof *fd); + fd->index = windres_get_16 (wrbfd, bfi->index, 2); /* To work out the length of the fontdir data, we must get the length of the device name and face name strings, even though - we don't store them in the fontdir structure. The + we don't store them in the rc_fontdir. The documentation says that these are NULL terminated char strings, not Unicode strings. */ @@ -732,7 +711,7 @@ bin_to_res_fontdir (const unsigned char *data, unsigned long length, length -= off; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_FONTDIR; r->u.fontdir = first; @@ -741,28 +720,27 @@ bin_to_res_fontdir (const unsigned char *data, unsigned long length, /* Convert an accelerators resource from binary. */ -static struct res_resource * -bin_to_res_accelerators (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_accelerators (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - struct accelerator *first, **pp; - struct res_resource *r; + rc_accelerator *first, **pp; + rc_res_resource *r; first = NULL; pp = &first; while (1) { - struct accelerator *a; + rc_accelerator *a; if (length < 8) toosmall (_("accelerator")); - a = (struct accelerator *) res_alloc (sizeof *a); + a = (rc_accelerator *) res_alloc (sizeof (rc_accelerator)); - a->flags = get_16 (big_endian, data); - a->key = get_16 (big_endian, data + 2); - a->id = get_16 (big_endian, data + 4); + a->flags = windres_get_16 (wrbfd, data, 2); + a->key = windres_get_16 (wrbfd, data + 2, 2); + a->id = windres_get_16 (wrbfd, data + 4, 2); a->next = NULL; *pp = a; @@ -775,7 +753,7 @@ bin_to_res_accelerators (const unsigned char *data, unsigned long length, length -= 8; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof (rc_res_resource)); r->type = RES_TYPE_ACCELERATOR; r->u.acc = first; @@ -784,22 +762,22 @@ bin_to_res_accelerators (const unsigned char *data, unsigned long length, /* Convert an rcdata resource from binary. */ -static struct res_resource * -bin_to_res_rcdata (const unsigned char *data, unsigned long length, - int big_endian ATTRIBUTE_UNUSED) +static rc_res_resource * +bin_to_res_rcdata (windres_bfd *wrbfd ATTRIBUTE_UNUSED, const bfd_byte *data, + rc_uint_type length, int rctyp) { - struct rcdata_item *ri; - struct res_resource *r; + rc_rcdata_item *ri; + rc_res_resource *r; - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = RCDATA_BUFFER; ri->u.buffer.length = length; ri->u.buffer.data = data; - r = (struct res_resource *) res_alloc (sizeof *r); - r->type = RES_TYPE_RCDATA; + r = (rc_res_resource *) res_alloc (sizeof *r); + r->type = rctyp; r->u.rcdata = ri; return r; @@ -807,22 +785,21 @@ bin_to_res_rcdata (const unsigned char *data, unsigned long length, /* Convert a group cursor resource from binary. */ -static struct res_resource * -bin_to_res_group_cursor (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_group_cursor (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { int type, c, i; - struct group_cursor *first, **pp; - struct res_resource *r; + rc_group_cursor *first, **pp; + rc_res_resource *r; if (length < 6) toosmall (_("group cursor header")); - type = get_16 (big_endian, data + 2); + type = windres_get_16 (wrbfd, data + 2, 2); if (type != 2) fatal (_("unexpected group cursor type %d"), type); - c = get_16 (big_endian, data + 4); + c = windres_get_16 (wrbfd, data + 4, 2); data += 6; length -= 6; @@ -832,19 +809,19 @@ bin_to_res_group_cursor (const unsigned char *data, unsigned long length, for (i = 0; i < c; i++) { - struct group_cursor *gc; + rc_group_cursor *gc; if (length < 14) toosmall (_("group cursor")); - gc = (struct group_cursor *) res_alloc (sizeof *gc); + gc = (rc_group_cursor *) res_alloc (sizeof *gc); - gc->width = get_16 (big_endian, data); - gc->height = get_16 (big_endian, data + 2); - gc->planes = get_16 (big_endian, data + 4); - gc->bits = get_16 (big_endian, data + 6); - gc->bytes = get_32 (big_endian, data + 8); - gc->index = get_16 (big_endian, data + 12); + gc->width = windres_get_16 (wrbfd, data, 2); + gc->height = windres_get_16 (wrbfd, data + 2, 2); + gc->planes = windres_get_16 (wrbfd, data + 4, 2); + gc->bits = windres_get_16 (wrbfd, data + 6, 2); + gc->bytes = windres_get_32 (wrbfd, data + 8, 4); + gc->index = windres_get_16 (wrbfd, data + 12, 2); gc->next = NULL; *pp = gc; @@ -854,7 +831,7 @@ bin_to_res_group_cursor (const unsigned char *data, unsigned long length, length -= 14; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof (rc_res_resource)); r->type = RES_TYPE_GROUP_CURSOR; r->u.group_cursor = first; @@ -863,22 +840,21 @@ bin_to_res_group_cursor (const unsigned char *data, unsigned long length, /* Convert a group icon resource from binary. */ -static struct res_resource * -bin_to_res_group_icon (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_group_icon (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { int type, c, i; - struct group_icon *first, **pp; - struct res_resource *r; + rc_group_icon *first, **pp; + rc_res_resource *r; if (length < 6) toosmall (_("group icon header")); - type = get_16 (big_endian, data + 2); + type = windres_get_16 (wrbfd, data + 2, 2); if (type != 1) fatal (_("unexpected group icon type %d"), type); - c = get_16 (big_endian, data + 4); + c = windres_get_16 (wrbfd, data + 4, 2); data += 6; length -= 6; @@ -888,20 +864,20 @@ bin_to_res_group_icon (const unsigned char *data, unsigned long length, for (i = 0; i < c; i++) { - struct group_icon *gi; + rc_group_icon *gi; if (length < 14) toosmall (_("group icon")); - gi = (struct group_icon *) res_alloc (sizeof *gi); + gi = (rc_group_icon *) res_alloc (sizeof (rc_group_icon)); - gi->width = data[0]; - gi->height = data[1]; - gi->colors = data[2]; - gi->planes = get_16 (big_endian, data + 4); - gi->bits = get_16 (big_endian, data + 6); - gi->bytes = get_32 (big_endian, data + 8); - gi->index = get_16 (big_endian, data + 12); + gi->width = windres_get_8 (wrbfd, data, 1); + gi->height = windres_get_8 (wrbfd, data + 1, 1); + gi->colors = windres_get_8 (wrbfd, data + 2, 1); + gi->planes = windres_get_16 (wrbfd, data + 4, 2); + gi->bits = windres_get_16 (wrbfd, data + 6, 2); + gi->bytes = windres_get_32 (wrbfd, data + 8, 4); + gi->index = windres_get_16 (wrbfd, data + 12, 2); gi->next = NULL; *pp = gi; @@ -911,7 +887,7 @@ bin_to_res_group_icon (const unsigned char *data, unsigned long length, length -= 14; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_GROUP_ICON; r->u.group_icon = first; @@ -924,16 +900,17 @@ bin_to_res_group_icon (const unsigned char *data, unsigned long length, to the type, and *OFF to the offset to the children. */ static void -get_version_header (const unsigned char *data, unsigned long length, - int big_endian, const char *key, unichar **pkey, - int *len, int *vallen, int *type, int *off) +get_version_header (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length, + const char *key, unichar **pkey, + rc_uint_type *len, rc_uint_type *vallen, rc_uint_type *type, + rc_uint_type *off) { if (length < 8) toosmall (key); - *len = get_16 (big_endian, data); - *vallen = get_16 (big_endian, data + 2); - *type = get_16 (big_endian, data + 4); + *len = windres_get_16 (wrbfd, data, 2); + *vallen = windres_get_16 (wrbfd, data + 2, 2); + *type = windres_get_16 (wrbfd, data + 4, 2); *off = 6; @@ -942,10 +919,10 @@ get_version_header (const unsigned char *data, unsigned long length, if (key == NULL) { - int sublen; + rc_uint_type sublen; - *pkey = get_unicode (data, length, big_endian, &sublen); - *off += sublen * 2 + 2; + *pkey = get_unicode (wrbfd, data, length, &sublen); + *off += (sublen + 1) * sizeof (unichar); } else { @@ -953,7 +930,7 @@ get_version_header (const unsigned char *data, unsigned long length, { if (length < 2) toosmall (key); - if (get_16 (big_endian, data) != (unsigned char) *key) + if (windres_get_16 (wrbfd, data, 2) != (bfd_byte) *key) fatal (_("unexpected version string")); *off += 2; @@ -972,25 +949,24 @@ get_version_header (const unsigned char *data, unsigned long length, /* Convert a version resource from binary. */ -static struct res_resource * -bin_to_res_version (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_version (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - int verlen, vallen, type, off; - struct fixed_versioninfo *fi; - struct ver_info *first, **pp; - struct versioninfo *v; - struct res_resource *r; + rc_uint_type verlen, vallen, type, off; + rc_fixed_versioninfo *fi; + rc_ver_info *first, **pp; + rc_versioninfo *v; + rc_res_resource *r; - get_version_header (data, length, big_endian, "VS_VERSION_INFO", + get_version_header (wrbfd, data, length, "VS_VERSION_INFO", (unichar **) NULL, &verlen, &vallen, &type, &off); if ((unsigned int) verlen != length) fatal (_("version length %d does not match resource length %lu"), - verlen, length); + (int) verlen, (unsigned long) length); if (type != 0) - fatal (_("unexpected version type %d"), type); + fatal (_("unexpected version type %d"), (int) type); data += off; length -= off; @@ -1002,32 +978,32 @@ bin_to_res_version (const unsigned char *data, unsigned long length, unsigned long signature, fiv; if (vallen != 52) - fatal (_("unexpected fixed version information length %d"), vallen); + fatal (_("unexpected fixed version information length %ld"), (long) vallen); if (length < 52) toosmall (_("fixed version info")); - signature = get_32 (big_endian, data); + signature = windres_get_32 (wrbfd, data, 4); if (signature != 0xfeef04bd) fatal (_("unexpected fixed version signature %lu"), signature); - fiv = get_32 (big_endian, data + 4); + fiv = windres_get_32 (wrbfd, data + 4, 4); if (fiv != 0 && fiv != 0x10000) fatal (_("unexpected fixed version info version %lu"), fiv); - fi = (struct fixed_versioninfo *) res_alloc (sizeof *fi); + fi = (rc_fixed_versioninfo *) res_alloc (sizeof (rc_fixed_versioninfo)); - fi->file_version_ms = get_32 (big_endian, data + 8); - fi->file_version_ls = get_32 (big_endian, data + 12); - fi->product_version_ms = get_32 (big_endian, data + 16); - fi->product_version_ls = get_32 (big_endian, data + 20); - fi->file_flags_mask = get_32 (big_endian, data + 24); - fi->file_flags = get_32 (big_endian, data + 28); - fi->file_os = get_32 (big_endian, data + 32); - fi->file_type = get_32 (big_endian, data + 36); - fi->file_subtype = get_32 (big_endian, data + 40); - fi->file_date_ms = get_32 (big_endian, data + 44); - fi->file_date_ls = get_32 (big_endian, data + 48); + fi->file_version_ms = windres_get_32 (wrbfd, data + 8, 4); + fi->file_version_ls = windres_get_32 (wrbfd, data + 12, 4); + fi->product_version_ms = windres_get_32 (wrbfd, data + 16, 4); + fi->product_version_ls = windres_get_32 (wrbfd, data + 20, 4); + fi->file_flags_mask = windres_get_32 (wrbfd, data + 24, 4); + fi->file_flags = windres_get_32 (wrbfd, data + 28, 4); + fi->file_os = windres_get_32 (wrbfd, data + 32, 4); + fi->file_type = windres_get_32 (wrbfd, data + 36, 4); + fi->file_subtype = windres_get_32 (wrbfd, data + 40, 4); + fi->file_date_ms = windres_get_32 (wrbfd, data + 44, 4); + fi->file_date_ls = windres_get_32 (wrbfd, data + 48, 4); data += 52; length -= 52; @@ -1038,38 +1014,38 @@ bin_to_res_version (const unsigned char *data, unsigned long length, while (length > 0) { - struct ver_info *vi; + rc_ver_info *vi; int ch; if (length < 8) toosmall (_("version var info")); - vi = (struct ver_info *) res_alloc (sizeof *vi); + vi = (rc_ver_info *) res_alloc (sizeof (rc_ver_info)); - ch = get_16 (big_endian, data + 6); + ch = windres_get_16 (wrbfd, data + 6, 2); if (ch == 'S') { - struct ver_stringinfo **ppvs; + rc_ver_stringinfo **ppvs; vi->type = VERINFO_STRING; - get_version_header (data, length, big_endian, "StringFileInfo", + get_version_header (wrbfd, data, length, "StringFileInfo", (unichar **) NULL, &verlen, &vallen, &type, &off); if (vallen != 0) - fatal (_("unexpected stringfileinfo value length %d"), vallen); + fatal (_("unexpected stringfileinfo value length %ld"), (long) vallen); data += off; length -= off; - get_version_header (data, length, big_endian, (const char *) NULL, + get_version_header (wrbfd, data, length, (const char *) NULL, &vi->u.string.language, &verlen, &vallen, &type, &off); if (vallen != 0) - fatal (_("unexpected version stringtable value length %d"), vallen); + fatal (_("unexpected version stringtable value length %ld"), (long) vallen); data += off; length -= off; @@ -1084,12 +1060,12 @@ bin_to_res_version (const unsigned char *data, unsigned long length, while (verlen > 0) { - struct ver_stringinfo *vs; - int subverlen, vslen, valoff; + rc_ver_stringinfo *vs; + rc_uint_type subverlen, vslen, valoff; - vs = (struct ver_stringinfo *) res_alloc (sizeof *vs); + vs = (rc_ver_stringinfo *) res_alloc (sizeof *vs); - get_version_header (data, length, big_endian, + get_version_header (wrbfd, data, length, (const char *) NULL, &vs->key, &subverlen, &vallen, &type, &off); @@ -1098,13 +1074,13 @@ bin_to_res_version (const unsigned char *data, unsigned long length, data += off; length -= off; - vs->value = get_unicode (data, length, big_endian, &vslen); + vs->value = get_unicode (wrbfd, data, length, &vslen); valoff = vslen * 2 + 2; valoff = (valoff + 3) &~ 3; if (off + valoff != subverlen) - fatal (_("unexpected version string length %d != %d + %d"), - subverlen, off, valoff); + fatal (_("unexpected version string length %ld != %ld + %ld"), + (long) subverlen, (long) off, (long) valoff); vs->next = NULL; *ppvs = vs; @@ -1114,29 +1090,29 @@ bin_to_res_version (const unsigned char *data, unsigned long length, length -= valoff; if (verlen < subverlen) - fatal (_("unexpected version string length %d < %d"), - verlen, subverlen); + fatal (_("unexpected version string length %ld < %ld"), + (long) verlen, (long) subverlen); verlen -= subverlen; } } else if (ch == 'V') { - struct ver_varinfo **ppvv; + rc_ver_varinfo **ppvv; vi->type = VERINFO_VAR; - get_version_header (data, length, big_endian, "VarFileInfo", + get_version_header (wrbfd, data, length, "VarFileInfo", (unichar **) NULL, &verlen, &vallen, &type, &off); if (vallen != 0) - fatal (_("unexpected varfileinfo value length %d"), vallen); + fatal (_("unexpected varfileinfo value length %ld"), (long) vallen); data += off; length -= off; - get_version_header (data, length, big_endian, (const char *) NULL, + get_version_header (wrbfd, data, length, (const char *) NULL, &vi->u.var.key, &verlen, &vallen, &type, &off); data += off; @@ -1147,15 +1123,15 @@ bin_to_res_version (const unsigned char *data, unsigned long length, while (vallen > 0) { - struct ver_varinfo *vv; + rc_ver_varinfo *vv; if (length < 4) toosmall (_("version varfileinfo")); - vv = (struct ver_varinfo *) res_alloc (sizeof *vv); + vv = (rc_ver_varinfo *) res_alloc (sizeof (rc_ver_varinfo)); - vv->language = get_16 (big_endian, data); - vv->charset = get_16 (big_endian, data + 2); + vv->language = windres_get_16 (wrbfd, data, 2); + vv->charset = windres_get_16 (wrbfd, data + 2, 2); vv->next = NULL; *ppvv = vv; @@ -1165,7 +1141,7 @@ bin_to_res_version (const unsigned char *data, unsigned long length, length -= 4; if (vallen < 4) - fatal (_("unexpected version value length %d"), vallen); + fatal (_("unexpected version value length %ld"), (long) vallen); vallen -= 4; } @@ -1178,11 +1154,11 @@ bin_to_res_version (const unsigned char *data, unsigned long length, pp = &vi->next; } - v = (struct versioninfo *) res_alloc (sizeof *v); + v = (rc_versioninfo *) res_alloc (sizeof (rc_versioninfo)); v->fixed = fi; v->var = first; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_VERSIONINFO; r->u.versioninfo = v; @@ -1191,1128 +1167,968 @@ bin_to_res_version (const unsigned char *data, unsigned long length, /* Convert an arbitrary user defined resource from binary. */ -static struct res_resource * -bin_to_res_userdata (const unsigned char *data, unsigned long length, - int big_endian ATTRIBUTE_UNUSED) +static rc_res_resource * +bin_to_res_userdata (windres_bfd *wrbfd ATTRIBUTE_UNUSED, const bfd_byte *data, + rc_uint_type length) { - struct rcdata_item *ri; - struct res_resource *r; + rc_rcdata_item *ri; + rc_res_resource *r; - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = RCDATA_BUFFER; ri->u.buffer.length = length; ri->u.buffer.data = data; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_USERDATA; r->u.rcdata = ri; return r; } -/* Macros to swap out values. */ +static rc_res_resource * +bin_to_res_toolbar (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) +{ + rc_toolbar *ri; + rc_res_resource *r; + rc_uint_type i; + + ri = (rc_toolbar *) res_alloc (sizeof (rc_toolbar)); + ri->button_width = windres_get_32 (wrbfd, data, 4); + ri->button_height = windres_get_32 (wrbfd, data + 4, 4); + ri->nitems = windres_get_32 (wrbfd, data + 8, 4); + ri->items = NULL; + + data += 12; + length -= 12; + for (i=0 ; i < ri->nitems; i++) + { + rc_toolbar_item *it; + it = (rc_toolbar_item *) res_alloc (sizeof (rc_toolbar_item)); + it->id.named = 0; + it->id.u.id = (int) windres_get_32 (wrbfd, data, 4); + it->prev = it->next = NULL; + data += 4; + length -= 4; + if(ri->items) { + rc_toolbar_item *ii = ri->items; + while (ii->next != NULL) + ii = ii->next; + it->prev = ii; + ii->next = it; + } + else + ri->items = it; + } + r = (rc_res_resource *) res_alloc (sizeof *r); + r->type = RES_TYPE_TOOLBAR; + r->u.toolbar = ri; + return r; +} -#define put_8(v, s) (*((unsigned char *) (s)) = (unsigned char) (v)) -#define put_16(be, v, s) ((be) ? bfd_putb16 ((v), (s)) : bfd_putl16 ((v), (s))) -#define put_32(be, v, s) ((be) ? bfd_putb32 ((v), (s)) : bfd_putl32 ((v), (s))) /* Local functions used to convert resources to binary format. */ -static void dword_align_bin (struct bindata ***, unsigned long *); -static struct bindata *resid_to_bin (struct res_id, int); -static struct bindata *unicode_to_bin (const unichar *, int); -static struct bindata *res_to_bin_accelerator - (const struct accelerator *, int); -static struct bindata *res_to_bin_cursor - (const struct cursor *, int); -static struct bindata *res_to_bin_group_cursor - (const struct group_cursor *, int); -static struct bindata *res_to_bin_dialog - (const struct dialog *, int); -static struct bindata *res_to_bin_fontdir - (const struct fontdir *, int); -static struct bindata *res_to_bin_group_icon - (const struct group_icon *, int); -static struct bindata *res_to_bin_menu - (const struct menu *, int); -static struct bindata *res_to_bin_menuitems - (const struct menuitem *, int); -static struct bindata *res_to_bin_menuexitems - (const struct menuitem *, int); -static struct bindata *res_to_bin_rcdata - (const struct rcdata_item *, int); -static struct bindata *res_to_bin_stringtable - (const struct stringtable *, int); -static struct bindata *string_to_unicode_bin (const char *, int); -static struct bindata *res_to_bin_versioninfo - (const struct versioninfo *, int); -static struct bindata *res_to_bin_generic - (unsigned long, const unsigned char *); +static rc_uint_type resid_to_bin (windres_bfd *, rc_uint_type, rc_res_id); +static rc_uint_type unicode_to_bin (windres_bfd *, rc_uint_type, const unichar *); +static rc_uint_type res_to_bin_accelerator (windres_bfd *, rc_uint_type, const rc_accelerator *); +static rc_uint_type res_to_bin_cursor (windres_bfd *, rc_uint_type, const rc_cursor *); +static rc_uint_type res_to_bin_group_cursor (windres_bfd *, rc_uint_type, const rc_group_cursor *); +static rc_uint_type res_to_bin_dialog (windres_bfd *, rc_uint_type, const rc_dialog *); +static rc_uint_type res_to_bin_fontdir (windres_bfd *, rc_uint_type, const rc_fontdir *); +static rc_uint_type res_to_bin_group_icon (windres_bfd *, rc_uint_type, const rc_group_icon *); +static rc_uint_type res_to_bin_menu (windres_bfd *, rc_uint_type, const rc_menu *); +static rc_uint_type res_to_bin_menuitems (windres_bfd *, rc_uint_type, const rc_menuitem *); +static rc_uint_type res_to_bin_menuexitems (windres_bfd *, rc_uint_type, const rc_menuitem *); +static rc_uint_type res_to_bin_rcdata (windres_bfd *, rc_uint_type, const rc_rcdata_item *); +static rc_uint_type res_to_bin_stringtable (windres_bfd *, rc_uint_type, const rc_stringtable *); +static rc_uint_type string_to_unicode_bin (windres_bfd *, rc_uint_type, const char *); +static rc_uint_type res_to_bin_toolbar (windres_bfd *, rc_uint_type, rc_toolbar *tb); +static rc_uint_type res_to_bin_versioninfo (windres_bfd *, rc_uint_type, const rc_versioninfo *); +static rc_uint_type res_to_bin_generic (windres_bfd *, rc_uint_type, rc_uint_type, + const bfd_byte *); /* Convert a resource to binary. */ -struct bindata * -res_to_bin (const struct res_resource *res, int big_endian) +rc_uint_type +res_to_bin (windres_bfd *wrbfd, rc_uint_type off, const rc_res_resource *res) { switch (res->type) { - default: - abort (); case RES_TYPE_BITMAP: case RES_TYPE_FONT: case RES_TYPE_ICON: case RES_TYPE_MESSAGETABLE: - return res_to_bin_generic (res->u.data.length, res->u.data.data); + return res_to_bin_generic (wrbfd, off, res->u.data.length, res->u.data.data); case RES_TYPE_ACCELERATOR: - return res_to_bin_accelerator (res->u.acc, big_endian); + return res_to_bin_accelerator (wrbfd, off, res->u.acc); case RES_TYPE_CURSOR: - return res_to_bin_cursor (res->u.cursor, big_endian); + return res_to_bin_cursor (wrbfd, off, res->u.cursor); case RES_TYPE_GROUP_CURSOR: - return res_to_bin_group_cursor (res->u.group_cursor, big_endian); + return res_to_bin_group_cursor (wrbfd, off, res->u.group_cursor); case RES_TYPE_DIALOG: - return res_to_bin_dialog (res->u.dialog, big_endian); + return res_to_bin_dialog (wrbfd, off, res->u.dialog); case RES_TYPE_FONTDIR: - return res_to_bin_fontdir (res->u.fontdir, big_endian); + return res_to_bin_fontdir (wrbfd, off, res->u.fontdir); case RES_TYPE_GROUP_ICON: - return res_to_bin_group_icon (res->u.group_icon, big_endian); + return res_to_bin_group_icon (wrbfd, off, res->u.group_icon); case RES_TYPE_MENU: - return res_to_bin_menu (res->u.menu, big_endian); - case RES_TYPE_RCDATA: - return res_to_bin_rcdata (res->u.rcdata, big_endian); + return res_to_bin_menu (wrbfd, off, res->u.menu); case RES_TYPE_STRINGTABLE: - return res_to_bin_stringtable (res->u.stringtable, big_endian); - case RES_TYPE_USERDATA: - return res_to_bin_rcdata (res->u.rcdata, big_endian); + return res_to_bin_stringtable (wrbfd, off, res->u.stringtable); case RES_TYPE_VERSIONINFO: - return res_to_bin_versioninfo (res->u.versioninfo, big_endian); + return res_to_bin_versioninfo (wrbfd, off, res->u.versioninfo); + case RES_TYPE_TOOLBAR: + return res_to_bin_toolbar (wrbfd, off, res->u.toolbar); + case RES_TYPE_USERDATA: + case RES_TYPE_RCDATA: + default: + return res_to_bin_rcdata (wrbfd, off, res->u.rcdata); } } -/* Align to a 32 bit boundary. PPP points to the of a list of bindata - structures. LENGTH points to the length of the structures. If - necessary, this adds a new bindata to bring length up to a 32 bit - boundary. It updates *PPP and *LENGTH. */ - -static void -dword_align_bin (struct bindata ***ppp, unsigned long *length) -{ - int add; - struct bindata *d; - - if ((*length & 3) == 0) - return; - - add = 4 - (*length & 3); - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = add; - d->data = (unsigned char *) reswr_alloc (add); - memset (d->data, 0, add); - - d->next = NULL; - **ppp = d; - *ppp = &(**ppp)->next; - - *length += add; -} - /* Convert a resource ID to binary. This always returns exactly one bindata structure. */ -static struct bindata * -resid_to_bin (struct res_id id, int big_endian) +static rc_uint_type +resid_to_bin (windres_bfd *wrbfd, rc_uint_type off, rc_res_id id) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - if (! id.named) { - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); - put_16 (big_endian, 0xffff, d->data); - put_16 (big_endian, id.u.id, d->data + 2); + if (wrbfd) + { + struct bin_res_id bri; + + windres_put_16 (wrbfd, bri.sig, 0xffff); + windres_put_16 (wrbfd, bri.id, id.u.id); + set_windres_bfd_content (wrbfd, &bri, off, BIN_RES_ID); + } + off += BIN_RES_ID; } else { - int i; - - d->length = id.u.n.length * 2 + 2; - d->data = (unsigned char *) reswr_alloc (d->length); - for (i = 0; i < id.u.n.length; i++) - put_16 (big_endian, id.u.n.name[i], d->data + i * 2); - put_16 (big_endian, 0, d->data + i * 2); + rc_uint_type len = (id.u.n.name ? unichar_len (id.u.n.name) : 0); + if (wrbfd) + { + bfd_byte *d = (bfd_byte *) reswr_alloc ((len + 1) * sizeof (unichar)); + rc_uint_type i; + for (i = 0; i < len; i++) + windres_put_16 (wrbfd, d + (i * sizeof (unichar)), id.u.n.name[i]); + windres_put_16 (wrbfd, d + (len * sizeof (unichar)), 0); + set_windres_bfd_content (wrbfd, d, off, (len + 1) * sizeof (unichar)); } - - d->next = NULL; - - return d; + off += (rc_uint_type) ((len + 1) * sizeof (unichar)); + } + return off; } /* Convert a null terminated unicode string to binary. This always returns exactly one bindata structure. */ -static struct bindata * -unicode_to_bin (const unichar *str, int big_endian) +static rc_uint_type +unicode_to_bin (windres_bfd *wrbfd, rc_uint_type off, const unichar *str) { - int len; - struct bindata *d; + rc_uint_type len = 0; - len = 0; if (str != NULL) - { - const unichar *s; - - for (s = str; *s != 0; s++) - ++len; - } - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = len * 2 + 2; - d->data = (unsigned char *) reswr_alloc (d->length); + len = unichar_len (str); - if (str == NULL) - put_16 (big_endian, 0, d->data); - else + if (wrbfd) { - const unichar *s; - int i; - - for (s = str, i = 0; *s != 0; s++, i++) - put_16 (big_endian, *s, d->data + i * 2); - put_16 (big_endian, 0, d->data + i * 2); + bfd_byte *d; + rc_uint_type i; + d = (bfd_byte *) reswr_alloc ( (len + 1) * sizeof (unichar)); + for (i = 0; i < len; i++) + windres_put_16 (wrbfd, d + (i * sizeof (unichar)), str[i]); + windres_put_16 (wrbfd, d + (len * sizeof (unichar)), 0); + set_windres_bfd_content (wrbfd, d, off, (len + 1) * sizeof (unichar)); } + off += (rc_uint_type) ((len + 1) * sizeof (unichar)); - d->next = NULL; - - return d; + return off; } /* Convert an accelerator resource to binary. */ -static struct bindata * -res_to_bin_accelerator (const struct accelerator *accelerators, - int big_endian) +static rc_uint_type +res_to_bin_accelerator (windres_bfd *wrbfd, rc_uint_type off, + const rc_accelerator *accelerators) { - struct bindata *first, **pp; - const struct accelerator *a; + bindata *first, **pp; + const rc_accelerator *a; first = NULL; pp = &first; for (a = accelerators; a != NULL; a = a->next) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 8; - d->data = (unsigned char *) reswr_alloc (d->length); - - put_16 (big_endian, - a->flags | (a->next != NULL ? 0 : ACC_LAST), - d->data); - put_16 (big_endian, a->key, d->data + 2); - put_16 (big_endian, a->id, d->data + 4); - put_16 (big_endian, 0, d->data + 6); - - d->next = NULL; - *pp = d; - pp = &d->next; - } + if (wrbfd) + { + struct bin_accelerator ba; - return first; + windres_put_16 (wrbfd, ba.flags, a->flags | (a->next != NULL ? 0 : ACC_LAST)); + windres_put_16 (wrbfd, ba.key, a->key); + windres_put_16 (wrbfd, ba.id, a->id); + windres_put_16 (wrbfd, ba.pad, 0); + set_windres_bfd_content (wrbfd, &ba, off, BIN_ACCELERATOR_SIZE); + } + off += BIN_ACCELERATOR_SIZE; + } + return off; } /* Convert a cursor resource to binary. */ -static struct bindata * -res_to_bin_cursor (const struct cursor *c, int big_endian) +static rc_uint_type +res_to_bin_cursor (windres_bfd *wrbfd, rc_uint_type off, const rc_cursor *c) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); - - put_16 (big_endian, c->xhotspot, d->data); - put_16 (big_endian, c->yhotspot, d->data + 2); - - d->next = (struct bindata *) reswr_alloc (sizeof *d); - d->next->length = c->length; - d->next->data = (unsigned char *) c->data; - d->next->next = NULL; + if (wrbfd) + { + struct bin_cursor bc; - return d; + windres_put_16 (wrbfd, bc.xhotspot, c->xhotspot); + windres_put_16 (wrbfd, bc.yhotspot, c->yhotspot); + set_windres_bfd_content (wrbfd, &bc, off, BIN_CURSOR_SIZE); + if (c->length) + set_windres_bfd_content (wrbfd, c->data, off + BIN_CURSOR_SIZE, c->length); + } + off = (off + BIN_CURSOR_SIZE + (rc_uint_type) c->length); + return off; } /* Convert a group cursor resource to binary. */ -static struct bindata * -res_to_bin_group_cursor (const struct group_cursor *group_cursors, - int big_endian) +static rc_uint_type +res_to_bin_group_cursor (windres_bfd *wrbfd, rc_uint_type off, + const rc_group_cursor *group_cursors) { - struct bindata *first, **pp; - int c; - const struct group_cursor *gc; - - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); - - put_16 (big_endian, 0, first->data); - put_16 (big_endian, 2, first->data + 2); + int c = 0; + const rc_group_cursor *gc; + struct bin_group_cursor bgc; + struct bin_group_cursor_item bgci; + rc_uint_type start = off; - first->next = NULL; - pp = &first->next; + off += BIN_GROUP_CURSOR_SIZE; - c = 0; - for (gc = group_cursors; gc != NULL; gc = gc->next) + for (c = 0, gc = group_cursors; gc != NULL; gc = gc->next, c++) { - struct bindata *d; - - ++c; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 14; - d->data = (unsigned char *) reswr_alloc (d->length); - - put_16 (big_endian, gc->width, d->data); - put_16 (big_endian, gc->height, d->data + 2); - put_16 (big_endian, gc->planes, d->data + 4); - put_16 (big_endian, gc->bits, d->data + 6); - put_32 (big_endian, gc->bytes, d->data + 8); - put_16 (big_endian, gc->index, d->data + 12); - - d->next = NULL; - *pp = d; - pp = &d->next; + if (wrbfd) + { + windres_put_16 (wrbfd, bgci.width, gc->width); + windres_put_16 (wrbfd, bgci.height, gc->height); + windres_put_16 (wrbfd, bgci.planes, gc->planes); + windres_put_16 (wrbfd, bgci.bits, gc->bits); + windres_put_32 (wrbfd, bgci.bytes, gc->bytes); + windres_put_16 (wrbfd, bgci.index, gc->index); + set_windres_bfd_content (wrbfd, &bgci, off, BIN_GROUP_CURSOR_ITEM_SIZE); } - put_16 (big_endian, c, first->data + 4); - - return first; + off += BIN_GROUP_CURSOR_ITEM_SIZE; + } + if (wrbfd) + { + windres_put_16 (wrbfd, bgc.sig1, 0); + windres_put_16 (wrbfd, bgc.sig2, 2); + windres_put_16 (wrbfd, bgc.nitems, c); + set_windres_bfd_content (wrbfd, &bgc, start, BIN_GROUP_CURSOR_SIZE); + } + return off; } /* Convert a dialog resource to binary. */ -static struct bindata * -res_to_bin_dialog (const struct dialog *dialog, int big_endian) +static rc_uint_type +res_to_bin_dialog (windres_bfd *wrbfd, rc_uint_type off, const rc_dialog *dialog) { + rc_uint_type off_delta; + rc_uint_type start, marker; int dialogex; - struct bindata *first, **pp; - unsigned long length; - int off, c; - struct dialog_control *dc; + int c; + rc_dialog_control *dc; + struct bin_dialogex bdx; + struct bin_dialog bd; + off_delta = off; + start = off; dialogex = extended_dialog (dialog); - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = dialogex ? 26 : 18; - first->data = (unsigned char *) reswr_alloc (first->length); - - length = first->length; - + if (wrbfd) + { if (! dialogex) { - put_32 (big_endian, dialog->style, first->data); - put_32 (big_endian, dialog->exstyle, first->data + 4); - off = 8; + windres_put_32 (wrbfd, bd.style, dialog->style); + windres_put_32 (wrbfd, bd.exstyle, dialog->exstyle); + windres_put_16 (wrbfd, bd.x, dialog->x); + windres_put_16 (wrbfd, bd.y, dialog->y); + windres_put_16 (wrbfd, bd.width, dialog->width); + windres_put_16 (wrbfd, bd.height, dialog->height); } else { - put_16 (big_endian, 1, first->data); - put_16 (big_endian, 0xffff, first->data + 2); - - if (dialog->ex == NULL) - put_32 (big_endian, 0, first->data + 4); - else - put_32 (big_endian, dialog->ex->help, first->data + 4); - put_32 (big_endian, dialog->exstyle, first->data + 8); - put_32 (big_endian, dialog->style, first->data + 12); - off = 16; + windres_put_16 (wrbfd, bdx.sig1, 1); + windres_put_16 (wrbfd, bdx.sig2, 0xffff); + windres_put_32 (wrbfd, bdx.help, (dialog->ex ? dialog->ex->help : 0)); + windres_put_32 (wrbfd, bdx.exstyle, dialog->exstyle); + windres_put_32 (wrbfd, bdx.style, dialog->style); + windres_put_16 (wrbfd, bdx.x, dialog->x); + windres_put_16 (wrbfd, bdx.y, dialog->y); + windres_put_16 (wrbfd, bdx.width, dialog->width); + windres_put_16 (wrbfd, bdx.height, dialog->height); + } } - put_16 (big_endian, dialog->x, first->data + off + 2); - put_16 (big_endian, dialog->y, first->data + off + 4); - put_16 (big_endian, dialog->width, first->data + off + 6); - put_16 (big_endian, dialog->height, first->data + off + 8); - - pp = &first->next; - - *pp = resid_to_bin (dialog->menu, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - *pp = resid_to_bin (dialog->class, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; + off += (dialogex != 0 ? BIN_DIALOGEX_SIZE : BIN_DIALOG_SIZE); - *pp = unicode_to_bin (dialog->caption, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; + off = resid_to_bin (wrbfd, off, dialog->menu); + off = resid_to_bin (wrbfd, off, dialog->class); + off = unicode_to_bin (wrbfd, off, dialog->caption); if ((dialog->style & DS_SETFONT) != 0) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = dialogex ? 6 : 2; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += d->length; - - put_16 (big_endian, dialog->pointsize, d->data); - - if (dialogex) + if (wrbfd) { - if (dialog->ex == NULL) + if (! dialogex) { - put_16 (big_endian, 0, d->data + 2); - put_8 (0, d->data + 4); - put_8 (1, d->data + 5); + struct bin_dialogfont bdf; + windres_put_16 (wrbfd, bdf.pointsize, dialog->pointsize); + set_windres_bfd_content (wrbfd, &bdf, off, BIN_DIALOGFONT_SIZE); } else { - put_16 (big_endian, dialog->ex->weight, d->data + 2); - put_8 (dialog->ex->italic, d->data + 4); - put_8 (dialog->ex->charset, d->data + 5); + struct bin_dialogexfont bdxf; + windres_put_16 (wrbfd, bdxf.pointsize, dialog->pointsize); + windres_put_16 (wrbfd, bdxf.weight, (dialog->ex == NULL ? 0 : dialog->ex->weight)); + windres_put_8 (wrbfd, bdxf.italic, (dialog->ex == NULL ? 0 : dialog->ex->italic)); + windres_put_8 (wrbfd, bdxf.charset, (dialog->ex == NULL ? 1 : dialog->ex->charset)); + set_windres_bfd_content (wrbfd, &bdxf, off, BIN_DIALOGEXFONT_SIZE); } } - - *pp = d; - pp = &d->next; - - *pp = unicode_to_bin (dialog->font, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; + off += (dialogex ? BIN_DIALOGEXFONT_SIZE : BIN_DIALOGFONT_SIZE); + off = unicode_to_bin (wrbfd, off, dialog->font); } - - c = 0; - for (dc = dialog->controls; dc != NULL; dc = dc->next) + for (c = 0, dc = dialog->controls; dc != NULL; dc = dc->next, c++) { - struct bindata *d; - int dcoff; - - ++c; - - dword_align_bin (&pp, &length); - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = dialogex ? 24 : 18; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += d->length; + bfd_byte dc_rclen[2]; + off += (4 - ((off - off_delta) & 3)) & 3; + if (wrbfd) + { if (! dialogex) { - put_32 (big_endian, dc->style, d->data); - put_32 (big_endian, dc->exstyle, d->data + 4); - dcoff = 8; + struct bin_dialog_control bdc; + + windres_put_32 (wrbfd, bdc.style, dc->style); + windres_put_32 (wrbfd, bdc.exstyle, dc->exstyle); + windres_put_16 (wrbfd, bdc.x, dc->x); + windres_put_16 (wrbfd, bdc.y, dc->y); + windres_put_16 (wrbfd, bdc.width, dc->width); + windres_put_16 (wrbfd, bdc.height, dc->height); + windres_put_16 (wrbfd, bdc.id, dc->id); + set_windres_bfd_content (wrbfd, &bdc, off, BIN_DIALOG_CONTROL_SIZE); } else { - put_32 (big_endian, dc->help, d->data); - put_32 (big_endian, dc->exstyle, d->data + 4); - put_32 (big_endian, dc->style, d->data + 8); - dcoff = 12; - } - - put_16 (big_endian, dc->x, d->data + dcoff); - put_16 (big_endian, dc->y, d->data + dcoff + 2); - put_16 (big_endian, dc->width, d->data + dcoff + 4); - put_16 (big_endian, dc->height, d->data + dcoff + 6); - - if (dialogex) - put_32 (big_endian, dc->id, d->data + dcoff + 8); - else - put_16 (big_endian, dc->id, d->data + dcoff + 8); - - *pp = d; - pp = &d->next; - - *pp = resid_to_bin (dc->class, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - *pp = resid_to_bin (dc->text, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 2; - d->data = (unsigned char *) reswr_alloc (d->length); + struct bin_dialogex_control bdc; + + windres_put_32 (wrbfd, bdc.help, dc->help); + windres_put_32 (wrbfd, bdc.exstyle, dc->exstyle); + windres_put_32 (wrbfd, bdc.style, dc->style); + windres_put_16 (wrbfd, bdc.x, dc->x); + windres_put_16 (wrbfd, bdc.y, dc->y); + windres_put_16 (wrbfd, bdc.width, dc->width); + windres_put_16 (wrbfd, bdc.height, dc->height); + windres_put_32 (wrbfd, bdc.id, dc->id); + set_windres_bfd_content (wrbfd, &bdc, off, BIN_DIALOGEX_CONTROL_SIZE); + } + } + off += (dialogex != 0 ? BIN_DIALOGEX_CONTROL_SIZE : BIN_DIALOG_CONTROL_SIZE); - length += 2; + off = resid_to_bin (wrbfd, off, dc->class); + off = resid_to_bin (wrbfd, off, dc->text); - d->next = NULL; - *pp = d; - pp = &d->next; + marker = off; /* Save two bytes for size of optional data. */ + off += 2; if (dc->data == NULL) - put_16 (big_endian, 0, d->data); + { + if (wrbfd) + windres_put_16 (wrbfd, dc_rclen, 0); + } else { - unsigned long sublen; - - dword_align_bin (&pp, &length); - - *pp = res_to_bin_rcdata (dc->data, big_endian); - sublen = 0; - while (*pp != NULL) - { - sublen += (*pp)->length; - pp = &(*pp)->next; + rc_uint_type saved_off = off; + rc_uint_type old_off; + off += (4 - ((off - off_delta) & 3)) & 3; + + old_off = off; + off = res_to_bin_rcdata (wrbfd, off, dc->data); + if ((off - old_off) == 0) + old_off = off = saved_off; + if (wrbfd) + windres_put_16 (wrbfd, dc_rclen, off - old_off); } - - put_16 (big_endian, sublen, d->data); - - length += sublen; + if (wrbfd) + set_windres_bfd_content (wrbfd, dc_rclen, marker, 2); } + + if (wrbfd) + { + windres_put_16 (wrbfd, (dialogex != 0 ? bdx.off : bd.off), c); + if (! dialogex) + set_windres_bfd_content (wrbfd, &bd, start, BIN_DIALOG_SIZE); + else + set_windres_bfd_content (wrbfd, &bdx, start, BIN_DIALOGEX_SIZE); } - put_16 (big_endian, c, first->data + off); - return first; + return off; } /* Convert a fontdir resource to binary. */ - -static struct bindata * -res_to_bin_fontdir (const struct fontdir *fontdirs, int big_endian) +static rc_uint_type +res_to_bin_fontdir (windres_bfd *wrbfd, rc_uint_type off, const rc_fontdir *fontdirs) { - struct bindata *first, **pp; + rc_uint_type start; int c; - const struct fontdir *fd; + const rc_fontdir *fd; - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 2; - first->data = (unsigned char *) reswr_alloc (first->length); + start = off; + off += 2; - first->next = NULL; - pp = &first->next; - - c = 0; - for (fd = fontdirs; fd != NULL; fd = fd->next) + for (c = 0, fd = fontdirs; fd != NULL; fd = fd->next, c++) { - struct bindata *d; - - ++c; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 2; - d->data = (unsigned char *) reswr_alloc (d->length); - - put_16 (big_endian, fd->index, d->data); - - *pp = d; - pp = &d->next; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = fd->length; - d->data = (unsigned char *) fd->data; - - d->next = NULL; - *pp = d; - pp = &d->next; + if (wrbfd) + { + bfd_byte d[2]; + windres_put_16 (wrbfd, d, fd->index); + set_windres_bfd_content (wrbfd, d, off, 2); + if (fd->length) + set_windres_bfd_content (wrbfd, fd->data, off + 2, fd->length); + } + off += (rc_uint_type) fd->length + 2; } - put_16 (big_endian, c, first->data); - - return first; + if (wrbfd) + { + bfd_byte d[2]; + windres_put_16 (wrbfd, d, c); + set_windres_bfd_content (wrbfd, d, start, 2); + } + return off; } /* Convert a group icon resource to binary. */ -static struct bindata * -res_to_bin_group_icon (const struct group_icon *group_icons, int big_endian) +static rc_uint_type +res_to_bin_group_icon (windres_bfd *wrbfd, rc_uint_type off, const rc_group_icon *group_icons) { - struct bindata *first, **pp; + rc_uint_type start; + struct bin_group_icon bgi; int c; - const struct group_icon *gi; - - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); + const rc_group_icon *gi; - put_16 (big_endian, 0, first->data); - put_16 (big_endian, 1, first->data + 2); + start = off; + off += BIN_GROUP_ICON_SIZE; - first->next = NULL; - pp = &first->next; - - c = 0; - for (gi = group_icons; gi != NULL; gi = gi->next) + for (c = 0, gi = group_icons; gi != NULL; gi = gi->next, c++) { - struct bindata *d; - - ++c; + struct bin_group_icon_item bgii; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 14; - d->data = (unsigned char *) reswr_alloc (d->length); - - d->data[0] = gi->width; - d->data[1] = gi->height; - d->data[2] = gi->colors; - d->data[3] = 0; - put_16 (big_endian, gi->planes, d->data + 4); - put_16 (big_endian, gi->bits, d->data + 6); - put_32 (big_endian, gi->bytes, d->data + 8); - put_16 (big_endian, gi->index, d->data + 12); - - d->next = NULL; - *pp = d; - pp = &d->next; + if (wrbfd) + { + windres_put_8 (wrbfd, bgii.width, gi->width); + windres_put_8 (wrbfd, bgii.height, gi->height); + windres_put_8 (wrbfd, bgii.colors, gi->colors); + windres_put_8 (wrbfd, bgii.pad, 0); + windres_put_16 (wrbfd, bgii.planes, gi->planes); + windres_put_16 (wrbfd, bgii.bits, gi->bits); + windres_put_32 (wrbfd, bgii.bytes, gi->bytes); + windres_put_16 (wrbfd, bgii.index, gi->index); + set_windres_bfd_content (wrbfd, &bgii, off, BIN_GROUP_ICON_ITEM_SIZE); + } + off += BIN_GROUP_ICON_ITEM_SIZE; } - put_16 (big_endian, c, first->data + 4); - - return first; + if (wrbfd) + { + windres_put_16 (wrbfd, bgi.sig1, 0); + windres_put_16 (wrbfd, bgi.sig2, 1); + windres_put_16 (wrbfd, bgi.count, c); + set_windres_bfd_content (wrbfd, &bgi, start, BIN_GROUP_ICON_SIZE); + } + return off; } /* Convert a menu resource to binary. */ -static struct bindata * -res_to_bin_menu (const struct menu *menu, int big_endian) +static rc_uint_type +res_to_bin_menu (windres_bfd *wrbfd, rc_uint_type off, const rc_menu *menu) { int menuex; - struct bindata *d; menuex = extended_menu (menu); - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = menuex ? 8 : 4; - d->data = (unsigned char *) reswr_alloc (d->length); - + if (wrbfd) + { if (! menuex) { - put_16 (big_endian, 0, d->data); - put_16 (big_endian, 0, d->data + 2); - - d->next = res_to_bin_menuitems (menu->items, big_endian); + struct bin_menu bm; + windres_put_16 (wrbfd, bm.sig1, 0); + windres_put_16 (wrbfd, bm.sig2, 0); + set_windres_bfd_content (wrbfd, &bm, off, BIN_MENU_SIZE); } else { - put_16 (big_endian, 1, d->data); - put_16 (big_endian, 4, d->data + 2); - put_32 (big_endian, menu->help, d->data + 4); - - d->next = res_to_bin_menuexitems (menu->items, big_endian); + struct bin_menuex bm; + windres_put_16 (wrbfd, bm.sig1, 1); + windres_put_16 (wrbfd, bm.sig2, 4); + windres_put_32 (wrbfd, bm.help, menu->help); + set_windres_bfd_content (wrbfd, &bm, off, BIN_MENUEX_SIZE); } - - return d; + } + off += (menuex != 0 ? BIN_MENUEX_SIZE : BIN_MENU_SIZE); + if (! menuex) + { + off = res_to_bin_menuitems (wrbfd, off, menu->items); + } + else + { + off = res_to_bin_menuexitems (wrbfd, off, menu->items); + } + return off; } /* Convert menu items to binary. */ -static struct bindata * -res_to_bin_menuitems (const struct menuitem *items, int big_endian) +static rc_uint_type +res_to_bin_menuitems (windres_bfd *wrbfd, rc_uint_type off, const rc_menuitem *items) { - struct bindata *first, **pp; - const struct menuitem *mi; - - first = NULL; - pp = &first; + const rc_menuitem *mi; for (mi = items; mi != NULL; mi = mi->next) { - struct bindata *d; + struct bin_menuitem bmi; int flags; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = mi->popup == NULL ? 4 : 2; - d->data = (unsigned char *) reswr_alloc (d->length); - flags = mi->type; if (mi->next == NULL) flags |= MENUITEM_ENDMENU; if (mi->popup != NULL) flags |= MENUITEM_POPUP; - put_16 (big_endian, flags, d->data); - + if (wrbfd) + { + windres_put_16 (wrbfd, bmi.flags, flags); if (mi->popup == NULL) - put_16 (big_endian, mi->id, d->data + 2); - - *pp = d; - pp = &d->next; + windres_put_16 (wrbfd, bmi.id, mi->id); + set_windres_bfd_content (wrbfd, &bmi, off, + mi->popup == NULL ? BIN_MENUITEM_SIZE + : BIN_MENUITEM_POPUP_SIZE); + } + off += (mi->popup == NULL ? BIN_MENUITEM_SIZE : BIN_MENUITEM_POPUP_SIZE); - *pp = unicode_to_bin (mi->text, big_endian); - pp = &(*pp)->next; + off = unicode_to_bin (wrbfd, off, mi->text); if (mi->popup != NULL) { - *pp = res_to_bin_menuitems (mi->popup, big_endian); - while (*pp != NULL) - pp = &(*pp)->next; + off = res_to_bin_menuitems (wrbfd, off, mi->popup); } } - - return first; + return off; } /* Convert menuex items to binary. */ -static struct bindata * -res_to_bin_menuexitems (const struct menuitem *items, int big_endian) +static rc_uint_type +res_to_bin_menuexitems (windres_bfd *wrbfd, rc_uint_type off, const rc_menuitem *items) { - struct bindata *first, **pp; - unsigned long length; - const struct menuitem *mi; - - first = NULL; - pp = &first; - - length = 0; + rc_uint_type off_delta = off; + const rc_menuitem *mi; for (mi = items; mi != NULL; mi = mi->next) { - struct bindata *d; + struct bin_menuitemex bmi; int flags; - dword_align_bin (&pp, &length); - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 12; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += 12; - - put_32 (big_endian, mi->type, d->data); - put_32 (big_endian, mi->state, d->data + 4); - put_16 (big_endian, mi->id, d->data + 8); + off += (4 - ((off - off_delta) & 3)) & 3; flags = 0; if (mi->next == NULL) flags |= 0x80; if (mi->popup != NULL) flags |= 1; - put_16 (big_endian, flags, d->data + 10); - *pp = d; - pp = &d->next; + if (wrbfd) + { + windres_put_32 (wrbfd, bmi.type, mi->type); + windres_put_32 (wrbfd, bmi.state, mi->state); + windres_put_32 (wrbfd, bmi.id, mi->id); + windres_put_16 (wrbfd, bmi.flags, flags); + set_windres_bfd_content (wrbfd, &bmi, off, BIN_MENUITEMEX_SIZE); + } + off += BIN_MENUITEMEX_SIZE; - *pp = unicode_to_bin (mi->text, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; + off = unicode_to_bin (wrbfd, off, mi->text); if (mi->popup != NULL) { - dword_align_bin (&pp, &length); - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); + bfd_byte help[4]; - put_32 (big_endian, mi->help, d->data); + off += (4 - ((off - off_delta) & 3)) & 3; - *pp = d; - pp = &d->next; - - *pp = res_to_bin_menuexitems (mi->popup, big_endian); - while (*pp != NULL) + if (wrbfd) { - length += (*pp)->length; - pp = &(*pp)->next; + windres_put_32 (wrbfd, help, mi->help); + set_windres_bfd_content (wrbfd, help, off, 4); } + off += 4; + off = res_to_bin_menuexitems (wrbfd, off, mi->popup); } } - - return first; + return off; } /* Convert an rcdata resource to binary. This is also used to convert - other information which happens to be stored in rcdata_item lists + other information which happens to be stored in rc_rcdata_item lists to binary. */ -static struct bindata * -res_to_bin_rcdata (const struct rcdata_item *items, int big_endian) +static rc_uint_type +res_to_bin_rcdata (windres_bfd *wrbfd, rc_uint_type off, const rc_rcdata_item *items) { - struct bindata *first, **pp; - const struct rcdata_item *ri; - - first = NULL; - pp = &first; + const rc_rcdata_item *ri; for (ri = items; ri != NULL; ri = ri->next) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - + rc_uint_type len; switch (ri->type) { default: abort (); - case RCDATA_WORD: - d->length = 2; - d->data = (unsigned char *) reswr_alloc (d->length); - put_16 (big_endian, ri->u.word, d->data); + len = 2; break; - case RCDATA_DWORD: - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); - put_32 (big_endian, ri->u.dword, d->data); + len = 4; break; - case RCDATA_STRING: - d->length = ri->u.string.length; - d->data = (unsigned char *) ri->u.string.s; + len = ri->u.string.length; + break; + case RCDATA_WSTRING: + len = ri->u.wstring.length * sizeof (unichar); + break; + case RCDATA_BUFFER: + len = ri->u.buffer.length; + break; + } + if (wrbfd) + { + bfd_byte h[4]; + bfd_byte *hp = &h[0]; + switch (ri->type) + { + case RCDATA_WORD: + windres_put_16 (wrbfd, hp, ri->u.word); + break; + case RCDATA_DWORD: + windres_put_32 (wrbfd, hp, ri->u.dword); + break; + case RCDATA_STRING: + hp = (bfd_byte *) ri->u.string.s; break; - case RCDATA_WSTRING: { - unsigned long i; + rc_uint_type i; - d->length = ri->u.wstring.length * 2; - d->data = (unsigned char *) reswr_alloc (d->length); + hp = (bfd_byte *) reswr_alloc (len); for (i = 0; i < ri->u.wstring.length; i++) - put_16 (big_endian, ri->u.wstring.w[i], d->data + i * 2); - break; + windres_put_16 (wrbfd, hp + i * sizeof (unichar), ri->u.wstring.w[i]); } - + break; case RCDATA_BUFFER: - d->length = ri->u.buffer.length; - d->data = (unsigned char *) ri->u.buffer.data; + hp = (bfd_byte *) ri->u.buffer.data; break; } - - d->next = NULL; - *pp = d; - pp = &d->next; + set_windres_bfd_content (wrbfd, hp, off, len); } - - return first; + off += len; + } + return off; } /* Convert a stringtable resource to binary. */ -static struct bindata * -res_to_bin_stringtable (const struct stringtable *st, int big_endian) +static rc_uint_type +res_to_bin_stringtable (windres_bfd *wrbfd, rc_uint_type off, + const rc_stringtable *st) { - struct bindata *first, **pp; int i; - first = NULL; - pp = &first; - for (i = 0; i < 16; i++) { - int slen, j; - struct bindata *d; + rc_uint_type slen, length; unichar *s; - slen = st->strings[i].length; + slen = (rc_uint_type) st->strings[i].length; s = st->strings[i].string; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 2 + slen * 2; - d->data = (unsigned char *) reswr_alloc (d->length); + length = 2 + slen * 2; + if (wrbfd) + { + bfd_byte *hp; + rc_uint_type j; - put_16 (big_endian, slen, d->data); + hp = (bfd_byte *) reswr_alloc (length); + windres_put_16 (wrbfd, hp, slen); for (j = 0; j < slen; j++) - put_16 (big_endian, s[j], d->data + 2 + j * 2); - - d->next = NULL; - *pp = d; - pp = &d->next; + windres_put_16 (wrbfd, hp + 2 + j * 2, s[j]); + set_windres_bfd_content (wrbfd, hp, off, length); } - - return first; + off += length; + } + return off; } /* Convert an ASCII string to a unicode binary string. This always returns exactly one bindata structure. */ -static struct bindata * -string_to_unicode_bin (const char *s, int big_endian) +static rc_uint_type +string_to_unicode_bin (windres_bfd *wrbfd, rc_uint_type off, const char *s) { - size_t len, i; - struct bindata *d; - - len = strlen (s); + rc_uint_type len; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = len * 2 + 2; - d->data = (unsigned char *) reswr_alloc (d->length); + len = (rc_uint_type) strlen (s); - for (i = 0; i < len; i++) - put_16 (big_endian, s[i], d->data + i * 2); - put_16 (big_endian, 0, d->data + i * 2); + if (wrbfd) + { + rc_uint_type i; + bfd_byte *hp; - d->next = NULL; + hp = (bfd_byte *) reswr_alloc ((len + 1) * sizeof (unichar)); - return d; + for (i = 0; i < len; i++) + windres_put_16 (wrbfd, hp + i * 2, s[i]); + windres_put_16 (wrbfd, hp + i * 2, 0); + set_windres_bfd_content (wrbfd, hp, off, (len + 1) * sizeof (unichar)); + } + off += (rc_uint_type) ((len + 1) * sizeof (unichar)); + return off; } -/* Convert a versioninfo resource to binary. */ - -static struct bindata * -res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian) +static rc_uint_type +res_to_bin_toolbar (windres_bfd *wrbfd, rc_uint_type off, rc_toolbar *tb) { - struct bindata *first, **pp; - unsigned long length; - struct ver_info *vi; - - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); - - length = 6; + if (wrbfd) + { + struct bin_toolbar bt; + windres_put_32 (wrbfd, bt.button_width, tb->button_width); + windres_put_32 (wrbfd, bt.button_height, tb->button_height); + windres_put_32 (wrbfd, bt.nitems, tb->nitems); + set_windres_bfd_content (wrbfd, &bt, off, BIN_TOOLBAR_SIZE); + if (tb->nitems > 0) + { + rc_toolbar_item *it; + bfd_byte *ids; + rc_uint_type i = 0; - if (versioninfo->fixed == NULL) - put_16 (big_endian, 0, first->data + 2); - else - put_16 (big_endian, 52, first->data + 2); + ids = (bfd_byte *) reswr_alloc (tb->nitems * 4); + it=tb->items; + while(it != NULL) + { + windres_put_32 (wrbfd, ids + i, it->id.u.id); + i += 4; + it = it->next; + } + set_windres_bfd_content (wrbfd, ids, off + BIN_TOOLBAR_SIZE, i); + } + } + off += BIN_TOOLBAR_SIZE + tb->nitems * 4; - put_16 (big_endian, 0, first->data + 4); + return off; +} - pp = &first->next; +/* Convert a versioninfo resource to binary. */ - *pp = string_to_unicode_bin ("VS_VERSION_INFO", big_endian); - length += (*pp)->length; - pp = &(*pp)->next; +static rc_uint_type +res_to_bin_versioninfo (windres_bfd *wrbfd, rc_uint_type off, + const rc_versioninfo *versioninfo) +{ + rc_uint_type off_delta = off; + rc_uint_type start; + struct bin_versioninfo bvi; + rc_ver_info *vi; - dword_align_bin (&pp, &length); + start = off; + off += BIN_VERSIONINFO_SIZE; + off = string_to_unicode_bin (wrbfd, off, "VS_VERSION_INFO"); + off += (4 - ((off - off_delta) & 3)) & 3; if (versioninfo->fixed != NULL) { - const struct fixed_versioninfo *fi; - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 52; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += 52; + if (wrbfd) + { + struct bin_fixed_versioninfo bfv; + const rc_fixed_versioninfo *fi; fi = versioninfo->fixed; - - put_32 (big_endian, 0xfeef04bd, d->data); - put_32 (big_endian, 0x10000, d->data + 4); - put_32 (big_endian, fi->file_version_ms, d->data + 8); - put_32 (big_endian, fi->file_version_ls, d->data + 12); - put_32 (big_endian, fi->product_version_ms, d->data + 16); - put_32 (big_endian, fi->product_version_ls, d->data + 20); - put_32 (big_endian, fi->file_flags_mask, d->data + 24); - put_32 (big_endian, fi->file_flags, d->data + 28); - put_32 (big_endian, fi->file_os, d->data + 32); - put_32 (big_endian, fi->file_type, d->data + 36); - put_32 (big_endian, fi->file_subtype, d->data + 40); - put_32 (big_endian, fi->file_date_ms, d->data + 44); - put_32 (big_endian, fi->file_date_ls, d->data + 48); - - d->next = NULL; - *pp = d; - pp = &d->next; + windres_put_32 (wrbfd, bfv.sig1, 0xfeef04bd); + windres_put_32 (wrbfd, bfv.sig2, 0x10000); + windres_put_32 (wrbfd, bfv.file_version, fi->file_version_ms); + windres_put_32 (wrbfd, bfv.file_version_ls, fi->file_version_ls); + windres_put_32 (wrbfd, bfv.product_version_ms, fi->product_version_ms); + windres_put_32 (wrbfd, bfv.product_version_ls, fi->product_version_ls); + windres_put_32 (wrbfd, bfv.file_flags_mask, fi->file_flags_mask); + windres_put_32 (wrbfd, bfv.file_flags, fi->file_flags); + windres_put_32 (wrbfd, bfv.file_os, fi->file_os); + windres_put_32 (wrbfd, bfv.file_type, fi->file_type); + windres_put_32 (wrbfd, bfv.file_subtype, fi->file_subtype); + windres_put_32 (wrbfd, bfv.file_date_ms, fi->file_date_ms); + windres_put_32 (wrbfd, bfv.file_date_ls, fi->file_date_ls); + set_windres_bfd_content (wrbfd, &bfv, off, BIN_FIXED_VERSIONINFO_SIZE); + } + off += BIN_FIXED_VERSIONINFO_SIZE; } for (vi = versioninfo->var; vi != NULL; vi = vi->next) { - struct bindata *vid; - unsigned long vilen; - - dword_align_bin (&pp, &length); - - vid = (struct bindata *) reswr_alloc (sizeof *vid); - vid->length = 6; - vid->data = (unsigned char *) reswr_alloc (vid->length); + struct bin_ver_info bv; + rc_uint_type bv_off; - length += 6; - vilen = 6; + off += (4 - ((off - off_delta) & 3)) & 3; - put_16 (big_endian, 0, vid->data + 2); - put_16 (big_endian, 0, vid->data + 4); + bv_off = off; - *pp = vid; - pp = &vid->next; + off += BIN_VER_INFO_SIZE; switch (vi->type) { default: abort (); - case VERINFO_STRING: { - unsigned long hold, vslen; - struct bindata *vsd; - const struct ver_stringinfo *vs; + struct bin_ver_info bvsd; + rc_uint_type vs_off; + const rc_ver_stringinfo *vs; - *pp = string_to_unicode_bin ("StringFileInfo", big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - pp = &(*pp)->next; + off = string_to_unicode_bin (wrbfd, off, "StringFileInfo"); + off += (4 - ((off - off_delta) & 3)) & 3; - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; + vs_off = off; - vsd = (struct bindata *) reswr_alloc (sizeof *vsd); - vsd->length = 6; - vsd->data = (unsigned char *) reswr_alloc (vsd->length); + off += BIN_VER_INFO_SIZE; - length += 6; - vilen += 6; - vslen = 6; + off = unicode_to_bin (wrbfd, off, vi->u.string.language); - put_16 (big_endian, 0, vsd->data + 2); - put_16 (big_endian, 0, vsd->data + 4); + for (vs = vi->u.string.strings; vs != NULL; vs = vs->next) + { + struct bin_ver_info bvss; + rc_uint_type vss_off,str_off; - *pp = vsd; - pp = &vsd->next; + off += (4 - ((off - off_delta) & 3)) & 3; - *pp = unicode_to_bin (vi->u.string.language, big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - vslen += (*pp)->length; - pp = &(*pp)->next; + vss_off = off; + off += BIN_VER_INFO_SIZE; - for (vs = vi->u.string.strings; vs != NULL; vs = vs->next) - { - struct bindata *vssd; - unsigned long vsslen; - - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - vslen += length - hold; - - vssd = (struct bindata *) reswr_alloc (sizeof *vssd); - vssd->length = 6; - vssd->data = (unsigned char *) reswr_alloc (vssd->length); - - length += 6; - vilen += 6; - vslen += 6; - vsslen = 6; - - put_16 (big_endian, 1, vssd->data + 4); - - *pp = vssd; - pp = &vssd->next; - - *pp = unicode_to_bin (vs->key, big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - vslen += (*pp)->length; - vsslen += (*pp)->length; - pp = &(*pp)->next; - - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - vslen += length - hold; - vsslen += length - hold; - - *pp = unicode_to_bin (vs->value, big_endian); - put_16 (big_endian, (*pp)->length / 2, vssd->data + 2); - length += (*pp)->length; - vilen += (*pp)->length; - vslen += (*pp)->length; - vsslen += (*pp)->length; - pp = &(*pp)->next; - - put_16 (big_endian, vsslen, vssd->data); - } + off = unicode_to_bin (wrbfd, off, vs->key); - put_16 (big_endian, vslen, vsd->data); + off += (4 - ((off - off_delta) & 3)) & 3; + str_off = off; + off = unicode_to_bin (wrbfd, off, vs->value); + if (wrbfd) + { + windres_put_16 (wrbfd, bvss.size, off - vss_off); + windres_put_16 (wrbfd, bvss.sig1, (off - str_off) / 2); + windres_put_16 (wrbfd, bvss.sig2, 1); + set_windres_bfd_content (wrbfd, &bvss, vss_off, + BIN_VER_INFO_SIZE); + } + } + if (wrbfd) + { + windres_put_16 (wrbfd, bvsd.size, off - vs_off); + windres_put_16 (wrbfd, bvsd.sig1, 0); + windres_put_16 (wrbfd, bvsd.sig2, 0); + set_windres_bfd_content (wrbfd, &bvsd, vs_off, + BIN_VER_INFO_SIZE); + } break; } case VERINFO_VAR: { - unsigned long hold, vvlen, vvvlen; - struct bindata *vvd; - const struct ver_varinfo *vv; - - *pp = string_to_unicode_bin ("VarFileInfo", big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - pp = &(*pp)->next; - - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - - vvd = (struct bindata *) reswr_alloc (sizeof *vvd); - vvd->length = 6; - vvd->data = (unsigned char *) reswr_alloc (vvd->length); + rc_uint_type vvd_off, vvvd_off; + struct bin_ver_info bvvd; + const rc_ver_varinfo *vv; - length += 6; - vilen += 6; - vvlen = 6; + off = string_to_unicode_bin (wrbfd, off, "VarFileInfo"); - put_16 (big_endian, 0, vvd->data + 4); + off += (4 - ((off - off_delta) & 3)) & 3; - *pp = vvd; - pp = &vvd->next; + vvd_off = off; + off += BIN_VER_INFO_SIZE; - *pp = unicode_to_bin (vi->u.var.key, big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - vvlen += (*pp)->length; - pp = &(*pp)->next; + off = unicode_to_bin (wrbfd, off, vi->u.var.key); - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - vvlen += length - hold; + off += (4 - ((off - off_delta) & 3)) & 3; - vvvlen = 0; + vvvd_off = off; for (vv = vi->u.var.var; vv != NULL; vv = vv->next) { - struct bindata *vvsd; - - vvsd = (struct bindata *) reswr_alloc (sizeof *vvsd); - vvsd->length = 4; - vvsd->data = (unsigned char *) reswr_alloc (vvsd->length); - - length += 4; - vilen += 4; - vvlen += 4; - vvvlen += 4; - - put_16 (big_endian, vv->language, vvsd->data); - put_16 (big_endian, vv->charset, vvsd->data + 2); - - vvsd->next = NULL; - *pp = vvsd; - pp = &vvsd->next; + if (wrbfd) + { + bfd_byte vvsd[4]; + + windres_put_16 (wrbfd, &vvsd[0], vv->language); + windres_put_16 (wrbfd, &vvsd[2], vv->charset); + set_windres_bfd_content (wrbfd, vvsd, off, 4); + } + off += 4; } - - put_16 (big_endian, vvlen, vvd->data); - put_16 (big_endian, vvvlen, vvd->data + 2); + if (wrbfd) + { + windres_put_16 (wrbfd, bvvd.size, off - vvd_off); + windres_put_16 (wrbfd, bvvd.sig1, off - vvvd_off); + windres_put_16 (wrbfd, bvvd.sig2, 0); + set_windres_bfd_content (wrbfd, &bvvd, vvd_off, + BIN_VER_INFO_SIZE); + } break; } } - put_16 (big_endian, vilen, vid->data); + if (wrbfd) + { + windres_put_16 (wrbfd, bv.size, off-bv_off); + windres_put_16 (wrbfd, bv.sig1, 0); + windres_put_16 (wrbfd, bv.sig2, 0); + set_windres_bfd_content (wrbfd, &bv, bv_off, + BIN_VER_INFO_SIZE); + } } - put_16 (big_endian, length, first->data); - - return first; + if (wrbfd) + { + windres_put_16 (wrbfd, bvi.size, off - start); + windres_put_16 (wrbfd, bvi.fixed_size, + versioninfo->fixed == NULL ? 0 + : BIN_FIXED_VERSIONINFO_SIZE); + windres_put_16 (wrbfd, bvi.sig2, 0); + set_windres_bfd_content (wrbfd, &bvi, start, BIN_VER_INFO_SIZE); + } + return off; } /* Convert a generic resource to binary. */ -static struct bindata * -res_to_bin_generic (unsigned long length, const unsigned char *data) +static rc_uint_type +res_to_bin_generic (windres_bfd *wrbfd, rc_uint_type off, rc_uint_type length, + const bfd_byte *data) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = length; - d->data = (unsigned char *) data; - - d->next = NULL; - - return d; + if (wrbfd && length != 0) + set_windres_bfd_content (wrbfd, data, off, length); + return off + (rc_uint_type) length; } diff --git a/binutils/rescoff.c b/binutils/rescoff.c index fdd9aad9982e..737eb4f0ba98 100644 --- a/binutils/rescoff.c +++ b/binutils/rescoff.c @@ -1,7 +1,8 @@ /* rescoff.c -- read and write resources in Windows COFF files. - Copyright 1997, 1998, 1999, 2000, 2003 + Copyright 1997, 1998, 1999, 2000, 2003, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -23,6 +24,7 @@ /* This file contains function that read and write Windows resources in COFF files. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -48,14 +50,12 @@ struct coff_file_info /* End of data read from file. */ const bfd_byte *data_end; /* Address of the resource section minus the image base of the file. */ - bfd_vma secaddr; - /* Non-zero if the file is big endian. */ - int big_endian; + rc_uint_type secaddr; }; /* A resource directory table in a COFF file. */ -struct extern_res_directory +struct __attribute__ ((__packed__)) extern_res_directory { /* Characteristics. */ bfd_byte characteristics[4]; @@ -96,26 +96,24 @@ struct extern_res_data bfd_byte reserved[4]; }; -/* Macros to swap in values. */ - -#define getfi_16(fi, s) ((fi)->big_endian ? bfd_getb16 (s) : bfd_getl16 (s)) -#define getfi_32(fi, s) ((fi)->big_endian ? bfd_getb32 (s) : bfd_getl32 (s)) - /* Local functions. */ static void overrun (const struct coff_file_info *, const char *); -static struct res_directory *read_coff_res_dir - (const bfd_byte *, const struct coff_file_info *, - const struct res_id *, int); -static struct res_resource *read_coff_data_entry - (const bfd_byte *, const struct coff_file_info *, const struct res_id *); +static rc_res_directory *read_coff_res_dir (windres_bfd *, const bfd_byte *, + const struct coff_file_info *, + const rc_res_id *, int); +static rc_res_resource *read_coff_data_entry (windres_bfd *, const bfd_byte *, + const struct coff_file_info *, + const rc_res_id *); /* Read the resources in a COFF file. */ -struct res_directory * +rc_res_directory * read_coff_rsrc (const char *filename, const char *target) { + rc_res_directory *ret; bfd *abfd; + windres_bfd wrbfd; char **matching; asection *sec; bfd_size_type size; @@ -143,27 +141,28 @@ read_coff_rsrc (const char *filename, const char *target) fatal (_("%s: no resource section"), filename); } + set_windres_bfd (&wrbfd, abfd, sec, WR_KIND_BFD); size = bfd_section_size (abfd, sec); data = (bfd_byte *) res_alloc (size); - if (! bfd_get_section_contents (abfd, sec, data, 0, size)) - bfd_fatal (_("can't read resource section")); + get_windres_bfd_content (&wrbfd, data, 0, size); finfo.filename = filename; finfo.data = data; finfo.data_end = data + size; finfo.secaddr = (bfd_get_section_vma (abfd, sec) - pe_data (abfd)->pe_opthdr.ImageBase); - finfo.big_endian = bfd_big_endian (abfd); - - bfd_close (abfd); /* Now just read in the top level resource directory. Note that we don't free data, since we create resource entries that point into it. If we ever want to free up the resource information we read, this will have to be cleaned up. */ - return read_coff_res_dir (data, &finfo, (const struct res_id *) NULL, 0); + ret = read_coff_res_dir (&wrbfd, data, &finfo, (const rc_res_id *) NULL, 0); + + bfd_close (abfd); + + return ret; } /* Give an error if we are out of bounds. */ @@ -176,14 +175,15 @@ overrun (const struct coff_file_info *finfo, const char *msg) /* Read a resource directory. */ -static struct res_directory * -read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, - const struct res_id *type, int level) +static rc_res_directory * +read_coff_res_dir (windres_bfd *wrbfd, const bfd_byte *data, + const struct coff_file_info *finfo, + const rc_res_id *type, int level) { const struct extern_res_directory *erd; - struct res_directory *rd; + rc_res_directory *rd; int name_count, id_count, i; - struct res_entry **pp; + rc_res_entry **pp; const struct extern_res_entry *ere; if ((size_t) (finfo->data_end - data) < sizeof (struct extern_res_directory)) @@ -191,15 +191,15 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, erd = (const struct extern_res_directory *) data; - rd = (struct res_directory *) res_alloc (sizeof *rd); - rd->characteristics = getfi_32 (finfo, erd->characteristics); - rd->time = getfi_32 (finfo, erd->time); - rd->major = getfi_16 (finfo, erd->major); - rd->minor = getfi_16 (finfo, erd->minor); + rd = (rc_res_directory *) res_alloc (sizeof (rc_res_directory)); + rd->characteristics = windres_get_32 (wrbfd, erd->characteristics, 4); + rd->time = windres_get_32 (wrbfd, erd->time, 4); + rd->major = windres_get_16 (wrbfd, erd->major, 2); + rd->minor = windres_get_16 (wrbfd, erd->minor, 2); rd->entries = NULL; - name_count = getfi_16 (finfo, erd->name_count); - id_count = getfi_16 (finfo, erd->id_count); + name_count = windres_get_16 (wrbfd, erd->name_count, 2); + id_count = windres_get_16 (wrbfd, erd->id_count, 2); pp = &rd->entries; @@ -209,33 +209,33 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, for (i = 0; i < name_count; i++, ere++) { - unsigned long name, rva; - struct res_entry *re; + rc_uint_type name, rva; + rc_res_entry *re; const bfd_byte *ers; int length, j; if ((const bfd_byte *) ere >= finfo->data_end) overrun (finfo, _("named directory entry")); - name = getfi_32 (finfo, ere->name); - rva = getfi_32 (finfo, ere->rva); + name = windres_get_32 (wrbfd, ere->name, 4); + rva = windres_get_32 (wrbfd, ere->rva, 4); /* For some reason the high bit in NAME is set. */ name &=~ 0x80000000; - if (name > (size_t) (finfo->data_end - finfo->data)) + if (name > (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("directory entry name")); ers = finfo->data + name; - re = (struct res_entry *) res_alloc (sizeof *re); + re = (rc_res_entry *) res_alloc (sizeof *re); re->next = NULL; re->id.named = 1; - length = getfi_16 (finfo, ers); + length = windres_get_16 (wrbfd, ers, 2); re->id.u.n.length = length; re->id.u.n.name = (unichar *) res_alloc (length * sizeof (unichar)); for (j = 0; j < length; j++) - re->id.u.n.name[j] = getfi_16 (finfo, ers + j * 2 + 2); + re->id.u.n.name[j] = windres_get_16 (wrbfd, ers + j * 2 + 2, 2); if (level == 0) type = &re->id; @@ -243,18 +243,18 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, if ((rva & 0x80000000) != 0) { rva &=~ 0x80000000; - if (rva >= (size_t) (finfo->data_end - finfo->data)) + if (rva >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("named subdirectory")); re->subdir = 1; - re->u.dir = read_coff_res_dir (finfo->data + rva, finfo, type, + re->u.dir = read_coff_res_dir (wrbfd, finfo->data + rva, finfo, type, level + 1); } else { - if (rva >= (size_t) (finfo->data_end - finfo->data)) + if (rva >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("named resource")); re->subdir = 0; - re->u.res = read_coff_data_entry (finfo->data + rva, finfo, type); + re->u.res = read_coff_data_entry (wrbfd, finfo->data + rva, finfo, type); } *pp = re; @@ -264,15 +264,15 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, for (i = 0; i < id_count; i++, ere++) { unsigned long name, rva; - struct res_entry *re; + rc_res_entry *re; if ((const bfd_byte *) ere >= finfo->data_end) overrun (finfo, _("ID directory entry")); - name = getfi_32 (finfo, ere->name); - rva = getfi_32 (finfo, ere->rva); + name = windres_get_32 (wrbfd, ere->name, 4); + rva = windres_get_32 (wrbfd, ere->rva, 4); - re = (struct res_entry *) res_alloc (sizeof *re); + re = (rc_res_entry *) res_alloc (sizeof *re); re->next = NULL; re->id.named = 0; re->id.u.id = name; @@ -283,18 +283,18 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, if ((rva & 0x80000000) != 0) { rva &=~ 0x80000000; - if (rva >= (size_t) (finfo->data_end - finfo->data)) + if (rva >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("ID subdirectory")); re->subdir = 1; - re->u.dir = read_coff_res_dir (finfo->data + rva, finfo, type, + re->u.dir = read_coff_res_dir (wrbfd, finfo->data + rva, finfo, type, level + 1); } else { - if (rva >= (size_t) (finfo->data_end - finfo->data)) + if (rva >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("ID resource")); re->subdir = 0; - re->u.res = read_coff_data_entry (finfo->data + rva, finfo, type); + re->u.res = read_coff_data_entry (wrbfd, finfo->data + rva, finfo, type); } *pp = re; @@ -306,12 +306,14 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, /* Read a resource data entry. */ -static struct res_resource * -read_coff_data_entry (const bfd_byte *data, const struct coff_file_info *finfo, const struct res_id *type) +static rc_res_resource * +read_coff_data_entry (windres_bfd *wrbfd, const bfd_byte *data, + const struct coff_file_info *finfo, + const rc_res_id *type) { const struct extern_res_data *erd; - struct res_resource *r; - unsigned long size, rva; + rc_res_resource *r; + rc_uint_type size, rva; const bfd_byte *resdata; if (type == NULL) @@ -322,22 +324,22 @@ read_coff_data_entry (const bfd_byte *data, const struct coff_file_info *finfo, erd = (const struct extern_res_data *) data; - size = getfi_32 (finfo, erd->size); - rva = getfi_32 (finfo, erd->rva); + size = windres_get_32 (wrbfd, erd->size, 4); + rva = windres_get_32 (wrbfd, erd->rva, 4); if (rva < finfo->secaddr - || rva - finfo->secaddr >= (size_t) (finfo->data_end - finfo->data)) + || rva - finfo->secaddr >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("resource data")); resdata = finfo->data + (rva - finfo->secaddr); - if (size > (size_t) (finfo->data_end - resdata)) + if (size > (rc_uint_type) (finfo->data_end - resdata)) overrun (finfo, _("resource data size")); - r = bin_to_res (*type, resdata, size, finfo->big_endian); + r = bin_to_res (wrbfd, *type, resdata, size); - memset (&r->res_info, 0, sizeof (struct res_res_info)); - r->coff_info.codepage = getfi_32 (finfo, erd->codepage); - r->coff_info.reserved = getfi_32 (finfo, erd->reserved); + memset (&r->res_info, 0, sizeof (rc_res_res_info)); + r->coff_info.codepage = windres_get_32 (wrbfd, erd->codepage, 4); + r->coff_info.reserved = windres_get_32 (wrbfd, erd->reserved, 4); return r; } @@ -347,9 +349,19 @@ read_coff_data_entry (const bfd_byte *data, const struct coff_file_info *finfo, struct bindata_build { /* The data. */ - struct bindata *d; + bindata *d; + /* The last structure we have added to the list. */ + bindata *last; + /* The size of the list as a whole. */ + unsigned long length; +}; + +struct coff_res_data_build +{ + /* The data. */ + coff_res_data *d; /* The last structure we have added to the list. */ - struct bindata *last; + coff_res_data *last; /* The size of the list as a whole. */ unsigned long length; }; @@ -361,9 +373,7 @@ struct coff_write_info { /* These fields are based on the BFD. */ /* The BFD itself. */ - bfd *abfd; - /* Non-zero if the file is big endian. */ - int big_endian; + windres_bfd *wrbfd; /* Pointer to section symbol used to build RVA relocs. */ asymbol **sympp; @@ -383,27 +393,19 @@ struct coff_write_info /* Resource data entries. */ struct bindata_build dataents; /* Actual resource data. */ - struct bindata_build resources; + struct coff_res_data_build resources; /* Relocations. */ arelent **relocs; /* Number of relocations. */ unsigned int reloc_count; }; -/* Macros to swap out values. */ - -#define putcwi_16(cwi, v, s) \ - ((cwi->big_endian) ? bfd_putb16 ((v), (s)) : bfd_putl16 ((v), (s))) -#define putcwi_32(cwi, v, s) \ - ((cwi->big_endian) ? bfd_putb32 ((v), (s)) : bfd_putl32 ((v), (s))) - -static void coff_bin_sizes - (const struct res_directory *, struct coff_write_info *); -static unsigned char *coff_alloc (struct bindata_build *, size_t); +static void coff_bin_sizes (const rc_res_directory *, struct coff_write_info *); +static bfd_byte *coff_alloc (struct bindata_build *, rc_uint_type); static void coff_to_bin - (const struct res_directory *, struct coff_write_info *); + (const rc_res_directory *, struct coff_write_info *); static void coff_res_to_bin - (const struct res_resource *, struct coff_write_info *); + (const rc_res_resource *, struct coff_write_info *); /* Write resources to a COFF file. RESOURCES should already be sorted. @@ -415,12 +417,14 @@ static void coff_res_to_bin void write_coff_file (const char *filename, const char *target, - const struct res_directory *resources) + const rc_res_directory *resources) { bfd *abfd; asection *sec; struct coff_write_info cwi; - struct bindata *d; + windres_bfd wrbfd; + bindata *d; + coff_res_data *rd; unsigned long length, offset; if (filename == NULL) @@ -474,8 +478,9 @@ write_coff_file (const char *filename, const char *target, We build these different types of data in different lists. */ - cwi.abfd = abfd; - cwi.big_endian = bfd_big_endian (abfd); + set_windres_bfd (&wrbfd, abfd, sec, WR_KIND_BFD); + + cwi.wrbfd = &wrbfd; cwi.sympp = sec->symbol_ptr_ptr; cwi.dirsize = 0; cwi.dirstrsize = 0; @@ -510,7 +515,7 @@ write_coff_file (const char *filename, const char *target, alignment. */ if ((cwi.dirstrs.length & 3) != 0) { - unsigned char *ex; + bfd_byte *ex; ex = coff_alloc (&cwi.dirstrs, 2); ex[0] = 0; @@ -542,21 +547,18 @@ write_coff_file (const char *filename, const char *target, } for (d = cwi.dirstrs.d; d != NULL; d = d->next) { - if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length)) - bfd_fatal ("bfd_set_section_contents"); + set_windres_bfd_content (&wrbfd, d->data, offset, d->length); offset += d->length; } for (d = cwi.dataents.d; d != NULL; d = d->next) { - if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length)) - bfd_fatal ("bfd_set_section_contents"); + set_windres_bfd_content (&wrbfd, d->data, offset, d->length); offset += d->length; } - for (d = cwi.resources.d; d != NULL; d = d->next) + for (rd = cwi.resources.d; rd != NULL; rd = rd->next) { - if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length)) - bfd_fatal ("bfd_set_section_contents"); - offset += d->length; + res_to_bin (cwi.wrbfd, (rc_uint_type) offset, rd->res); + offset += rd->length; } assert (offset == length); @@ -572,10 +574,10 @@ write_coff_file (const char *filename, const char *target, entries. This updates fields in CWI. */ static void -coff_bin_sizes (const struct res_directory *resdir, +coff_bin_sizes (const rc_res_directory *resdir, struct coff_write_info *cwi) { - const struct res_entry *re; + const rc_res_entry *re; cwi->dirsize += sizeof (struct extern_res_directory); @@ -595,15 +597,15 @@ coff_bin_sizes (const struct res_directory *resdir, /* Allocate data for a particular list. */ -static unsigned char * -coff_alloc (struct bindata_build *bb, size_t size) +static bfd_byte * +coff_alloc (struct bindata_build *bb, rc_uint_type size) { - struct bindata *d; + bindata *d; - d = (struct bindata *) reswr_alloc (sizeof *d); + d = (bindata *) reswr_alloc (sizeof (bindata)); d->next = NULL; - d->data = (unsigned char *) reswr_alloc (size); + d->data = (bfd_byte *) reswr_alloc (size); d->length = size; if (bb->d == NULL) @@ -619,11 +621,11 @@ coff_alloc (struct bindata_build *bb, size_t size) /* Convert the resource directory RESDIR to binary. */ static void -coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) +coff_to_bin (const rc_res_directory *resdir, struct coff_write_info *cwi) { struct extern_res_directory *erd; int ci, cn; - const struct res_entry *e; + const rc_res_entry *e; struct extern_res_entry *ere; /* Write out the directory table. */ @@ -631,10 +633,10 @@ coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) erd = ((struct extern_res_directory *) coff_alloc (&cwi->dirs, sizeof (*erd))); - putcwi_32 (cwi, resdir->characteristics, erd->characteristics); - putcwi_32 (cwi, resdir->time, erd->time); - putcwi_16 (cwi, resdir->major, erd->major); - putcwi_16 (cwi, resdir->minor, erd->minor); + windres_put_32 (cwi->wrbfd, erd->characteristics, resdir->characteristics); + windres_put_32 (cwi->wrbfd, erd->time, resdir->time); + windres_put_16 (cwi->wrbfd, erd->major, resdir->major); + windres_put_16 (cwi->wrbfd, erd->minor, resdir->minor); ci = 0; cn = 0; @@ -646,8 +648,8 @@ coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) ++ci; } - putcwi_16 (cwi, cn, erd->name_count); - putcwi_16 (cwi, ci, erd->id_count); + windres_put_16 (cwi->wrbfd, erd->name_count, cn); + windres_put_16 (cwi->wrbfd, erd->id_count, ci); /* Write out the data entries. Note that we allocate space for all the entries before writing them out. That permits a recursive @@ -658,35 +660,33 @@ coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) for (e = resdir->entries; e != NULL; e = e->next, ere++) { if (! e->id.named) - putcwi_32 (cwi, e->id.u.id, ere->name); + windres_put_32 (cwi->wrbfd, ere->name, e->id.u.id); else { - unsigned char *str; - int i; + bfd_byte *str; + rc_uint_type i; /* For some reason existing files seem to have the high bit set on the address of the name, although that is not documented. */ - putcwi_32 (cwi, - 0x80000000 | (cwi->dirsize + cwi->dirstrs.length), - ere->name); + windres_put_32 (cwi->wrbfd, ere->name, + 0x80000000 | (cwi->dirsize + cwi->dirstrs.length)); str = coff_alloc (&cwi->dirstrs, e->id.u.n.length * 2 + 2); - putcwi_16 (cwi, e->id.u.n.length, str); + windres_put_16 (cwi->wrbfd, str, e->id.u.n.length); for (i = 0; i < e->id.u.n.length; i++) - putcwi_16 (cwi, e->id.u.n.name[i], str + i * 2 + 2); + windres_put_16 (cwi->wrbfd, str + (i + 1) * sizeof (unichar), e->id.u.n.name[i]); } if (e->subdir) { - putcwi_32 (cwi, 0x80000000 | cwi->dirs.length, ere->rva); + windres_put_32 (cwi->wrbfd, ere->rva, 0x80000000 | cwi->dirs.length); coff_to_bin (e->u.dir, cwi); } else { - putcwi_32 (cwi, - cwi->dirsize + cwi->dirstrsize + cwi->dataents.length, - ere->rva); + windres_put_32 (cwi->wrbfd, ere->rva, + cwi->dirsize + cwi->dirstrsize + cwi->dataents.length); coff_res_to_bin (e->u.res, cwi); } @@ -696,12 +696,11 @@ coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) /* Convert the resource RES to binary. */ static void -coff_res_to_bin (const struct res_resource *res, struct coff_write_info *cwi) +coff_res_to_bin (const rc_res_resource *res, struct coff_write_info *cwi) { arelent *r; struct extern_res_data *erd; - struct bindata *d; - unsigned long length; + coff_res_data *d; /* For some reason, although every other address is a section offset, the address of the resource data itself is an RVA. That @@ -714,7 +713,7 @@ coff_res_to_bin (const struct res_resource *res, struct coff_write_info *cwi) r->sym_ptr_ptr = cwi->sympp; r->address = cwi->dirsize + cwi->dirstrsize + cwi->dataents.length; r->addend = 0; - r->howto = bfd_reloc_type_lookup (cwi->abfd, BFD_RELOC_RVA); + r->howto = bfd_reloc_type_lookup (WR_BFD (cwi->wrbfd), BFD_RELOC_RVA); if (r->howto == NULL) bfd_fatal (_("can't get BFD_RELOC_RVA relocation type")); @@ -726,41 +725,29 @@ coff_res_to_bin (const struct res_resource *res, struct coff_write_info *cwi) erd = (struct extern_res_data *) coff_alloc (&cwi->dataents, sizeof (*erd)); - putcwi_32 (cwi, + windres_put_32 (cwi->wrbfd, erd->rva, (cwi->dirsize + cwi->dirstrsize + cwi->dataentsize - + cwi->resources.length), - erd->rva); - putcwi_32 (cwi, res->coff_info.codepage, erd->codepage); - putcwi_32 (cwi, res->coff_info.reserved, erd->reserved); + + cwi->resources.length)); + windres_put_32 (cwi->wrbfd, erd->codepage, res->coff_info.codepage); + windres_put_32 (cwi->wrbfd, erd->reserved, res->coff_info.reserved); - d = res_to_bin (res, cwi->big_endian); + d = (coff_res_data *) reswr_alloc (sizeof (coff_res_data)); + d->length = res_to_bin (NULL, (rc_uint_type) 0, res); + d->res = res; + d->next = NULL; if (cwi->resources.d == NULL) cwi->resources.d = d; else cwi->resources.last->next = d; - length = 0; - for (; d->next != NULL; d = d->next) - length += d->length; - length += d->length; cwi->resources.last = d; - cwi->resources.length += length; + cwi->resources.length += (d->length + 3) & ~3; - putcwi_32 (cwi, length, erd->size); + windres_put_32 (cwi->wrbfd, erd->size, d->length); /* Force the next resource to have 32 bit alignment. */ - - if ((length & 3) != 0) - { - int add; - unsigned char *ex; - - add = 4 - (length & 3); - - ex = coff_alloc (&cwi->resources, add); - memset (ex, 0, add); - } + d->length = (d->length + 3) & ~3; } diff --git a/binutils/resrc.c b/binutils/resrc.c index 73b482cd04ab..ebed255157d3 100644 --- a/binutils/resrc.c +++ b/binutils/resrc.c @@ -1,7 +1,8 @@ /* resrc.c -- read and write Windows rc files. - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -23,6 +24,7 @@ /* This file contains functions that read and write Windows rc files. These are text files that represent resources. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -87,11 +89,11 @@ struct icondir { /* Width of image. */ - unsigned char width; + bfd_byte width; /* Height of image. */ - unsigned char height; + bfd_byte height; /* Number of colors in image. */ - unsigned char colorcount; + bfd_byte colorcount; union { struct @@ -125,7 +127,7 @@ int rc_lineno; /* The pipe we are reading from, so that we can close it if we exit. */ -static FILE *cpp_pipe; +FILE *cpp_pipe; /* The temporary file used if we're not using popen, so we can delete it if we exit. */ @@ -138,7 +140,7 @@ static enum {ISTREAM_PIPE, ISTREAM_FILE} istream_type; /* As we read the rc file, we attach information to this structure. */ -static struct res_directory *resources; +static rc_res_directory *resources; /* The number of cursor resources we have written out. */ @@ -150,17 +152,39 @@ static int fonts; /* Font directory information. */ -struct fontdir *fontdirs; +rc_fontdir *fontdirs; /* Resource info to use for fontdirs. */ -struct res_res_info fontdirs_resinfo; +rc_res_res_info fontdirs_resinfo; /* The number of icon resources we have written out. */ static int icons; -/* Local functions. */ +/* The windres target bfd . */ + +static windres_bfd wrtarget = +{ + (bfd *) NULL, (asection *) NULL, WR_KIND_TARGET +}; + +/* Local functions for rcdata based resource definitions. */ + +static void define_font_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_icon_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_bitmap_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_cursor_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_fontdir_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_messagetable_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static rc_uint_type rcdata_copy (const rc_rcdata_item *, bfd_byte *); +static bfd_byte *rcdata_render_as_buffer (const rc_rcdata_item *, rc_uint_type *); static int run_cmd (char *, const char *); static FILE *open_input_stream (char *); @@ -170,7 +194,7 @@ static void close_input_stream (void); static void unexpected_eof (const char *); static int get_word (FILE *, const char *); static unsigned long get_long (FILE *, const char *); -static void get_data (FILE *, unsigned char *, unsigned long, const char *); +static void get_data (FILE *, bfd_byte *, rc_uint_type, const char *); static void define_fontdirs (void); /* Run `cmd' and redirect the output to `redir'. */ @@ -327,7 +351,33 @@ open_input_stream (char *cmd) return cpp_pipe; } -/* look for the preprocessor program */ +/* Determine if FILENAME contains special characters that + can cause problems unless the entire filename is quoted. */ + +static int +filename_need_quotes (const char *filename) +{ + if (filename == NULL || (filename[0] == '-' && filename[1] == 0)) + return 0; + + while (*filename != 0) + { + switch (*filename) + { + case '&': + case ' ': + case '<': + case '>': + case '|': + case '%': + return 1; + } + ++filename; + } + return 0; +} + +/* Look for the preprocessor program. */ static FILE * look_for_default (char *cmd, const char *prefix, int end_prefix, @@ -336,6 +386,7 @@ look_for_default (char *cmd, const char *prefix, int end_prefix, char *space; int found; struct stat s; + const char *fnquotes = (filename_need_quotes (filename) ? "\"" : ""); strcpy (cmd, prefix); @@ -366,8 +417,8 @@ look_for_default (char *cmd, const char *prefix, int end_prefix, strcpy (cmd, prefix); - sprintf (cmd + end_prefix, "%s %s %s", - DEFAULT_PREPROCESSOR, preprocargs, filename); + sprintf (cmd + end_prefix, "%s %s %s%s%s", + DEFAULT_PREPROCESSOR, preprocargs, fnquotes, filename, fnquotes); if (verbose) fprintf (stderr, _("Using `%s'\n"), cmd); @@ -378,11 +429,12 @@ look_for_default (char *cmd, const char *prefix, int end_prefix, /* Read an rc file. */ -struct res_directory * +rc_res_directory * read_rc_file (const char *filename, const char *preprocessor, const char *preprocargs, int language, int use_temp_file) { char *cmd; + const char *fnquotes = (filename_need_quotes (filename) ? "\"" : ""); istream_type = (use_temp_file) ? ISTREAM_FILE : ISTREAM_PIPE; @@ -396,8 +448,10 @@ read_rc_file (const char *filename, const char *preprocessor, cmd = xmalloc (strlen (preprocessor) + strlen (preprocargs) + strlen (filename) + + strlen (fnquotes) * 2 + 10); - sprintf (cmd, "%s %s %s", preprocessor, preprocargs, filename); + sprintf (cmd, "%s %s %s%s%s", preprocessor, preprocargs, + fnquotes, filename, fnquotes); cpp_pipe = open_input_stream (cmd); } @@ -411,6 +465,7 @@ read_rc_file (const char *filename, const char *preprocessor, + strlen (preprocessor) + strlen (preprocargs) + strlen (filename) + + strlen (fnquotes) * 2 #ifdef HAVE_EXECUTABLE_SUFFIX + strlen (EXECUTABLE_SUFFIX) #endif @@ -440,20 +495,20 @@ read_rc_file (const char *filename, const char *preprocessor, /* First, try looking for a prefixed gcc in the windres directory, with the same prefix as windres */ - cpp_pipe = look_for_default (cmd, program_name, dash-program_name+1, + cpp_pipe = look_for_default (cmd, program_name, dash - program_name + 1, preprocargs, filename); } - if (slash && !cpp_pipe) + if (slash && ! cpp_pipe) { /* Next, try looking for a gcc in the same directory as that windres */ - cpp_pipe = look_for_default (cmd, program_name, slash-program_name+1, + cpp_pipe = look_for_default (cmd, program_name, slash - program_name + 1, preprocargs, filename); } - if (!cpp_pipe) + if (! cpp_pipe) { /* Sigh, try the default */ @@ -468,7 +523,6 @@ read_rc_file (const char *filename, const char *preprocessor, rc_lineno = 1; if (language != -1) rcparse_set_language (language); - yyin = cpp_pipe; yyparse (); rcparse_discard_strings (); @@ -575,24 +629,24 @@ get_long (FILE *e, const char *msg) /* Read data from a file. This is a wrapper to do error checking. */ static void -get_data (FILE *e, unsigned char *p, unsigned long c, const char *msg) +get_data (FILE *e, bfd_byte *p, rc_uint_type c, const char *msg) { - unsigned long got; + rc_uint_type got; // $$$d - got = fread (p, 1, c, e); + got = (rc_uint_type) fread (p, 1, c, e); if (got == c) return; - fatal (_("%s: read of %lu returned %lu"), msg, c, got); + fatal (_("%s: read of %lu returned %lu"), msg, (long) c, (long) got); } /* Define an accelerator resource. */ void -define_accelerator (struct res_id id, const struct res_res_info *resinfo, - struct accelerator *data) +define_accelerator (rc_res_id id, const rc_res_res_info *resinfo, + rc_accelerator *data) { - struct res_resource *r; + rc_res_resource *r; r = define_standard_resource (&resources, RT_ACCELERATOR, id, resinfo->language, 0); @@ -608,15 +662,15 @@ define_accelerator (struct res_id id, const struct res_res_info *resinfo, #define BITMAP_SKIP (14) void -define_bitmap (struct res_id id, const struct res_res_info *resinfo, +define_bitmap (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; struct stat s; - unsigned char *data; - int i; - struct res_resource *r; + bfd_byte *data; + rc_uint_type i; + rc_res_resource *r; e = open_file_search (filename, FOPEN_RB, "bitmap file", &real_filename); @@ -624,7 +678,7 @@ define_bitmap (struct res_id id, const struct res_res_info *resinfo, fatal (_("stat failed on bitmap file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size - BITMAP_SKIP); + data = (bfd_byte *) res_alloc (s.st_size - BITMAP_SKIP); for (i = 0; i < BITMAP_SKIP; i++) getc (e); @@ -650,7 +704,7 @@ define_bitmap (struct res_id id, const struct res_res_info *resinfo, select one of the actual cursors. */ void -define_cursor (struct res_id id, const struct res_res_info *resinfo, +define_cursor (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; @@ -658,8 +712,8 @@ define_cursor (struct res_id id, const struct res_res_info *resinfo, int type, count, i; struct icondir *icondirs; int first_cursor; - struct res_resource *r; - struct group_cursor *first, **pp; + rc_res_resource *r; + rc_group_cursor *first, **pp; e = open_file_search (filename, FOPEN_RB, "cursor file", &real_filename); @@ -699,19 +753,19 @@ define_cursor (struct res_id id, const struct res_res_info *resinfo, for (i = 0; i < count; i++) { - unsigned char *data; - struct res_id name; - struct cursor *c; + bfd_byte *data; + rc_res_id name; + rc_cursor *c; if (fseek (e, icondirs[i].offset, SEEK_SET) != 0) fatal (_("%s: fseek to %lu failed: %s"), real_filename, icondirs[i].offset, strerror (errno)); - data = (unsigned char *) res_alloc (icondirs[i].bytes); + data = (bfd_byte *) res_alloc (icondirs[i].bytes); get_data (e, data, icondirs[i].bytes, real_filename); - c = (struct cursor *) res_alloc (sizeof *c); + c = (rc_cursor *) res_alloc (sizeof (rc_cursor)); c->xhotspot = icondirs[i].u.cursor.xhotspot; c->yhotspot = icondirs[i].u.cursor.yhotspot; c->length = icondirs[i].bytes; @@ -738,9 +792,9 @@ define_cursor (struct res_id id, const struct res_res_info *resinfo, pp = &first; for (i = 0; i < count; i++) { - struct group_cursor *cg; + rc_group_cursor *cg; - cg = (struct group_cursor *) res_alloc (sizeof *cg); + cg = (rc_group_cursor *) res_alloc (sizeof (rc_group_cursor)); cg->next = NULL; cg->width = icondirs[i].width; cg->height = 2 * icondirs[i].height; @@ -768,13 +822,13 @@ define_cursor (struct res_id id, const struct res_res_info *resinfo, /* Define a dialog resource. */ void -define_dialog (struct res_id id, const struct res_res_info *resinfo, - const struct dialog *dialog) +define_dialog (rc_res_id id, const rc_res_res_info *resinfo, + const rc_dialog *dialog) { - struct dialog *copy; - struct res_resource *r; + rc_dialog *copy; + rc_res_resource *r; - copy = (struct dialog *) res_alloc (sizeof *copy); + copy = (rc_dialog *) res_alloc (sizeof *copy); *copy = *dialog; r = define_standard_resource (&resources, RT_DIALOG, id, @@ -787,15 +841,15 @@ define_dialog (struct res_id id, const struct res_res_info *resinfo, /* Define a dialog control. This does not define a resource, but merely allocates and fills in a structure. */ -struct dialog_control * -define_control (const struct res_id iid, unsigned long id, unsigned long x, - unsigned long y, unsigned long width, unsigned long height, - unsigned long class, unsigned long style, - unsigned long exstyle) +rc_dialog_control * +define_control (const rc_res_id iid, rc_uint_type id, rc_uint_type x, + rc_uint_type y, rc_uint_type width, rc_uint_type height, + const rc_res_id class, rc_uint_type style, + rc_uint_type exstyle) { - struct dialog_control *n; + rc_dialog_control *n; - n = (struct dialog_control *) res_alloc (sizeof *n); + n = (rc_dialog_control *) res_alloc (sizeof (rc_dialog_control)); n->next = NULL; n->id = id; n->style = style; @@ -804,8 +858,7 @@ define_control (const struct res_id iid, unsigned long id, unsigned long x, n->y = y; n->width = width; n->height = height; - n->class.named = 0; - n->class.u.id = class; + n->class = class; n->text = iid; n->data = NULL; n->help = 0; @@ -813,23 +866,26 @@ define_control (const struct res_id iid, unsigned long id, unsigned long x, return n; } -struct dialog_control * -define_icon_control (struct res_id iid, unsigned long id, unsigned long x, - unsigned long y, unsigned long style, - unsigned long exstyle, unsigned long help, - struct rcdata_item *data, struct dialog_ex *ex) +rc_dialog_control * +define_icon_control (rc_res_id iid, rc_uint_type id, rc_uint_type x, + rc_uint_type y, rc_uint_type style, + rc_uint_type exstyle, rc_uint_type help, + rc_rcdata_item *data, rc_dialog_ex *ex) { - struct dialog_control *n; - struct res_id tid; + rc_dialog_control *n; + rc_res_id tid; + rc_res_id cid; if (style == 0) style = SS_ICON | WS_CHILD | WS_VISIBLE; res_string_to_id (&tid, ""); - n = define_control (tid, id, x, y, 0, 0, CTL_STATIC, style, exstyle); + cid.named = 0; + cid.u.id = CTL_STATIC; + n = define_control (tid, id, x, y, 0, 0, cid, style, exstyle); n->text = iid; - if (help && !ex) + if (help && ! ex) rcparse_warning (_("help ID requires DIALOGEX")); - if (data && !ex) + if (data && ! ex) rcparse_warning (_("control data requires DIALOGEX")); n->help = help; n->data = data; @@ -840,20 +896,20 @@ define_icon_control (struct res_id iid, unsigned long id, unsigned long x, /* Define a font resource. */ void -define_font (struct res_id id, const struct res_res_info *resinfo, +define_font (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; struct stat s; - unsigned char *data; - struct res_resource *r; + bfd_byte *data; + rc_res_resource *r; long offset; long fontdatalength; - unsigned char *fontdata; - struct fontdir *fd; + bfd_byte *fontdata; + rc_fontdir *fd; const char *device, *face; - struct fontdir **pp; + rc_fontdir **pp; e = open_file_search (filename, FOPEN_RB, "font file", &real_filename); @@ -861,7 +917,7 @@ define_font (struct res_id id, const struct res_res_info *resinfo, fatal (_("stat failed on font file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size); + data = (bfd_byte *) res_alloc (s.st_size); get_data (e, data, s.st_size, real_filename); @@ -902,12 +958,12 @@ define_font (struct res_id id, const struct res_res_info *resinfo, ++fonts; fontdatalength = 58 + strlen (device) + strlen (face); - fontdata = (unsigned char *) res_alloc (fontdatalength); + fontdata = (bfd_byte *) res_alloc (fontdatalength); memcpy (fontdata, data, 56); strcpy ((char *) fontdata + 56, device); strcpy ((char *) fontdata + 57 + strlen (device), face); - fd = (struct fontdir *) res_alloc (sizeof *fd); + fd = (rc_fontdir *) res_alloc (sizeof (rc_fontdir)); fd->next = NULL; fd->index = fonts; fd->length = fontdatalength; @@ -922,14 +978,33 @@ define_font (struct res_id id, const struct res_res_info *resinfo, fontdirs_resinfo = *resinfo; } +static void +define_font_rcdata (rc_res_id id,const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + r = define_standard_resource (&resources, RT_FONT, id, + resinfo->language, 0); + + pb_data = rcdata_render_as_buffer (data, &len_data); + + r->type = RES_TYPE_FONT; + r->u.data.length = len_data; + r->u.data.data = pb_data; + r->res_info = *resinfo; +} + /* Define the fontdirs resource. This is called after the entire rc file has been parsed, if any font resources were seen. */ static void define_fontdirs (void) { - struct res_resource *r; - struct res_id id; + rc_res_resource *r; + rc_res_id id; id.named = 0; id.u.id = 1; @@ -941,6 +1016,89 @@ define_fontdirs (void) r->res_info = fontdirs_resinfo; } +static bfd_byte * +rcdata_render_as_buffer (const rc_rcdata_item *data, rc_uint_type *plen) +{ + const rc_rcdata_item *d; + bfd_byte *ret = NULL, *pret; + rc_uint_type len = 0; + + for (d = data; d != NULL; d = d->next) + len += rcdata_copy (d, NULL); + if (len != 0) + { + ret = pret = (bfd_byte *) res_alloc (len); + for (d = data; d != NULL; d = d->next) + pret += rcdata_copy (d, pret); + } + if (plen) + *plen = len; + return ret; +} + +static void +define_fontdir_rcdata (rc_res_id id,const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_fontdir *fd, *fd_first, *fd_cur; + rc_uint_type len_data; + bfd_byte *pb_data; + rc_uint_type c; + + fd_cur = fd_first = NULL; + r = define_standard_resource (&resources, RT_FONTDIR, id, 0x409, 0); + + pb_data = rcdata_render_as_buffer (data, &len_data); + + if (pb_data) + { + rc_uint_type off = 2; + c = windres_get_16 (&wrtarget, pb_data, len_data); + for (; c > 0; c--) + { + size_t len; + rc_uint_type safe_pos = off; + const struct bin_fontdir_item *bfi; + + bfi = (const struct bin_fontdir_item *) pb_data + off; + fd = (rc_fontdir *) res_alloc (sizeof (rc_fontdir)); + fd->index = windres_get_16 (&wrtarget, bfi->index, len_data - off); + fd->data = pb_data + off; + off += 56; + len = strlen ((char *) bfi->device_name) + 1; + off += (rc_uint_type) len; + off += (rc_uint_type) strlen ((char *) bfi->device_name + len) + 1; + fd->length = (off - safe_pos); + fd->next = NULL; + if (fd_first == NULL) + fd_first = fd; + else + fd_cur->next = fd; + fd_cur = fd; + } + } + r->type = RES_TYPE_FONTDIR; + r->u.fontdir = fd_first; + r->res_info = *resinfo; +} + +static void define_messagetable_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + r = define_standard_resource (&resources, RT_MESSAGETABLE, id, resinfo->language, 0); + + pb_data = rcdata_render_as_buffer (data, &len_data); + r->type = RES_TYPE_MESSAGETABLE; + r->u.data.length = len_data; + r->u.data.data = pb_data; + r->res_info = *resinfo; +} + /* Define an icon resource. An icon file may contain a set of bitmaps, each representing the same icon at various different resolutions. They each get written out with a different ID. The @@ -948,7 +1106,7 @@ define_fontdirs (void) select one of the actual icon bitmaps. */ void -define_icon (struct res_id id, const struct res_res_info *resinfo, +define_icon (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; @@ -956,8 +1114,8 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, int type, count, i; struct icondir *icondirs; int first_icon; - struct res_resource *r; - struct group_icon *first, **pp; + rc_res_resource *r; + rc_group_icon *first, **pp; e = open_file_search (filename, FOPEN_RB, "icon file", &real_filename); @@ -996,14 +1154,14 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, for (i = 0; i < count; i++) { - unsigned char *data; - struct res_id name; + bfd_byte *data; + rc_res_id name; if (fseek (e, icondirs[i].offset, SEEK_SET) != 0) fatal (_("%s: fseek to %lu failed: %s"), real_filename, icondirs[i].offset, strerror (errno)); - data = (unsigned char *) res_alloc (icondirs[i].bytes); + data = (bfd_byte *) res_alloc (icondirs[i].bytes); get_data (e, data, icondirs[i].bytes, real_filename); @@ -1029,13 +1187,13 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, pp = &first; for (i = 0; i < count; i++) { - struct group_icon *cg; + rc_group_icon *cg; /* For some reason, at least in some files the planes and bits are zero. We instead set them from the color. This is copied from rcl. */ - cg = (struct group_icon *) res_alloc (sizeof *cg); + cg = (rc_group_icon *) res_alloc (sizeof (rc_group_icon)); cg->next = NULL; cg->width = icondirs[i].width; cg->height = icondirs[i].height; @@ -1072,16 +1230,180 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, r->res_info = *resinfo; } +static void +define_group_icon_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_group_icon *cg, *first, *cur; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + cur = NULL; + first = NULL; + + while (len_data >= 6) + { + int c, i; + unsigned short type; + type = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2); + if (type != 1) + fatal (_("unexpected group icon type %d"), type); + c = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4); + len_data -= 6; + pb_data += 6; + + for (i = 0; i < c; i++) + { + if (len_data < 14) + fatal ("too small group icon rcdata"); + cg = (rc_group_icon *) res_alloc (sizeof (rc_group_icon)); + cg->next = NULL; + cg->width = pb_data[0]; + cg->height = pb_data[1]; + cg->colors = pb_data[2]; + cg->planes = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4); + cg->bits = windres_get_16 (&wrtarget, pb_data + 6, len_data - 6); + cg->bytes = windres_get_32 (&wrtarget, pb_data + 8, len_data - 8); + cg->index = windres_get_16 (&wrtarget, pb_data + 12, len_data - 12); + if (! first) + first = cg; + else + cur->next = cg; + cur = cg; + pb_data += 14; + len_data -= 14; + } + } + r = define_standard_resource (&resources, RT_GROUP_ICON, id, + resinfo->language, 0); + r->type = RES_TYPE_GROUP_ICON; + r->u.group_icon = first; + r->res_info = *resinfo; +} + +static void +define_group_cursor_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_group_cursor *cg, *first, *cur; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + first = cur = NULL; + + while (len_data >= 6) + { + int c, i; + unsigned short type; + type = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2); + if (type != 2) + fatal (_("unexpected group cursor type %d"), type); + c = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4); + len_data -= 6; + pb_data += 6; + + for (i = 0; i < c; i++) + { + if (len_data < 14) + fatal ("too small group icon rcdata"); + cg = (rc_group_cursor *) res_alloc (sizeof (rc_group_cursor)); + cg->next = NULL; + cg->width = windres_get_16 (&wrtarget, pb_data, len_data); + cg->height = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2); + cg->planes = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4); + cg->bits = windres_get_16 (&wrtarget, pb_data + 6, len_data - 6); + cg->bytes = windres_get_32 (&wrtarget, pb_data + 8, len_data - 8); + cg->index = windres_get_16 (&wrtarget, pb_data + 12, len_data - 12); + if (! first) + first = cg; + else + cur->next = cg; + cur = cg; + pb_data += 14; + len_data -= 14; + } + } + + r = define_standard_resource (&resources, RT_GROUP_ICON, id, + resinfo->language, 0); + r->type = RES_TYPE_GROUP_CURSOR; + r->u.group_cursor = first; + r->res_info = *resinfo; +} + +static void +define_cursor_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_cursor *c; + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + c = (rc_cursor *) res_alloc (sizeof (rc_cursor)); + c->xhotspot = windres_get_16 (&wrtarget, pb_data, len_data); + c->yhotspot = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2); + c->length = len_data - BIN_CURSOR_SIZE; + c->data = (const bfd_byte *) (data + BIN_CURSOR_SIZE); + + r = define_standard_resource (&resources, RT_CURSOR, id, resinfo->language, 0); + r->type = RES_TYPE_CURSOR; + r->u.cursor = c; + r->res_info = *resinfo; +} + +static void +define_bitmap_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + r = define_standard_resource (&resources, RT_BITMAP, id, resinfo->language, 0); + r->type = RES_TYPE_BITMAP; + r->u.data.length = len_data; + r->u.data.data = pb_data; + r->res_info = *resinfo; +} + +static void +define_icon_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + r = define_standard_resource (&resources, RT_ICON, id, resinfo->language, 0); + r->type = RES_TYPE_ICON; + r->u.data.length = len_data; + r->u.data.data = pb_data; + r->res_info = *resinfo; +} + /* Define a menu resource. */ void -define_menu (struct res_id id, const struct res_res_info *resinfo, - struct menuitem *menuitems) +define_menu (rc_res_id id, const rc_res_res_info *resinfo, + rc_menuitem *menuitems) { - struct menu *m; - struct res_resource *r; + rc_menu *m; + rc_res_resource *r; - m = (struct menu *) res_alloc (sizeof *m); + m = (rc_menu *) res_alloc (sizeof (rc_menu)); m->items = menuitems; m->help = 0; @@ -1094,22 +1416,19 @@ define_menu (struct res_id id, const struct res_res_info *resinfo, /* Define a menu item. This does not define a resource, but merely allocates and fills in a structure. */ -struct menuitem * -define_menuitem (const char *text, int menuid, unsigned long type, - unsigned long state, unsigned long help, - struct menuitem *menuitems) +rc_menuitem * +define_menuitem (const unichar *text, rc_uint_type menuid, rc_uint_type type, + rc_uint_type state, rc_uint_type help, + rc_menuitem *menuitems) { - struct menuitem *mi; + rc_menuitem *mi; - mi = (struct menuitem *) res_alloc (sizeof *mi); + mi = (rc_menuitem *) res_alloc (sizeof (rc_menuitem)); mi->next = NULL; mi->type = type; mi->state = state; mi->id = menuid; - if (text == NULL) - mi->text = NULL; - else - unicode_from_ascii ((int *) NULL, &mi->text, text); + mi->text = unichar_dup (text); mi->help = help; mi->popup = menuitems; return mi; @@ -1118,14 +1437,14 @@ define_menuitem (const char *text, int menuid, unsigned long type, /* Define a messagetable resource. */ void -define_messagetable (struct res_id id, const struct res_res_info *resinfo, +define_messagetable (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; struct stat s; - unsigned char *data; - struct res_resource *r; + bfd_byte *data; + rc_res_resource *r; e = open_file_search (filename, FOPEN_RB, "messagetable file", &real_filename); @@ -1134,7 +1453,7 @@ define_messagetable (struct res_id id, const struct res_res_info *resinfo, fatal (_("stat failed on bitmap file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size); + data = (bfd_byte *) res_alloc (s.st_size); get_data (e, data, s.st_size, real_filename); @@ -1153,10 +1472,10 @@ define_messagetable (struct res_id id, const struct res_res_info *resinfo, /* Define an rcdata resource. */ void -define_rcdata (struct res_id id, const struct res_res_info *resinfo, - struct rcdata_item *data) +define_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) { - struct res_resource *r; + rc_res_resource *r; r = define_standard_resource (&resources, RT_RCDATA, id, resinfo->language, 0); @@ -1167,13 +1486,13 @@ define_rcdata (struct res_id id, const struct res_res_info *resinfo, /* Create an rcdata item holding a string. */ -struct rcdata_item * -define_rcdata_string (const char *string, unsigned long len) +rc_rcdata_item * +define_rcdata_string (const char *string, rc_uint_type len) { - struct rcdata_item *ri; + rc_rcdata_item *ri; char *s; - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = RCDATA_STRING; ri->u.string.length = len; @@ -1184,14 +1503,33 @@ define_rcdata_string (const char *string, unsigned long len) return ri; } +/* Create an rcdata item holding a unicode string. */ + +rc_rcdata_item * +define_rcdata_unistring (const unichar *string, rc_uint_type len) +{ + rc_rcdata_item *ri; + unichar *s; + + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); + ri->next = NULL; + ri->type = RCDATA_WSTRING; + ri->u.wstring.length = len; + s = (unichar *) res_alloc (len * sizeof (unichar)); + memcpy (s, string, len * sizeof (unichar)); + ri->u.wstring.w = s; + + return ri; +} + /* Create an rcdata item holding a number. */ -struct rcdata_item * -define_rcdata_number (unsigned long val, int dword) +rc_rcdata_item * +define_rcdata_number (rc_uint_type val, int dword) { - struct rcdata_item *ri; + rc_rcdata_item *ri; - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = dword ? RCDATA_DWORD : RCDATA_WORD; ri->u.word = val; @@ -1203,11 +1541,11 @@ define_rcdata_number (unsigned long val, int dword) which appears in a STRINGTABLE statement. */ void -define_stringtable (const struct res_res_info *resinfo, - unsigned long stringid, const char *string) +define_stringtable (const rc_res_res_info *resinfo, + rc_uint_type stringid, const unichar *string) { - struct res_id id; - struct res_resource *r; + rc_res_id id; + rc_res_resource *r; id.named = 0; id.u.id = (stringid >> 4) + 1; @@ -1219,8 +1557,8 @@ define_stringtable (const struct res_res_info *resinfo, int i; r->type = RES_TYPE_STRINGTABLE; - r->u.stringtable = ((struct stringtable *) - res_alloc (sizeof (struct stringtable))); + r->u.stringtable = ((rc_stringtable *) + res_alloc (sizeof (rc_stringtable))); for (i = 0; i < 16; i++) { r->u.stringtable->strings[i].length = 0; @@ -1230,21 +1568,79 @@ define_stringtable (const struct res_res_info *resinfo, r->res_info = *resinfo; } - unicode_from_ascii (&r->u.stringtable->strings[stringid & 0xf].length, - &r->u.stringtable->strings[stringid & 0xf].string, - string); + r->u.stringtable->strings[stringid & 0xf].length = unichar_len (string); + r->u.stringtable->strings[stringid & 0xf].string = unichar_dup (string); +} + +void +define_toolbar (rc_res_id id, rc_res_res_info *resinfo, rc_uint_type width, rc_uint_type height, + rc_toolbar_item *items) +{ + rc_toolbar *t; + rc_res_resource *r; + + t = (rc_toolbar *) res_alloc (sizeof (rc_toolbar)); + t->button_width = width; + t->button_height = height; + t->nitems = 0; + t->items = items; + while (items != NULL) + { + t->nitems+=1; + items = items->next; + } + r = define_standard_resource (&resources, RT_TOOLBAR, id, resinfo->language, 0); + r->type = RES_TYPE_TOOLBAR; + r->u.toolbar = t; + r->res_info = *resinfo; } /* Define a user data resource where the data is in the rc file. */ void -define_user_data (struct res_id id, struct res_id type, - const struct res_res_info *resinfo, - struct rcdata_item *data) +define_user_data (rc_res_id id, rc_res_id type, + const rc_res_res_info *resinfo, + rc_rcdata_item *data) { - struct res_id ids[3]; - struct res_resource *r; + rc_res_id ids[3]; + rc_res_resource *r; + bfd_byte *pb_data; + rc_uint_type len_data; + /* We have to check if the binary data is parsed specially. */ + if (type.named == 0) + { + switch (type.u.id) + { + case RT_FONTDIR: + define_fontdir_rcdata (id, resinfo, data); + return; + case RT_FONT: + define_font_rcdata (id, resinfo, data); + return; + case RT_ICON: + define_icon_rcdata (id, resinfo, data); + return; + case RT_BITMAP: + define_bitmap_rcdata (id, resinfo, data); + return; + case RT_CURSOR: + define_cursor_rcdata (id, resinfo, data); + return; + case RT_GROUP_ICON: + define_group_icon_rcdata (id, resinfo, data); + return; + case RT_GROUP_CURSOR: + define_group_cursor_rcdata (id, resinfo, data); + return; + case RT_MESSAGETABLE: + define_messagetable_rcdata (id, resinfo, data); + return; + default: + /* Treat as normal user-data. */ + break; + } + } ids[0] = type; ids[1] = id; ids[2].named = 0; @@ -1252,19 +1648,25 @@ define_user_data (struct res_id id, struct res_id type, r = define_resource (& resources, 3, ids, 0); r->type = RES_TYPE_USERDATA; - r->u.userdata = data; + r->u.userdata = ((rc_rcdata_item *) + res_alloc (sizeof (rc_rcdata_item))); + r->u.userdata->next = NULL; + r->u.userdata->type = RCDATA_BUFFER; + pb_data = rcdata_render_as_buffer (data, &len_data); + r->u.userdata->u.buffer.length = len_data; + r->u.userdata->u.buffer.data = pb_data; r->res_info = *resinfo; } void -define_rcdata_file (struct res_id id, const struct res_res_info *resinfo, +define_rcdata_file (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { - struct rcdata_item *ri; + rc_rcdata_item *ri; FILE *e; char *real_filename; struct stat s; - unsigned char *data; + bfd_byte *data; e = open_file_search (filename, FOPEN_RB, "file", &real_filename); @@ -1273,14 +1675,14 @@ define_rcdata_file (struct res_id id, const struct res_res_info *resinfo, fatal (_("stat failed on file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size); + data = (bfd_byte *) res_alloc (s.st_size); get_data (e, data, s.st_size, real_filename); fclose (e); free (real_filename); - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = RCDATA_BUFFER; ri->u.buffer.length = s.st_size; @@ -1292,15 +1694,15 @@ define_rcdata_file (struct res_id id, const struct res_res_info *resinfo, /* Define a user data resource where the data is in a file. */ void -define_user_file (struct res_id id, struct res_id type, - const struct res_res_info *resinfo, const char *filename) +define_user_file (rc_res_id id, rc_res_id type, + const rc_res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; struct stat s; - unsigned char *data; - struct res_id ids[3]; - struct res_resource *r; + bfd_byte *data; + rc_res_id ids[3]; + rc_res_resource *r; e = open_file_search (filename, FOPEN_RB, "file", &real_filename); @@ -1308,7 +1710,7 @@ define_user_file (struct res_id id, struct res_id type, fatal (_("stat failed on file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size); + data = (bfd_byte *) res_alloc (s.st_size); get_data (e, data, s.st_size, real_filename); @@ -1322,8 +1724,8 @@ define_user_file (struct res_id id, struct res_id type, r = define_resource (&resources, 3, ids, 0); r->type = RES_TYPE_USERDATA; - r->u.userdata = ((struct rcdata_item *) - res_alloc (sizeof (struct rcdata_item))); + r->u.userdata = ((rc_rcdata_item *) + res_alloc (sizeof (rc_rcdata_item))); r->u.userdata->next = NULL; r->u.userdata->type = RCDATA_BUFFER; r->u.userdata->u.buffer.length = s.st_size; @@ -1334,16 +1736,16 @@ define_user_file (struct res_id id, struct res_id type, /* Define a versioninfo resource. */ void -define_versioninfo (struct res_id id, int language, - struct fixed_versioninfo *fixedverinfo, - struct ver_info *verinfo) +define_versioninfo (rc_res_id id, rc_uint_type language, + rc_fixed_versioninfo *fixedverinfo, + rc_ver_info *verinfo) { - struct res_resource *r; + rc_res_resource *r; r = define_standard_resource (&resources, RT_VERSION, id, language, 0); r->type = RES_TYPE_VERSIONINFO; - r->u.versioninfo = ((struct versioninfo *) - res_alloc (sizeof (struct versioninfo))); + r->u.versioninfo = ((rc_versioninfo *) + res_alloc (sizeof (rc_versioninfo))); r->u.versioninfo->fixed = fixedverinfo; r->u.versioninfo->var = verinfo; r->res_info.language = language; @@ -1351,16 +1753,16 @@ define_versioninfo (struct res_id id, int language, /* Add string version info to a list of version information. */ -struct ver_info * -append_ver_stringfileinfo (struct ver_info *verinfo, const char *language, - struct ver_stringinfo *strings) +rc_ver_info * +append_ver_stringfileinfo (rc_ver_info *verinfo, const char *language, + rc_ver_stringinfo *strings) { - struct ver_info *vi, **pp; + rc_ver_info *vi, **pp; - vi = (struct ver_info *) res_alloc (sizeof *vi); + vi = (rc_ver_info *) res_alloc (sizeof (rc_ver_info)); vi->next = NULL; vi->type = VERINFO_STRING; - unicode_from_ascii ((int *) NULL, &vi->u.string.language, language); + unicode_from_ascii ((rc_uint_type *) NULL, &vi->u.string.language, language); vi->u.string.strings = strings; for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next) @@ -1372,16 +1774,16 @@ append_ver_stringfileinfo (struct ver_info *verinfo, const char *language, /* Add variable version info to a list of version information. */ -struct ver_info * -append_ver_varfileinfo (struct ver_info *verinfo, const char *key, - struct ver_varinfo *var) +rc_ver_info * +append_ver_varfileinfo (rc_ver_info *verinfo, const unichar *key, + rc_ver_varinfo *var) { - struct ver_info *vi, **pp; + rc_ver_info *vi, **pp; - vi = (struct ver_info *) res_alloc (sizeof *vi); + vi = (rc_ver_info *) res_alloc (sizeof *vi); vi->next = NULL; vi->type = VERINFO_VAR; - unicode_from_ascii ((int *) NULL, &vi->u.var.key, key); + vi->u.var.key = unichar_dup (key); vi->u.var.var = var; for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next) @@ -1393,16 +1795,16 @@ append_ver_varfileinfo (struct ver_info *verinfo, const char *key, /* Append version string information to a list. */ -struct ver_stringinfo * -append_verval (struct ver_stringinfo *strings, const char *key, - const char *value) +rc_ver_stringinfo * +append_verval (rc_ver_stringinfo *strings, const unichar *key, + const unichar *value) { - struct ver_stringinfo *vs, **pp; + rc_ver_stringinfo *vs, **pp; - vs = (struct ver_stringinfo *) res_alloc (sizeof *vs); + vs = (rc_ver_stringinfo *) res_alloc (sizeof (rc_ver_stringinfo)); vs->next = NULL; - unicode_from_ascii ((int *) NULL, &vs->key, key); - unicode_from_ascii ((int *) NULL, &vs->value, value); + vs->key = unichar_dup (key); + vs->value = unichar_dup (value); for (pp = &strings; *pp != NULL; pp = &(*pp)->next) ; @@ -1413,13 +1815,13 @@ append_verval (struct ver_stringinfo *strings, const char *key, /* Append version variable information to a list. */ -struct ver_varinfo * -append_vertrans (struct ver_varinfo *var, unsigned long language, - unsigned long charset) +rc_ver_varinfo * +append_vertrans (rc_ver_varinfo *var, rc_uint_type language, + rc_uint_type charset) { - struct ver_varinfo *vv, **pp; + rc_ver_varinfo *vv, **pp; - vv = (struct ver_varinfo *) res_alloc (sizeof *vv); + vv = (rc_ver_varinfo *) res_alloc (sizeof (rc_ver_varinfo)); vv->next = NULL; vv->language = language; vv->charset = charset; @@ -1434,29 +1836,28 @@ append_vertrans (struct ver_varinfo *var, unsigned long language, /* Local functions used to write out an rc file. */ static void indent (FILE *, int); -static void write_rc_directory - (FILE *, const struct res_directory *, const struct res_id *, - const struct res_id *, int *, int); -static void write_rc_subdir - (FILE *, const struct res_entry *, const struct res_id *, - const struct res_id *, int *, int); -static void write_rc_resource - (FILE *, const struct res_id *, const struct res_id *, - const struct res_resource *, int *); -static void write_rc_accelerators (FILE *, const struct accelerator *); -static void write_rc_cursor (FILE *, const struct cursor *); -static void write_rc_group_cursor (FILE *, const struct group_cursor *); -static void write_rc_dialog (FILE *, const struct dialog *); -static void write_rc_dialog_control (FILE *, const struct dialog_control *); -static void write_rc_fontdir (FILE *, const struct fontdir *); -static void write_rc_group_icon (FILE *, const struct group_icon *); -static void write_rc_menu (FILE *, const struct menu *, int); -static void write_rc_menuitems (FILE *, const struct menuitem *, int, int); -static void write_rc_rcdata (FILE *, const struct rcdata_item *, int); -static void write_rc_stringtable - (FILE *, const struct res_id *, const struct stringtable *); -static void write_rc_versioninfo (FILE *, const struct versioninfo *); -static void write_rc_filedata (FILE *, unsigned long, const unsigned char *); +static void write_rc_directory (FILE *, const rc_res_directory *, const rc_res_id *, + const rc_res_id *, rc_uint_type *, int); +static void write_rc_subdir (FILE *, const rc_res_entry *, const rc_res_id *, + const rc_res_id *, rc_uint_type *, int); +static void write_rc_resource (FILE *, const rc_res_id *, const rc_res_id *, + const rc_res_resource *, rc_uint_type *); +static void write_rc_accelerators (FILE *, const rc_accelerator *); +static void write_rc_cursor (FILE *, const rc_cursor *); +static void write_rc_group_cursor (FILE *, const rc_group_cursor *); +static void write_rc_dialog (FILE *, const rc_dialog *); +static void write_rc_dialog_control (FILE *, const rc_dialog_control *); +static void write_rc_fontdir (FILE *, const rc_fontdir *); +static void write_rc_group_icon (FILE *, const rc_group_icon *); +static void write_rc_menu (FILE *, const rc_menu *, int); +static void write_rc_toolbar (FILE *, const rc_toolbar *); +static void write_rc_menuitems (FILE *, const rc_menuitem *, int, int); +static void write_rc_messagetable (FILE *, rc_uint_type , const bfd_byte *); + +static void write_rc_datablock (FILE *, rc_uint_type , const bfd_byte *, int, int, int); +static void write_rc_rcdata (FILE *, const rc_rcdata_item *, int); +static void write_rc_stringtable (FILE *, const rc_res_id *, const rc_stringtable *); +static void write_rc_versioninfo (FILE *, const rc_versioninfo *); /* Indent a given number of spaces. */ @@ -1471,19 +1872,15 @@ indent (FILE *e, int c) /* Dump the resources we have read in the format of an rc file. - Actually, we don't use the format of an rc file, because it's way - too much of a pain--for example, we'd have to write icon resources - into a file and refer to that file. We just generate a readable - format that kind of looks like an rc file, and is useful for - understanding the contents of a resource file. Someday we may want - to generate an rc file which the rc compiler can read; if that day - comes, this code will have to be fixed up. */ + Reasoned by the fact, that some resources need to be stored into file and + refer to that file, we use the user-data model for that to express it binary + without the need to store it somewhere externally. */ void -write_rc_file (const char *filename, const struct res_directory *resources) +write_rc_file (const char *filename, const rc_res_directory *resources) { FILE *e; - int language; + rc_uint_type language; if (filename == NULL) e = stdout; @@ -1494,9 +1891,9 @@ write_rc_file (const char *filename, const struct res_directory *resources) fatal (_("can't open `%s' for output: %s"), filename, strerror (errno)); } - language = -1; - write_rc_directory (e, resources, (const struct res_id *) NULL, - (const struct res_id *) NULL, &language, 1); + language = (rc_uint_type) ((bfd_signed_vma) -1); + write_rc_directory (e, resources, (const rc_res_id *) NULL, + (const rc_res_id *) NULL, &language, 1); } /* Write out a directory. E is the file to write to. RD is the @@ -1506,20 +1903,23 @@ write_rc_file (const char *filename, const struct res_directory *resources) language. LEVEL is the level in the tree. */ static void -write_rc_directory (FILE *e, const struct res_directory *rd, - const struct res_id *type, const struct res_id *name, - int *language, int level) +write_rc_directory (FILE *e, const rc_res_directory *rd, + const rc_res_id *type, const rc_res_id *name, + rc_uint_type *language, int level) { - const struct res_entry *re; + const rc_res_entry *re; /* Print out some COFF information that rc files can't represent. */ - + if (rd->time != 0 || rd->characteristics != 0 || rd->major != 0 || rd->minor != 0) + { + wr_printcomment (e, "COFF information not part of RC"); if (rd->time != 0) - fprintf (e, "// Time stamp: %lu\n", rd->time); + wr_printcomment (e, "Time stamp: %u", rd->time); if (rd->characteristics != 0) - fprintf (e, "// Characteristics: %lu\n", rd->characteristics); + wr_printcomment (e, "Characteristics: %u", rd->characteristics); if (rd->major != 0 || rd->minor != 0) - fprintf (e, "// Version: %d %d\n", rd->major, rd->minor); + wr_printcomment (e, "Version major:%d minor:%d", rd->major, rd->minor); + } for (re = rd->entries; re != NULL; re = re->next) { @@ -1546,7 +1946,7 @@ write_rc_directory (FILE *e, const struct res_directory *rd, && re->id.u.id != (unsigned long) (unsigned int) *language && (re->id.u.id & 0xffff) == re->id.u.id) { - fprintf (e, "LANGUAGE %lu, %lu\n", + wr_print (e, "LANGUAGE %u, %u\n", re->id.u.id & ((1 << SUBLANG_SHIFT) - 1), (re->id.u.id >> SUBLANG_SHIFT) & 0xff); *language = re->id.u.id; @@ -1572,12 +1972,16 @@ write_rc_directory (FILE *e, const struct res_directory *rd, } else { - fprintf (e, "// Resource at unexpected level %d\n", level); - write_rc_resource (e, type, (struct res_id *) NULL, re->u.res, + wr_printcomment (e, "Resource at unexpected level %d", level); + write_rc_resource (e, type, (rc_res_id *) NULL, re->u.res, language); } } } + if (rd->entries == NULL) + { + wr_print_flush (e); + } } /* Write out a subdirectory entry. E is the file to write to. RE is @@ -1586,15 +1990,15 @@ write_rc_directory (FILE *e, const struct res_directory *rd, LEVEL is the level in the tree. */ static void -write_rc_subdir (FILE *e, const struct res_entry *re, - const struct res_id *type, const struct res_id *name, - int *language, int level) +write_rc_subdir (FILE *e, const rc_res_entry *re, + const rc_res_id *type, const rc_res_id *name, + rc_uint_type *language, int level) { fprintf (e, "\n"); switch (level) { case 1: - fprintf (e, "// Type: "); + wr_printcomment (e, "Type: "); if (re->id.named) res_id_print (e, re->id, 1); else @@ -1622,6 +2026,8 @@ write_rc_subdir (FILE *e, const struct res_entry *re, case RT_VXD: s = "vxd"; break; case RT_ANICURSOR: s = "anicursor"; break; case RT_ANIICON: s = "aniicon"; break; + case RT_TOOLBAR: s = "toolbar"; break; + case RT_HTML: s = "html"; break; default: s = NULL; break; } @@ -1630,25 +2036,21 @@ write_rc_subdir (FILE *e, const struct res_entry *re, else res_id_print (e, re->id, 1); } - fprintf (e, "\n"); break; case 2: - fprintf (e, "// Name: "); + wr_printcomment (e, "Name: "); res_id_print (e, re->id, 1); - fprintf (e, "\n"); break; case 3: - fprintf (e, "// Language: "); + wr_printcomment (e, "Language: "); res_id_print (e, re->id, 1); - fprintf (e, "\n"); break; default: - fprintf (e, "// Level %d: ", level); + wr_printcomment (e, "Level %d: ", level); res_id_print (e, re->id, 1); - fprintf (e, "\n"); } write_rc_directory (e, re->u.dir, type, name, language, level + 1); @@ -1661,38 +2063,36 @@ write_rc_subdir (FILE *e, const struct res_entry *re, language. */ static void -write_rc_resource (FILE *e, const struct res_id *type, - const struct res_id *name, const struct res_resource *res, - int *language) +write_rc_resource (FILE *e, const rc_res_id *type, + const rc_res_id *name, const rc_res_resource *res, + rc_uint_type *language) { const char *s; int rt; int menuex = 0; - fprintf (e, "\n"); - switch (res->type) { default: abort (); case RES_TYPE_ACCELERATOR: - s = "ACCELERATOR"; + s = "ACCELERATORS"; rt = RT_ACCELERATOR; break; case RES_TYPE_BITMAP: - s = "BITMAP"; + s = "2 /* RT_BITMAP */"; rt = RT_BITMAP; break; case RES_TYPE_CURSOR: - s = "CURSOR"; + s = "1 /* RT_CURSOR */"; rt = RT_CURSOR; break; case RES_TYPE_GROUP_CURSOR: - s = "GROUP_CURSOR"; + s = "12 /* RT_GROUP_CURSOR */"; rt = RT_GROUP_CURSOR; break; @@ -1705,22 +2105,22 @@ write_rc_resource (FILE *e, const struct res_id *type, break; case RES_TYPE_FONT: - s = "FONT"; + s = "8 /* RT_FONT */"; rt = RT_FONT; break; case RES_TYPE_FONTDIR: - s = "FONTDIR"; + s = "7 /* RT_FONTDIR */"; rt = RT_FONTDIR; break; case RES_TYPE_ICON: - s = "ICON"; + s = "3 /* RT_ICON */"; rt = RT_ICON; break; case RES_TYPE_GROUP_ICON: - s = "GROUP_ICON"; + s = "14 /* RT_GROUP_ICON */"; rt = RT_GROUP_ICON; break; @@ -1739,7 +2139,7 @@ write_rc_resource (FILE *e, const struct res_id *type, break; case RES_TYPE_MESSAGETABLE: - s = "MESSAGETABLE"; + s = "11 /* RT_MESSAGETABLE */"; rt = RT_MESSAGETABLE; break; @@ -1762,32 +2162,76 @@ write_rc_resource (FILE *e, const struct res_id *type, s = "VERSIONINFO"; rt = RT_VERSION; break; + + case RES_TYPE_TOOLBAR: + s = "TOOLBAR"; + rt = RT_TOOLBAR; + break; } if (rt != 0 && type != NULL && (type->named || type->u.id != (unsigned long) rt)) { - fprintf (e, "// Unexpected resource type mismatch: "); + wr_printcomment (e, "Unexpected resource type mismatch: "); res_id_print (e, *type, 1); fprintf (e, " != %d", rt); } if (res->coff_info.codepage != 0) - fprintf (e, "// Code page: %lu\n", res->coff_info.codepage); + wr_printcomment (e, "Code page: %u", res->coff_info.codepage); if (res->coff_info.reserved != 0) - fprintf (e, "// COFF reserved value: %lu\n", res->coff_info.reserved); + wr_printcomment (e, "COFF reserved value: %u", res->coff_info.reserved); + wr_print (e, "\n"); + if (rt == RT_STRING) + ; + else + { if (name != NULL) - res_id_print (e, *name, 0); + res_id_print (e, *name, 1); else fprintf (e, "??Unknown-Name??"); - fprintf (e, " "); + } + if (s != NULL) fprintf (e, "%s", s); else if (type != NULL) + { + if (type->named == 0) + { +#define PRINT_RT_NAME(NAME) case NAME: \ + fprintf (e, "%u /* %s */", (unsigned int) NAME, #NAME); \ + break + + switch (type->u.id) + { + default: res_id_print (e, *type, 0); + break; + + PRINT_RT_NAME(RT_MANIFEST); + PRINT_RT_NAME(RT_ANICURSOR); + PRINT_RT_NAME(RT_ANIICON); + PRINT_RT_NAME(RT_RCDATA); + PRINT_RT_NAME(RT_ICON); + PRINT_RT_NAME(RT_CURSOR); + PRINT_RT_NAME(RT_BITMAP); + PRINT_RT_NAME(RT_PLUGPLAY); + PRINT_RT_NAME(RT_VXD); + PRINT_RT_NAME(RT_FONT); + PRINT_RT_NAME(RT_FONTDIR); + PRINT_RT_NAME(RT_HTML); + PRINT_RT_NAME(RT_MESSAGETABLE); + PRINT_RT_NAME(RT_DLGINCLUDE); + PRINT_RT_NAME(RT_DLGINIT); + } +#undef PRINT_RT_NAME + } + else + res_id_print (e, *type, 1); + } else fprintf (e, "??Unknown-Type??"); @@ -1805,11 +2249,17 @@ write_rc_resource (FILE *e, const struct res_id *type, if (res->type == RES_TYPE_DIALOG) { - fprintf (e, " %d, %d, %d, %d", res->u.dialog->x, res->u.dialog->y, - res->u.dialog->width, res->u.dialog->height); + fprintf (e, " %d, %d, %d, %d", + (int) res->u.dialog->x, (int) res->u.dialog->y, + (int) res->u.dialog->width, (int) res->u.dialog->height); if (res->u.dialog->ex != NULL && res->u.dialog->ex->help != 0) - fprintf (e, ", %lu", res->u.dialog->ex->help); + fprintf (e, ", %u", (unsigned int) res->u.dialog->ex->help); + } + else if (res->type == RES_TYPE_TOOLBAR) + { + fprintf (e, " %d, %d", (int) res->u.toolbar->button_width, + (int) res->u.toolbar->button_height); } fprintf (e, "\n"); @@ -1838,16 +2288,16 @@ write_rc_resource (FILE *e, const struct res_id *type, if (res->res_info.language != 0 && res->res_info.language != *language) fprintf (e, "%sLANGUAGE %d, %d\n", modifiers ? "// " : "", - res->res_info.language & ((1<<SUBLANG_SHIFT)-1), - (res->res_info.language >> SUBLANG_SHIFT) & 0xff); + (int) res->res_info.language & ((1<<SUBLANG_SHIFT)-1), + (int) (res->res_info.language >> SUBLANG_SHIFT) & 0xff); if (res->res_info.characteristics != 0) - fprintf (e, "%sCHARACTERISTICS %lu\n", + fprintf (e, "%sCHARACTERISTICS %u\n", modifiers ? "// " : "", - res->res_info.characteristics); + (unsigned int) res->res_info.characteristics); if (res->res_info.version != 0) - fprintf (e, "%sVERSION %lu\n", + fprintf (e, "%sVERSION %u\n", modifiers ? "// " : "", - res->res_info.version); + (unsigned int) res->res_info.version); } switch (res->type) @@ -1895,6 +2345,10 @@ write_rc_resource (FILE *e, const struct res_id *type, write_rc_rcdata (e, res->u.userdata, 0); break; + case RES_TYPE_TOOLBAR: + write_rc_toolbar (e, res->u.toolbar); + break; + case RES_TYPE_VERSIONINFO: write_rc_versioninfo (e, res->u.versioninfo); break; @@ -1902,8 +2356,10 @@ write_rc_resource (FILE *e, const struct res_id *type, case RES_TYPE_BITMAP: case RES_TYPE_FONT: case RES_TYPE_ICON: + write_rc_datablock (e, res->u.data.length, res->u.data.data, 0, 1, 0); + break; case RES_TYPE_MESSAGETABLE: - write_rc_filedata (e, res->u.data.length, res->u.data.data); + write_rc_messagetable (e, res->u.data.length, res->u.data.data); break; } } @@ -1911,9 +2367,9 @@ write_rc_resource (FILE *e, const struct res_id *type, /* Write out accelerator information. */ static void -write_rc_accelerators (FILE *e, const struct accelerator *accelerators) +write_rc_accelerators (FILE *e, const rc_accelerator *accelerators) { - const struct accelerator *acc; + const rc_accelerator *acc; fprintf (e, "BEGIN\n"); for (acc = accelerators; acc != NULL; acc = acc->next) @@ -1926,16 +2382,16 @@ write_rc_accelerators (FILE *e, const struct accelerator *accelerators) && ISPRINT (acc->key) && (acc->flags & ACC_VIRTKEY) == 0) { - fprintf (e, "\"%c\"", acc->key); + fprintf (e, "\"%c\"", (char) acc->key); printable = 1; } else { - fprintf (e, "%d", acc->key); + fprintf (e, "%d", (int) acc->key); printable = 0; } - fprintf (e, ", %d", acc->id); + fprintf (e, ", %d", (int) acc->id); if (! printable) { @@ -1962,41 +2418,60 @@ write_rc_accelerators (FILE *e, const struct accelerator *accelerators) file, which the rc file would include. */ static void -write_rc_cursor (FILE *e, const struct cursor *cursor) +write_rc_cursor (FILE *e, const rc_cursor *cursor) { - fprintf (e, "// Hotspot: x: %d; y: %d\n", cursor->xhotspot, - cursor->yhotspot); - write_rc_filedata (e, cursor->length, cursor->data); + fprintf (e, "BEGIN\n"); + indent (e, 2); + fprintf (e, " 0x%x, 0x%x,\t/* Hotspot x: %d, y: %d. */\n", + (unsigned int) cursor->xhotspot, (unsigned int) cursor->yhotspot, + (int) cursor->xhotspot, (int) cursor->yhotspot); + write_rc_datablock (e, (rc_uint_type) cursor->length, (const bfd_byte *) cursor->data, + 0, 0, 0); + fprintf (e, "END\n"); } /* Write out group cursor data. This would normally be built from the cursor data. */ static void -write_rc_group_cursor (FILE *e, const struct group_cursor *group_cursor) +write_rc_group_cursor (FILE *e, const rc_group_cursor *group_cursor) { - const struct group_cursor *gc; + const rc_group_cursor *gc; + int c; - for (gc = group_cursor; gc != NULL; gc = gc->next) + for (c = 0, gc = group_cursor; gc != NULL; gc = gc->next, c++) + ; + fprintf (e, "BEGIN\n"); + + indent (e, 2); + fprintf (e, "0, 2, %d%s\t /* Having %d items. */\n", c, (c != 0 ? "," : ""), c); + indent (e, 4); + fprintf (e, "/* width, height, planes, bits, bytes, index. */\n"); + + for (c = 1, gc = group_cursor; gc != NULL; gc = gc->next, c++) { - fprintf (e, "// width: %d; height %d; planes %d; bits %d\n", - gc->width, gc->height, gc->planes, gc->bits); - fprintf (e, "// data bytes: %lu; index: %d\n", - gc->bytes, gc->index); + indent (e, 4); + fprintf (e, "%d, %d, %d, %d, 0x%xL, %d%s /* Element %d. */\n", + (int) gc->width, (int) gc->height, (int) gc->planes, (int) gc->bits, + (unsigned int) gc->bytes, (int) gc->index, (gc->next != NULL ? "," : ""), c); + fprintf (e, "/* width: %d; height %d; planes %d; bits %d. */\n", + (int) gc->width, (int) gc->height, (int) gc->planes, + (int) gc->bits); } + fprintf (e, "END\n"); } /* Write dialog data. */ static void -write_rc_dialog (FILE *e, const struct dialog *dialog) +write_rc_dialog (FILE *e, const rc_dialog *dialog) { - const struct dialog_control *control; + const rc_dialog_control *control; - fprintf (e, "STYLE 0x%lx\n", dialog->style); + fprintf (e, "STYLE 0x%x\n", dialog->style); if (dialog->exstyle != 0) - fprintf (e, "EXSTYLE 0x%lx\n", dialog->exstyle); + fprintf (e, "EXSTYLE 0x%x\n", (unsigned int) dialog->exstyle); if ((dialog->class.named && dialog->class.u.n.length > 0) || dialog->class.u.id != 0) @@ -2008,9 +2483,9 @@ write_rc_dialog (FILE *e, const struct dialog *dialog) if (dialog->caption != NULL) { - fprintf (e, "CAPTION \""); - unicode_print (e, dialog->caption, -1); - fprintf (e, "\"\n"); + fprintf (e, "CAPTION "); + unicode_print_quoted (e, dialog->caption, -1); + fprintf (e, "\n"); } if ((dialog->menu.named && dialog->menu.u.n.length > 0) @@ -2023,15 +2498,16 @@ write_rc_dialog (FILE *e, const struct dialog *dialog) if (dialog->font != NULL) { - fprintf (e, "FONT %d, \"", dialog->pointsize); - unicode_print (e, dialog->font, -1); - fprintf (e, "\""); + fprintf (e, "FONT %d, ", (int) dialog->pointsize); + unicode_print_quoted (e, dialog->font, -1); if (dialog->ex != NULL && (dialog->ex->weight != 0 || dialog->ex->italic != 0 || dialog->ex->charset != 1)) fprintf (e, ", %d, %d, %d", - dialog->ex->weight, dialog->ex->italic, dialog->ex->charset); + (int) dialog->ex->weight, + (int) dialog->ex->italic, + (int) dialog->ex->charset); fprintf (e, "\n"); } @@ -2082,7 +2558,7 @@ static const struct control_info control_info[] = /* Write a dialog control. */ static void -write_rc_dialog_control (FILE *e, const struct dialog_control *control) +write_rc_dialog_control (FILE *e, const rc_dialog_control *control) { const struct control_info *ci; @@ -2103,7 +2579,10 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) else if (ci->name != NULL) fprintf (e, "%s", ci->name); else + { fprintf (e, "CONTROL"); + ci = NULL; + } if (control->text.named || control->text.u.id != 0) { @@ -2112,7 +2591,7 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) fprintf (e, ","); } - fprintf (e, " %d, ", control->id); + fprintf (e, " %d, ", (int) control->id); if (ci == NULL) { @@ -2121,10 +2600,10 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) res_id_print (e, control->class, 0); if (control->class.named) fprintf (e, "\""); - fprintf (e, ", 0x%lx, ", control->style); + fprintf (e, ", 0x%x, ", (unsigned int) control->style); } - fprintf (e, "%d, %d", control->x, control->y); + fprintf (e, "%d, %d", (int) control->x, (int) control->y); if (control->style != SS_ICON || control->exstyle != 0 @@ -2132,15 +2611,17 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) || control->height != 0 || control->help != 0) { - fprintf (e, ", %d, %d", control->width, control->height); + fprintf (e, ", %d, %d", (int) control->width, (int) control->height); /* FIXME: We don't need to print the style if it is the default. More importantly, in certain cases we actually need to turn off parts of the forced style, by using NOT. */ - fprintf (e, ", 0x%lx", control->style); + if (ci != NULL) + fprintf (e, ", 0x%x", (unsigned int) control->style); if (control->exstyle != 0 || control->help != 0) - fprintf (e, ", 0x%lx, %lu", control->exstyle, control->help); + fprintf (e, ", 0x%x, %u", (unsigned int) control->exstyle, + (unsigned int) control->help); } fprintf (e, "\n"); @@ -2153,51 +2634,93 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) the font data. */ static void -write_rc_fontdir (FILE *e, const struct fontdir *fontdir) +write_rc_fontdir (FILE *e, const rc_fontdir *fontdir) { - const struct fontdir *fc; + const rc_fontdir *fc; + int c; - for (fc = fontdir; fc != NULL; fc = fc->next) + for (c = 0, fc = fontdir; fc != NULL; fc = fc->next, c++) + ; + fprintf (e, "BEGIN\n"); + indent (e, 2); + fprintf (e, "%d%s\t /* Has %d elements. */\n", c, (c != 0 ? "," : ""), c); + for (c = 1, fc = fontdir; fc != NULL; fc = fc->next, c++) { - fprintf (e, "// Font index: %d\n", fc->index); - write_rc_filedata (e, fc->length, fc->data); + indent (e, 4); + fprintf (e, "%d,\t/* Font no %d with index %d. */\n", + (int) fc->index, c, (int) fc->index); + write_rc_datablock (e, (rc_uint_type) fc->length - 2, + (const bfd_byte *) fc->data + 4,fc->next != NULL, + 0, 0); } + fprintf (e, "END\n"); } /* Write out group icon data. This would normally be built from the icon data. */ static void -write_rc_group_icon (FILE *e, const struct group_icon *group_icon) +write_rc_group_icon (FILE *e, const rc_group_icon *group_icon) { - const struct group_icon *gi; + const rc_group_icon *gi; + int c; - for (gi = group_icon; gi != NULL; gi = gi->next) + for (c = 0, gi = group_icon; gi != NULL; gi = gi->next, c++) + ; + + fprintf (e, "BEGIN\n"); + indent (e, 2); + fprintf (e, " 0, 1, %d%s\t /* Has %d elements. */\n", c, (c != 0 ? "," : ""), c); + + indent (e, 4); + fprintf (e, "/* \"width height colors pad\", planes, bits, bytes, index. */\n"); + for (c = 1, gi = group_icon; gi != NULL; gi = gi->next, c++) { - fprintf (e, "// width: %d; height %d; colors: %d; planes %d; bits %d\n", - gi->width, gi->height, gi->colors, gi->planes, gi->bits); - fprintf (e, "// data bytes: %lu; index: %d\n", - gi->bytes, gi->index); + indent (e, 4); + fprintf (e, "\"\\%03o\\%03o\\%03o\\%03o\", %d, %d, 0x%xL, %d%s\t/* Element no %d. */\n", + gi->width, gi->height, gi->colors, 0, (int) gi->planes, (int) gi->bits, + (unsigned int) gi->bytes, (int) gi->index, (gi->next != NULL ? "," : ""), c); } + fprintf (e, "END\n"); } /* Write out a menu resource. */ static void -write_rc_menu (FILE *e, const struct menu *menu, int menuex) +write_rc_menu (FILE *e, const rc_menu *menu, int menuex) { if (menu->help != 0) - fprintf (e, "// Help ID: %lu\n", menu->help); + fprintf (e, "// Help ID: %u\n", (unsigned int) menu->help); write_rc_menuitems (e, menu->items, menuex, 0); } +static void +write_rc_toolbar (FILE *e, const rc_toolbar *tb) +{ + rc_toolbar_item *it; + indent (e, 0); + fprintf (e, "BEGIN\n"); + it = tb->items; + while(it != NULL) + { + indent (e, 2); + if (it->id.u.id == 0) + fprintf (e, "SEPARATOR\n"); + else + fprintf (e, "BUTTON %d\n", (int) it->id.u.id); + it = it->next; + } + indent (e, 0); + fprintf (e, "END\n"); +} + /* Write out menuitems. */ static void -write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, +write_rc_menuitems (FILE *e, const rc_menuitem *menuitems, int menuex, int ind) { - const struct menuitem *mi; + const rc_menuitem *mi; indent (e, ind); fprintf (e, "BEGIN\n"); @@ -2225,15 +2748,14 @@ write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, fprintf (e, " \"\""); else { - fprintf (e, " \""); - unicode_print (e, mi->text, -1); - fprintf (e, "\""); + fprintf (e, " "); + unicode_print_quoted (e, mi->text, -1); } if (! menuex) { if (mi->popup == NULL) - fprintf (e, ", %d", mi->id); + fprintf (e, ", %d", (int) mi->id); if ((mi->type & MENUITEM_CHECKED) != 0) fprintf (e, ", CHECKED"); @@ -2252,15 +2774,15 @@ write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, { if (mi->id != 0 || mi->type != 0 || mi->state != 0 || mi->help != 0) { - fprintf (e, ", %d", mi->id); + fprintf (e, ", %d", (int) mi->id); if (mi->type != 0 || mi->state != 0 || mi->help != 0) { - fprintf (e, ", %lu", mi->type); + fprintf (e, ", %u", (unsigned int) mi->type); if (mi->state != 0 || mi->help != 0) { - fprintf (e, ", %lu", mi->state); + fprintf (e, ", %u", (unsigned int) mi->state); if (mi->help != 0) - fprintf (e, ", %lu", mi->help); + fprintf (e, ", %u", (unsigned int) mi->help); } } } @@ -2276,158 +2798,332 @@ write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, fprintf (e, "END\n"); } -/* Write out an rcdata resource. This is also used for other types of - resources that need to print arbitrary data. */ - -static void -write_rc_rcdata (FILE *e, const struct rcdata_item *rcdata, int ind) +static int +test_rc_datablock_unicode (rc_uint_type length, const bfd_byte *data) { - const struct rcdata_item *ri; + rc_uint_type i; + if ((length & 1) != 0) + return 0; - indent (e, ind); - fprintf (e, "BEGIN\n"); + for (i = 0; i < length; i += 2) + { + if (data[i] == 0 && data[i + 1] == 0 && (i + 2) < length) + return 0; + if (data[i] == 0xff && data[i + 1] == 0xff) + return 0; + } + return 1; +} - for (ri = rcdata; ri != NULL; ri = ri->next) +static int +test_rc_datablock_text (rc_uint_type length, const bfd_byte *data) +{ + int has_nl; + rc_uint_type c; + rc_uint_type i; + + if (length <= 1) + return 0; + + has_nl = 0; + for (i = 0, c = 0; i < length; i++) { - if (ri->type == RCDATA_BUFFER && ri->u.buffer.length == 0) - continue; + if (! ISPRINT (data[i]) && data[i] != '\n' + && ! (data[i] == '\r' && (i + 1) < length && data[i + 1] == '\n') + && data[i] != '\t' + && ! (data[i] == 0 && (i + 1) != length)) + { + if (data[i] <= 7) + return 0; + c++; + } + else if (data[i] == '\n') has_nl++; + } + if (length > 80 && ! has_nl) + return 0; + c = (((c * 10000) + (i / 100) - 1)) / i; + if (c >= 150) + return 0; + return 1; +} - indent (e, ind + 2); +static void +write_rc_messagetable (FILE *e, rc_uint_type length, const bfd_byte *data) +{ + int has_error = 0; + const struct bin_messagetable *mt; + fprintf (e, "BEGIN\n"); - switch (ri->type) - { - default: - abort (); + write_rc_datablock (e, length, data, 0, 0, 0); - case RCDATA_WORD: - fprintf (e, "%d", ri->u.word); + fprintf (e, "\n"); + wr_printcomment (e, "MC syntax dump"); + if (length < BIN_MESSAGETABLE_SIZE) + has_error = 1; + else + do { + rc_uint_type m, i; + mt = (const struct bin_messagetable *) data; + m = windres_get_32 (&wrtarget, mt->cblocks, length); + if (length < (BIN_MESSAGETABLE_SIZE + m * BIN_MESSAGETABLE_BLOCK_SIZE)) + { + has_error = 1; break; + } + for (i = 0; i < m; i++) + { + rc_uint_type low, high, offset; + const struct bin_messagetable_item *mti; - case RCDATA_DWORD: - fprintf (e, "%luL", ri->u.dword); + low = windres_get_32 (&wrtarget, mt->items[i].lowid, 4); + high = windres_get_32 (&wrtarget, mt->items[i].highid, 4); + offset = windres_get_32 (&wrtarget, mt->items[i].offset, 4); + while (low <= high) + { + rc_uint_type elen, flags; + if ((offset + BIN_MESSAGETABLE_ITEM_SIZE) > length) + { + has_error = 1; break; + } + mti = (const struct bin_messagetable_item *) &data[offset]; + elen = windres_get_16 (&wrtarget, mti->length, 2); + flags = windres_get_16 (&wrtarget, mti->flags, 2); + if ((offset + elen) > length) + { + has_error = 1; + break; + } + wr_printcomment (e, "MessageId = 0x%x", low); + wr_printcomment (e, ""); + if ((flags & MESSAGE_RESOURCE_UNICODE) == MESSAGE_RESOURCE_UNICODE) + unicode_print (e, (const unichar *) mti->data, + (elen - BIN_MESSAGETABLE_ITEM_SIZE) / 2); + else + ascii_print (e, (const char *) mti->data, + (elen - BIN_MESSAGETABLE_ITEM_SIZE)); + wr_printcomment (e,""); + ++low; + offset += elen; + } + } + } while (0); + if (has_error) + wr_printcomment (e, "Illegal data"); + wr_print_flush (e); + fprintf (e, "END\n"); +} - case RCDATA_STRING: - { - const char *s; - unsigned long i; +static void +write_rc_datablock (FILE *e, rc_uint_type length, const bfd_byte *data, int has_next, + int hasblock, int show_comment) +{ + int plen; + if (hasblock) + fprintf (e, "BEGIN\n"); + + if (show_comment == -1) + { + if (test_rc_datablock_text(length, data)) + { + rc_uint_type i, c; + for (i = 0; i < length;) + { + indent (e, 2); + fprintf (e, "\""); + + for (c = 0; i < length && c < 160 && data[i] != '\n'; c++, i++) + ; + if (i < length && data[i] == '\n') + ++i, ++c; + ascii_print (e, (const char *) &data[i - c], c); fprintf (e, "\""); - s = ri->u.string.s; - for (i = 0; i < ri->u.string.length; i++) + if (i < length) + fprintf (e, "\n"); + } + + if (i == 0) { - if (ISPRINT (*s)) - putc (*s, e); - else - fprintf (e, "\\%03o", *s); + indent (e, 2); + fprintf (e, "\"\""); } - fprintf (e, "\""); - break; + if (has_next) + fprintf (e, ","); + fprintf (e, "\n"); + if (hasblock) + fprintf (e, "END\n"); + return; } + if (test_rc_datablock_unicode (length, data)) + { + rc_uint_type i, c; + for (i = 0; i < length;) + { + const unichar *u; - case RCDATA_WSTRING: + u = (const unichar *) &data[i]; + indent (e, 2); fprintf (e, "L\""); - unicode_print (e, ri->u.wstring.w, ri->u.wstring.length); + + for (c = 0; i < length && c < 160 && u[c] != '\n'; c++, i += 2) + ; + if (i < length && u[c] == '\n') + i += 2, ++c; + unicode_print (e, u, c); fprintf (e, "\""); - break; + if (i < length) + fprintf (e, "\n"); + } - case RCDATA_BUFFER: + if (i == 0) { - unsigned long i; - int first; + indent (e, 2); + fprintf (e, "L\"\""); + } + if (has_next) + fprintf (e, ","); + fprintf (e, "\n"); + if (hasblock) + fprintf (e, "END\n"); + return; + } - /* Assume little endian data. */ + show_comment = 0; + } - first = 1; - for (i = 0; i + 3 < ri->u.buffer.length; i += 4) + if (length != 0) { - unsigned long l; - int j; + rc_uint_type i, max_row; + int first = 1; - if (! first) - indent (e, ind + 2); - l = ((((((ri->u.buffer.data[i + 3] << 8) - | ri->u.buffer.data[i + 2]) << 8) - | ri->u.buffer.data[i + 1]) << 8) - | ri->u.buffer.data[i]); - fprintf (e, "%luL", l); - if (i + 4 < ri->u.buffer.length || ri->next != NULL) - fprintf (e, ","); - for (j = 0; j < 4; ++j) - if (! ISPRINT (ri->u.buffer.data[i + j]) - && ri->u.buffer.data[i + j] != 0) - break; - if (j >= 4) + max_row = (show_comment ? 4 : 8); + indent (e, 2); + for (i = 0; i + 3 < length;) { - fprintf (e, "\t// "); - for (j = 0; j < 4; ++j) + rc_uint_type k; + rc_uint_type comment_start; + + comment_start = i; + + if (! first) + indent (e, 2); + + for (k = 0; k < max_row && i + 3 < length; k++, i += 4) { - if (! ISPRINT (ri->u.buffer.data[i + j])) - fprintf (e, "\\%03o", ri->u.buffer.data[i + j]); + if (k == 0) + plen = fprintf (e, "0x%lxL", + (long) windres_get_32 (&wrtarget, data + i, length - i)); else + plen = fprintf (e, " 0x%lxL", + (long) windres_get_32 (&wrtarget, data + i, length - i)) - 1; + if (has_next || (i + 4) < length) { - if (ri->u.buffer.data[i + j] == '\\') - fprintf (e, "\\"); - fprintf (e, "%c", ri->u.buffer.data[i + j]); + if (plen>0 && plen < 11) + indent (e, 11 - plen); + fprintf (e, ","); } } + if (show_comment) + { + fprintf (e, "\t/* "); + ascii_print (e, (const char *) &data[comment_start], i - comment_start); + fprintf (e, ". */"); } fprintf (e, "\n"); first = 0; } - if (i + 1 < ri->u.buffer.length) + if (i + 1 < length) { - int s; - int j; - if (! first) - indent (e, ind + 2); - s = (ri->u.buffer.data[i + 1] << 8) | ri->u.buffer.data[i]; - fprintf (e, "%d", s); - if (i + 2 < ri->u.buffer.length || ri->next != NULL) - fprintf (e, ","); - for (j = 0; j < 2; ++j) - if (! ISPRINT (ri->u.buffer.data[i + j]) - && ri->u.buffer.data[i + j] != 0) - break; - if (j >= 2) + indent (e, 2); + plen = fprintf (e, "0x%x", + (int) windres_get_16 (&wrtarget, data + i, length - i)); + if (has_next || i + 2 < length) { - fprintf (e, "\t// "); - for (j = 0; j < 2; ++j) - { - if (! ISPRINT (ri->u.buffer.data[i + j])) - fprintf (e, "\\%03o", ri->u.buffer.data[i + j]); - else - { - if (ri->u.buffer.data[i + j] == '\\') - fprintf (e, "\\"); - fprintf (e, "%c", ri->u.buffer.data[i + j]); - } + if (plen > 0 && plen < 11) + indent (e, 11 - plen); + fprintf (e, ","); } + if (show_comment) + { + fprintf (e, "\t/* "); + ascii_print (e, (const char *) &data[i], 2); + fprintf (e, ". */"); } fprintf (e, "\n"); i += 2; first = 0; } - if (i < ri->u.buffer.length) + if (i < length) { if (! first) - indent (e, ind + 2); - if ((ri->u.buffer.data[i] & 0x7f) == ri->u.buffer.data[i] - && ISPRINT (ri->u.buffer.data[i])) - fprintf (e, "\"%c\"", ri->u.buffer.data[i]); - else - fprintf (e, "\"\\%03o\"", ri->u.buffer.data[i]); - if (ri->next != NULL) + indent (e, 2); + fprintf (e, "\""); + ascii_print (e, (const char *) &data[i], 1); + fprintf (e, "\""); + if (has_next) fprintf (e, ","); fprintf (e, "\n"); first = 0; } + } + if (hasblock) + fprintf (e, "END\n"); +} + +/* Write out an rcdata resource. This is also used for other types of + resources that need to print arbitrary data. */ +static void +write_rc_rcdata (FILE *e, const rc_rcdata_item *rcdata, int ind) +{ + const rc_rcdata_item *ri; + + indent (e, ind); + fprintf (e, "BEGIN\n"); + + for (ri = rcdata; ri != NULL; ri = ri->next) + { + if (ri->type == RCDATA_BUFFER && ri->u.buffer.length == 0) + continue; + + switch (ri->type) + { + default: + abort (); + + case RCDATA_WORD: + indent (e, ind + 2); + fprintf (e, "%ld", (long) (ri->u.word & 0xffff)); + break; + + case RCDATA_DWORD: + indent (e, ind + 2); + fprintf (e, "%luL", (unsigned long) ri->u.dword); + break; + + case RCDATA_STRING: + indent (e, ind + 2); + fprintf (e, "\""); + ascii_print (e, ri->u.string.s, ri->u.string.length); + fprintf (e, "\""); + break; + + case RCDATA_WSTRING: + indent (e, ind + 2); + fprintf (e, "L\""); + unicode_print (e, ri->u.wstring.w, ri->u.wstring.length); + fprintf (e, "\""); + break; + + case RCDATA_BUFFER: + write_rc_datablock (e, (rc_uint_type) ri->u.buffer.length, + (const bfd_byte *) ri->u.buffer.data, + ri->next != NULL, 0, -1); break; - } } if (ri->type != RCDATA_BUFFER) @@ -2445,17 +3141,17 @@ write_rc_rcdata (FILE *e, const struct rcdata_item *rcdata, int ind) /* Write out a stringtable resource. */ static void -write_rc_stringtable (FILE *e, const struct res_id *name, - const struct stringtable *stringtable) +write_rc_stringtable (FILE *e, const rc_res_id *name, + const rc_stringtable *stringtable) { - unsigned long offset; + rc_uint_type offset; int i; if (name != NULL && ! name->named) offset = (name->u.id - 1) << 4; else { - fprintf (e, "// %s string table name\n", + fprintf (e, "/* %s string table name. */\n", name == NULL ? "Missing" : "Invalid"); offset = 0; } @@ -2466,10 +3162,10 @@ write_rc_stringtable (FILE *e, const struct res_id *name, { if (stringtable->strings[i].length != 0) { - fprintf (e, " %lu, \"", offset + i); - unicode_print (e, stringtable->strings[i].string, + fprintf (e, " %lu, ", (long) offset + i); + unicode_print_quoted (e, stringtable->strings[i].string, stringtable->strings[i].length); - fprintf (e, "\"\n"); + fprintf (e, "\n"); } } @@ -2479,36 +3175,37 @@ write_rc_stringtable (FILE *e, const struct res_id *name, /* Write out a versioninfo resource. */ static void -write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) +write_rc_versioninfo (FILE *e, const rc_versioninfo *versioninfo) { - const struct fixed_versioninfo *f; - const struct ver_info *vi; + const rc_fixed_versioninfo *f; + const rc_ver_info *vi; f = versioninfo->fixed; if (f->file_version_ms != 0 || f->file_version_ls != 0) - fprintf (e, " FILEVERSION %lu, %lu, %lu, %lu\n", - (f->file_version_ms >> 16) & 0xffff, - f->file_version_ms & 0xffff, - (f->file_version_ls >> 16) & 0xffff, - f->file_version_ls & 0xffff); + fprintf (e, " FILEVERSION %u, %u, %u, %u\n", + (unsigned int) ((f->file_version_ms >> 16) & 0xffff), + (unsigned int) (f->file_version_ms & 0xffff), + (unsigned int) ((f->file_version_ls >> 16) & 0xffff), + (unsigned int) (f->file_version_ls & 0xffff)); if (f->product_version_ms != 0 || f->product_version_ls != 0) - fprintf (e, " PRODUCTVERSION %lu, %lu, %lu, %lu\n", - (f->product_version_ms >> 16) & 0xffff, - f->product_version_ms & 0xffff, - (f->product_version_ls >> 16) & 0xffff, - f->product_version_ls & 0xffff); + fprintf (e, " PRODUCTVERSION %u, %u, %u, %u\n", + (unsigned int) ((f->product_version_ms >> 16) & 0xffff), + (unsigned int) (f->product_version_ms & 0xffff), + (unsigned int) ((f->product_version_ls >> 16) & 0xffff), + (unsigned int) (f->product_version_ls & 0xffff)); if (f->file_flags_mask != 0) - fprintf (e, " FILEFLAGSMASK 0x%lx\n", f->file_flags_mask); + fprintf (e, " FILEFLAGSMASK 0x%x\n", (unsigned int) f->file_flags_mask); if (f->file_flags != 0) - fprintf (e, " FILEFLAGS 0x%lx\n", f->file_flags); + fprintf (e, " FILEFLAGS 0x%x\n", (unsigned int) f->file_flags); if (f->file_os != 0) - fprintf (e, " FILEOS 0x%lx\n", f->file_os); + fprintf (e, " FILEOS 0x%x\n", (unsigned int) f->file_os); if (f->file_type != 0) - fprintf (e, " FILETYPE 0x%lx\n", f->file_type); + fprintf (e, " FILETYPE 0x%x\n", (unsigned int) f->file_type); if (f->file_subtype != 0) - fprintf (e, " FILESUBTYPE 0x%lx\n", f->file_subtype); + fprintf (e, " FILESUBTYPE 0x%x\n", (unsigned int) f->file_subtype); if (f->file_date_ms != 0 || f->file_date_ls != 0) - fprintf (e, "// Date: %lu, %lu\n", f->file_date_ms, f->file_date_ls); + fprintf (e, "/* Date: %u, %u. */\n", + (unsigned int) f->file_date_ms, (unsigned int) f->file_date_ls); fprintf (e, "BEGIN\n"); @@ -2518,22 +3215,22 @@ write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) { case VERINFO_STRING: { - const struct ver_stringinfo *vs; + const rc_ver_stringinfo *vs; fprintf (e, " BLOCK \"StringFileInfo\"\n"); fprintf (e, " BEGIN\n"); - fprintf (e, " BLOCK \""); - unicode_print (e, vi->u.string.language, -1); - fprintf (e, "\"\n"); + fprintf (e, " BLOCK "); + unicode_print_quoted (e, vi->u.string.language, -1); + fprintf (e, "\n"); fprintf (e, " BEGIN\n"); for (vs = vi->u.string.strings; vs != NULL; vs = vs->next) { - fprintf (e, " VALUE \""); - unicode_print (e, vs->key, -1); - fprintf (e, "\", \""); - unicode_print (e, vs->value, -1); - fprintf (e, "\"\n"); + fprintf (e, " VALUE "); + unicode_print_quoted (e, vs->key, -1); + fprintf (e, ", "); + unicode_print_quoted (e, vs->value, -1); + fprintf (e, "\n"); } fprintf (e, " END\n"); @@ -2543,17 +3240,16 @@ write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) case VERINFO_VAR: { - const struct ver_varinfo *vv; + const rc_ver_varinfo *vv; fprintf (e, " BLOCK \"VarFileInfo\"\n"); fprintf (e, " BEGIN\n"); - fprintf (e, " VALUE \""); - unicode_print (e, vi->u.var.key, -1); - fprintf (e, "\""); + fprintf (e, " VALUE "); + unicode_print_quoted (e, vi->u.var.key, -1); for (vv = vi->u.var.var; vv != NULL; vv = vv->next) fprintf (e, ", 0x%x, %d", (unsigned int) vv->language, - vv->charset); + (int) vv->charset); fprintf (e, "\n END\n"); @@ -2565,32 +3261,36 @@ write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) fprintf (e, "END\n"); } -/* Write out data which would normally be read from a file. */ - -static void -write_rc_filedata (FILE *e, unsigned long length, const unsigned char *data) +static rc_uint_type +rcdata_copy (const rc_rcdata_item *src, bfd_byte *dst) { - unsigned long i; - - for (i = 0; i + 15 < length; i += 16) - { - fprintf (e, "// %4lx: ", i); - fprintf (e, "%02x %02x %02x %02x %02x %02x %02x %02x ", - data[i + 0], data[i + 1], data[i + 2], data[i + 3], - data[i + 4], data[i + 5], data[i + 6], data[i + 7]); - fprintf (e, "%02x %02x %02x %02x %02x %02x %02x %02x\n", - data[i + 8], data[i + 9], data[i + 10], data[i + 11], - data[i + 12], data[i + 13], data[i + 14], data[i + 15]); - } - - if (i < length) - { - fprintf (e, "// %4lx:", i); - while (i < length) + if (! src) + return 0; + switch (src->type) { - fprintf (e, " %02x", data[i]); - ++i; - } - fprintf (e, "\n"); + case RCDATA_WORD: + if (dst) + windres_put_16 (&wrtarget, dst, (rc_uint_type) src->u.word); + return 2; + case RCDATA_DWORD: + if (dst) + windres_put_32 (&wrtarget, dst, (rc_uint_type) src->u.dword); + return 4; + case RCDATA_STRING: + if (dst && src->u.string.length) + memcpy (dst, src->u.string.s, src->u.string.length); + return (rc_uint_type) src->u.string.length; + case RCDATA_WSTRING: + if (dst && src->u.wstring.length) + memcpy (dst, src->u.wstring.w, src->u.wstring.length * sizeof (unichar)); + return (rc_uint_type) (src->u.wstring.length * sizeof (unichar)); + case RCDATA_BUFFER: + if (dst && src->u.buffer.length) + memcpy (dst, src->u.buffer.data, src->u.buffer.length); + return (rc_uint_type) src->u.buffer.length; + default: + abort (); } + /* Never reached. */ + return 0; } diff --git a/binutils/resres.c b/binutils/resres.c index 1489d5eeda49..f345da3e5de6 100644 --- a/binutils/resres.c +++ b/binutils/resres.c @@ -1,6 +1,8 @@ /* resres.c: read_res_file and write_res_file implementation for windres. - Copyright 1998, 1999, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2001, 2002, 2007 + Free Software Foundation, Inc. Written by Anders Norlander <anorland@hem2.passagen.se>. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -23,6 +25,7 @@ It assumes that it can use fread and fwrite to read and write integers. It does no swapping. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -31,154 +34,179 @@ #include <assert.h> #include <time.h> -struct res_hdr - { - unsigned long data_size; - unsigned long header_size; - }; - -static void write_res_directory - PARAMS ((const struct res_directory *, - const struct res_id *, const struct res_id *, - int *, int)); -static void write_res_resource - PARAMS ((const struct res_id *, const struct res_id *, - const struct res_resource *, int *)); -static void write_res_bin - PARAMS ((const struct res_resource *, const struct res_id *, - const struct res_id *, const struct res_res_info *)); - -static void write_res_id PARAMS ((const struct res_id *)); -static void write_res_info PARAMS ((const struct res_res_info *)); -static void write_res_data PARAMS ((const void *, size_t, int)); -static void write_res_header - PARAMS ((unsigned long, const struct res_id *, const struct res_id *, - const struct res_res_info *)); - -static int read_resource_entry PARAMS ((void)); -static void read_res_data PARAMS ((void *, size_t, int)); -static void read_res_id PARAMS ((struct res_id *)); -static unichar *read_unistring PARAMS ((int *)); -static void skip_null_resource PARAMS ((void)); - -static unsigned long get_id_size PARAMS ((const struct res_id *)); -static void res_align_file PARAMS ((void)); +static rc_uint_type write_res_directory (windres_bfd *, rc_uint_type, + const rc_res_directory *, const rc_res_id *, + const rc_res_id *, rc_uint_type *, int); +static rc_uint_type write_res_resource (windres_bfd *, rc_uint_type,const rc_res_id *, + const rc_res_id *, const rc_res_resource *, + rc_uint_type *); +static rc_uint_type write_res_bin (windres_bfd *, rc_uint_type, const rc_res_resource *, + const rc_res_id *, const rc_res_id *, + const rc_res_res_info *); -static void - res_add_resource - PARAMS ((struct res_resource *, const struct res_id *, - const struct res_id *, int, int)); +static rc_uint_type write_res_id (windres_bfd *, rc_uint_type, const rc_res_id *); +static rc_uint_type write_res_info (windres_bfd *, rc_uint_type, const rc_res_res_info *); +static rc_uint_type write_res_data_hdr (windres_bfd *, rc_uint_type, res_hdr *); -void - res_append_resource - PARAMS ((struct res_directory **, struct res_resource *, - int, const struct res_id *, int)); +static rc_uint_type write_res_header (windres_bfd *, rc_uint_type, rc_uint_type, + const rc_res_id *, const rc_res_id *, + const rc_res_res_info *); + +static int read_resource_entry (windres_bfd *, rc_uint_type *, rc_uint_type); +static void read_res_data (windres_bfd *, rc_uint_type *, rc_uint_type, void *, + rc_uint_type); +static void read_res_data_hdr (windres_bfd *, rc_uint_type *, rc_uint_type, res_hdr *); +static void read_res_id (windres_bfd *, rc_uint_type *, rc_uint_type, rc_res_id *); +static unichar *read_unistring (windres_bfd *, rc_uint_type *, rc_uint_type, rc_uint_type *); +static void skip_null_resource (windres_bfd *, rc_uint_type *, rc_uint_type); +static int probe_binary (windres_bfd *wrbfd, rc_uint_type); + +static unsigned long get_id_size (const rc_res_id *); -static struct res_directory *resources = NULL; +static void res_add_resource (rc_res_resource *, const rc_res_id *, + const rc_res_id *, rc_uint_type, int); + +static void res_append_resource (rc_res_directory **, rc_res_resource *, + int, const rc_res_id *, int); + +static rc_res_directory *resources = NULL; -static FILE *fres; static const char *filename; extern char *program_name; /* Read resource file */ -struct res_directory * -read_res_file (fn) - const char *fn; +rc_res_directory * +read_res_file (const char *fn) { + rc_uint_type off, flen; + windres_bfd wrbfd; + bfd *abfd; + asection *sec; filename = fn; - fres = fopen (filename, "rb"); - if (fres == NULL) - fatal ("can't open `%s' for output: %s", filename, strerror (errno)); - skip_null_resource (); + flen = (rc_uint_type) get_file_size (filename); + if (! flen) + fatal ("can't open '%s' for input.", filename); + abfd = windres_open_as_binary (filename, 1); + sec = bfd_get_section_by_name (abfd, ".data"); + if (sec == NULL) + bfd_fatal ("bfd_get_section_by_name"); + set_windres_bfd (&wrbfd, abfd, sec, + (target_is_bigendian ? WR_KIND_BFD_BIN_B + : WR_KIND_BFD_BIN_L)); + off = 0; + + if (! probe_binary (&wrbfd, flen)) + set_windres_bfd_endianess (&wrbfd, ! target_is_bigendian); - while (read_resource_entry ()) + skip_null_resource (&wrbfd, &off, flen); + + while (read_resource_entry (&wrbfd, &off, flen)) ; - fclose (fres); + bfd_close (abfd); return resources; } /* Write resource file */ void -write_res_file (fn, resdir) - const char *fn; - const struct res_directory *resdir; +write_res_file (const char *fn,const rc_res_directory *resdir) { - int language; - static const unsigned char sign[] = + asection *sec; + rc_uint_type language; + bfd *abfd; + windres_bfd wrbfd; + unsigned long sec_length = 0,sec_length_wrote; + static const bfd_byte sign[] = {0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - long fpos; filename = fn; - fres = fopen (filename, "wb"); - if (fres == NULL) - fatal ("can't open `%s' for output: %s", filename, strerror (errno)); - - /* Write 32 bit resource signature */ - write_res_data (sign, sizeof (sign), 1); - - /* write resources */ + abfd = windres_open_as_binary (filename, 0); + sec = bfd_make_section (abfd, ".data"); + if (sec == NULL) + bfd_fatal ("bfd_make_section"); + if (! bfd_set_section_flags (abfd, sec, + (SEC_HAS_CONTENTS | SEC_ALLOC + | SEC_LOAD | SEC_DATA))) + bfd_fatal ("bfd_set_section_flags"); + /* Requiring this is probably a bug in BFD. */ + sec->output_section = sec; + + set_windres_bfd (&wrbfd, abfd, sec, + (target_is_bigendian ? WR_KIND_BFD_BIN_B + : WR_KIND_BFD_BIN_L)); language = -1; - write_res_directory (resdir, (const struct res_id *) NULL, - (const struct res_id *) NULL, &language, 1); - - /* end file on DWORD boundary */ - fpos = ftell (fres); - if (fpos % 4) - write_res_data (sign, fpos % 4, 1); - - fclose (fres); + sec_length = write_res_directory ((windres_bfd *) NULL, 0x20UL, resdir, + (const rc_res_id *) NULL, + (const rc_res_id *) NULL, &language, 1); + if (! bfd_set_section_size (abfd, sec, (sec_length + 3) & ~3)) + bfd_fatal ("bfd_set_section_size"); + if ((sec_length & 3) != 0) + set_windres_bfd_content (&wrbfd, sign, sec_length, 4-(sec_length & 3)); + set_windres_bfd_content (&wrbfd, sign, 0, sizeof (sign)); + language = -1; + sec_length_wrote = write_res_directory (&wrbfd, 0x20UL, resdir, + (const rc_res_id *) NULL, + (const rc_res_id *) NULL, + &language, 1); + if (sec_length != sec_length_wrote) + fatal ("res write failed with different sizes (%lu/%lu).", (long) sec_length, + (long) sec_length_wrote); + + bfd_close (abfd); + return; } /* Read a resource entry, returns 0 when all resources are read */ static int -read_resource_entry (void) +read_resource_entry (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax) { - struct res_id type; - struct res_id name; - struct res_res_info resinfo; - struct res_hdr reshdr; - long version; + rc_res_id type; + rc_res_id name; + rc_res_res_info resinfo; + res_hdr reshdr; void *buff; - struct res_resource *r; + rc_res_resource *r; + struct bin_res_info l; - res_align_file (); + off[0] = (off[0] + 3) & ~3; /* Read header */ - if (fread (&reshdr, sizeof (reshdr), 1, fres) != 1) + if ((off[0] + 8) > omax) return 0; + read_res_data_hdr (wrbfd, off, omax, &reshdr); /* read resource type */ - read_res_id (&type); + read_res_id (wrbfd, off, omax, &type); /* read resource id */ - read_res_id (&name); + read_res_id (wrbfd, off, omax, &name); - res_align_file (); + off[0] = (off[0] + 3) & ~3; /* Read additional resource header */ - read_res_data (&resinfo.version, sizeof (resinfo.version), 1); - read_res_data (&resinfo.memflags, sizeof (resinfo.memflags), 1); - read_res_data (&resinfo.language, sizeof (resinfo.language), 1); - read_res_data (&version, sizeof (version), 1); - read_res_data (&resinfo.characteristics, sizeof (resinfo.characteristics), 1); + read_res_data (wrbfd, off, omax, &l, BIN_RES_INFO_SIZE); + resinfo.version = windres_get_32 (wrbfd, l.version, 4); + resinfo.memflags = windres_get_16 (wrbfd, l.memflags, 2); + resinfo.language = windres_get_16 (wrbfd, l.language, 2); + /* resinfo.version2 = windres_get_32 (wrbfd, l.version2, 4); */ + resinfo.characteristics = windres_get_32 (wrbfd, l.characteristics, 4); - res_align_file (); + off[0] = (off[0] + 3) & ~3; /* Allocate buffer for data */ buff = res_alloc (reshdr.data_size); /* Read data */ - read_res_data (buff, reshdr.data_size, 1); + read_res_data (wrbfd, off, omax, buff, reshdr.data_size); /* Convert binary data to resource */ - r = bin_to_res (type, buff, reshdr.data_size, 0); + r = bin_to_res (wrbfd, type, buff, reshdr.data_size); r->res_info = resinfo; /* Add resource to resource directory */ res_add_resource (r, &type, &name, resinfo.language, 0); @@ -187,15 +215,12 @@ read_resource_entry (void) } /* write resource directory to binary resource file */ -static void -write_res_directory (rd, type, name, language, level) - const struct res_directory *rd; - const struct res_id *type; - const struct res_id *name; - int *language; - int level; +static rc_uint_type +write_res_directory (windres_bfd *wrbfd, rc_uint_type off, const rc_res_directory *rd, + const rc_res_id *type, const rc_res_id *name, rc_uint_type *language, + int level) { - const struct res_entry *re; + const rc_res_entry *re; for (re = rd->entries; re != NULL; re = re->next) { @@ -218,7 +243,7 @@ write_res_directory (rd, type, name, language, level) case 3: /* If we're at level 3, then this key represents a language. Use it to update the current language. */ - if (!re->id.named + if (! re->id.named && re->id.u.id != (unsigned long) *language && (re->id.u.id & 0xffff) == re->id.u.id) { @@ -231,7 +256,8 @@ write_res_directory (rd, type, name, language, level) } if (re->subdir) - write_res_directory (re->u.dir, type, name, language, level + 1); + off = write_res_directory (wrbfd, off, re->u.dir, type, name, language, + level + 1); else { if (level == 3) @@ -241,25 +267,25 @@ write_res_directory (rd, type, name, language, level) 2, and represents the name to use. We probably just set LANGUAGE, and it will probably match what the resource itself records if anything. */ - write_res_resource (type, name, re->u.res, language); + off = write_res_resource (wrbfd, off, type, name, re->u.res, + language); } else { fprintf (stderr, "// Resource at unexpected level %d\n", level); - write_res_resource (type, (struct res_id *) NULL, re->u.res, - language); + off = write_res_resource (wrbfd, off, type, (rc_res_id *) NULL, + re->u.res, language); } } } + return off; } -static void -write_res_resource (type, name, res, language) - const struct res_id *type; - const struct res_id *name; - const struct res_resource *res; - int *language ATTRIBUTE_UNUSED; +static rc_uint_type +write_res_resource (windres_bfd *wrbfd, rc_uint_type off, const rc_res_id *type, + const rc_res_id *name, const rc_res_resource *res, + rc_uint_type *language ATTRIBUTE_UNUSED) { int rt; @@ -327,6 +353,10 @@ write_res_resource (type, name, res, language) case RES_TYPE_VERSIONINFO: rt = RT_VERSION; break; + + case RES_TYPE_TOOLBAR: + rt = RT_TOOLBAR; + break; } if (rt != 0 @@ -339,35 +369,29 @@ write_res_resource (type, name, res, language) abort (); } - write_res_bin (res, type, name, &res->res_info); - return; + return write_res_bin (wrbfd, off, res, type, name, &res->res_info); } /* Write a resource in binary resource format */ -static void -write_res_bin (res, type, name, resinfo) - const struct res_resource *res; - const struct res_id *type; - const struct res_id *name; - const struct res_res_info *resinfo; +static rc_uint_type +write_res_bin (windres_bfd *wrbfd, rc_uint_type off, const rc_res_resource *res, + const rc_res_id *type, const rc_res_id *name, + const rc_res_res_info *resinfo) { - unsigned long datasize = 0; - const struct bindata *bin_rep, *data; + rc_uint_type noff; + rc_uint_type datasize = 0; - bin_rep = res_to_bin (res, 0); - for (data = bin_rep; data != NULL; data = data->next) - datasize += data->length; + noff = res_to_bin ((windres_bfd *) NULL, off, res); + datasize = noff - off; - write_res_header (datasize, type, name, resinfo); - - for (data = bin_rep; data != NULL; data = data->next) - write_res_data (data->data, data->length, 1); + off = write_res_header (wrbfd, off, datasize, type, name, resinfo); + return res_to_bin (wrbfd, off, res); } /* Get number of bytes needed to store an id in binary format */ static unsigned long get_id_size (id) - const struct res_id *id; + const rc_res_id *id; { if (id->named) return sizeof (unichar) * (id->u.n.length + 1); @@ -376,108 +400,142 @@ get_id_size (id) } /* Write a resource header */ -static void -write_res_header (datasize, type, name, resinfo) - unsigned long datasize; - const struct res_id *type; - const struct res_id *name; - const struct res_res_info *resinfo; +static rc_uint_type +write_res_header (windres_bfd *wrbfd, rc_uint_type off, rc_uint_type datasize, + const rc_res_id *type, const rc_res_id *name, + const rc_res_res_info *resinfo) { - struct res_hdr reshdr; + res_hdr reshdr; reshdr.data_size = datasize; reshdr.header_size = 24 + get_id_size (type) + get_id_size (name); reshdr.header_size = (reshdr.header_size + 3) & ~3; - res_align_file (); - write_res_data (&reshdr, sizeof (reshdr), 1); - write_res_id (type); - write_res_id (name); + off = (off + 3) & ~3; + + off = write_res_data_hdr (wrbfd, off, &reshdr); + off = write_res_id (wrbfd, off, type); + off = write_res_id (wrbfd, off, name); - res_align_file (); + off = (off + 3) & ~3; - write_res_info (resinfo); - res_align_file (); + off = write_res_info (wrbfd, off, resinfo); + off = (off + 3) & ~3; + return off; } +static rc_uint_type +write_res_data_hdr (windres_bfd *wrbfd, rc_uint_type off, res_hdr *hdr) +{ + if (wrbfd) + { + struct bin_res_hdr brh; + windres_put_32 (wrbfd, brh.data_size, hdr->data_size); + windres_put_32 (wrbfd, brh.header_size, hdr->header_size); + set_windres_bfd_content (wrbfd, &brh, off, BIN_RES_HDR_SIZE); + } + return off + BIN_RES_HDR_SIZE; +} -/* Write data to file, abort on failure */ static void -write_res_data (data, size, count) - const void *data; - size_t size; - int count; +read_res_data_hdr (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, + res_hdr *reshdr) { - if ((size_t) fwrite (data, size, count, fres) != (size_t) count) - fatal ("%s: could not write to file", filename); + struct bin_res_hdr brh; + + if ((off[0] + BIN_RES_HDR_SIZE) > omax) + fatal ("%s: unexpected end of file %ld/%ld", filename,(long) off[0], (long) omax); + + get_windres_bfd_content (wrbfd, &brh, off[0], BIN_RES_HDR_SIZE); + reshdr->data_size = windres_get_32 (wrbfd, brh.data_size, 4); + reshdr->header_size = windres_get_32 (wrbfd, brh.header_size, 4); + off[0] += BIN_RES_HDR_SIZE; } /* Read data from file, abort on failure */ static void -read_res_data (data, size, count) - void *data; - size_t size; - int count; +read_res_data (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, void *data, + rc_uint_type size) { - if (fread (data, size, count, fres) != (size_t) count) - fatal ("%s: unexpected end of file", filename); + if ((off[0] + size) > omax) + fatal ("%s: unexpected end of file %ld/%ld %ld", filename,(long) off[0], + (long) omax, (long) size); + get_windres_bfd_content (wrbfd, data, off[0], size); + off[0] += size; } /* Write a resource id */ -static void -write_res_id (id) - const struct res_id *id; +static rc_uint_type +write_res_id (windres_bfd *wrbfd, rc_uint_type off, const rc_res_id *id) { if (id->named) { - unsigned long len = id->u.n.length; - unichar null_term = 0; - write_res_data (id->u.n.name, len * sizeof (unichar), 1); - write_res_data (&null_term, sizeof (null_term), 1); + rc_uint_type len = (((bfd_signed_vma) id->u.n.length < 0 ? 0 : id->u.n.length) + 1); + if (wrbfd) + { + rc_uint_type i; + bfd_byte *d = (bfd_byte *) xmalloc (len * sizeof (unichar)); + for (i = 0; i < (len - 1); i++) + windres_put_16 (wrbfd, d + (i * sizeof (unichar)), id->u.n.name[i]); + windres_put_16 (wrbfd, d + (i * sizeof (unichar)), 0); + set_windres_bfd_content (wrbfd, d, off, (len * sizeof (unichar))); + } + off += (len * sizeof (unichar)); } else { - unsigned short i = 0xFFFF; - write_res_data (&i, sizeof (i), 1); - i = id->u.id; - write_res_data (&i, sizeof (i), 1); + if (wrbfd) + { + struct bin_res_id bid; + windres_put_16 (wrbfd, bid.sig, 0xffff); + windres_put_16 (wrbfd, bid.id, id->u.id); + set_windres_bfd_content (wrbfd, &bid, off, BIN_RES_ID); + } + off += BIN_RES_ID; } + return off; } /* Write resource info */ -static void -write_res_info (info) - const struct res_res_info *info; +static rc_uint_type +write_res_info (windres_bfd *wrbfd, rc_uint_type off, const rc_res_res_info *info) { - write_res_data (&info->version, sizeof (info->version), 1); - write_res_data (&info->memflags, sizeof (info->memflags), 1); - write_res_data (&info->language, sizeof (info->language), 1); - write_res_data (&info->version, sizeof (info->version), 1); - write_res_data (&info->characteristics, sizeof (info->characteristics), 1); + if (wrbfd) + { + struct bin_res_info l; + + windres_put_32 (wrbfd, l.version, info->version); + windres_put_16 (wrbfd, l.memflags, info->memflags); + windres_put_16 (wrbfd, l.language, info->language); + windres_put_32 (wrbfd, l.version2, info->version); + windres_put_32 (wrbfd, l.characteristics, info->characteristics); + set_windres_bfd_content (wrbfd, &l, off, BIN_RES_INFO_SIZE); + } + return off + BIN_RES_INFO_SIZE; } /* read a resource identifier */ -void -read_res_id (id) - struct res_id *id; +static void +read_res_id (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, rc_res_id *id) { + struct bin_res_id bid; unsigned short ord; unichar *id_s = NULL; - int len; + rc_uint_type len; - read_res_data (&ord, sizeof (ord), 1); + read_res_data (wrbfd, off, omax, &bid, BIN_RES_ID - 2); + ord = (unsigned short) windres_get_16 (wrbfd, bid.sig, 2); if (ord == 0xFFFF) /* an ordinal id */ { - read_res_data (&ord, sizeof (ord), 1); + read_res_data (wrbfd, off, omax, bid.id, BIN_RES_ID - 2); id->named = 0; - id->u.id = ord; + id->u.id = windres_get_16 (wrbfd, bid.id, 2); } else /* named id */ { - if (fseek (fres, -sizeof (ord), SEEK_CUR) != 0) - fatal ("%s: %s: could not seek in file", program_name, filename); - id_s = read_unistring (&len); + off[0] -= 2; + id_s = read_unistring (wrbfd, off, omax, &len); id->named = 1; id->u.n.length = len; id->u.n.name = id_s; @@ -486,39 +544,62 @@ read_res_id (id) /* Read a null terminated UNICODE string */ static unichar * -read_unistring (len) - int *len; +read_unistring (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, + rc_uint_type *len) { unichar *s; + bfd_byte d[2]; unichar c; unichar *p; - int l; + rc_uint_type l; + rc_uint_type soff = off[0]; - *len = 0; - l = 0; + do + { + read_res_data (wrbfd, &soff, omax, d, sizeof (unichar)); + c = windres_get_16 (wrbfd, d, 2); + } + while (c != 0); + l = ((soff - off[0]) / sizeof (unichar)); - /* there are hardly any names longer than 256 characters */ - p = s = (unichar *) xmalloc (sizeof (unichar) * 256); + /* there are hardly any names longer than 256 characters, but anyway. */ + p = s = (unichar *) xmalloc (sizeof (unichar) * l); do { - read_res_data (&c, sizeof (c), 1); + read_res_data (wrbfd, off, omax, d, sizeof (unichar)); + c = windres_get_16 (wrbfd, d, 2); *p++ = c; - if (c != 0) - l++; } while (c != 0); - *len = l; + *len = l - 1; return s; } -/* align file on DWORD boundary */ -static void -res_align_file (void) +static int +probe_binary (windres_bfd *wrbfd, rc_uint_type omax) { - int pos = ftell (fres); - int skip = ((pos + 3) & ~3) - pos; - if (fseek (fres, skip, SEEK_CUR) != 0) - fatal ("%s: %s: unable to align file", program_name, filename); + rc_uint_type off; + res_hdr reshdr; + + off = 0; + read_res_data_hdr (wrbfd, &off, omax, &reshdr); + if (reshdr.data_size != 0) + return 1; + if ((reshdr.header_size != 0x20 && ! target_is_bigendian) + || (reshdr.header_size != 0x20000000 && target_is_bigendian)) + return 1; + + /* Subtract size of HeaderSize. DataSize has to be zero. */ + off += 0x20 - BIN_RES_HDR_SIZE; + if ((off + BIN_RES_HDR_SIZE) >= omax) + return 1; + read_res_data_hdr (wrbfd, &off, omax, &reshdr); + /* off is advanced by BIN_RES_HDR_SIZE in read_res_data_hdr() + which is part of reshdr.header_size. We shouldn't take it + into account twice. */ + if ((off - BIN_RES_HDR_SIZE + reshdr.data_size + reshdr.header_size) > omax) + return 0; + return 1; } /* Check if file is a win32 binary resource file, if so @@ -526,16 +607,19 @@ res_align_file (void) error. */ static void -skip_null_resource (void) +skip_null_resource (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax) { - struct res_hdr reshdr = - {0, 0}; - read_res_data (&reshdr, sizeof (reshdr), 1); - if ((reshdr.data_size != 0) || (reshdr.header_size != 0x20)) + res_hdr reshdr; + read_res_data_hdr (wrbfd, off, omax, &reshdr); + if (reshdr.data_size != 0) + goto skip_err; + if ((reshdr.header_size != 0x20 && ! target_is_bigendian) + || (reshdr.header_size != 0x20000000 && target_is_bigendian)) goto skip_err; - /* Subtract size of HeaderSize and DataSize */ - if (fseek (fres, reshdr.header_size - 8, SEEK_CUR) != 0) + /* Subtract size of HeaderSize. DataSize has to be zero. */ + off[0] += 0x20 - BIN_RES_HDR_SIZE; + if (off[0] >= omax) goto skip_err; return; @@ -547,15 +631,11 @@ skip_err: } /* Add a resource to resource directory */ -void -res_add_resource (r, type, id, language, dupok) - struct res_resource *r; - const struct res_id *type; - const struct res_id *id; - int language; - int dupok; +static void +res_add_resource (rc_res_resource *r, const rc_res_id *type, const rc_res_id *id, + rc_uint_type language, int dupok) { - struct res_id a[3]; + rc_res_id a[3]; a[0] = *type; a[1] = *id; @@ -568,21 +648,17 @@ res_add_resource (r, type, id, language, dupok) This is just copied from define_resource and modified to add an existing resource. */ -void -res_append_resource (resources, resource, cids, ids, dupok) - struct res_directory **resources; - struct res_resource *resource; - int cids; - const struct res_id *ids; - int dupok; +static void +res_append_resource (rc_res_directory **resources, rc_res_resource *resource, + int cids, const rc_res_id *ids, int dupok) { - struct res_entry *re = NULL; + rc_res_entry *re = NULL; int i; assert (cids > 0); for (i = 0; i < cids; i++) { - struct res_entry **pp; + rc_res_entry **pp; if (*resources == NULL) { @@ -593,8 +669,8 @@ res_append_resource (resources, resource, cids, ids, dupok) if (timeval == 0) timeval = time (NULL); - *resources = ((struct res_directory *) - res_alloc (sizeof **resources)); + *resources = ((rc_res_directory *) + res_alloc (sizeof (rc_res_directory))); (*resources)->characteristics = 0; (*resources)->time = timeval; (*resources)->major = 0; @@ -610,7 +686,7 @@ res_append_resource (resources, resource, cids, ids, dupok) re = *pp; else { - re = (struct res_entry *) res_alloc (sizeof *re); + re = (rc_res_entry *) res_alloc (sizeof (rc_res_entry)); re->next = NULL; re->id = ids[i]; if ((i + 1) < cids) @@ -629,7 +705,7 @@ res_append_resource (resources, resource, cids, ids, dupok) if ((i + 1) < cids) { - if (!re->subdir) + if (! re->subdir) { fprintf (stderr, "%s: ", program_name); res_ids_print (stderr, i, ids); diff --git a/binutils/size.c b/binutils/size.c index b78cba02ba04..f83b050506b8 100644 --- a/binutils/size.c +++ b/binutils/size.c @@ -1,6 +1,6 @@ /* size.c -- report size of various sections of an executable file. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -28,10 +28,11 @@ If you write shell scripts which manipulate this info then you may be out of luck; there's no --compatibility or --pedantic option. */ +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "getopt.h" +#include "bucomm.h" #ifndef BSD_DEFAULT #define BSD_DEFAULT 1 @@ -98,7 +99,7 @@ usage (FILE *stream, int status) #endif ); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } @@ -346,7 +347,10 @@ display_file (char *filename) bfd *file; if (get_file_size (filename) < 1) - return; + { + return_code = 1; + return; + } file = bfd_openr (filename, target); if (file == NULL) diff --git a/binutils/srconv.c b/binutils/srconv.c index d1f3efdb9e01..906432f6dba4 100644 --- a/binutils/srconv.c +++ b/binutils/srconv.c @@ -1,6 +1,6 @@ /* srconv.c -- Sysroff conversion program Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,6 +26,7 @@ All debugging information is preserved */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "sysroff.h" @@ -704,6 +705,7 @@ walk_tree_type_1 (struct coff_sfile *sfile, struct coff_symbol *symbol, { struct IT_dpt dpt; + dpt.dunno = 0; walk_tree_type_1 (sfile, symbol, type->u.pointer.points_to, nest + 1); dpt.neg = 0x1001; sysroff_swap_dpt_out (file, &dpt); @@ -1728,7 +1730,7 @@ show_usage (FILE *file, int status) -h --help Display this information\n\ -v --version Print the program's version number\n")); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/stabs.c b/binutils/stabs.c index 879a3e2c7a70..c8fc77dab2f6 100644 --- a/binutils/stabs.c +++ b/binutils/stabs.c @@ -1,6 +1,6 @@ /* stabs.c -- Parse stabs debugging information - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. This file is part of GNU Binutils. @@ -25,10 +25,8 @@ code. The job it does is somewhat different, because it is not trying to identify the correct address for anything. */ -#include <stdio.h> - +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "safe-ctype.h" #include "demangle.h" @@ -1696,12 +1694,12 @@ parse_stab_range_type (void *dhandle, struct stab_handle *info, const char *type #define ULLHIGH "01777777777777777777777;" if (index_type == DEBUG_TYPE_NULL) { - if (strncmp (s2, LLLOW, sizeof LLLOW - 1) == 0 - && strncmp (s3, LLHIGH, sizeof LLHIGH - 1) == 0) + if (CONST_STRNEQ (s2, LLLOW) + && CONST_STRNEQ (s3, LLHIGH)) return debug_make_int_type (dhandle, 8, FALSE); if (! ov2 && n2 == 0 - && strncmp (s3, ULLHIGH, sizeof ULLHIGH - 1) == 0) + && CONST_STRNEQ (s3, ULLHIGH)) return debug_make_int_type (dhandle, 8, TRUE); } @@ -2832,7 +2830,7 @@ parse_stab_argtypes (void *dhandle, struct stab_handle *info, && (ISDIGIT (argtypes[2]) || argtypes[2] == 'Q' || argtypes[2] == 't')) - || strncmp (argtypes, "__ct", 4) == 0); + || CONST_STRNEQ (argtypes, "__ct")); is_constructor = (is_full_physname_constructor || (tagname != NULL @@ -2840,7 +2838,7 @@ parse_stab_argtypes (void *dhandle, struct stab_handle *info, is_destructor = ((argtypes[0] == '_' && (argtypes[1] == '$' || argtypes[1] == '.') && argtypes[2] == '_') - || strncmp (argtypes, "__dt", 4) == 0); + || CONST_STRNEQ (argtypes, "__dt")); is_v3 = argtypes[0] == '_' && argtypes[1] == 'Z'; if (is_destructor || is_full_physname_constructor || is_v3) @@ -3841,7 +3839,7 @@ stab_demangle_function_name (struct stab_demangle_info *minfo, *pp = scan + 2; if (*pp - name >= 5 - && strncmp (name, "type", 4) == 0 + && CONST_STRNEQ (name, "type") && (name[4] == '$' || name[4] == '.')) { const char *tem; diff --git a/binutils/strings.c b/binutils/strings.c index a04cb581eaea..2238574bac04 100644 --- a/binutils/strings.c +++ b/binutils/strings.c @@ -1,6 +1,6 @@ /* strings -- print the strings of printable characters in files Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,6 +46,7 @@ littleendian 32-bit. --target=BFDNAME + -T {bfdname} Specify a non-default object file format. --help @@ -57,17 +58,13 @@ Written by Richard Stallman <rms@gnu.ai.mit.edu> and David MacKenzie <djm@gnu.ai.mit.edu>. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "sysdep.h" #include "bfd.h" -#include <stdio.h> #include "getopt.h" -#include <errno.h> -#include "bucomm.h" #include "libiberty.h" #include "safe-ctype.h" #include <sys/stat.h> +#include "bucomm.h" /* Some platforms need to put stdin into binary mode, to read binary files. */ @@ -195,7 +192,7 @@ main (int argc, char **argv) target = NULL; encoding = 's'; - while ((optc = getopt_long (argc, argv, "afhHn:ot:e:Vv0123456789", + while ((optc = getopt_long (argc, argv, "afhHn:ot:e:T:Vv0123456789", long_options, (int *) 0)) != EOF) { switch (optc) @@ -721,7 +718,7 @@ usage (FILE *stream, int status) -h --help Display this information\n\ -v --version Print the program's version number\n")); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/sysdep.h b/binutils/sysdep.h new file mode 100644 index 000000000000..9627b46d459c --- /dev/null +++ b/binutils/sysdep.h @@ -0,0 +1,174 @@ +/* sysdep.h -- handle host dependencies for binutils + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _BIN_SYSDEP_H +#define _BIN_SYSDEP_H + +#include "ansidecl.h" +#include <stdio.h> +#include <sys/types.h> + +#include "bfdver.h" +#include "config.h" + +#include <stdarg.h> + +#ifdef USE_BINARY_FOPEN +#include "fopen-bin.h" +#else +#include "fopen-same.h" +#endif + +#include <errno.h> +#ifndef errno +extern int errno; +#endif + +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#ifdef HAVE_STRING_H +#include <string.h> +#else +#ifdef HAVE_STRINGS_H +#include <strings.h> +#else +extern char *strchr (); +extern char *strrchr (); +#endif +#endif + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#else +#ifdef HAVE_SYS_FILE_H +#include <sys/file.h> +#endif +#endif + +#if !HAVE_DECL_STPCPY +extern char *stpcpy (char *, const char *); +#endif + +#if !HAVE_DECL_STRSTR +extern char *strstr (); +#endif + +#ifdef HAVE_SBRK +#if !HAVE_DECL_SBRK +extern char *sbrk (); +#endif +#endif + +#if !HAVE_DECL_GETENV +extern char *getenv (); +#endif + +#if !HAVE_DECL_ENVIRON +extern char **environ; +#endif + +#if !HAVE_DECL_FPRINTF +extern int fprintf (FILE *, const char *, ...); +#endif + +#if !HAVE_DECL_SNPRINTF +extern int snprintf(char *, size_t, const char *, ...); +#endif + +#if !HAVE_DECL_VSNPRINTF +extern int vsnprintf(char *, size_t, const char *, va_list); +#endif + +#ifndef O_RDONLY +#define O_RDONLY 0 +#endif + +#ifndef O_RDWR +#define O_RDWR 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#if defined(__GNUC__) && !defined(C_ALLOCA) +# undef alloca +# define alloca __builtin_alloca +#else +# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA) +# include <alloca.h> +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +# if !defined (__STDC__) && !defined (__hpux) +char *alloca (); +# else +void *alloca (); +# endif /* __STDC__, __hpux */ +# endif /* alloca */ +# endif /* HAVE_ALLOCA_H */ +#endif + +#ifdef HAVE_LOCALE_H +# ifndef ENABLE_NLS + /* The Solaris version of locale.h always includes libintl.h. If we have + been configured with --disable-nls then ENABLE_NLS will not be defined + and the dummy definitions of bindtextdomain (et al) below will conflict + with the defintions in libintl.h. So we define these values to prevent + the bogus inclusion of libintl.h. */ +# define _LIBINTL_H +# define _LIBGETTEXT_H +# endif +# include <locale.h> +#endif + +#ifdef ENABLE_NLS +# include <libintl.h> +# define _(String) gettext (String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define gettext(Msgid) (Msgid) +# define dgettext(Domainname, Msgid) (Msgid) +# define dcgettext(Domainname, Msgid, Category) (Msgid) +# define textdomain(Domainname) while (0) /* nothing */ +# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ +# define _(String) (String) +# define N_(String) (String) +#endif + +/* Used by ar.c and objcopy.c. */ +#define BUFSIZE 8192 + +#endif /* _BIN_SYSDEP_H */ diff --git a/binutils/sysdump.c b/binutils/sysdump.c index ec19472558fd..2f924692064a 100644 --- a/binutils/sysdump.c +++ b/binutils/sysdump.c @@ -1,5 +1,5 @@ /* Sysroff object format dumper. - Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -25,13 +25,12 @@ This program reads a SYSROFF object file and prints it in an almost human readable form to stdout. */ +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "safe-ctype.h" - -#include <stdio.h> #include "libiberty.h" #include "getopt.h" +#include "bucomm.h" #include "sysroff.h" static int dump = 1; @@ -644,7 +643,7 @@ show_usage (FILE *file, int status) -h --help Display this information\n\ -v --version Print the program's version number\n")); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/sysinfo.c b/binutils/sysinfo.c deleted file mode 100644 index a8426ff71fef..000000000000 --- a/binutils/sysinfo.c +++ /dev/null @@ -1,1804 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - COND = 258, - REPEAT = 259, - TYPE = 260, - NAME = 261, - NUMBER = 262, - UNIT = 263 - }; -#endif -/* Tokens. */ -#define COND 258 -#define REPEAT 259 -#define TYPE 260 -#define NAME 261 -#define NUMBER 262 -#define UNIT 263 - - - - -/* Copy the first part of user declarations. */ -#line 20 "sysinfo.y" - -#include <stdio.h> -#include <stdlib.h> - -static char writecode; -static char *it; -static int code; -static char * repeat; -static char *oldrepeat; -static char *name; -static int rdepth; -static char *names[] = {" ","[n]","[n][m]"}; -static char *pnames[]= {"","*","**"}; - -static int yyerror (char *s); -extern int yylex (void); - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 39 "sysinfo.y" -typedef union YYSTYPE { - int i; - char *s; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 124 "sysinfo.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 136 "sysinfo.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 38 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 11 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 19 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 27 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 55 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 263 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 5, 6, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 7, 8, 9, 10 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 11, 12, 19, 22, - 25, 28, 29, 30, 37, 38, 45, 46, 57, 59, - 60, 64, 67, 71, 72, 73, 77, 78 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 12, 0, -1, -1, 13, 14, -1, 15, 14, -1, - -1, -1, 5, 8, 9, 16, 17, 6, -1, 22, - 17, -1, 20, 17, -1, 18, 17, -1, -1, -1, - 5, 4, 8, 19, 17, 6, -1, -1, 5, 3, - 8, 21, 17, 6, -1, -1, 5, 25, 5, 24, - 26, 6, 27, 23, 28, 6, -1, 7, -1, -1, - 5, 8, 6, -1, 9, 10, -1, 5, 8, 6, - -1, -1, -1, 5, 29, 6, -1, -1, 29, 5, - 8, 8, 6, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 53, 53, 53, 91, 92, 97, 96, 174, 175, - 176, 177, 181, 180, 228, 227, 255, 254, 362, 363, - 367, 372, 378, 379, 382, 383, 385, 387 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "COND", "REPEAT", "'('", "')'", "TYPE", - "NAME", "NUMBER", "UNIT", "$accept", "top", "@1", "it_list", "it", "@2", - "it_field_list", "repeat_it_field", "@3", "cond_it_field", "@4", - "it_field", "@5", "attr_type", "attr_desc", "attr_size", "attr_id", - "enums", "enum_list", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 40, 41, 260, 261, 262, - 263 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 11, 13, 12, 14, 14, 16, 15, 17, 17, - 17, 17, 19, 18, 21, 20, 23, 22, 24, 24, - 25, 26, 27, 27, 28, 28, 29, 29 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 0, 2, 2, 0, 0, 6, 2, 2, - 2, 0, 0, 6, 0, 6, 0, 10, 1, 0, - 3, 2, 3, 0, 0, 3, 0, 5 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 2, 0, 5, 1, 0, 3, 5, 0, 4, 6, - 11, 0, 0, 11, 11, 11, 0, 0, 0, 0, - 7, 10, 9, 8, 14, 12, 0, 19, 11, 11, - 20, 18, 0, 0, 0, 0, 0, 15, 13, 21, - 23, 0, 16, 0, 24, 22, 26, 0, 0, 17, - 0, 25, 0, 0, 27 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 1, 2, 5, 6, 10, 12, 13, 29, 14, - 28, 15, 44, 32, 19, 36, 42, 47, 48 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -14 -static const yysigned_char yypact[] = -{ - -14, 8, 4, -14, 2, -14, 4, 3, -14, -14, - 6, 0, 7, 6, 6, 6, 9, 10, 11, 15, - -14, -14, -14, -14, -14, -14, 16, 14, 6, 6, - -14, -14, 5, 17, 18, 19, 20, -14, -14, -14, - 22, 23, -14, 24, 27, -14, -14, 28, 1, -14, - 25, -14, 29, 30, -14 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -14, -14, -14, 32, -14, -14, -13, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const unsigned char yytable[] = -{ - 21, 22, 23, 16, 17, 18, 50, 51, 3, 4, - 7, 11, 9, 20, 35, 33, 34, 24, 25, 26, - 27, 31, 30, 37, 38, 0, 40, 41, 0, 39, - 45, 43, 46, 52, 49, 0, 54, 53, 8 -}; - -static const yysigned_char yycheck[] = -{ - 13, 14, 15, 3, 4, 5, 5, 6, 0, 5, - 8, 5, 9, 6, 9, 28, 29, 8, 8, 8, - 5, 7, 6, 6, 6, -1, 6, 5, -1, 10, - 6, 8, 5, 8, 6, -1, 6, 8, 6 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 12, 13, 0, 5, 14, 15, 8, 14, 9, - 16, 5, 17, 18, 20, 22, 3, 4, 5, 25, - 6, 17, 17, 17, 8, 8, 8, 5, 21, 19, - 6, 7, 24, 17, 17, 9, 26, 6, 6, 10, - 6, 5, 27, 8, 23, 6, 5, 28, 29, 6, - 5, 6, 8, 8, 6 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 53 "sysinfo.y" - { - switch (writecode) - { - case 'i': - printf("#ifdef SYSROFF_SWAP_IN\n"); - break; - case 'p': - printf("#ifdef SYSROFF_p\n"); - break; - case 'd': - break; - case 'g': - printf("#ifdef SYSROFF_SWAP_OUT\n"); - break; - case 'c': - printf("#ifdef SYSROFF_PRINT\n"); - printf("#include <stdio.h>\n"); - printf("#include <stdlib.h>\n"); - printf("#include <ansidecl.h>\n"); - break; - } - } - break; - - case 3: -#line 75 "sysinfo.y" - { - switch (writecode) { - case 'i': - case 'p': - case 'g': - case 'c': - printf("#endif\n"); - break; - case 'd': - break; - } -} - break; - - case 6: -#line 97 "sysinfo.y" - { - it = (yyvsp[-1].s); code = (yyvsp[0].i); - switch (writecode) - { - case 'd': - printf("\n\n\n#define IT_%s_CODE 0x%x\n", it,code); - printf("struct IT_%s;\n", it); - printf("extern void sysroff_swap_%s_in PARAMS ((struct IT_%s *));\n", - (yyvsp[-1].s), it); - printf("extern void sysroff_swap_%s_out PARAMS ((FILE *, struct IT_%s *));\n", - (yyvsp[-1].s), it); - printf("extern void sysroff_print_%s_out PARAMS ((struct IT_%s *));\n", - (yyvsp[-1].s), it); - printf("struct IT_%s { \n", it); - break; - case 'i': - printf("void sysroff_swap_%s_in(ptr)\n",(yyvsp[-1].s)); - printf("struct IT_%s *ptr;\n", it); - printf("{\n"); - printf("unsigned char raw[255];\n"); - printf("\tint idx = 0 ;\n"); - printf("\tint size;\n"); - printf("memset(raw,0,255);\n"); - printf("memset(ptr,0,sizeof(*ptr));\n"); - printf("size = fillup(raw);\n"); - break; - case 'g': - printf("void sysroff_swap_%s_out(file,ptr)\n",(yyvsp[-1].s)); - printf("FILE * file;\n"); - printf("struct IT_%s *ptr;\n", it); - printf("{\n"); - printf("\tunsigned char raw[255];\n"); - printf("\tint idx = 16 ;\n"); - printf("\tmemset (raw, 0, 255);\n"); - printf("\tcode = IT_%s_CODE;\n", it); - break; - case 'o': - printf("void sysroff_swap_%s_out(abfd,ptr)\n",(yyvsp[-1].s)); - printf("bfd * abfd;\n"); - printf("struct IT_%s *ptr;\n",it); - printf("{\n"); - printf("int idx = 0 ;\n"); - break; - case 'c': - printf("void sysroff_print_%s_out(ptr)\n",(yyvsp[-1].s)); - printf("struct IT_%s *ptr;\n", it); - printf("{\n"); - printf("itheader(\"%s\", IT_%s_CODE);\n",(yyvsp[-1].s),(yyvsp[-1].s)); - break; - - case 't': - break; - } - - } - break; - - case 7: -#line 154 "sysinfo.y" - { - switch (writecode) { - case 'd': - printf("};\n"); - break; - case 'g': - printf("\tchecksum(file,raw, idx, IT_%s_CODE);\n", it); - - case 'i': - - case 'o': - case 'c': - printf("}\n"); - } -} - break; - - case 12: -#line 181 "sysinfo.y" - { - rdepth++; - switch (writecode) - { - case 'c': - if (rdepth==1) - printf("\tprintf(\"repeat %%d\\n\", %s);\n",(yyvsp[0].s)); - if (rdepth==2) - printf("\tprintf(\"repeat %%d\\n\", %s[n]);\n",(yyvsp[0].s)); - case 'i': - case 'g': - case 'o': - - if (rdepth==1) - { - printf("\t{ int n; for (n = 0; n < %s; n++) {\n", (yyvsp[0].s)); - } - if (rdepth == 2) { - printf("\t{ int m; for (m = 0; m < %s[n]; m++) {\n", (yyvsp[0].s)); - } - - break; - } - - oldrepeat = repeat; - repeat = (yyvsp[0].s); - } - break; - - case 13: -#line 211 "sysinfo.y" - { - repeat = oldrepeat; - oldrepeat =0; - rdepth--; - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\t}}\n"); - } - } - break; - - case 14: -#line 228 "sysinfo.y" - { - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\tif (%s) {\n", (yyvsp[0].s)); - break; - } - } - break; - - case 15: -#line 241 "sysinfo.y" - { - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\t}\n"); - } - } - break; - - case 16: -#line 255 "sysinfo.y" - {name = (yyvsp[0].s); } - break; - - case 17: -#line 257 "sysinfo.y" - { - char *desc = (yyvsp[-8].s); - char *type = (yyvsp[-6].s); - int size = (yyvsp[-5].i); - char *id = (yyvsp[-3].s); -char *p = names[rdepth]; -char *ptr = pnames[rdepth]; - switch (writecode) - { - case 'g': - if (size % 8) - { - - printf("\twriteBITS(ptr->%s%s,raw,&idx,%d);\n", - id, - names[rdepth], size); - - } - else { - printf("\twrite%s(ptr->%s%s,raw,&idx,%d,file);\n", - type, - id, - names[rdepth],size/8); - } - break; - case 'i': - { - - if (rdepth >= 1) - - { - printf("if (!ptr->%s) ptr->%s = (%s*)xcalloc(%s, sizeof(ptr->%s[0]));\n", - id, - id, - type, - repeat, - id); - } - - if (rdepth == 2) - { - printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)xcalloc(%s[n], sizeof(ptr->%s[n][0]));\n", - id, - id, - type, - repeat, - id); - } - - } - - if (size % 8) - { - printf("\tptr->%s%s = getBITS(raw,&idx, %d,size);\n", - id, - names[rdepth], - size); - } - else { - printf("\tptr->%s%s = get%s(raw,&idx, %d,size);\n", - id, - names[rdepth], - type, - size/8); - } - break; - case 'o': - printf("\tput%s(raw,%d,%d,&idx,ptr->%s%s);\n", type,size/8,size%8,id,names[rdepth]); - break; - case 'd': - if (repeat) - printf("\t/* repeat %s */\n", repeat); - - if (type[0] == 'I') { - printf("\tint %s%s; \t/* %s */\n",ptr,id, desc); - } - else if (type[0] =='C') { - printf("\tchar %s*%s;\t /* %s */\n",ptr,id, desc); - } - else { - printf("\tbarray %s%s;\t /* %s */\n",ptr,id, desc); - } - break; - case 'c': - printf("tabout();\n"); - printf("\tprintf(\"/*%-30s*/ ptr->%s = \");\n", desc, id); - - if (type[0] == 'I') - printf("\tprintf(\"%%d\\n\",ptr->%s%s);\n", id,p); - else if (type[0] == 'C') - printf("\tprintf(\"%%s\\n\",ptr->%s%s);\n", id,p); - - else if (type[0] == 'B') - { - printf("\tpbarray(&ptr->%s%s);\n", id,p); - } - else abort(); - break; - } - } - break; - - case 18: -#line 362 "sysinfo.y" - { (yyval.s) = (yyvsp[0].s); } - break; - - case 19: -#line 363 "sysinfo.y" - { (yyval.s) = "INT";} - break; - - case 20: -#line 368 "sysinfo.y" - { (yyval.s) = (yyvsp[-1].s); } - break; - - case 21: -#line 373 "sysinfo.y" - { (yyval.i) = (yyvsp[-1].i) * (yyvsp[0].i); } - break; - - case 22: -#line 378 "sysinfo.y" - { (yyval.s) = (yyvsp[-1].s); } - break; - - case 23: -#line 379 "sysinfo.y" - { (yyval.s) = "dummy";} - break; - - case 27: -#line 387 "sysinfo.y" - { - switch (writecode) - { - case 'd': - printf("#define %s %s\n", (yyvsp[-2].s),(yyvsp[-1].s)); - break; - case 'c': - printf("if (ptr->%s%s == %s) { tabout(); printf(\"%s\\n\");}\n", name, names[rdepth],(yyvsp[-1].s),(yyvsp[-2].s)); - } - } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 1503 "sysinfo.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 402 "sysinfo.y" - -/* four modes - - -d write structure definitions for sysroff in host format - -i write functions to swap into sysroff format in - -o write functions to swap into sysroff format out - -c write code to print info in human form */ - -int yydebug; - -int -main (int ac, char **av) -{ - yydebug=0; - if (ac > 1) - writecode = av[1][1]; -if (writecode == 'd') - { - printf("typedef struct { unsigned char *data; int len; } barray; \n"); - printf("typedef int INT;\n"); - printf("typedef char * CHARS;\n"); - - } - yyparse(); -return 0; -} - -static int -yyerror (char *s) -{ - fprintf(stderr, "%s\n" , s); - return 0; -} - diff --git a/binutils/sysinfo.h b/binutils/sysinfo.h deleted file mode 100644 index a608d69f82b3..000000000000 --- a/binutils/sysinfo.h +++ /dev/null @@ -1,67 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - COND = 258, - REPEAT = 259, - TYPE = 260, - NAME = 261, - NUMBER = 262, - UNIT = 263 - }; -#endif -/* Tokens. */ -#define COND 258 -#define REPEAT 259 -#define TYPE 260 -#define NAME 261 -#define NUMBER 262 -#define UNIT 263 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 39 "sysinfo.y" -typedef union YYSTYPE { - int i; - char *s; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 59 "sysinfo.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/syslex.c b/binutils/syslex.c deleted file mode 100644 index 48aab40d1659..000000000000 --- a/binutils/syslex.c +++ /dev/null @@ -1,1729 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/syslex.c,v 1.1.16.1 2006/04/16 18:36:41 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include <stdio.h> -#include <errno.h> - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include <stdlib.h> -#ifndef _WIN32 -#include <unistd.h> -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include <io.h> -#include <stdlib.h> -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 25 -#define YY_END_OF_BUFFER 26 -static yyconst short int yy_accept[81] = - { 0, - 0, 0, 26, 25, 7, 8, 5, 25, 1, 2, - 11, 11, 6, 3, 4, 25, 25, 25, 25, 25, - 25, 25, 0, 9, 11, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, - 13, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 12, 15, 0, 23, 0, 0, 0, 0, 0, - 0, 14, 18, 0, 0, 0, 0, 0, 17, 0, - 24, 0, 0, 0, 20, 22, 0, 21, 19, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 1, 5, 1, 1, 1, 1, 1, 6, - 7, 1, 1, 1, 1, 1, 1, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 1, 10, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 11, 1, 12, 1, 1, 1, 13, 14, 15, 16, - - 17, 18, 19, 20, 21, 1, 1, 22, 1, 23, - 24, 25, 1, 26, 27, 28, 29, 30, 1, 31, - 32, 33, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[34] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 3, 3, 1, - 1, 1, 3, 3, 3, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1 - } ; - -static yyconst short int yy_base[84] = - { 0, - 0, 0, 100, 101, 101, 101, 101, 94, 101, 101, - 26, 28, 0, 101, 101, 82, 26, 18, 74, 79, - 78, 81, 88, 101, 32, 0, 0, 76, 65, 62, - 61, 75, 20, 59, 61, 66, 58, 0, 57, 56, - 54, 63, 53, 62, 54, 101, 59, 48, 53, 46, - 59, 101, 44, 43, 101, 41, 55, 46, 53, 44, - 31, 101, 101, 39, 27, 21, 39, 19, 101, 35, - 101, 33, 26, 29, 101, 101, 28, 101, 101, 101, - 58, 61, 41 - } ; - -static yyconst short int yy_def[84] = - { 0, - 80, 1, 80, 80, 80, 80, 80, 81, 80, 80, - 80, 80, 82, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 81, 80, 80, 83, 82, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 83, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, - 80, 80, 80 - } ; - -static yyconst short int yy_nxt[135] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 4, 4, 4, 4, 4, - 19, 4, 4, 4, 4, 20, 21, 4, 4, 22, - 4, 4, 4, 25, 25, 25, 25, 32, 29, 25, - 25, 33, 44, 38, 79, 78, 30, 77, 45, 76, - 75, 74, 73, 72, 71, 70, 26, 31, 23, 23, - 23, 27, 69, 27, 68, 67, 66, 65, 64, 63, - 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, - 52, 51, 50, 49, 48, 47, 46, 43, 42, 41, - 40, 39, 24, 37, 36, 35, 34, 28, 24, 80, - - 3, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80 - } ; - -static yyconst short int yy_chk[135] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 11, 11, 12, 12, 18, 17, 25, - 25, 18, 33, 83, 77, 74, 17, 73, 33, 72, - 70, 68, 67, 66, 65, 64, 11, 17, 81, 81, - 81, 82, 61, 82, 60, 59, 58, 57, 56, 54, - 53, 51, 50, 49, 48, 47, 45, 44, 43, 42, - 41, 40, 39, 37, 36, 35, 34, 32, 31, 30, - 29, 28, 23, 22, 21, 20, 19, 16, 8, 3, - - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "syslex.l" -#define INITIAL 0 -#line 2 "syslex.l" -/* Copyright 2001, 2003, 2005 Free Software Foundation, Inc. - -This file is part of GNU Binutils. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GLD; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA -02110-1301, USA. */ - -#include "config.h" -#ifdef HAVE_STRING_H -#include <string.h> -#else -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif -#endif -#include "sysinfo.h" - -#define YY_NO_UNPUT - -#ifndef yywrap -static int yywrap (void) { return 1; } -#endif - -extern int yylex (void); -#line 457 "syslex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 39 "syslex.l" - -#line 621 "syslex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 101 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 40 "syslex.l" -{ return '(';} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 41 "syslex.l" -{ return ')';} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 42 "syslex.l" -{ return '[';} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 43 "syslex.l" -{ return ']';} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 44 "syslex.l" -{ ; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 45 "syslex.l" -{ ; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 46 "syslex.l" -{ ; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 47 "syslex.l" -{ ; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 48 "syslex.l" -{ - yylval.s = malloc (yyleng - 1); - memcpy (yylval.s, yytext + 1, yyleng - 2); - yylval.s[yyleng - 2] = '\0'; - return NAME; - } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 55 "syslex.l" -{ - yylval.i = strtol(yytext,0,16); - return NUMBER; - } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 60 "syslex.l" -{ - yylval.i = atoi(yytext); - return NUMBER; - } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 66 "syslex.l" -{ yylval.i =1 ;return UNIT;} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 67 "syslex.l" -{ yylval.i = 1; return UNIT;} - YY_BREAK -case 14: -YY_RULE_SETUP -#line 68 "syslex.l" -{ yylval.i= 8; return UNIT;} - YY_BREAK -case 15: -YY_RULE_SETUP -#line 69 "syslex.l" -{ yylval.i = 8; return UNIT;} - YY_BREAK -case 16: -YY_RULE_SETUP -#line 71 "syslex.l" -{ yylval.s = "INT"; return TYPE;} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 72 "syslex.l" -{ yylval.s = "BARRAY"; return TYPE;} - YY_BREAK -case 18: -YY_RULE_SETUP -#line 73 "syslex.l" -{ yylval.s = "CHARS"; return TYPE;} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 74 "syslex.l" -{ yylval.i = 0; return NUMBER;} - YY_BREAK -case 20: -YY_RULE_SETUP -#line 75 "syslex.l" -{ yylval.i = -4; return NUMBER;} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 76 "syslex.l" -{ yylval.i = -2; return NUMBER; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 77 "syslex.l" -{ yylval.i = -1; return NUMBER; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 78 "syslex.l" -{ return COND;} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 79 "syslex.l" -{ return REPEAT;} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 80 "syslex.l" -ECHO; - YY_BREAK -#line 840 "syslex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 80); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include <unistd.h> -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 80 "syslex.l" diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index a7e6ad6d975a..ee8d32ec7e0c 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,195 @@ +2007-06-23 H.J. Lu <hongjiu.lu@intel.com> + + * binutils-all/strip-3.d: Also strip .xtensa.info section. + +2007-05-24 Kai Tietz <Kai.Tietz@onevision.com> + + * binutils-all/windres/version_cat.rc: New. + * binutils-all/windres/version_cat.rsd: New. + +2007-05-23 Kai Tietz <Kai.Tietz@onevision.com> + + * binutils-all/windres/html.rc: New. + * binutils-all/windres/html.rsd: New. + * binutils-all/windres/html1.hm: New. + * binutils-all/windres/html2.hm: New. + * binutils-all/windres/messagetable.rc: New. + * binutils-all/windres/messagetable.rsd: New. + * binutils-all/windres/MSG00001.bin: New. + * binutils-all/windres/strtab2.rc: New. + * binutils-all/windres/strtab2.rsd: New. + * binutils-all/windres/version.rc: New. + * binutils-all/windres/version.rsd: New. + * binutils-all/windres/dialog.rsd: Fix expected results. + +2007-05-17 Joseph Myers <joseph@codesourcery.com> + + * binutils-all/strip-3.d: Strip .pdr section. + +2007-05-15 Alan Modra <amodra@bigpond.net.au> + + * binutils-all/objcopy.exp: Only run needed-by-reloc test for ELF. + +2007-05-11 Alan Modra <amodra@bigpond.net.au> + + * binutils-all/needed-by-reloc.s: Use .long rather than .4byte. + +2007-05-08 Mark Shinwell <shinwell@codesourcery.com> + + * binutils-all/strip-3.d: Strip .ARM.attributes and .reginfo + sections. + +2007-05-02 Alan Modra <amodra@bigpond.net.au> + + * binutils-all/objcopy.exp (copy_setup): Don't perror, use send_log. + (copy_executable): Return early if test2 is blank. + Return unsupported rather than unresolved if we can't run + executables. Do test1 if we can compile. + +2007-04-24 Nathan Froyd <froydnj@codesourcery.com> + Phil Edwards <phil@codesourcery.com> + + * binutils-all/objcopy.exp: Add test for stripping a symbol + used in a relocation. + * binutils-all/needed-by-reloc.s: New file. + +2007-04-20 Nathan Froyd <froydnj@codesourcery.com> + Phil Edwards <phil@codesourcery.com> + Thomas de Lellis <tdel@windriver.com> + + * binutils-all/objcopy.exp: Add test for --reverse-bytes. + +2007-04-21 Richard Earnshaw <rearnsha@arm.com> + + * binutils-all/readelf.exp (regexp_diff): Delete. + +2007-04-20 Richard Earnshaw <rearnsha@arm.com> + + * binutils-all/arm/thumb2-cond.s: Allow for tab expansion by the pty. + Rename the second test. + +2007-04-12 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/4348 + * binutils-all/empty.s: New file. + * binutils-all/strip-3.d: Likewise. + + * binutils-all/objcopy.exp: Run strip-3 for ELF target. + +2007-02-27 Nathan Sidwell <nathan@codesourcery.com> + + * binutils-all/objcopy.exp: Skip for uclinux targets. + +2007-02-14 Nick Clifton <nickc@redhat.com> + + * binutils-all/readelf.exp (readelf_wi_test): Fix unexpected + output failure message. + +2007-01-08 Kai Tietz <kai.tietz@onevision.com> + + * copy-3.d: Renamed target x86_64-*-mingw64 to x86_64-*-mingw* + * dlltool.exp: Dito + * lang.rc: Dito + * strtab1.rc: Dito + * windres.exp: Dito + +2006-09-20 Kai Tietz <Kai.Tietz@onevision.com> + + * binutils-all/copy-3.d: Add support for target x86_64-pc-mingw64. + * binutils-all/dlltool.exp: Likewise. + * binutils-all/objcopy.exp: Likewise. + * binutils-all/windres/windres.exp: Likewise. + * binutils-all/windres/lang.rc: xfail it as long as there is no windows.h. + * binutils-all/windres/strtab1.rc: Likewise. + * lib/utils-lib.exp: Adjust executable prefix detection (as .exe). + +2006-09-14 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/3181 + * binutils-all/objcopy.exp: Run strip-1 and strip-2 for ELF + targets. + + * binutils-all/strip-1.d: New file. + * binutils-all/strip-2.d: Likewise. + + * lib/utils-lib.exp (run_dump_test): Support strip. + +2006-08-15 Thiemo Seufer <ths@mips.com> + Nigel Stephens <nigel@mips.com> + David Ung <davidu@mips.com> + + * binutils-all/readelf.exp (readelf_test): Handle mips*-sde-elf*. + +2006-06-24 Richard Sandiford <richard@codesourcery.com> + + * binutils-all/localize-hidden-1.d: Use objdump --syms instead + of readelf. + +2006-06-23 Richard Sandiford <richard@codesourcery.com> + + * binutils-all/localize-hidden-1.s, + * binutils-all/localize-hidden-1.d, + * binutils-all/localize-hidden-2.s, + * binutils-all/localize-hidden-2.d: New tests. + * binutils-all/objcopy.exp: Run them. + +2006-06-06 Paul Brook <paul@codesourcery.com> + + * binutils-all/arm/objdump.exp: New file. + * binutils-all/arm/thumb2-cond.s: New test. + +2006-05-03 H.J. Lu <hongjiu.lu@intel.com> + + * binutils-all/copy-3.d: Fix a typo. + +2006-05-03 H.J. Lu <hongjiu.lu@intel.com> + + * binutils-all/copy-3.d: New. + + * objcopy.exp: Run copy-3. + +2006-05-02 Dave Korn <dave.korn@artimi.com> + + * binutils-all/copy-1.d (name): Correct spelling of 'setting'. + * binutils-all/copy-1.d (name): Likewise. + +2006-05-02 Nick Clifton <nickc@redhat.com> + + * binutils-all/copy-2.d: Change the name of the section whose + flags are changed to "foo" so that the test will work with PE + based targets. Skip this test for AOUT based targeted. + * binutils-all/copytest.s: New file. + +2006-05-01 H.J. Lu <hongjiu.lu@intel.com> + + * binutils-all/objcopy.exp: Run "copy-1" for ELF only. + +2006-05-01 Ben Elliston <bje@au.ibm.com> + + * binutils-all/objcopy.exp (objcopy_test_readelf): Remove stray ; + +2006-04-26 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/2593 + * binutils-all/copy-1.d: New file. + * binutils-all/copy-1.s: Likewise. + * binutils-all/copy-2.d: Likewise. + + * binutils-all/objcopy.exp: Add run_dump_test "copy-1" and + run_dump_test "copy-2". + + * lib/utils-lib.exp (run_dump_test): New. + (slurp_options): Likewise. + (regexp_diff): Likewise. + (file_contents): Likewise. + (verbose_eval): Likewise. + +2006-04-25 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/2467 + * binutils-all/objcopy.exp (strip_test): Also test "strip -g" + on archive. + 2006-04-10 H.J. Lu <hongjiu.lu@intel.com> * lib/utils-lib.exp (default_binutils_run): Check exit status. diff --git a/binutils/testsuite/binutils-all/arm/objdump.exp b/binutils/testsuite/binutils-all/arm/objdump.exp new file mode 100644 index 000000000000..4677a48585c2 --- /dev/null +++ b/binutils/testsuite/binutils-all/arm/objdump.exp @@ -0,0 +1,63 @@ +# Copyright 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +if {![istarget "arm*-*-*"]} then { + return +} + +if {[which $OBJDUMP] == 0} then { + perror "$OBJDUMP does not exist" + return +} + +send_user "Version [binutil_version $OBJDUMP]" + +########################### +# Set up the test of movem.s +########################### + +if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} then { + return +} + +if [is_remote host] { + set objfile [remote_download host tmpdir/thumb2-cond.o] +} else { + set objfile tmpdir/thumb2-cond.o +} + +# Make sure that conditional instructions are correctly decoded. + +set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"] + +set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr" + +if [regexp $want $got] then { + pass "thumb2-cond test1" +} else { + fail "thumb2-cond test1" +} + +set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"] + +set want "bx\[ \t\]*lr" + +if [regexp $want $got] then { + pass "thumb2-cond test2" +} else { + fail "thumb2-cond test2" +} diff --git a/binutils/testsuite/binutils-all/arm/thumb2-cond.s b/binutils/testsuite/binutils-all/arm/thumb2-cond.s new file mode 100644 index 000000000000..95761e17a676 --- /dev/null +++ b/binutils/testsuite/binutils-all/arm/thumb2-cond.s @@ -0,0 +1,6 @@ +.thumb +foo: +.short 0xf000, 0xf800 +.short 0xbf38 +.short 0xf000, 0xbf04 +bx lr diff --git a/binutils/testsuite/binutils-all/copy-1.d b/binutils/testsuite/binutils-all/copy-1.d new file mode 100644 index 000000000000..f2b0d9e90df7 --- /dev/null +++ b/binutils/testsuite/binutils-all/copy-1.d @@ -0,0 +1,13 @@ +#PROG: objcopy +#objdump: -h +#objcopy: --set-section-flags .post_text_reserve=contents,alloc,load,readonly,code +#name: copy with setting section flags 1 + +.*: +file format .* + +Sections: +Idx.* +#... + [0-9]* .post_text_reserve.* + CONTENTS, ALLOC, LOAD, READONLY, CODE +#... diff --git a/binutils/testsuite/binutils-all/copy-1.s b/binutils/testsuite/binutils-all/copy-1.s new file mode 100644 index 000000000000..32864de76ed8 --- /dev/null +++ b/binutils/testsuite/binutils-all/copy-1.s @@ -0,0 +1,6 @@ + .globl text_symbol + .text +text_symbol: + .long 1 + .section .post_text_reserve,"w", %nobits + .space 160 diff --git a/binutils/testsuite/binutils-all/copy-2.d b/binutils/testsuite/binutils-all/copy-2.d new file mode 100644 index 000000000000..8a1ab593858f --- /dev/null +++ b/binutils/testsuite/binutils-all/copy-2.d @@ -0,0 +1,18 @@ +#PROG: objcopy +#objdump: -h +#objcopy: --set-section-flags foo=contents,alloc,load,code +#name: copy with setting section flags 2 +#source: copytest.s +#not-target: *-*-aout +# Note - we use copytest.s and a section named "foo" rather +# than .text because for some file formats (eg PE) the .text +# section has a fixed set of flags and these cannot be changed. + +.*: +file format .* + +Sections: +Idx.* +#... + [0-9]* foo.* + CONTENTS, ALLOC, LOAD, CODE +#... diff --git a/binutils/testsuite/binutils-all/copy-3.d b/binutils/testsuite/binutils-all/copy-3.d new file mode 100644 index 000000000000..1b07817cd230 --- /dev/null +++ b/binutils/testsuite/binutils-all/copy-3.d @@ -0,0 +1,17 @@ +#PROG: objcopy +#objdump: -h +#objcopy: --set-section-flags .text=alloc,data +#name: copy with setting section flags 3 +#source: bintest.s +#not-target: *-*-aout *-*-*pe *-*-*coff i*86-*-cygwin* i*86-*-mingw32* x86_64-*-mingw* +# The .text # section in PE/COFF has a fixed set of flags and these +# cannot be changed. We skip it for them. + +.*: +file format .* + +Sections: +Idx.* +#... + [0-9]* .text.* + CONTENTS, ALLOC, LOAD, RELOC, DATA +#... diff --git a/binutils/testsuite/binutils-all/copytest.s b/binutils/testsuite/binutils-all/copytest.s new file mode 100644 index 000000000000..33c13b881a6c --- /dev/null +++ b/binutils/testsuite/binutils-all/copytest.s @@ -0,0 +1,7 @@ + .globl foo_symbol + .section foo +foo_symbol: + .long 1 + .section bar +bar_symbol: + .long 2 diff --git a/binutils/testsuite/binutils-all/dlltool.exp b/binutils/testsuite/binutils-all/dlltool.exp index 6ddfcfae9b0c..af0145d48d1c 100644 --- a/binutils/testsuite/binutils-all/dlltool.exp +++ b/binutils/testsuite/binutils-all/dlltool.exp @@ -1,4 +1,4 @@ -# Copyright 2002, 2004 Free Software Foundation, Inc. +# Copyright 2002, 2004, 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,13 +14,14 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -if {![istarget "i*86-*-*"]} { +if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw*"] } { return } if {![istarget "i*86-*-*pe*"] \ && ![istarget "i*86-*-cygwin*"] \ - && ![istarget "i*86-*-mingw32*"] } { + && ![istarget "i*86-*-mingw32*"] \ + && ![istarget "x86_64-*-mingw*"] } { set target_xfail "yes" } else { set target_xfail "no" diff --git a/binutils/testsuite/binutils-all/empty.s b/binutils/testsuite/binutils-all/empty.s new file mode 100644 index 000000000000..8690c06ad8e3 --- /dev/null +++ b/binutils/testsuite/binutils-all/empty.s @@ -0,0 +1 @@ +# An empty file. diff --git a/binutils/testsuite/binutils-all/localize-hidden-1.d b/binutils/testsuite/binutils-all/localize-hidden-1.d new file mode 100644 index 000000000000..a5286ed1e814 --- /dev/null +++ b/binutils/testsuite/binutils-all/localize-hidden-1.d @@ -0,0 +1,19 @@ +#PROG: objcopy +#objdump: --syms +#objcopy: --localize-hidden +#name: --localize-hidden test 1 +#... +0+1200 l .*\*ABS\* 0+ \.hidden Lhidden +0+1300 l .*\*ABS\* 0+ \.internal Linternal +0+1400 l .*\*ABS\* 0+ \.protected Lprotected +0+1100 l .*\*ABS\* 0+ Ldefault +#... +0+2200 l .*\*ABS\* 0+ \.hidden Ghidden +0+2300 l .*\*ABS\* 0+ \.internal Ginternal +0+3200 l .*\*ABS\* 0+ \.hidden Whidden +0+3300 l .*\*ABS\* 0+ \.internal Winternal +0+2100 g .*\*ABS\* 0+ Gdefault +0+2400 g .*\*ABS\* 0+ \.protected Gprotected +0+3100 w.*\*ABS\* 0+ Wdefault +0+3400 w.*\*ABS\* 0+ \.protected Wprotected +#pass diff --git a/binutils/testsuite/binutils-all/localize-hidden-1.s b/binutils/testsuite/binutils-all/localize-hidden-1.s new file mode 100644 index 000000000000..bdaa69d0c08b --- /dev/null +++ b/binutils/testsuite/binutils-all/localize-hidden-1.s @@ -0,0 +1,36 @@ + .globl Gdefault + .globl Ghidden + .globl Ginternal + .globl Gprotected + + .weak Wdefault + .weak Whidden + .weak Winternal + .weak Wprotected + + .hidden Lhidden + .hidden Ghidden + .hidden Whidden + + .internal Linternal + .internal Ginternal + .internal Winternal + + .protected Lprotected + .protected Gprotected + .protected Wprotected + + .equ Ldefault, 0x1100 + .equ Lhidden, 0x1200 + .equ Linternal, 0x1300 + .equ Lprotected, 0x1400 + + .equ Gdefault, 0x2100 + .equ Ghidden, 0x2200 + .equ Ginternal, 0x2300 + .equ Gprotected, 0x2400 + + .equ Wdefault, 0x3100 + .equ Whidden, 0x3200 + .equ Winternal, 0x3300 + .equ Wprotected, 0x3400 diff --git a/binutils/testsuite/binutils-all/localize-hidden-2.d b/binutils/testsuite/binutils-all/localize-hidden-2.d new file mode 100644 index 000000000000..ed3807aefbcf --- /dev/null +++ b/binutils/testsuite/binutils-all/localize-hidden-2.d @@ -0,0 +1,7 @@ +#PROG: objcopy +#nm: -n +#objcopy: --localize-hidden +#name: --localize-hidden test 2 +#... +0+100 A G +#pass diff --git a/binutils/testsuite/binutils-all/localize-hidden-2.s b/binutils/testsuite/binutils-all/localize-hidden-2.s new file mode 100644 index 000000000000..d428c3aa4708 --- /dev/null +++ b/binutils/testsuite/binutils-all/localize-hidden-2.s @@ -0,0 +1,2 @@ + .globl G + .equ G,0x100 diff --git a/binutils/testsuite/binutils-all/needed-by-reloc.s b/binutils/testsuite/binutils-all/needed-by-reloc.s new file mode 100644 index 000000000000..40ebdedfe90f --- /dev/null +++ b/binutils/testsuite/binutils-all/needed-by-reloc.s @@ -0,0 +1,7 @@ + .globl foo + + .data + .long foo + .text +foo: + .long 1 diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 23e537ea76ac..72338df350bd 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -1,5 +1,5 @@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004 +# 2004, 2006, 2007 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -113,6 +113,40 @@ proc objcopy_test {testname srcfile} { objcopy_test "simple copy" bintest.s +# Test reversing bytes in a section. + +set reversed ${tempfile}-reversed +set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS -j .data --reverse-bytes=4 $tempfile $reversed"] + +if ![string match "" $got] then { + fail "objcopy --reverse-bytes" +} else { + if [is_remote host] { + remote_upload host ${reversed} tmpdir/copy-reversed.o + set reversed tmpdir/copy-reversed.o + } + + set origdata [binutils_run $OBJDUMP "$OBJDUMPFLAGS -s -j .data $tempfile"] + set revdata [binutils_run $OBJDUMP "$OBJDUMPFLAGS -s -j .data $reversed"] + + set want "^ \[0-9\]+ (\[0-9\]+)" + set found_orig [regexp -lineanchor $want $origdata -> origdata] + set found_rev [regexp -lineanchor $want $revdata -> revdata] + + if {$found_orig == 0 || $found_rev == 0} then { + fail "objcopy --reverse-bytes" + } else { + scan $origdata "%2x%2x%2x%2x" b1 b2 b3 b4 + scan $revdata "%2x%2x%2x%2x" c4 c3 c2 c1 + + if {$b1 == $c1 && $b2 == $c2 && $b3 == $c3 && $b4 == $c4} then { + pass "objcopy --reverse-bytes" + } else { + fail "objcopy --reverse-bytes" + } + } +} + # Test generating S records. # We make the srec filename 8.3 compatible. Note that the header string @@ -359,6 +393,12 @@ proc strip_test { } { return } + set exec_output [binutils_run $STRIP "-g $archive"] + if ![string match "" $exec_output] { + fail $test + return + } + set exec_output [binutils_run $STRIP "$STRIPFLAGS $archive"] if ![string match "" $exec_output] { fail $test @@ -437,7 +477,7 @@ strip_test_with_saving_a_symbol # Build a final executable. -if { [istarget *-*-cygwin] || [istarget *-*-mingw32] } { +if { [istarget *-*-cygwin] || [istarget *-*-mingw*] } { set test_prog "testprog.exe" } else { set test_prog "testprog" @@ -452,6 +492,10 @@ proc copy_setup { } { set res [build_wrapper testglue.o] set flags { debug } + if { [istarget *-*-uclinux*] } { + return 1 + } + if { $res != "" } { lappend flags "additional_flags=[lindex $res 1]" set add_libs "testglue.o" @@ -472,7 +516,7 @@ proc copy_setup { } { set status [lindex $result 0] if { $status != "pass" } { - perror "unresolved setup, status = $status" + send_log "cannot run executable, status = ${status}\n" return 3 } @@ -497,6 +541,9 @@ proc copy_executable { prog flags test1 test2 } { if ![string match "" $exec_output] { fail $test1 + if [string match "" $test2] { + return + } fail $test2 return } @@ -538,6 +585,10 @@ proc copy_executable { prog flags test1 test2 } { fail $test1 } + if [string match "" $test2] { + return + } + set output [remote_load target tmpdir/copyprog] set status [lindex $output 0] if { $status != "pass" } { @@ -649,10 +700,10 @@ switch [copy_setup] { untested $test4 } "3" { - unresolved $test1 - unresolved $test2 - unresolved $test3 - unresolved $test4 + copy_executable "$OBJCOPY" "$OBJCOPYFLAGS" "$test1" "" + unsupported $test2 + unsupported $test3 + unsupported $test4 } "0" { copy_executable "$OBJCOPY" "$OBJCOPYFLAGS" "$test1" "$test2" @@ -677,7 +728,7 @@ proc objcopy_test_readelf {testname srcfile} { catch "exec $OBJCOPY $OBJCOPYFLAGS tmpdir/bintest.o tmpdir/copy.o" exec_output if ![string match "" $exec_output] then { fail "objcopy ($testname)" - return; + return } verbose -log "$READELF -a tmpdir/bintest.o > tmpdir/bintest.o.out" @@ -717,4 +768,36 @@ if { ([istarget "ia64-*-elf*"] if [is_elf_format] { objcopy_test "ELF unknown section type" unknown.s objcopy_test_readelf "ELF group" group.s + run_dump_test "copy-1" +} + +run_dump_test "copy-2" +run_dump_test "copy-3" + +if [is_elf_format] { + run_dump_test "strip-1" + run_dump_test "strip-2" + run_dump_test "strip-3" + + if { [istarget "i*86-*"] || [istarget "x86_64-*-*"] } { + # Check to make sure we don't strip a symbol named in relocations. + set test "objcopy keeps symbols needed by relocs" + + set srcfile $srcdir/$subdir/needed-by-reloc.s + + if {![binutils_assemble $srcfile tmpdir/bintest.o]} then { + unresolved $test + } else { + set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS --strip-symbol=foo tmpdir/bintest.o ${copyfile}.o"] + + if [regexp "not stripping symbol `foo' because it is named in a relocation" $got] { + pass $test + } else { + fail $test + } + } + } + + run_dump_test "localize-hidden-1" } +run_dump_test "localize-hidden-2" diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp index 8815fee59241..814ae7caa565 100644 --- a/binutils/testsuite/binutils-all/readelf.exp +++ b/binutils/testsuite/binutils-all/readelf.exp @@ -31,108 +31,6 @@ proc file_contents { filename } { return $contents } -# regexp_diff, based on simple_diff taken from ld test suite -# compares two files line-by-line -# file1 contains strings, file2 contains regexps and #-comments -# blank lines are ignored in either file -# returns non-zero if differences exist -# -proc regexp_diff { file_1 file_2 } { - - set eof -1 - set end_1 0 - set end_2 0 - set differences 0 - set diff_pass 0 - - if [file exists $file_1] then { - set file_a [open $file_1 r] - } else { - warning "$file_1 doesn't exist" - return 1 - } - - if [file exists $file_2] then { - set file_b [open $file_2 r] - } else { - fail "$file_2 doesn't exist" - close $file_a - return 1 - } - - verbose " Regexp-diff'ing: $file_1 $file_2" 2 - - while { 1 } { - set line_a "" - set line_b "" - while { [string length $line_a] == 0 } { - if { [gets $file_a line_a] == $eof } { - set end_1 1 - break - } - } - while { [string length $line_b] == 0 || [string match "#*" $line_b] } { - if [ string match "#pass" $line_b ] { - set end_2 1 - set diff_pass 1 - break - } elseif [ string match "#..." $line_b ] { - if { [gets $file_b line_b] == $eof } { - set end_2 1 - break - } - verbose "looking for \"^$line_b$\"" 3 - while { ![regexp "^$line_b$" "$line_a"] } { - verbose "skipping \"$line_a\"" 3 - if { [gets $file_a line_a] == $eof } { - set end_1 1 - break - } - } - break - } - if { [gets $file_b line_b] == $eof } { - set end_2 1 - break - } - } - - if { $diff_pass } { - break - } elseif { $end_1 && $end_2 } { - break - } elseif { $end_1 } { - send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n" - verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3 - set differences 1 - break - } elseif { $end_2 } { - send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" - verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3 - set differences 1 - break - } else { - verbose "regexp \"^$line_b$\"\nline \"$line_a\"" 3 - if ![regexp "^$line_b$" "$line_a"] { - send_log "regexp_diff match failure\n" - send_log "regexp \"^$line_b$\"\nline \"$line_a\"\n" - set differences 1 - } - } - } - - if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } { - send_log "$file_1 and $file_2 are different lengths\n" - verbose "$file_1 and $file_2 are different lengths" 3 - set differences 1 - } - - close $file_a - close $file_b - - return $differences -} - # Find out the size by reading the output of the EI_CLASS field. # Similar to the test for readelf -h, but we're just looking for the # EI_CLASS line here. @@ -193,7 +91,7 @@ proc readelf_test { options binary_file regexp_file xfails } { set target_machine "" if [istarget "mips*-*-*"] then { - if { [istarget "mips*-*-*linux*"] } then { + if { [istarget "mips*-*-*linux*"] || [istarget "mips*-sde-elf*"] } then { set target_machine tmips } else { set target_machine mips @@ -260,7 +158,7 @@ proc readelf_wi_test {} { set got [prune_readelf_wi_warnings $got] if ![string match "" $got] then { - fail "readelf $options (reason: unexpected output)" + fail "readelf $READELFFLAGS -wi (reason: unexpected output)" send_log $got send_log "\n" return diff --git a/binutils/testsuite/binutils-all/strip-1.d b/binutils/testsuite/binutils-all/strip-1.d new file mode 100644 index 000000000000..200983211ea9 --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-1.d @@ -0,0 +1,11 @@ +#PROG: strip +#source: group.s +#readelf: -Sg --wide +#name: strip with section group 1 + +#... + \[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AX[ \t]+.* +#... + \[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WA[ \t]+.* +#... +There are no section groups in this file. diff --git a/binutils/testsuite/binutils-all/strip-2.d b/binutils/testsuite/binutils-all/strip-2.d new file mode 100644 index 000000000000..5c54b7ecb824 --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-2.d @@ -0,0 +1,18 @@ +#PROG: strip +#source: group.s +#strip: --strip-unneeded +#readelf: -Sg --wide +#name: strip with section group 2 + +#... + \[[ 0-9]+\] foo_group[ \t]+GROUP[ \t]+.* +#... + \[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG[ \t]+.* +#... + \[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG[ \t]+.* +#... +COMDAT group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 2 sections: + \[Index\] Name + \[[ 0-9]+\] .text.* + \[[ 0-9]+\] .data.* +#pass diff --git a/binutils/testsuite/binutils-all/strip-3.d b/binutils/testsuite/binutils-all/strip-3.d new file mode 100644 index 000000000000..d65669770017 --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-3.d @@ -0,0 +1,11 @@ +#PROG: strip +#source: empty.s +#strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .pdr -R .xtensa.info +#readelf: -S --wide +#name: strip empty file +#target: *-*-linux* + +#... + \[[ 0]+\][ \t]+NULL[ \t]+.* + \[[ 1]+\] \.shstrtab.*[ \t]+STRTAB[ \t]+.* +#pass diff --git a/binutils/testsuite/binutils-all/windres/MSG00001.bin b/binutils/testsuite/binutils-all/windres/MSG00001.bin Binary files differnew file mode 100644 index 000000000000..0092b8341525 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/MSG00001.bin diff --git a/binutils/testsuite/binutils-all/windres/dialogid.rsd b/binutils/testsuite/binutils-all/windres/dialogid.rsd index 1e6bb1885dc7..6c655a1c1178 100644 --- a/binutils/testsuite/binutils-all/windres/dialogid.rsd +++ b/binutils/testsuite/binutils-all/windres/dialogid.rsd @@ -9,10 +9,10 @@ Contents of section .data: 0040 0100ffff 00000000 00000000 00008880 ................ 0050 02000000 0000c800 c8000000 00000000 ................ 0060 00000000 00000000 4d000050 0b000b00 ........M..P.... - 0070 5300a200 ffff0000 63006c00 61007300 S.......c.l.a.s. - 0080 73006e00 61006d00 65000000 ffff6c00 s.n.a.m.e.....l. + 0070 5300a200 ffffffff 43004c00 41005300 S.......C.L.A.S. + 0080 53004e00 41004d00 45000000 ffff6c00 S.N.A.M.E.....l. 0090 00000000 00000000 00000000 0e120050 ...............P - 00a0 05000500 0a000a00 66000000 63006c00 ........f...c.l. - 00b0 61007300 73006e00 61006d00 65000000 a.s.s.n.a.m.e... + 00a0 05000500 0a000a00 66000000 43004c00 ........f...C.L. + 00b0 41005300 53004e00 41004d00 45000000 A.S.S.N.A.M.E... 00c0 73007400 72006900 6e006700 69006400 s.t.r.i.n.g.i.d. 00d0 00000000 .... diff --git a/binutils/testsuite/binutils-all/windres/html.rc b/binutils/testsuite/binutils-all/windres/html.rc new file mode 100644 index 000000000000..ead6a11829c2 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/html.rc @@ -0,0 +1,7 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +129 HTML "html1.hm" +130 HTML "html2.hm" diff --git a/binutils/testsuite/binutils-all/windres/html.rsd b/binutils/testsuite/binutils-all/windres/html.rsd new file mode 100644 index 000000000000..c124a82b662f --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/html.rsd @@ -0,0 +1,45 @@ + +html.res: file format binary + +Contents of section .data: + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 0d010000 20000000 ffff1700 ffff8100 .... ........... + 0030 00000000 30100704 00000000 00000000 ....0........... + 0040 3c21444f 43545950 4520646f 63747970 <!DOCTYPE doctyp + 0050 65205055 424c4943 20222d2f 2f773363 e PUBLIC "-//w3c + 0060 2f2f6474 64206874 6d6c2034 2e302074 //dtd html 4.0 t + 0070 72616e73 6974696f 6e616c2f 2f656e22 ransitional//en" + 0080 3e0d0a3c 68746d6c 3e0d0a3c 68656164 >..<html>..<head + 0090 3e0d0a20 203c6d65 74612063 6f6e7465 >.. <meta conte + 00a0 6e743d22 74657874 2f68746d 6c3b2063 nt="text/html; c + 00b0 68617273 65743d69 736f2d38 3835392d harset=iso-8859- + 00c0 31222020 68747470 2d657175 69763d22 1" http-equiv=" + 00d0 436f6e74 656e742d 54797065 223e0d0a Content-Type">.. + 00e0 20203c74 69746c65 3e57696e 64726573 <title>Windres + 00f0 3c2f7469 746c653e 0d0a3c2f 68656164 </title>..</head + 0100 3e0d0a0d 0a3c626f 64793e0d 0a546869 >....<body>..Thi + 0110 73206973 20612074 65737420 70616765 s is a test page + 0120 20666f72 2077696e 64726573 2048544d for windres HTM + 0130 4c207265 736f7572 63652e0d 0a3c2f62 L resource...</b + 0140 6f64793e 0d0a3c2f 68746d6c 3e000000 ody>..</html>... + 0150 14010000 20000000 ffff1700 ffff8200 .... ........... + 0160 00000000 30100704 00000000 00000000 ....0........... + 0170 3c21444f 43545950 4520646f 63747970 <!DOCTYPE doctyp + 0180 65205055 424c4943 20222d2f 2f773363 e PUBLIC "-//w3c + 0190 2f2f6474 64206874 6d6c2034 2e302074 //dtd html 4.0 t + 01a0 72616e73 6974696f 6e616c2f 2f656e22 ransitional//en" + 01b0 3e0d0a3c 68746d6c 3e0d0a3c 68656164 >..<html>..<head + 01c0 3e0d0a20 203c6d65 74612063 6f6e7465 >.. <meta conte + 01d0 6e743d22 74657874 2f68746d 6c3b2063 nt="text/html; c + 01e0 68617273 65743d69 736f2d38 3835392d harset=iso-8859- + 01f0 31222020 68747470 2d657175 69763d22 1" http-equiv=" + 0200 436f6e74 656e742d 54797065 223e0d0a Content-Type">.. + 0210 20203c74 69746c65 3e57696e 64726573 <title>Windres + 0220 3c2f7469 746c653e 0d0a3c2f 68656164 </title>..</head + 0230 3e0d0a0d 0a3c626f 64793e0d 0a546869 >....<body>..Thi + 0240 73206973 20612073 65636f6e 64207465 s is a second te + 0250 73742070 61676520 666f7220 77696e64 st page for wind + 0260 72657320 48544d4c 20726573 6f757263 res HTML resourc + 0270 652e0d0a 3c2f626f 64793e0d 0a3c2f68 e...</body>..</h + 0280 746d6c3e tml> diff --git a/binutils/testsuite/binutils-all/windres/html1.hm b/binutils/testsuite/binutils-all/windres/html1.hm new file mode 100644 index 000000000000..ffc5a1825cce --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/html1.hm @@ -0,0 +1,11 @@ +<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+ <title>Windres</title>
+</head>
+
+<body>
+This is a test page for windres HTML resource.
+</body>
+</html>
\ No newline at end of file diff --git a/binutils/testsuite/binutils-all/windres/html2.hm b/binutils/testsuite/binutils-all/windres/html2.hm new file mode 100644 index 000000000000..2fb343bf5282 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/html2.hm @@ -0,0 +1,11 @@ +<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+ <title>Windres</title>
+</head>
+
+<body>
+This is a second test page for windres HTML resource.
+</body>
+</html>
\ No newline at end of file diff --git a/binutils/testsuite/binutils-all/windres/lang.rc b/binutils/testsuite/binutils-all/windres/lang.rc index d894315568e4..11a4d06b948b 100644 --- a/binutils/testsuite/binutils-all/windres/lang.rc +++ b/binutils/testsuite/binutils-all/windres/lang.rc @@ -1,3 +1,4 @@ +//#xfail x86_64-*-mingw* #include "windows.h" LANGUAGE 0, 0 diff --git a/binutils/testsuite/binutils-all/windres/messagetable.rc b/binutils/testsuite/binutils-all/windres/messagetable.rc new file mode 100644 index 000000000000..e10ee639db5b --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/messagetable.rc @@ -0,0 +1,6 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +888 MESSAGETABLE MSG00001.bin diff --git a/binutils/testsuite/binutils-all/windres/messagetable.rsd b/binutils/testsuite/binutils-all/windres/messagetable.rsd new file mode 100644 index 000000000000..9d108a589324 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/messagetable.rsd @@ -0,0 +1,15 @@ + +messagetable.res: file format binary + +Contents of section .data: + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 70000000 20000000 ffff0b00 ffff7803 p... .........x. + 0030 00000000 30100704 00000000 00000000 ....0........... + 0040 01000000 00000000 05000000 10000000 ................ + 0050 14000000 4e6f7469 63653a20 25310d0a ....Notice: %1.. + 0060 00000000 0c000000 25310d0a 00000000 ........%1...... + 0070 10000000 5761726e 3a202531 0d0a0000 ....Warn: %1.... + 0080 10000000 4572726f 723a2025 310d0a00 ....Error: %1... + 0090 10000000 46617461 6c3a2025 310d0a00 ....Fatal: %1... + 00a0 10000000 25310d0a 25320d0a 00000000 ....%1..%2...... diff --git a/binutils/testsuite/binutils-all/windres/strtab1.rc b/binutils/testsuite/binutils-all/windres/strtab1.rc index a1a246d8eb82..416d157f1cf8 100644 --- a/binutils/testsuite/binutils-all/windres/strtab1.rc +++ b/binutils/testsuite/binutils-all/windres/strtab1.rc @@ -1,3 +1,4 @@ +//#xfail x86_64-*-mingw* #include "windows.h" LANGUAGE 0, 0 diff --git a/binutils/testsuite/binutils-all/windres/strtab2.rc b/binutils/testsuite/binutils-all/windres/strtab2.rc new file mode 100644 index 000000000000..9322034946c9 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/strtab2.rc @@ -0,0 +1,9 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE 0, 0 + +STRINGTABLE MOVEABLE PURE DISCARDABLE +BEGIN + 1 L"hello, world" +END diff --git a/binutils/testsuite/binutils-all/windres/strtab2.rsd b/binutils/testsuite/binutils-all/windres/strtab2.rsd new file mode 100644 index 000000000000..4d610739352b --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/strtab2.rsd @@ -0,0 +1,8 @@ + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 38000000 20000000 ffff0600 ffff0100 8... ........... + 0030 00000000 30100000 00000000 00000000 ....0........... + 0040 00000c00 68006500 6c006c00 6f002c00 ....h.e.l.l.o.,. + 0050 20007700 6f007200 6c006400 00000000 .w.o.r.l.d..... + 0060 00000000 00000000 00000000 00000000 ................ + 0070 00000000 00000000 ........ diff --git a/binutils/testsuite/binutils-all/windres/version.rc b/binutils/testsuite/binutils-all/windres/version.rc new file mode 100644 index 000000000000..5eea3353e0d2 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/version.rc @@ -0,0 +1,33 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704e4" + BEGIN + VALUE L"CompanyName", L"binutil\x0073" + VALUE "FileDescription", "RC compiler." + VALUE "FileVersion", "1.0.0.1" + VALUE "InternalName", "windres.exe" + VALUE "LegalCopyright", "(c) FSF. All rights are reserved." + VALUE "OriginalFilename", "windres.exe" + VALUE "ProductName", "windows resource compiler" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x407, 1252 + END +END diff --git a/binutils/testsuite/binutils-all/windres/version.rsd b/binutils/testsuite/binutils-all/windres/version.rsd new file mode 100644 index 000000000000..85dd5d35281f --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/version.rsd @@ -0,0 +1,55 @@ + +version.res: file format binary + +Contents of section .data: + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 ec020000 20000000 ffff1000 ffff0100 .... ........... + 0030 00000000 00000704 00000000 00000000 ................ + 0040 ec023400 00005600 53005f00 56004500 ..4...V.S._.V.E. + 0050 52005300 49004f00 4e005f00 49004e00 R.S.I.O.N._.I.N. + 0060 46004f00 00000000 bd04effe 00000100 F.O............. + 0070 00000100 01000000 00000100 01000000 ................ + 0080 3f000000 00000000 04000000 01000000 ?............... + 0090 00000000 00000000 00000000 4c020000 ............L... + 00a0 00005300 74007200 69006e00 67004600 ..S.t.r.i.n.g.F. + 00b0 69006c00 65004900 6e006600 6f000000 i.l.e.I.n.f.o... + 00c0 28020000 00003000 34003000 37003000 (.....0.4.0.7.0. + 00d0 34006500 34000000 32000900 01004300 4.e.4...2.....C. + 00e0 6f006d00 70006100 6e007900 4e006100 o.m.p.a.n.y.N.a. + 00f0 6d006500 00000000 62006900 6e007500 m.e.....b.i.n.u. + 0100 74006900 6c007300 00000000 42000d00 t.i.l.s.....B... + 0110 01004600 69006c00 65004400 65007300 ..F.i.l.e.D.e.s. + 0120 63007200 69007000 74006900 6f006e00 c.r.i.p.t.i.o.n. + 0130 00000000 52004300 20006300 6f006d00 ....R.C. .c.o.m. + 0140 70006900 6c006500 72002e00 00000000 p.i.l.e.r....... + 0150 30000800 01004600 69006c00 65005600 0.....F.i.l.e.V. + 0160 65007200 73006900 6f006e00 00000000 e.r.s.i.o.n..... + 0170 31002e00 30002e00 30002e00 31000000 1...0...0...1... + 0180 38000c00 01004900 6e007400 65007200 8.....I.n.t.e.r. + 0190 6e006100 6c004e00 61006d00 65000000 n.a.l.N.a.m.e... + 01a0 77006900 6e006400 72006500 73002e00 w.i.n.d.r.e.s... + 01b0 65007800 65000000 68002200 01004c00 e.x.e...h."...L. + 01c0 65006700 61006c00 43006f00 70007900 e.g.a.l.C.o.p.y. + 01d0 72006900 67006800 74000000 28006300 r.i.g.h.t...(.c. + 01e0 29002000 46005300 46002e00 20004100 ). .F.S.F... .A. + 01f0 6c006c00 20007200 69006700 68007400 l.l. .r.i.g.h.t. + 0200 73002000 61007200 65002000 72006500 s. .a.r.e. .r.e. + 0210 73006500 72007600 65006400 2e000000 s.e.r.v.e.d..... + 0220 40000c00 01004f00 72006900 67006900 @.....O.r.i.g.i. + 0230 6e006100 6c004600 69006c00 65006e00 n.a.l.F.i.l.e.n. + 0240 61006d00 65000000 77006900 6e006400 a.m.e...w.i.n.d. + 0250 72006500 73002e00 65007800 65000000 r.e.s...e.x.e... + 0260 54001a00 01005000 72006f00 64007500 T.....P.r.o.d.u. + 0270 63007400 4e006100 6d006500 00000000 c.t.N.a.m.e..... + 0280 77006900 6e006400 6f007700 73002000 w.i.n.d.o.w.s. . + 0290 72006500 73006f00 75007200 63006500 r.e.s.o.u.r.c.e. + 02a0 20006300 6f006d00 70006900 6c006500 .c.o.m.p.i.l.e. + 02b0 72000000 34000800 01005000 72006f00 r...4.....P.r.o. + 02c0 64007500 63007400 56006500 72007300 d.u.c.t.V.e.r.s. + 02d0 69006f00 6e000000 31002e00 30002e00 i.o.n...1...0... + 02e0 30002e00 31000000 44000000 00005600 0...1...D.....V. + 02f0 61007200 46006900 6c006500 49006e00 a.r.F.i.l.e.I.n. + 0300 66006f00 00000000 24000400 00005400 f.o.....$.....T. + 0310 72006100 6e007300 6c006100 74006900 r.a.n.s.l.a.t.i. + 0320 6f006e00 00000000 0704e404 o.n......... diff --git a/binutils/testsuite/binutils-all/windres/version_cat.rc b/binutils/testsuite/binutils-all/windres/version_cat.rc new file mode 100644 index 000000000000..5b70eada1e87 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/version_cat.rc @@ -0,0 +1,33 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704e4" + BEGIN + VALUE L"Company" "Name", L"binutil\x0073" + VALUE "File" "Description", L"RC " L"compiler." + VALUE "File" "Version", "1.0.0.1" + VALUE "Internal" "Name", "windres" L".exe" + VALUE "Legal" "Copyright", "(c) FSF." " All rights are reserved." + VALUE "Original" "Filename", L"windres" ".exe" + VALUE "Product" "Name", "windows resource " "compiler" + VALUE "Product" "Version", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x407, 1252 + END +END diff --git a/binutils/testsuite/binutils-all/windres/version_cat.rsd b/binutils/testsuite/binutils-all/windres/version_cat.rsd new file mode 100644 index 000000000000..85dd5d35281f --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/version_cat.rsd @@ -0,0 +1,55 @@ + +version.res: file format binary + +Contents of section .data: + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 ec020000 20000000 ffff1000 ffff0100 .... ........... + 0030 00000000 00000704 00000000 00000000 ................ + 0040 ec023400 00005600 53005f00 56004500 ..4...V.S._.V.E. + 0050 52005300 49004f00 4e005f00 49004e00 R.S.I.O.N._.I.N. + 0060 46004f00 00000000 bd04effe 00000100 F.O............. + 0070 00000100 01000000 00000100 01000000 ................ + 0080 3f000000 00000000 04000000 01000000 ?............... + 0090 00000000 00000000 00000000 4c020000 ............L... + 00a0 00005300 74007200 69006e00 67004600 ..S.t.r.i.n.g.F. + 00b0 69006c00 65004900 6e006600 6f000000 i.l.e.I.n.f.o... + 00c0 28020000 00003000 34003000 37003000 (.....0.4.0.7.0. + 00d0 34006500 34000000 32000900 01004300 4.e.4...2.....C. + 00e0 6f006d00 70006100 6e007900 4e006100 o.m.p.a.n.y.N.a. + 00f0 6d006500 00000000 62006900 6e007500 m.e.....b.i.n.u. + 0100 74006900 6c007300 00000000 42000d00 t.i.l.s.....B... + 0110 01004600 69006c00 65004400 65007300 ..F.i.l.e.D.e.s. + 0120 63007200 69007000 74006900 6f006e00 c.r.i.p.t.i.o.n. + 0130 00000000 52004300 20006300 6f006d00 ....R.C. .c.o.m. + 0140 70006900 6c006500 72002e00 00000000 p.i.l.e.r....... + 0150 30000800 01004600 69006c00 65005600 0.....F.i.l.e.V. + 0160 65007200 73006900 6f006e00 00000000 e.r.s.i.o.n..... + 0170 31002e00 30002e00 30002e00 31000000 1...0...0...1... + 0180 38000c00 01004900 6e007400 65007200 8.....I.n.t.e.r. + 0190 6e006100 6c004e00 61006d00 65000000 n.a.l.N.a.m.e... + 01a0 77006900 6e006400 72006500 73002e00 w.i.n.d.r.e.s... + 01b0 65007800 65000000 68002200 01004c00 e.x.e...h."...L. + 01c0 65006700 61006c00 43006f00 70007900 e.g.a.l.C.o.p.y. + 01d0 72006900 67006800 74000000 28006300 r.i.g.h.t...(.c. + 01e0 29002000 46005300 46002e00 20004100 ). .F.S.F... .A. + 01f0 6c006c00 20007200 69006700 68007400 l.l. .r.i.g.h.t. + 0200 73002000 61007200 65002000 72006500 s. .a.r.e. .r.e. + 0210 73006500 72007600 65006400 2e000000 s.e.r.v.e.d..... + 0220 40000c00 01004f00 72006900 67006900 @.....O.r.i.g.i. + 0230 6e006100 6c004600 69006c00 65006e00 n.a.l.F.i.l.e.n. + 0240 61006d00 65000000 77006900 6e006400 a.m.e...w.i.n.d. + 0250 72006500 73002e00 65007800 65000000 r.e.s...e.x.e... + 0260 54001a00 01005000 72006f00 64007500 T.....P.r.o.d.u. + 0270 63007400 4e006100 6d006500 00000000 c.t.N.a.m.e..... + 0280 77006900 6e006400 6f007700 73002000 w.i.n.d.o.w.s. . + 0290 72006500 73006f00 75007200 63006500 r.e.s.o.u.r.c.e. + 02a0 20006300 6f006d00 70006900 6c006500 .c.o.m.p.i.l.e. + 02b0 72000000 34000800 01005000 72006f00 r...4.....P.r.o. + 02c0 64007500 63007400 56006500 72007300 d.u.c.t.V.e.r.s. + 02d0 69006f00 6e000000 31002e00 30002e00 i.o.n...1...0... + 02e0 30002e00 31000000 44000000 00005600 0...1...D.....V. + 02f0 61007200 46006900 6c006500 49006e00 a.r.F.i.l.e.I.n. + 0300 66006f00 00000000 24000400 00005400 f.o.....$.....T. + 0310 72006100 6e007300 6c006100 74006900 r.a.n.s.l.a.t.i. + 0320 6f006e00 00000000 0704e404 o.n......... diff --git a/binutils/testsuite/binutils-all/windres/windres.exp b/binutils/testsuite/binutils-all/windres/windres.exp index 4189c551a6f7..eb825d0f7364 100644 --- a/binutils/testsuite/binutils-all/windres/windres.exp +++ b/binutils/testsuite/binutils-all/windres/windres.exp @@ -1,4 +1,4 @@ -# Copyright 2001, 2003, 2004 Free Software Foundation, Inc. +# Copyright 2001, 2003, 2004, 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,13 +19,14 @@ # Written by DJ Delorie <dj@redhat.com> -if {![istarget "i*86-*-*"]} { +if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw*"] } { return } if {![istarget "i*86-*-*pe*"] \ && ![istarget "i*86-*-cygwin*"] \ - && ![istarget "i*86-*-mingw32*"] } { + && ![istarget "i*86-*-mingw32*"] \ + && ![istarget "x86_64-*-mingw*"] } { set target_xfail "yes" } else { set target_xfail "no" diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp index f7970b292691..597437e6ffd7 100644 --- a/binutils/testsuite/lib/utils-lib.exp +++ b/binutils/testsuite/lib/utils-lib.exp @@ -1,4 +1,4 @@ -# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004 +# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -161,9 +161,508 @@ proc is_elf_format {} { # Returns target executable extension, if any. # proc exe_ext {} { - if { [istarget *-*-mingw32] || [istarget *-*-cygwin*] } { + if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } { return ".exe" } else { return "" } } + +# Copied and modified from gas. + +# run_dump_test FILE (optional:) EXTRA_OPTIONS +# +# Assemble a .s file, then run some utility on it and check the output. +# +# There should be an assembly language file named FILE.s in the test +# suite directory, and a pattern file called FILE.d. `run_dump_test' +# will assemble FILE.s, run some tool like `objdump', `objcopy', or +# `nm' on the .o file to produce textual output, and then analyze that +# with regexps. The FILE.d file specifies what program to run, and +# what to expect in its output. +# +# The FILE.d file begins with zero or more option lines, which specify +# flags to pass to the assembler, the program to run to dump the +# assembler's output, and the options it wants. The option lines have +# the syntax: +# +# # OPTION: VALUE +# +# OPTION is the name of some option, like "name" or "objdump", and +# VALUE is OPTION's value. The valid options are described below. +# Whitespace is ignored everywhere, except within VALUE. The option +# list ends with the first line that doesn't match the above syntax. +# However, a line within the options that begins with a #, but doesn't +# have a recognizable option name followed by a colon, is considered a +# comment and entirely ignored. +# +# The optional EXTRA_OPTIONS argument to `run_dump_test' is a list of +# two-element lists. The first element of each is an option name, and +# the second additional arguments to be added on to the end of the +# option list as given in FILE.d. (If omitted, no additional options +# are added.) +# +# The interesting options are: +# +# name: TEST-NAME +# The name of this test, passed to DejaGNU's `pass' and `fail' +# commands. If omitted, this defaults to FILE, the root of the +# .s and .d files' names. +# +# as: FLAGS +# When assembling FILE.s, pass FLAGS to the assembler. +# +# PROG: PROGRAM-NAME +# The name of the program to run to analyze the .o file produced +# by the assembler. This can be omitted; run_dump_test will guess +# which program to run by seeing which of the flags options below +# is present. +# +# objdump: FLAGS +# nm: FLAGS +# objcopy: FLAGS +# Use the specified program to analyze the .o file, and pass it +# FLAGS, in addition to the .o file name. Note that they are run +# with LC_ALL=C in the environment to give consistent sorting +# of symbols. +# +# source: SOURCE +# Assemble the file SOURCE.s. If omitted, this defaults to FILE.s. +# This is useful if several .d files want to share a .s file. +# +# target: GLOBS... +# Run this test only on a specified list of targets. More precisely, +# each glob in the space-separated list is passed to "istarget"; if +# it evaluates true for any of them, the test will be run, otherwise +# it will be marked unsupported. +# +# not-target: GLOBS... +# Do not run this test on a specified list of targets. Again, +# the each glob in the space-separated list is passed to +# "istarget", and the test is run if it evaluates *false* for +# *all* of them. Otherwise it will be marked unsupported. +# +# skip: GLOBS... +# not-skip: GLOBS... +# These are exactly the same as "not-target" and "target", +# respectively, except that they do nothing at all if the check +# fails. They should only be used in groups, to construct a single +# test which is run on all targets but with variant options or +# expected output on some targets. (For example, see +# gas/arm/inst.d and gas/arm/wince_inst.d.) +# +# error: REGEX +# An error with message matching REGEX must be emitted for the test +# to pass. The PROG, objdump, nm and objcopy options have no +# meaning and need not supplied if this is present. +# +# warning: REGEX +# Expect a gas warning matching REGEX. It is an error to issue +# both "error" and "warning". +# +# stderr: FILE +# FILE contains regexp lines to be matched against the diagnostic +# output of the assembler. This does not preclude the use of +# PROG, nm, objdump, or objcopy. +# +# error-output: FILE +# Means the same as 'stderr', but also indicates that the assembler +# is expected to exit unsuccessfully (therefore PROG, objdump, nm, +# and objcopy have no meaning and should not be supplied). +# +# Each option may occur at most once. +# +# After the option lines come regexp lines. `run_dump_test' calls +# `regexp_diff' to compare the output of the dumping tool against the +# regexps in FILE.d. `regexp_diff' is defined later in this file; see +# further comments there. + +proc run_dump_test { name {extra_options {}} } { + global subdir srcdir + global OBJDUMP NM OBJCOPY READELF STRIP + global OBJDUMPFLAGS NMFLAGS OBJCOPYFLAGS READELFFLAGS STRIPFLAGS + global host_triplet + global env + global copyfile + global tempfile + + if [string match "*/*" $name] { + set file $name + set name [file tail $name] + } else { + set file "$srcdir/$subdir/$name" + } + set opt_array [slurp_options "${file}.d"] + if { $opt_array == -1 } { + perror "error reading options from $file.d" + unresolved $subdir/$name + return + } + set opts(addr2line) {} + set opts(ar) {} + set opts(nm) {} + set opts(objcopy) {} + set opts(objdump) {} + set opts(strip) {} + set opts(ranlib) {} + set opts(readelf) {} + set opts(size) {} + set opts(strings) {} + set opts(name) {} + set opts(PROG) {} + set opts(DUMPPROG) {} + set opts(source) {} + set opts(target) {} + set opts(not-target) {} + set opts(skip) {} + set opts(not-skip) {} + + foreach i $opt_array { + set opt_name [lindex $i 0] + set opt_val [lindex $i 1] + if ![info exists opts($opt_name)] { + perror "unknown option $opt_name in file $file.d" + unresolved $subdir/$name + return + } + if [string length $opts($opt_name)] { + perror "option $opt_name multiply set in $file.d" + unresolved $subdir/$name + return + } + set opts($opt_name) $opt_val + } + + foreach i $extra_options { + set opt_name [lindex $i 0] + set opt_val [lindex $i 1] + if ![info exists opts($opt_name)] { + perror "unknown option $opt_name given in extra_opts" + unresolved $subdir/$name + return + } + # add extra option to end of existing option, adding space + # if necessary. + if [string length $opts($opt_name)] { + append opts($opt_name) " " + } + append opts($opt_name) $opt_val + } + + if { $opts(name) == "" } { + set testname "$subdir/$name" + } else { + set testname $opts(name) + } + verbose "Testing $testname" + + if {$opts(PROG) == ""} { + perror "program isn't set in $file.d" + unresolved $testname + return + } + + set destopt "" + switch -- $opts(PROG) { + ar { set program ar } + objcopy { set program objcopy } + ranlib { set program ranlib } + strip { + set program strip + set destopt "-o" + } + strings { set program strings } + default { + perror "unrecognized program option $opts(PROG) in $file.d" + unresolved $testname + return } + } + + set dumpprogram "" + if { $opts(DUMPPROG) != "" } { + switch -- $opts(DUMPPROG) { + addr2line { set dumpprogram addr2line } + nm { set dumpprogram nm } + objdump { set dumpprogram objdump } + readelf { set dumpprogram readelf } + size { set dumpprogram size } + default { + perror "unrecognized dump program option $opts(DUMPPROG) in $file.d" + unresolved $testname + return } + } + } else { + # Guess which program to run, by seeing which option was specified. + foreach p {objdump nm readelf} { + if {$opts($p) != ""} { + if {$dumpprogram != ""} { + perror "ambiguous dump program in $file.d" + unresolved $testname + return + } else { + set dumpprogram $p + } + } + } + } + + # Handle skipping the test on specified targets. + # You can have both skip/not-skip and target/not-target, but you can't + # have both skip and not-skip, or target and not-target, in the same file. + if { $opts(skip) != "" } then { + if { $opts(not-skip) != "" } then { + perror "$testname: mixing skip and not-skip directives is invalid" + unresolved $testname + return + } + foreach glob $opts(skip) { + if {[istarget $glob]} { return } + } + } + if { $opts(not-skip) != "" } then { + set skip 1 + foreach glob $opts(not-skip) { + if {[istarget $glob]} { + set skip 0 + break + } + } + if {$skip} { return } + } + if { $opts(target) != "" } then { + if { $opts(not-target) != "" } then { + perror "$testname: mixing target and not-target directives is invalid" + unresolved $testname + return + } + set skip 1 + foreach glob $opts(target) { + if {[istarget $glob]} { + set skip 0 + break + } + } + if {$skip} { + unsupported $testname + return + } + } + if { $opts(not-target) != "" } then { + foreach glob $opts(not-target) { + if {[istarget $glob]} { + unsupported $testname + return + } + } + } + + if { $opts(source) == "" } { + set srcfile ${file}.s + } else { + set srcfile $srcdir/$subdir/$opts(source) + } + + set exec_output [binutils_assemble ${srcfile} tmpdir/bintest.o] + if [string match "" $exec_output] then { + send_log "$exec_output\n" + verbose "$exec_output" + fail $testname + return + } + + set progopts1 $opts($program) + eval set progopts \$[string toupper $program]FLAGS + eval set binary \$[string toupper $program] + + set exec_output [binutils_run $binary "$progopts $progopts1 $tempfile $destopt ${copyfile}.o"] + if ![string match "" $exec_output] { + send_log "$exec_output\n" + verbose "$exec_output" + fail $testname + return + } + + set progopts1 $opts($dumpprogram) + eval set progopts \$[string toupper $dumpprogram]FLAGS + eval set binary \$[string toupper $dumpprogram] + + if { [which $binary] == 0 } { + untested $testname + return + } + + verbose "running $binary $progopts $progopts1" 3 + + set cmd "$binary $progopts $progopts1 ${copyfile}.o > tmpdir/dump.out" + + # Ensure consistent sorting of symbols + if {[info exists env(LC_ALL)]} { + set old_lc_all $env(LC_ALL) + } + set env(LC_ALL) "C" + send_log "$cmd\n" + catch "exec $cmd" comp_output + if {[info exists old_lc_all]} { + set env(LC_ALL) $old_lc_all + } else { + unset env(LC_ALL) + } + set comp_output [prune_warnings $comp_output] + if ![string match "" $comp_output] then { + send_log "$comp_output\n" + fail $testname + return + } + + verbose_eval {[file_contents "tmpdir/dump.out"]} 3 + if { [regexp_diff "tmpdir/dump.out" "${file}.d"] } then { + fail $testname + verbose "output is [file_contents "tmpdir/dump.out"]" 2 + return + } + + pass $testname +} + +proc slurp_options { file } { + if [catch { set f [open $file r] } x] { + #perror "couldn't open `$file': $x" + perror "$x" + return -1 + } + set opt_array {} + # whitespace expression + set ws {[ ]*} + set nws {[^ ]*} + # whitespace is ignored anywhere except within the options list; + # option names are alphabetic plus dash + set pat "^#${ws}(\[a-zA-Z-\]*)$ws:${ws}(.*)$ws\$" + while { [gets $f line] != -1 } { + set line [string trim $line] + # Whitespace here is space-tab. + if [regexp $pat $line xxx opt_name opt_val] { + # match! + lappend opt_array [list $opt_name $opt_val] + } elseif {![regexp "^#" $line ]} { + break + } + } + close $f + return $opt_array +} + +# regexp_diff, based on simple_diff taken from ld test suite +# compares two files line-by-line +# file1 contains strings, file2 contains regexps and #-comments +# blank lines are ignored in either file +# returns non-zero if differences exist +# +proc regexp_diff { file_1 file_2 } { + + set eof -1 + set end_1 0 + set end_2 0 + set differences 0 + set diff_pass 0 + + if [file exists $file_1] then { + set file_a [open $file_1 r] + } else { + perror "$file_1 doesn't exist" + return 1 + } + + if [file exists $file_2] then { + set file_b [open $file_2 r] + } else { + perror "$file_2 doesn't exist" + close $file_a + return 1 + } + + verbose " Regexp-diff'ing: $file_1 $file_2" 2 + + while { 1 } { + set line_a "" + set line_b "" + while { [string length $line_a] == 0 } { + if { [gets $file_a line_a] == $eof } { + set end_1 1 + break + } + } + while { [string length $line_b] == 0 || [string match "#*" $line_b] } { + if [ string match "#pass" $line_b ] { + set end_2 1 + set diff_pass 1 + break + } elseif [ string match "#..." $line_b ] { + if { [gets $file_b line_b] == $eof } { + set end_2 1 + set diff_pass 1 + break + } + verbose "looking for \"^$line_b$\"" 3 + while { ![regexp "^$line_b$" "$line_a"] } { + verbose "skipping \"$line_a\"" 3 + if { [gets $file_a line_a] == $eof } { + set end_1 1 + break + } + } + break + } + if { [gets $file_b line_b] == $eof } { + set end_2 1 + break + } + } + + if { $diff_pass } { + break + } elseif { $end_1 && $end_2 } { + break + } elseif { $end_1 } { + send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n" + verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3 + set differences 1 + break + } elseif { $end_2 } { + send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" + verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3 + set differences 1 + break + } else { + verbose "regexp \"^$line_b$\"\nline \"$line_a\"" 3 + if ![regexp "^$line_b$" "$line_a"] { + send_log "regexp_diff match failure\n" + send_log "regexp \"^$line_b$\"\nline \"$line_a\"\n" + verbose "regexp_diff match failure\n" 3 + set differences 1 + } + } + } + + if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } { + send_log "$file_1 and $file_2 are different lengths\n" + verbose "$file_1 and $file_2 are different lengths" 3 + set differences 1 + } + + close $file_a + close $file_b + + return $differences +} + +proc file_contents { filename } { + set file [open $filename r] + set contents [read $file] + close $file + return $contents +} + +proc verbose_eval { expr { level 1 } } { + global verbose + if $verbose>$level then { eval verbose "$expr" $level } +} diff --git a/binutils/version.c b/binutils/version.c index 2843e69f06b1..b4a4c3d3e7e9 100644 --- a/binutils/version.c +++ b/binutils/version.c @@ -1,6 +1,6 @@ /* version.c -- binutils version information - Copyright 1991, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1991, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -18,9 +18,8 @@ along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <stdio.h> +#include "sysdep.h" #include "bfd.h" -#include "bfdver.h" #include "bucomm.h" /* Print the version number and copyright information, and exit. This @@ -32,7 +31,7 @@ print_version (const char *name) /* This output is intended to follow the GNU standards document. */ /* xgettext:c-format */ printf ("GNU %s %s\n", name, BFD_VERSION_STRING); - printf (_("Copyright 2005 Free Software Foundation, Inc.\n")); + printf (_("Copyright 2007 Free Software Foundation, Inc.\n")); printf (_("\ This program is free software; you may redistribute it under the terms of\n\ the GNU General Public License. This program has absolutely no warranty.\n")); diff --git a/binutils/windint.h b/binutils/windint.h new file mode 100644 index 000000000000..b46f857a7a86 --- /dev/null +++ b/binutils/windint.h @@ -0,0 +1,1088 @@ +/* windint.h -- internal header file for windres program. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 + Free Software Foundation, Inc. + Written by Kai Tietz, Onevision. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "winduni.h" + +#ifndef WINDINT_H +#define WINDINT_H + +/* Use bfd_size_type to ensure a sufficient number of bits. */ +#ifndef DEFINED_RC_UINT_TYPE +#define DEFINED_RC_UINT_TYPE +typedef bfd_size_type rc_uint_type; +#endif + +/* Resource directory structure. */ + +typedef struct res_hdr +{ + rc_uint_type data_size; + rc_uint_type header_size; +} res_hdr; + +struct __attribute__ ((__packed__)) bin_res_hdr +{ + bfd_byte data_size[4]; + bfd_byte header_size[4]; +}; +#define BIN_RES_HDR_SIZE 8 + +struct __attribute__ ((__packed__)) bin_res_id +{ + bfd_byte sig[2]; /* Has to be 0xffff for unnamed ids. */ + bfd_byte id[2]; +}; +#define BIN_RES_ID 4 + +/* This structure is used when converting resource information to + binary. */ + +typedef struct bindata +{ + /* Next data. */ + struct bindata *next; + /* Length of data. */ + rc_uint_type length; + /* Data. */ + bfd_byte *data; +} bindata; + +/* This structure is used when converting resource information to + coff. */ +typedef struct coff_res_data +{ + /* Next data. */ + struct coff_res_data *next; + /* Length of data. */ + rc_uint_type length; + /* Data. */ + const struct rc_res_resource *res; +} coff_res_data; + +/* We represent resources internally as a tree, similar to the tree + used in the .rsrc section of a COFF file. The root is a + rc_res_directory structure. */ + +typedef struct rc_res_directory +{ + /* Resource flags. According to the MS docs, this is currently + always zero. */ + rc_uint_type characteristics; + /* Time/date stamp. */ + rc_uint_type time; + /* Major version number. */ + rc_uint_type major; + /* Minor version number. */ + rc_uint_type minor; + /* Directory entries. */ + struct rc_res_entry *entries; +} rc_res_directory; + +/* A resource ID is stored in a rc_res_id structure. */ + +typedef struct rc_res_id +{ + /* Non-zero if this entry has a name rather than an ID. */ + rc_uint_type named : 1; + union + { + /* If the named field is non-zero, this is the name. */ + struct + { + /* Length of the name. */ + rc_uint_type length; + /* Pointer to the name, which is a Unicode string. */ + unichar *name; + } n; + /* If the named field is zero, this is the ID. */ + rc_uint_type id; + } u; +} rc_res_id; + +/* Each entry in the tree is a rc_res_entry structure. We mix + directories and resources because in a COFF file all entries in a + directory are sorted together, whether the entries are + subdirectories or resources. */ + +typedef struct rc_res_entry +{ + /* Next entry. */ + struct rc_res_entry *next; + /* Resource ID. */ + rc_res_id id; + /* Non-zero if this entry is a subdirectory rather than a leaf. */ + rc_uint_type subdir : 1; + union + { + /* If the subdir field is non-zero, this is a pointer to the + subdirectory. */ + rc_res_directory *dir; + /* If the subdir field is zero, this is a pointer to the resource + data. */ + struct rc_res_resource *res; + } u; +} rc_res_entry; + +/* Types of resources. */ + +enum rc_res_type +{ + RES_TYPE_UNINITIALIZED, + RES_TYPE_ACCELERATOR, + RES_TYPE_BITMAP, + RES_TYPE_CURSOR, + RES_TYPE_GROUP_CURSOR, + RES_TYPE_DIALOG, + RES_TYPE_FONT, + RES_TYPE_FONTDIR, + RES_TYPE_ICON, + RES_TYPE_GROUP_ICON, + RES_TYPE_MENU, + RES_TYPE_MESSAGETABLE, + RES_TYPE_RCDATA, + RES_TYPE_STRINGTABLE, + RES_TYPE_USERDATA, + RES_TYPE_VERSIONINFO, + RES_TYPE_DLGINCLUDE, + RES_TYPE_PLUGPLAY, + RES_TYPE_VXD, + RES_TYPE_ANICURSOR, + RES_TYPE_ANIICON, + RES_TYPE_DLGINIT, + RES_TYPE_TOOLBAR +}; + +/* A res file and a COFF file store information differently. The + res_info structures holds data which in a res file is stored with + each resource, but in a COFF file is stored elsewhere. */ + +typedef struct rc_res_res_info +{ + /* Language. In a COFF file, the third level of the directory is + keyed by the language, so the language of a resource is defined + by its location in the resource tree. */ + rc_uint_type language; + /* Characteristics of the resource. Entirely user defined. In a + COFF file, the rc_res_directory structure has a characteristics + field, but I don't know if it's related to the one in the res + file. */ + rc_uint_type characteristics; + /* Version of the resource. Entirely user defined. In a COFF file, + the rc_res_directory structure has a characteristics field, but I + don't know if it's related to the one in the res file. */ + rc_uint_type version; + /* Memory flags. This is a combination of the MEMFLAG values + defined below. Most of these values are historical, and are not + meaningful for win32. I don't think there is any way to store + this information in a COFF file. */ + rc_uint_type memflags; +} rc_res_res_info; + +/* Binary layout of rc_res_info. */ + +struct __attribute__ ((__packed__)) bin_res_info +{ + bfd_byte version[4]; + bfd_byte memflags[2]; + bfd_byte language[2]; + bfd_byte version2[4]; + bfd_byte characteristics[4]; +}; +#define BIN_RES_INFO_SIZE 16 + +/* Each resource in a COFF file has some information which can does + not appear in a res file. */ + +typedef struct rc_res_coff_info +{ + /* The code page used for the data. I don't really know what this + should be. It has something todo with ASCII to Unicode encoding. */ + rc_uint_type codepage; + /* A resource entry in a COFF file has a reserved field, which we + record here when reading a COFF file. When writing a COFF file, + we set this field to zero. */ + rc_uint_type reserved; +} rc_res_coff_info; + +/* Resource data is stored in a rc_res_resource structure. */ + +typedef struct rc_res_resource +{ + /* The type of resource. */ + enum rc_res_type type; + /* The data for the resource. */ + union + { + struct + { + rc_uint_type length; + const bfd_byte *data; + } data; + struct rc_accelerator *acc; + struct rc_cursor *cursor; + struct rc_group_cursor *group_cursor; + struct rc_dialog *dialog; + struct rc_fontdir *fontdir; + struct rc_group_icon *group_icon; + struct rc_menu *menu; + struct rc_rcdata_item *rcdata; + struct rc_stringtable *stringtable; + struct rc_rcdata_item *userdata; + struct rc_versioninfo *versioninfo; + struct rc_toolbar *toolbar; + } u; + /* Information from a res file. */ + struct rc_res_res_info res_info; + /* Information from a COFF file. */ + rc_res_coff_info coff_info; +} rc_res_resource; + +#define SUBLANG_SHIFT 10 + +/* Memory flags in the memflags field of a rc_res_resource. */ + +#define MEMFLAG_MOVEABLE 0x10 +#define MEMFLAG_PURE 0x20 +#define MEMFLAG_PRELOAD 0x40 +#define MEMFLAG_DISCARDABLE 0x1000 + +/* Standard resource type codes. These are used in the ID field of a + rc_res_entry structure. */ + +#define RT_CURSOR 1 +#define RT_BITMAP 2 +#define RT_ICON 3 +#define RT_MENU 4 +#define RT_DIALOG 5 +#define RT_STRING 6 +#define RT_FONTDIR 7 +#define RT_FONT 8 +#define RT_ACCELERATOR 9 +#define RT_RCDATA 10 +#define RT_MESSAGETABLE 11 +#define RT_GROUP_CURSOR 12 +#define RT_GROUP_ICON 14 +#define RT_VERSION 16 +#define RT_DLGINCLUDE 17 +#define RT_PLUGPLAY 19 +#define RT_VXD 20 +#define RT_ANICURSOR 21 +#define RT_ANIICON 22 +#define RT_HTML 23 +#define RT_MANIFEST 24 +#define RT_DLGINIT 240 +#define RT_TOOLBAR 241 + +/* An accelerator resource is a linked list of these structures. */ + +typedef struct rc_accelerator +{ + /* Next accelerator. */ + struct rc_accelerator *next; + /* Flags. A combination of the ACC values defined below. */ + rc_uint_type flags; + /* Key value. */ + rc_uint_type key; + /* Resource ID. */ + rc_uint_type id; +} rc_accelerator; + +struct __attribute__ ((__packed__)) bin_accelerator +{ + bfd_byte flags[2]; + bfd_byte key[2]; + bfd_byte id[2]; + bfd_byte pad[2]; +}; +#define BIN_ACCELERATOR_SIZE 8 + +/* Accelerator flags in the flags field of a rc_accelerator. + These are the same values that appear in a res file. I hope. */ + +#define ACC_VIRTKEY 0x01 +#define ACC_NOINVERT 0x02 +#define ACC_SHIFT 0x04 +#define ACC_CONTROL 0x08 +#define ACC_ALT 0x10 +#define ACC_LAST 0x80 + +/* A cursor resource. */ + +typedef struct rc_cursor +{ + /* X coordinate of hotspot. */ + bfd_signed_vma xhotspot; + /* Y coordinate of hotspot. */ + bfd_signed_vma yhotspot; + /* Length of bitmap data. */ + rc_uint_type length; + /* Data. */ + const bfd_byte *data; +} rc_cursor; + +struct __attribute__ ((__packed__)) bin_cursor +{ + bfd_byte xhotspot[2]; + bfd_byte yhotspot[2]; +}; +#define BIN_CURSOR_SIZE 4 + +/* A group_cursor resource is a list of rc_i_group_cursor structures. */ + +typedef struct rc_group_cursor +{ + /* Next cursor in group. */ + struct rc_group_cursor *next; + /* Width. */ + rc_uint_type width; + /* Height. */ + rc_uint_type height; + /* Planes. */ + rc_uint_type planes; + /* Bits per pixel. */ + rc_uint_type bits; + /* Number of bytes in cursor resource. */ + rc_uint_type bytes; + /* Index of cursor resource. */ + rc_uint_type index; +} rc_group_cursor; + +struct __attribute__ ((__packed__)) bin_group_cursor_item +{ + bfd_byte width[2]; + bfd_byte height[2]; + bfd_byte planes[2]; + bfd_byte bits[2]; + bfd_byte bytes[4]; + bfd_byte index[2]; +}; +#define BIN_GROUP_CURSOR_ITEM_SIZE 14 + +struct __attribute__ ((__packed__)) bin_group_cursor +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; + bfd_byte nitems[2]; + /* struct bin_group_cursor_item item[nitems]; */ +}; +#define BIN_GROUP_CURSOR_SIZE 6 + +/* A dialog resource. */ + +typedef struct rc_dialog +{ + /* Basic window style. */ + unsigned int style; + /* Extended window style. */ + rc_uint_type exstyle; + /* X coordinate. */ + rc_uint_type x; + /* Y coordinate. */ + rc_uint_type y; + /* Width. */ + rc_uint_type width; + /* Height. */ + rc_uint_type height; + /* Menu name. */ + rc_res_id menu; + /* Class name. */ + rc_res_id class; + /* Caption. */ + unichar *caption; + /* Font point size. */ + rc_uint_type pointsize; + /* Font name. */ + unichar *font; + /* Extended information for a dialogex. */ + struct rc_dialog_ex *ex; + /* Controls. */ + struct rc_dialog_control *controls; +} rc_dialog; + +struct __attribute__ ((__packed__)) bin_dialog +{ + bfd_byte style[4]; + bfd_byte exstyle[4]; + bfd_byte off[2]; + bfd_byte x[2]; + bfd_byte y[2]; + bfd_byte width[2]; + bfd_byte height[2]; +}; +#define BIN_DIALOG_SIZE 18 + +/* An extended dialog has additional information. */ + +typedef struct rc_dialog_ex +{ + /* Help ID. */ + rc_uint_type help; + /* Font weight. */ + rc_uint_type weight; + /* Whether the font is italic. */ + bfd_byte italic; + /* Character set. */ + bfd_byte charset; +} rc_dialog_ex; + +struct __attribute__ ((__packed__)) bin_dialogex +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; + bfd_byte help[4]; + bfd_byte exstyle[4]; + bfd_byte style[4]; + bfd_byte off[2]; + bfd_byte x[2]; + bfd_byte y[2]; + bfd_byte width[2]; + bfd_byte height[2]; +}; +#define BIN_DIALOGEX_SIZE 26 + +struct __attribute__ ((__packed__)) bin_dialogfont +{ + bfd_byte pointsize[2]; +}; +#define BIN_DIALOGFONT_SIZE 2 + +struct __attribute__ ((__packed__)) bin_dialogexfont +{ + bfd_byte pointsize[2]; + bfd_byte weight[2]; + bfd_byte italic[1]; + bfd_byte charset[1]; +}; +#define BIN_DIALOGEXFONT_SIZE 6 + +/* Window style flags, from the winsup Defines.h header file. These + can appear in the style field of a rc_dialog or a rc_dialog_control. */ + +#define CW_USEDEFAULT 0x80000000 +#define WS_BORDER 0x800000L +#define WS_CAPTION 0xc00000L +#define WS_CHILD 0x40000000L +#define WS_CHILDWINDOW 0x40000000L +#define WS_CLIPCHILDREN 0x2000000L +#define WS_CLIPSIBLINGS 0x4000000L +#define WS_DISABLED 0x8000000L +#define WS_DLGFRAME 0x400000L +#define WS_GROUP 0x20000L +#define WS_HSCROLL 0x100000L +#define WS_ICONIC 0x20000000L +#define WS_MAXIMIZE 0x1000000L +#define WS_MAXIMIZEBOX 0x10000L +#define WS_MINIMIZE 0x20000000L +#define WS_MINIMIZEBOX 0x20000L +#define WS_OVERLAPPED 0L +#define WS_OVERLAPPEDWINDOW 0xcf0000L +#define WS_POPUP 0x80000000L +#define WS_POPUPWINDOW 0x80880000L +#define WS_SIZEBOX 0x40000L +#define WS_SYSMENU 0x80000L +#define WS_TABSTOP 0x10000L +#define WS_THICKFRAME 0x40000L +#define WS_TILED 0L +#define WS_TILEDWINDOW 0xcf0000L +#define WS_VISIBLE 0x10000000L +#define WS_VSCROLL 0x200000L +#define MDIS_ALLCHILDSTYLES 0x1 +#define BS_3STATE 0x5L +#define BS_AUTO3STATE 0x6L +#define BS_AUTOCHECKBOX 0x3L +#define BS_AUTORADIOBUTTON 0x9L +#define BS_BITMAP 0x80L +#define BS_BOTTOM 0x800L +#define BS_CENTER 0x300L +#define BS_CHECKBOX 0x2L +#define BS_DEFPUSHBUTTON 0x1L +#define BS_GROUPBOX 0x7L +#define BS_ICON 0x40L +#define BS_LEFT 0x100L +#define BS_LEFTTEXT 0x20L +#define BS_MULTILINE 0x2000L +#define BS_NOTIFY 0x4000L +#define BS_OWNERDRAW 0xbL +#define BS_PUSHBOX 0xcL /* FIXME! What should this be? */ +#define BS_PUSHBUTTON 0L +#define BS_PUSHLIKE 0x1000L +#define BS_RADIOBUTTON 0x4L +#define BS_RIGHT 0x200L +#define BS_RIGHTBUTTON 0x20L +#define BS_TEXT 0L +#define BS_TOP 0x400L +#define BS_USERBUTTON 0x8L +#define BS_VCENTER 0xc00L +#define CBS_AUTOHSCROLL 0x40L +#define CBS_DISABLENOSCROLL 0x800L +#define CBS_DROPDOWN 0x2L +#define CBS_DROPDOWNLIST 0x3L +#define CBS_HASSTRINGS 0x200L +#define CBS_LOWERCASE 0x4000L +#define CBS_NOINTEGRALHEIGHT 0x400L +#define CBS_OEMCONVERT 0x80L +#define CBS_OWNERDRAWFIXED 0x10L +#define CBS_OWNERDRAWVARIABLE 0x20L +#define CBS_SIMPLE 0x1L +#define CBS_SORT 0x100L +#define CBS_UPPERCASE 0x2000L +#define ES_AUTOHSCROLL 0x80L +#define ES_AUTOVSCROLL 0x40L +#define ES_CENTER 0x1L +#define ES_LEFT 0L +#define ES_LOWERCASE 0x10L +#define ES_MULTILINE 0x4L +#define ES_NOHIDESEL 0x100L +#define ES_NUMBER 0x2000L +#define ES_OEMCONVERT 0x400L +#define ES_PASSWORD 0x20L +#define ES_READONLY 0x800L +#define ES_RIGHT 0x2L +#define ES_UPPERCASE 0x8L +#define ES_WANTRETURN 0x1000L +#define LBS_DISABLENOSCROLL 0x1000L +#define LBS_EXTENDEDSEL 0x800L +#define LBS_HASSTRINGS 0x40L +#define LBS_MULTICOLUMN 0x200L +#define LBS_MULTIPLESEL 0x8L +#define LBS_NODATA 0x2000L +#define LBS_NOINTEGRALHEIGHT 0x100L +#define LBS_NOREDRAW 0x4L +#define LBS_NOSEL 0x4000L +#define LBS_NOTIFY 0x1L +#define LBS_OWNERDRAWFIXED 0x10L +#define LBS_OWNERDRAWVARIABLE 0x20L +#define LBS_SORT 0x2L +#define LBS_STANDARD 0xa00003L +#define LBS_USETABSTOPS 0x80L +#define LBS_WANTKEYBOARDINPUT 0x400L +#define SBS_BOTTOMALIGN 0x4L +#define SBS_HORZ 0L +#define SBS_LEFTALIGN 0x2L +#define SBS_RIGHTALIGN 0x4L +#define SBS_SIZEBOX 0x8L +#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x4L +#define SBS_SIZEBOXTOPLEFTALIGN 0x2L +#define SBS_SIZEGRIP 0x10L +#define SBS_TOPALIGN 0x2L +#define SBS_VERT 0x1L +#define SS_BITMAP 0xeL +#define SS_BLACKFRAME 0x7L +#define SS_BLACKRECT 0x4L +#define SS_CENTER 0x1L +#define SS_CENTERIMAGE 0x200L +#define SS_ENHMETAFILE 0xfL +#define SS_ETCHEDFRAME 0x12L +#define SS_ETCHEDHORZ 0x10L +#define SS_ETCHEDVERT 0x11L +#define SS_GRAYFRAME 0x8L +#define SS_GRAYRECT 0x5L +#define SS_ICON 0x3L +#define SS_LEFT 0L +#define SS_LEFTNOWORDWRAP 0xcL +#define SS_NOPREFIX 0x80L +#define SS_NOTIFY 0x100L +#define SS_OWNERDRAW 0xdL +#define SS_REALSIZEIMAGE 0x800L +#define SS_RIGHT 0x2L +#define SS_RIGHTJUST 0x400L +#define SS_SIMPLE 0xbL +#define SS_SUNKEN 0x1000L +#define SS_USERITEM 0xaL +#define SS_WHITEFRAME 0x9L +#define SS_WHITERECT 0x6L +#define DS_3DLOOK 0x4L +#define DS_ABSALIGN 0x1L +#define DS_CENTER 0x800L +#define DS_CENTERMOUSE 0x1000L +#define DS_CONTEXTHELP 0x2000L +#define DS_CONTROL 0x400L +#define DS_FIXEDSYS 0x8L +#define DS_LOCALEDIT 0x20L +#define DS_MODALFRAME 0x80L +#define DS_NOFAILCREATE 0x10L +#define DS_NOIDLEMSG 0x100L +#define DS_SETFONT 0x40L +#define DS_SETFOREGROUND 0x200L +#define DS_SYSMODAL 0x2L + +/* A dialog control. */ + +typedef struct rc_dialog_control +{ + /* Next control. */ + struct rc_dialog_control *next; + /* ID. */ + rc_uint_type id; + /* Style. */ + rc_uint_type style; + /* Extended style. */ + rc_uint_type exstyle; + /* X coordinate. */ + rc_uint_type x; + /* Y coordinate. */ + rc_uint_type y; + /* Width. */ + rc_uint_type width; + /* Height. */ + rc_uint_type height; + /* Class name. */ + rc_res_id class; + /* Associated text. */ + rc_res_id text; + /* Extra data for the window procedure. */ + struct rc_rcdata_item *data; + /* Help ID. Only used in an extended dialog. */ + rc_uint_type help; +} rc_dialog_control; + +struct __attribute__ ((__packed__)) bin_dialog_control +{ + bfd_byte style[4]; + bfd_byte exstyle[4]; + bfd_byte x[2]; + bfd_byte y[2]; + bfd_byte width[2]; + bfd_byte height[2]; + bfd_byte id[2]; +}; +#define BIN_DIALOG_CONTROL_SIZE 18 + +struct __attribute__ ((__packed__)) bin_dialogex_control +{ + bfd_byte help[4]; + bfd_byte exstyle[4]; + bfd_byte style[4]; + bfd_byte x[2]; + bfd_byte y[2]; + bfd_byte width[2]; + bfd_byte height[2]; + bfd_byte id[4]; +}; +#define BIN_DIALOGEX_CONTROL_SIZE 24 + +/* Control classes. These can be used as the ID field in a rc_dialog_control. */ + +#define CTL_BUTTON 0x80 +#define CTL_EDIT 0x81 +#define CTL_STATIC 0x82 +#define CTL_LISTBOX 0x83 +#define CTL_SCROLLBAR 0x84 +#define CTL_COMBOBOX 0x85 + +/* A fontdir resource is a list of rc_fontdir. */ + +typedef struct rc_fontdir +{ + struct rc_fontdir *next; + /* Index of font entry. */ + rc_uint_type index; + /* Length of font information. */ + rc_uint_type length; + /* Font information. */ + const bfd_byte *data; +} rc_fontdir; + +struct __attribute__ ((__packed__)) bin_fontdir_item +{ + bfd_byte index[2]; + bfd_byte header[54]; + bfd_byte device_name[1]; + /* bfd_byte face_name[]; */ +}; + +/* A group_icon resource is a list of rc_group_icon. */ + +typedef struct rc_group_icon +{ + /* Next icon in group. */ + struct rc_group_icon *next; + /* Width. */ + bfd_byte width; + /* Height. */ + bfd_byte height; + /* Color count. */ + bfd_byte colors; + /* Planes. */ + rc_uint_type planes; + /* Bits per pixel. */ + rc_uint_type bits; + /* Number of bytes in cursor resource. */ + rc_uint_type bytes; + /* Index of cursor resource. */ + rc_uint_type index; +} rc_group_icon; + +struct __attribute__ ((__packed__)) bin_group_icon +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; + bfd_byte count[2]; +}; +#define BIN_GROUP_ICON_SIZE 6 + +struct __attribute__ ((__packed__)) bin_group_icon_item +{ + bfd_byte width[1]; + bfd_byte height[1]; + bfd_byte colors[1]; + bfd_byte pad[1]; + bfd_byte planes[2]; + bfd_byte bits[2]; + bfd_byte bytes[4]; + bfd_byte index[2]; +}; +#define BIN_GROUP_ICON_ITEM_SIZE 14 + +/* A menu resource. */ + +typedef struct rc_menu +{ + /* List of menuitems. */ + struct rc_menuitem *items; + /* Help ID. I don't think there is any way to set this in an rc + file, but it can appear in the binary format. */ + rc_uint_type help; +} rc_menu; + +struct __attribute__ ((__packed__)) bin_menu +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; +}; +#define BIN_MENU_SIZE 4 + +struct __attribute__ ((__packed__)) bin_menuex +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; + bfd_byte help[4]; +}; +#define BIN_MENUEX_SIZE 8 + +/* A menu resource is a list of rc_menuitem. */ + +typedef struct rc_menuitem +{ + /* Next menu item. */ + struct rc_menuitem *next; + /* Type. In a normal menu, rather than a menuex, this is the flags + field. */ + rc_uint_type type; + /* State. This is only used in a menuex. */ + rc_uint_type state; + /* Id. */ + rc_uint_type id; + /* Unicode text. */ + unichar *text; + /* Popup menu items for a popup. */ + struct rc_menuitem *popup; + /* Help ID. This is only used in a menuex. */ + rc_uint_type help; +} rc_menuitem; + +struct __attribute__ ((__packed__)) bin_menuitem +{ + bfd_byte flags[2]; + bfd_byte id[2]; +}; +#define BIN_MENUITEM_SIZE 4 +#define BIN_MENUITEM_POPUP_SIZE 2 + +struct __attribute__ ((__packed__)) bin_menuitemex +{ + bfd_byte type[4]; + bfd_byte state[4]; + bfd_byte id[4]; + bfd_byte flags[2]; + /* unicode text */ + /* if popup: align, bfd_byte help[4], align, bin_menuitemex[]; */ +}; +#define BIN_MENUITEMEX_SIZE 14 + +/* Menu item flags. These can appear in the flags field of a rc_menuitem. */ + +#define MENUITEM_GRAYED 0x001 +#define MENUITEM_INACTIVE 0x002 +#define MENUITEM_BITMAP 0x004 +#define MENUITEM_OWNERDRAW 0x100 +#define MENUITEM_CHECKED 0x008 +#define MENUITEM_POPUP 0x010 +#define MENUITEM_MENUBARBREAK 0x020 +#define MENUITEM_MENUBREAK 0x040 +#define MENUITEM_ENDMENU 0x080 +#define MENUITEM_HELP 0x4000 + +/* An rcdata resource is a pointer to a list of rc_rcdata_item. */ + +typedef struct rc_rcdata_item +{ + /* Next data item. */ + struct rc_rcdata_item *next; + /* Type of data. */ + enum + { + RCDATA_WORD, + RCDATA_DWORD, + RCDATA_STRING, + RCDATA_WSTRING, + RCDATA_BUFFER + } type; + union + { + rc_uint_type word; + rc_uint_type dword; + struct + { + rc_uint_type length; + const char *s; + } string; + struct + { + rc_uint_type length; + const unichar *w; + } wstring; + struct + { + rc_uint_type length; + const bfd_byte *data; + } buffer; + } u; +} rc_rcdata_item; + +/* A stringtable resource is a pointer to a rc_stringtable. */ + +typedef struct rc_stringtable +{ + /* Each stringtable resource is a list of 16 unicode strings. */ + struct + { + /* Length of string. */ + rc_uint_type length; + /* String data if length > 0. */ + unichar *string; + } strings[16]; +} rc_stringtable; + +/* A versioninfo resource points to a rc_versioninfo. */ + +typedef struct rc_versioninfo +{ + /* Fixed version information. */ + struct rc_fixed_versioninfo *fixed; + /* Variable version information. */ + struct rc_ver_info *var; +} rc_versioninfo; + +struct __attribute__ ((__packed__)) bin_versioninfo +{ + bfd_byte size[2]; + bfd_byte fixed_size[2]; + bfd_byte sig2[2]; +}; +#define BIN_VERSIONINFO_SIZE 6 + +/* The fixed portion of a versioninfo resource. */ + +typedef struct rc_fixed_versioninfo +{ + /* The file version, which is two 32 bit integers. */ + rc_uint_type file_version_ms; + rc_uint_type file_version_ls; + /* The product version, which is two 32 bit integers. */ + rc_uint_type product_version_ms; + rc_uint_type product_version_ls; + /* The file flags mask. */ + rc_uint_type file_flags_mask; + /* The file flags. */ + rc_uint_type file_flags; + /* The OS type. */ + rc_uint_type file_os; + /* The file type. */ + rc_uint_type file_type; + /* The file subtype. */ + rc_uint_type file_subtype; + /* The date, which in Windows is two 32 bit integers. */ + rc_uint_type file_date_ms; + rc_uint_type file_date_ls; +} rc_fixed_versioninfo; + +struct __attribute__ ((__packed__)) bin_fixed_versioninfo +{ + bfd_byte sig1[4]; + bfd_byte sig2[4]; + bfd_byte file_version[4]; + bfd_byte file_version_ls[4]; + bfd_byte product_version_ms[4]; + bfd_byte product_version_ls[4]; + bfd_byte file_flags_mask[4]; + bfd_byte file_flags[4]; + bfd_byte file_os[4]; + bfd_byte file_type[4]; + bfd_byte file_subtype[4]; + bfd_byte file_date_ms[4]; + bfd_byte file_date_ls[4]; +}; +#define BIN_FIXED_VERSIONINFO_SIZE 52 + +/* A list of variable version information. */ + +typedef struct rc_ver_info +{ + /* Next item. */ + struct rc_ver_info *next; + /* Type of data. */ + enum { VERINFO_STRING, VERINFO_VAR } type; + union + { + /* StringFileInfo data. */ + struct + { + /* Language. */ + unichar *language; + /* Strings. */ + struct rc_ver_stringinfo *strings; + } string; + /* VarFileInfo data. */ + struct + { + /* Key. */ + unichar *key; + /* Values. */ + struct rc_ver_varinfo *var; + } var; + } u; +} rc_ver_info; + +struct __attribute__ ((__packed__)) bin_ver_info +{ + bfd_byte size[2]; + bfd_byte sig1[2]; + bfd_byte sig2[2]; +}; +#define BIN_VER_INFO_SIZE 6 + +/* A list of string version information. */ + +typedef struct rc_ver_stringinfo +{ + /* Next string. */ + struct rc_ver_stringinfo *next; + /* Key. */ + unichar *key; + /* Value. */ + unichar *value; +} rc_ver_stringinfo; + +/* A list of variable version information. */ + +typedef struct rc_ver_varinfo +{ + /* Next item. */ + struct rc_ver_varinfo *next; + /* Language ID. */ + rc_uint_type language; + /* Character set ID. */ + rc_uint_type charset; +} rc_ver_varinfo; + +typedef struct rc_toolbar_item +{ + struct rc_toolbar_item *next; + struct rc_toolbar_item *prev; + rc_res_id id; +} rc_toolbar_item; + +struct __attribute__ ((__packed__)) bin_messagetable_item +{ + bfd_byte length[2]; + bfd_byte flags[2]; + bfd_byte data[1]; +}; +#define BIN_MESSAGETABLE_ITEM_SIZE 4 + +#define MESSAGE_RESOURCE_UNICODE 0x0001 + +struct __attribute__ ((__packed__)) bin_messagetable_block +{ + bfd_byte lowid[4]; + bfd_byte highid[4]; + bfd_byte offset[4]; +}; +#define BIN_MESSAGETABLE_BLOCK_SIZE 12 + +struct __attribute__ ((__packed__)) bin_messagetable +{ + bfd_byte cblocks[4]; + struct bin_messagetable_block items[1]; +}; +#define BIN_MESSAGETABLE_SIZE 8 + +typedef struct rc_toolbar +{ + rc_uint_type button_width; + rc_uint_type button_height; + rc_uint_type nitems; + rc_toolbar_item *items; +} rc_toolbar; + +struct __attribute__ ((__packed__)) bin_toolbar +{ + bfd_byte button_width[4]; + bfd_byte button_height[4]; + bfd_byte nitems[4]; + /* { bfd_byte id[4]; } * nitems; */ +}; +#define BIN_TOOLBAR_SIZE 12 + +extern int target_is_bigendian; + +typedef struct windres_bfd +{ + bfd *abfd; + asection *sec; + rc_uint_type kind : 4; +} windres_bfd; + +#define WR_KIND_TARGET 0 +#define WR_KIND_BFD 1 +#define WR_KIND_BFD_BIN_L 2 +#define WR_KIND_BFD_BIN_B 3 + +#define WR_KIND(PTR) (PTR)->kind +#define WR_SECTION(PTR) (PTR)->sec +#define WR_BFD(PTR) (PTR)->abfd + +extern void set_windres_bfd_content (windres_bfd *, const void *, rc_uint_type, rc_uint_type); +extern void get_windres_bfd_content (windres_bfd *, void *, rc_uint_type, rc_uint_type); + +extern void windres_put_8 (windres_bfd *, void *, rc_uint_type); +extern void windres_put_16 (windres_bfd *, void *, rc_uint_type); +extern void windres_put_32 (windres_bfd *, void *, rc_uint_type); +extern rc_uint_type windres_get_8 (windres_bfd *, const void *, rc_uint_type); +extern rc_uint_type windres_get_16 (windres_bfd *, const void *, rc_uint_type); +extern rc_uint_type windres_get_32 (windres_bfd *, const void *, rc_uint_type); + +extern void set_windres_bfd (windres_bfd *, bfd *, asection *, rc_uint_type); +extern void set_windres_bfd_endianess (windres_bfd *, int); + +#endif diff --git a/binutils/windmc.c b/binutils/windmc.c new file mode 100644 index 000000000000..5465b351cd77 --- /dev/null +++ b/binutils/windmc.c @@ -0,0 +1,1197 @@ +/* windmc.c -- a program to compile Windows message files. + Copyright 2007 + Free Software Foundation, Inc. + Written by Kai Tietz, Onevision. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +/* This program can read and comile Windows message format. + + It is based on information taken from the following sources: + + * Microsoft documentation. + + * The wmc program, written by Bertho A. Stultiens (BS). */ + +#include "sysdep.h" +#include <assert.h> +#include <time.h> +#include "bfd.h" +#include "getopt.h" +#include "bucomm.h" +#include "libiberty.h" +#include "safe-ctype.h" +#include "obstack.h" + +#include "windmc.h" +#include "windint.h" + +/* Defines a message compiler element item with length and offset + information. */ +typedef struct mc_msg_item +{ + rc_uint_type res_len; + rc_uint_type res_off; + struct bin_messagetable_item *res; +} mc_msg_item; + +/* Defined in bfd/binary.c. Used to set architecture and machine of input + binary files. */ +extern enum bfd_architecture bfd_external_binary_architecture; +extern unsigned long bfd_external_machine; + +int target_is_bigendian = 0; +const char *def_target_arch; + +/* Globals and static variable definitions. */ + +/* bfd global helper struct variable. */ +static struct +{ + bfd *abfd; + asection *sec; +} mc_bfd; + +/* Memory list. */ +mc_node *mc_nodes = NULL; +static mc_node_lang **mc_nodes_lang = NULL; +static int mc_nodes_lang_count = 0; +static mc_keyword **mc_severity_codes = NULL; +static int mc_severity_codes_count = 0; +static mc_keyword **mc_facility_codes = NULL; +static int mc_facility_codes_count = 0; + +/* When we are building a resource tree, we allocate everything onto + an obstack, so that we can free it all at once if we want. */ +#define obstack_chunk_alloc xmalloc +#define obstack_chunk_free free + +/* The resource building obstack. */ +static struct obstack res_obstack; + +/* Flag variables. */ +/* Set by -C. Set the default code page to be used for input text file. */ +static rc_uint_type mcset_codepage_in = 0; + +/* Set by -O. Set the default code page to be used for output text files. */ +static rc_uint_type mcset_codepage_out = 0; + +/* Set by -b. .BIN filename should have .mc filename_ included for uniqueness. */ +static int mcset_prefix_bin = 0; + +/* The base name of the .mc file. */ +static const char *mcset_mc_basename = "unknown"; + +/* Set by -e <ext>. Specify the extension for the header file. */ +static const char *mcset_header_ext = ".h"; + +/* Set by -h <path>. Gives the path of where to create the C include file. */ +static const char *mcset_header_dir = "./"; + +/* Set by -r <path>. Gives the path of where to create the RC include file + and the binary message resource files it includes. */ +static const char *mcset_rc_dir = "./"; + +/* Modified by -a & -u. By -u input file is unicode, by -a is ASCII (default). */ +static int mcset_text_in_is_unicode = 0; + +/* Modified by -A & -U. By -U bin file is unicode (default), by -A is ASCII. */ +static int mcset_bin_out_is_unicode = 1; + +/* Set by -c. Sets the Customer bit in all the message ID's. */ +int mcset_custom_bit = 0; + +/* Set by -o. Generate OLE2 header file. Use HRESULT definition instead of + status code definition. */ +static int mcset_use_hresult = 0; + +/* Set by -m <msglen>. Generate a warning if the size of any message exceeds + maxmsglen characters. */ +rc_uint_type mcset_max_message_length = 0; + +/* Set by -d. Sets message values in header to decimal initially. */ +int mcset_out_values_are_decimal = 0; + +/* Set by -n. terminates all strings with null's in the message tables. */ +static int mcset_automatic_null_termination = 0; + +/* The type used for message id output in header. */ +unichar *mcset_msg_id_typedef = NULL; + +/* Set by -x path. Geberated debug C file for mapping ID's to text. */ +static const char *mcset_dbg_dir = NULL; + +/* getopt long name definitions. */ +static const struct option long_options[] = +{ + {"binprefix", no_argument, 0, 'b'}, + {"target", required_argument, 0, 'F'}, + {"extension", required_argument, 0, 'e'}, + {"headerdir", required_argument, 0, 'h'}, + {"rcdir", required_argument, 0, 'r'}, + {"verbose", no_argument, 0, 'v'}, + {"codepage_in", required_argument, 0, 'C'}, + {"codepage_out", required_argument, 0, 'O'}, + {"maxlength", required_argument, 0, 'm'}, + {"ascii_in", no_argument, 0, 'a'}, + {"ascii_out", no_argument, 0, 'A'}, + {"unicode_in", no_argument, 0, 'u'}, + {"unicode_out", no_argument, 0, 'U'}, + {"customflag", no_argument, 0, 'c'}, + {"decimal_values", no_argument, 0, 'd'}, + {"hresult_use", no_argument, 0, 'o'}, + {"nullterminate", no_argument, 0, 'n'}, + {"xdbg", required_argument, 0, 'x'}, + {"version", no_argument, 0, 'V'}, + {"help", no_argument, 0, 'H'}, + {0, no_argument, 0, 0} +}; + + +/* Initialize the resource building obstack. */ +static void +res_init (void) +{ + obstack_init (&res_obstack); +} + +/* Allocate space on the resource building obstack. */ +void * +res_alloc (rc_uint_type bytes) +{ + return (void *) obstack_alloc (&res_obstack, (size_t) bytes); +} + +static FILE * +mc_create_path_text_file (const char *path, const char *ext) +{ + FILE *ret; + size_t len = 1; + char *hsz; + + len += (path != NULL ? strlen (path) : 0); + len += strlen (mcset_mc_basename); + len += (ext != NULL ? strlen (ext) : 0); + hsz = xmalloc (len); + sprintf (hsz, "%s%s%s", (path != NULL ? path : ""), mcset_mc_basename, + (ext != NULL ? ext : "")); + if ((ret = fopen (hsz, "wb")) == NULL) + fatal (_("can't create %s file ,%s' for output.\n"), (ext ? ext : "text"), hsz); + free (hsz); + return ret; +} + +static void +usage (FILE *stream, int status) +{ + fprintf (stream, _("Usage: %s [option(s)] [input-file]\n"), + program_name); + fprintf (stream, _(" The options are:\n\ + -a --ascii_in Read input file as ASCII file\n\ + -A --ascii_out Write binary messages as ASCII\n\ + -b --binprefix .bin filename is prefixed by .mc filename_ for uniqueness.\n\ + -c --customflag Set custom flags for messages\n\ + -C --codepage_in=<val> Set codepage when reading mc text file\n\ + -d --decimal_values Print values to text files decimal\n\ + -e --extension=<extension> Set header extension used on export header file\n\ + -F --target <target> Specify output target for endianess.\n\ + -h --headerdir=<directory> Set the export directory for headers\n\ + -u --unicode_in Read input file as UTF16 file\n\ + -U --unicode_out Write binary messages as UFT16\n\ + -m --maxlength=<val> Set the maximal allowed message length\n\ + -n --nullterminate Automatic add a zero termination to strings\n\ + -o --hresult_use Use HRESULT definition instead of status code definition\n\ + -O --codepage_out=<val> Set codepage used for writing text file\n\ + -r --rcdir=<directory> Set the export directory for rc files\n\ + -x --xdbg=<directory> Where to create the .dbg C include file\n\ + that maps message ID's to their symbolic name.\n\ +")); + fprintf (stream, _("\ + -H --help Print this help message\n\ + -v --verbose Verbose - tells you what it's doing\n\ + -V --version Print version information\n")); + + list_supported_targets (program_name, stream); + + if (REPORT_BUGS_TO[0] && status == 0) + fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); + + exit (status); +} + +static void +set_endianess (bfd *abfd, const char *target) +{ + const bfd_target *target_vec; + + def_target_arch = NULL; + target_vec = bfd_find_target (target, abfd); + if (! target_vec) + fatal ("Can't detect target endianess and architecture."); + target_is_bigendian = ((target_vec->byteorder == BFD_ENDIAN_BIG) ? 1 : 0); + { + const char *tname = target_vec->name; + const char **arch = bfd_arch_list (); + + if (arch && tname) + { + if (strchr (tname, '-') != NULL) + tname = strchr (tname, '-') + 1; + while (*arch != NULL) + { + const char *in_a = strstr (*arch, tname); + char end_ch = (in_a ? in_a[strlen (tname)] : 0); + if (in_a && (in_a == *arch || in_a[-1] == ':') + && end_ch == 0) + { + def_target_arch = *arch; + break; + } + arch++; + } + } + if (! def_target_arch) + fatal ("Can't detect architecture."); + } +} + +static int +probe_codepage (rc_uint_type *cp, int *is_uni, const char *pswitch, int defmode) +{ + if (*is_uni == -1) + { + if (*cp != CP_UTF16) + *is_uni = defmode; + else + *is_uni = 1; + } + if (*is_uni) + { + if (*cp != 0 && *cp != CP_UTF16) + { + fprintf (stderr, _("%s: warning: "), program_name); + fprintf (stderr, _("A codepage was specified switch ,%s' and UTF16.\n"), pswitch); + fprintf (stderr, _("\tcodepage settings are ignored.\n")); + } + *cp = CP_UTF16; + return 1; + } + if (*cp == CP_UTF16) + { + *is_uni = 1; + return 1; + } + if (*cp == 0) + *cp = 1252; + if (! unicode_is_valid_codepage (*cp)) + fatal ("Code page 0x%x is unknown.", (unsigned int) *cp); + *is_uni = 0; + return 1; +} + +mc_node * +mc_add_node (void) +{ + mc_node *ret; + + ret = res_alloc (sizeof (mc_node)); + memset (ret, 0, sizeof (mc_node)); + if (! mc_nodes) + mc_nodes = ret; + else + { + mc_node *h = mc_nodes; + + while (h->next != NULL) + h = h->next; + h->next = ret; + } + return ret; +} + +mc_node_lang * +mc_add_node_lang (mc_node *root, const mc_keyword *lang, rc_uint_type vid) +{ + mc_node_lang *ret, *h, *p; + + if (! lang || ! root) + fatal (_("try to add a ill language.")); + ret = res_alloc (sizeof (mc_node_lang)); + memset (ret, 0, sizeof (mc_node_lang)); + ret->lang = lang; + ret->vid = vid; + if ((h = root->sub) == NULL) + root->sub = ret; + else + { + p = NULL; + while (h != NULL) + { + if (h->lang->nval > lang->nval) + break; + if (h->lang->nval == lang->nval) + { + if (h->vid > vid) + break; + if (h->vid == vid) + fatal ("double defined message id %ld.\n", (long) vid); + } + h = (p = h)->next; + } + ret->next = h; + if (! p) + root->sub = ret; + else + p->next = ret; + } + return ret; +} + +static char * +convert_unicode_to_ACP (const unichar *usz) +{ + char *s; + rc_uint_type l; + + if (! usz) + return NULL; + codepage_from_unicode (&l, usz, &s, mcset_codepage_out); + if (! s) + fatal ("unicode string not mappable to ASCII codepage 0x%lx.\n", (long) mcset_codepage_out); + return s; +} + +static void +write_dbg_define (FILE *fp, const unichar *sym_name, const unichar *typecast) +{ + char *sym; + + if (!sym_name || sym_name[0] == 0) + return; + sym = convert_unicode_to_ACP (sym_name); + fprintf (fp, " {("); + if (typecast) + unicode_print (fp, typecast, unichar_len (typecast)); + else + fprintf (fp, "DWORD"); + fprintf (fp, ") %s, \"%s\" },\n", sym, sym); +} + +static void +write_header_define (FILE *fp, const unichar *sym_name, rc_uint_type vid, const unichar *typecast, mc_node_lang *nl) +{ + char *sym; + char *tdef = NULL; + + if (!sym_name || sym_name[0] == 0) + { + if (nl != NULL) + { + if (mcset_out_values_are_decimal) + fprintf (fp, "//\n// MessageId: 0x%lu\n//\n", (unsigned long) vid); + else + fprintf (fp, "//\n// MessageId: 0x%lx\n//\n", (unsigned long) vid); + } + return; + } + sym = convert_unicode_to_ACP (sym_name); + if (typecast && typecast[0] != 0) + tdef = convert_unicode_to_ACP (typecast); + fprintf (fp, "//\n// MessageId: %s\n//\n", sym); + if (! mcset_out_values_are_decimal) + fprintf (fp, "#define %s %s%s%s 0x%lx\n\n", sym, + (tdef ? "(" : ""), (tdef ? tdef : ""), (tdef ? ")" : ""), + (unsigned long) vid); + else + fprintf (fp, "#define %s %s%s%s 0x%lu\n\n", sym, + (tdef ? "(" : ""), (tdef ? tdef : ""), (tdef ? ")" : ""), + (unsigned long) vid); +} + +static int +sort_mc_node_lang (const void *l, const void *r) +{ + const mc_node_lang *l1 = *((const mc_node_lang **)l); + const mc_node_lang *r1 = *((const mc_node_lang **)r); + + if (l == r) + return 0; + if (l1->lang != r1->lang) + { + if (l1->lang->nval < r1->lang->nval) + return -1; + return 1; + } + if (l1->vid == r1->vid) + return 0; + if (l1->vid < r1->vid) + return -1; + return 1; +} + +static int +sort_keyword_by_nval (const void *l, const void *r) +{ + const mc_keyword *l1 = *((const mc_keyword **)l); + const mc_keyword *r1 = *((const mc_keyword **)r); + rc_uint_type len1, len2; + int e; + + if (l == r) + return 0; + if (l1->nval != r1->nval) + { + if (l1->nval < r1->nval) + return -1; + return 1; + } + len1 = unichar_len (l1->usz); + len2 = unichar_len (r1->usz); + if (len1 <= len2) + e = memcmp (l1->usz, r1->usz, sizeof (unichar) * len1); + else + e = memcmp (l1->usz, r1->usz, sizeof (unichar) * len2); + if (e) + return e; + if (len1 < len2) + return -1; + else if (len1 > len2) + return 1; + return 0; +} + +static void +do_sorts (void) +{ + mc_node *h; + mc_node_lang *n; + const mc_keyword *k; + int i; + + /* Sort message by their language and id ascending. */ + mc_nodes_lang_count = 0; + + h = mc_nodes; + while (h != NULL) + { + n = h->sub; + while (n != NULL) + { + mc_nodes_lang_count +=1; + n = n->next; + } + h = h->next; + } + + if (mc_nodes_lang_count != 0) + { + h = mc_nodes; + i = 0; + mc_nodes_lang = xmalloc (sizeof (mc_node_lang *) * mc_nodes_lang_count); + + while (h != NULL) + { + n = h->sub; + while (n != NULL) + { + mc_nodes_lang[i++] = n; + n = n->next; + } + h = h->next; + } + qsort (mc_nodes_lang, (size_t) mc_nodes_lang_count, sizeof (mc_node_lang *), sort_mc_node_lang); + } + /* Sort facility code definitions by there id ascending. */ + i = 0; + while ((k = enum_facility (i)) != NULL) + ++i; + mc_facility_codes_count = i; + if (i != 0) + { + mc_facility_codes = xmalloc (sizeof (mc_keyword *) * i); + i = 0; + while ((k = enum_facility (i)) != NULL) + mc_facility_codes[i++] = (mc_keyword *) k; + qsort (mc_facility_codes, (size_t) mc_facility_codes_count, sizeof (mc_keyword *), sort_keyword_by_nval); + } + + /* Sort severity code definitions by there id ascending. */ + i = 0; + while ((k = enum_severity (i)) != NULL) + ++i; + mc_severity_codes_count = i; + if (i != 0) + { + mc_severity_codes = xmalloc (sizeof (mc_keyword *) * i); + i = 0; + while ((k = enum_severity (i)) != NULL) + mc_severity_codes[i++] = (mc_keyword *) k; + qsort (mc_severity_codes, (size_t) mc_severity_codes_count, sizeof (mc_keyword *), sort_keyword_by_nval); + } +} + +static int +mc_get_block_count (mc_node_lang **nl, int elems) +{ + rc_uint_type exid; + int i, ret; + + if (! nl) + return 0; + i = 0; + ret = 0; + while (i < elems) + { + ret++; + exid = nl[i++]->vid; + while (i < elems && nl[i]->vid == exid + 1) + exid = nl[i++]->vid; + } + return ret; +} + +static bfd * +windmc_open_as_binary (const char *filename) +{ + bfd *abfd; + + abfd = bfd_openw (filename, "binary"); + if (! abfd) + fatal ("can't open `%s' for output", filename); + + return abfd; +} + +static void +target_put_16 (void *p, rc_uint_type value) +{ + assert (!! p); + + if (target_is_bigendian) + bfd_putb16 (value, p); + else + bfd_putl16 (value, p); +} + +static void +target_put_32 (void *p, rc_uint_type value) +{ + assert (!! p); + + if (target_is_bigendian) + bfd_putb32 (value, p); + else + bfd_putl32 (value, p); +} + +static struct bin_messagetable_item * +mc_generate_bin_item (mc_node_lang *n, rc_uint_type *res_len) +{ + struct bin_messagetable_item *ret = NULL; + rc_uint_type len; + + *res_len = 0; + if (mcset_bin_out_is_unicode == 1) + { + unichar *ht = n->message; + rc_uint_type txt_len; + + txt_len = unichar_len (n->message); + if (mcset_automatic_null_termination && txt_len != 0) + { + while (txt_len > 0 && ht[txt_len - 1] > 0 && ht[txt_len - 1] < 0x20) + ht[--txt_len] = 0; + } + txt_len *= sizeof (unichar); + len = BIN_MESSAGETABLE_ITEM_SIZE + txt_len + sizeof (unichar); + ret = res_alloc ((len + 3) & ~3); + memset (ret, 0, (len + 3) & ~3); + target_put_16 (ret->length, (len + 3) & ~3); + target_put_16 (ret->flags, MESSAGE_RESOURCE_UNICODE); + txt_len = 0; + while (*ht != 0) + { + target_put_16 (ret->data + txt_len, *ht++); + txt_len += 2; + } + } + else + { + rc_uint_type txt_len, l; + char *cvt_txt; + + codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp); + if (! cvt_txt) + fatal ("Failed to convert message to language codepage.\n"); + txt_len = strlen (cvt_txt); + if (mcset_automatic_null_termination && txt_len > 0) + { + while (txt_len > 0 && cvt_txt[txt_len - 1] > 0 && cvt_txt[txt_len - 1] < 0x20) + cvt_txt[--txt_len] = 0; + } + len = BIN_MESSAGETABLE_ITEM_SIZE + txt_len + 1; + ret = res_alloc ((len + 3) & ~3); + memset (ret, 0, (len + 3) & ~3); + target_put_16 (ret->length, (len + 3) & ~3); + target_put_16 (ret->flags, 0); + strcpy ((char *) ret->data, cvt_txt); + } + *res_len = (len + 3) & ~3; + return ret; +} + +static void +mc_write_blocks (struct bin_messagetable *mtbl, mc_node_lang **nl, mc_msg_item *ml, int elems) +{ + int i, idx = 0; + rc_uint_type exid; + + if (! nl) + return; + i = 0; + while (i < elems) + { + target_put_32 (mtbl->items[idx].lowid, nl[i]->vid); + target_put_32 (mtbl->items[idx].highid, nl[i]->vid); + target_put_32 (mtbl->items[idx].offset, ml[i].res_off); + exid = nl[i++]->vid; + while (i < elems && nl[i]->vid == exid + 1) + { + target_put_32 (mtbl->items[idx].highid, nl[i]->vid); + exid = nl[i++]->vid; + } + ++idx; + } +} + +static void +set_windmc_bfd_content (const void *data, rc_uint_type off, rc_uint_type length) +{ + if (! bfd_set_section_contents (mc_bfd.abfd, mc_bfd.sec, data, off, length)) + bfd_fatal ("bfd_set_section_contents"); +} + +static void +windmc_write_bin (const char *filename, mc_node_lang **nl, int elems) +{ + unsigned long sec_length = 1; + int block_count, i; + mc_msg_item *mi; + struct bin_messagetable *mtbl; + rc_uint_type dta_off, dta_start; + + if (elems <= 0) + return; + mc_bfd.abfd = windmc_open_as_binary (filename); + mc_bfd.sec = bfd_make_section (mc_bfd.abfd, ".data"); + if (mc_bfd.sec == NULL) + bfd_fatal ("bfd_make_section"); + if (! bfd_set_section_flags (mc_bfd.abfd, mc_bfd.sec, + (SEC_HAS_CONTENTS | SEC_ALLOC + | SEC_LOAD | SEC_DATA))) + bfd_fatal ("bfd_set_section_flags"); + /* Requiring this is probably a bug in BFD. */ + mc_bfd.sec->output_section = mc_bfd.sec; + + block_count = mc_get_block_count (nl, elems); + + dta_off = (rc_uint_type) ((BIN_MESSAGETABLE_BLOCK_SIZE * block_count) + BIN_MESSAGETABLE_SIZE - 4); + dta_start = dta_off = (dta_off + 3) & ~3; + mi = xmalloc (sizeof (mc_msg_item) * elems); + mtbl = xmalloc (dta_start); + + /* Clear header region. */ + memset (mtbl, 0, dta_start); + target_put_32 (mtbl->cblocks, block_count); + /* Prepare items section for output. */ + for (i = 0; i < elems; i++) + { + mi[i].res_off = dta_off; + mi[i].res = mc_generate_bin_item (nl[i], &mi[i].res_len); + dta_off += mi[i].res_len; + } + sec_length = (dta_off + 3) & ~3; + if (! bfd_set_section_size (mc_bfd.abfd, mc_bfd.sec, sec_length)) + bfd_fatal ("bfd_set_section_size"); + /* Make sure we write the complete block. */ + set_windmc_bfd_content ("\0", sec_length - 1, 1); + + /* Write block information. */ + mc_write_blocks (mtbl, nl, mi, elems); + + set_windmc_bfd_content (mtbl, 0, dta_start); + + /* Write items. */ + for (i = 0; i < elems; i++) + set_windmc_bfd_content (mi[i].res, mi[i].res_off, mi[i].res_len); + + free (mtbl); + free (mi); + bfd_close (mc_bfd.abfd); + mc_bfd.abfd = NULL; + mc_bfd.sec = NULL; +} + +static void +write_bin (void) +{ + mc_node_lang *n = NULL; + int i, c; + + if (! mc_nodes_lang_count) + return; + + i = 0; + while (i < mc_nodes_lang_count) + { + char *nd; + char *filename; + + if (n && n->lang == mc_nodes_lang[i]->lang) + { + i++; + continue; + } + n = mc_nodes_lang[i]; + c = i + 1; + while (c < mc_nodes_lang_count && n->lang == mc_nodes_lang[c]->lang) + c++; + nd = convert_unicode_to_ACP (n->lang->sval); + + /* Prepare filename for binary output. */ + filename = xmalloc (strlen (nd) + 4 + 1 + strlen (mcset_mc_basename) + 1 + strlen (mcset_rc_dir)); + strcpy (filename, mcset_rc_dir); + if (mcset_prefix_bin) + sprintf (filename + strlen (filename), "%s_", mcset_mc_basename); + strcat (filename, nd); + strcat (filename, ".bin"); + + /* Write message file. */ + windmc_write_bin (filename, &mc_nodes_lang[i], (c - i)); + + free (filename); + i = c; + } +} + +static void +write_rc (FILE *fp) +{ + mc_node_lang *n; + int i, l; + + fprintf (fp, + "/* Do not edit this file manually.\n" + " This file is autogenerated by windmc. */\n\n"); + if (! mc_nodes_lang_count) + return; + n = NULL; + i = 0; + for (l = 0; l < mc_nodes_lang_count; l++) + { + if (n && n->lang == mc_nodes_lang[l]->lang) + continue; + ++i; + n = mc_nodes_lang[l]; + fprintf (fp, "\n// Country: %s\n// Language: %s\n#pragma code_page(%u)\n", + n->lang->lang_info.country, n->lang->lang_info.name, + (unsigned) n->lang->lang_info.wincp); + fprintf (fp, "LANGUAGE 0x%lx, 0x%lx\n", (long) (n->lang->nval & 0x3ff), + (long) ((n->lang->nval & 0xffff) >> 10)); + fprintf (fp, "1 MESSAGETABLE \""); + if (mcset_prefix_bin) + fprintf (fp, "%s_", mcset_mc_basename); + unicode_print (fp, n->lang->sval, unichar_len (n->lang->sval)); + fprintf (fp, ".bin\"\n"); + } +} + +static void +write_dbg (FILE *fp) +{ + mc_node *h; + + fprintf (fp, + "/* Do not edit this file manually.\n" + " This file is autogenerated by windmc.\n\n" + " This file maps each message ID value in to a text string that contains\n" + " the symbolic name used for it. */\n\n"); + + fprintf (fp, + "struct %sSymbolicName\n" + "{\n ", mcset_mc_basename); + if (mcset_msg_id_typedef) + unicode_print (fp, mcset_msg_id_typedef, unichar_len (mcset_msg_id_typedef)); + else + fprintf (fp, "DWORD"); + fprintf (fp, + " MessageId;\n" + " char *SymbolicName;\n" + "} %sSymbolicNames[] =\n" + "{\n", mcset_mc_basename); + h = mc_nodes; + while (h != NULL) + { + if (h->symbol) + write_dbg_define (fp, h->symbol, mcset_msg_id_typedef); + h = h->next; + } + fprintf (fp, " { ("); + if (mcset_msg_id_typedef) + unicode_print (fp, mcset_msg_id_typedef, unichar_len (mcset_msg_id_typedef)); + else + fprintf (fp, "DWORD"); + fprintf (fp, + ") 0xffffffff, NULL }\n" + "};\n"); +} + +static void +write_header (FILE *fp) +{ + char *s; + int i; + const mc_keyword *key; + mc_node *h; + + fprintf (fp, + "/* Do not edit this file manually.\n" + " This file is autogenerated by windmc. */\n\n" + "//\n// The values are 32 bit layed out as follows:\n//\n" + "// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1\n" + "// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0\n" + "// +---+-+-+-----------------------+-------------------------------+\n" + "// |Sev|C|R| Facility | Code |\n" + "// +---+-+-+-----------------------+-------------------------------+\n//\n" + "// where\n//\n" + "// C - is the Customer code flag\n//\n" + "// R - is a reserved bit\n//\n" + "// Code - is the facility's status code\n//\n"); + + h = mc_nodes; + + fprintf (fp, "// Sev - is the severity code\n//\n"); + if (mc_severity_codes_count != 0) + { + for (i = 0; i < mc_severity_codes_count; i++) + { + key = mc_severity_codes[i]; + fprintf (fp, "// %s - %02lx\n", convert_unicode_to_ACP (key->usz), + (unsigned long) key->nval); + if (key->sval && key->sval[0] != 0) + { + if (! mcset_out_values_are_decimal) + fprintf (fp, "#define %s 0x%lx\n", convert_unicode_to_ACP (key->sval), + (unsigned long) key->nval); + else + fprintf (fp, "#define %s 0x%lu\n", convert_unicode_to_ACP (key->sval), + (unsigned long) key->nval); + } + } + fprintf (fp, "//\n"); + } + fprintf (fp, "// Facility - is the facility code\n//\n"); + if (mc_facility_codes_count != 0) + { + for (i = 0; i < mc_facility_codes_count; i++) + { + key = mc_facility_codes[i]; + fprintf (fp, "// %s - %04lx\n", convert_unicode_to_ACP (key->usz), + (unsigned long) key->nval); + if (key->sval && key->sval[0] != 0) + { + if (! mcset_out_values_are_decimal) + fprintf (fp, "#define %s 0x%lx\n", convert_unicode_to_ACP (key->sval), + (unsigned long) key->nval); + else + fprintf (fp, "#define %s 0x%lu\n", convert_unicode_to_ACP (key->sval), + (unsigned long) key->nval); + } + } + fprintf (fp, "//\n"); + } + fprintf (fp, "\n"); + while (h != NULL) + { + if (h->user_text) + { + s = convert_unicode_to_ACP (h->user_text); + if (s) + fprintf (fp, "%s", s); + } + if (h->symbol) + write_header_define (fp, h->symbol, h->vid, mcset_msg_id_typedef, h->sub); + h = h->next; + } +} + +static const char * +mc_unify_path (const char *path) +{ + char *end; + char *hsz; + + if (! path || *path == 0) + return "./"; + hsz = xmalloc (strlen (path) + 2); + strcpy (hsz, path); + end = hsz + strlen (hsz); + if (hsz[-1] != '/' && hsz[-1] != '\\') + strcpy (end, "/"); + while ((end = strchr (hsz, '\\')) != NULL) + *end = '/'; + return hsz; +} + +int main (int, char **); + +int +main (int argc, char **argv) +{ + FILE *h_fp; + int c; + char *target, *input_filename; + int verbose; + +#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) + setlocale (LC_MESSAGES, ""); +#endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + program_name = argv[0]; + xmalloc_set_program_name (program_name); + + expandargv (&argc, &argv); + + bfd_init (); + set_default_bfd_target (); + + target = NULL; + verbose = 0; + input_filename = NULL; + + res_init (); + + while ((c = getopt_long (argc, argv, "C:F:O:h:e:m:r:x:aAbcdHunoUvV", long_options, + (int *) 0)) != EOF) + { + switch (c) + { + case 'b': + mcset_prefix_bin = 1; + break; + case 'e': + { + mcset_header_ext = optarg; + if (mcset_header_ext[0] != '.' && mcset_header_ext[0] != 0) + { + char *hsz = xmalloc (strlen (mcset_header_ext) + 2); + + sprintf (hsz, ".%s", mcset_header_ext); + mcset_header_ext = hsz; + } + } + break; + case 'h': + mcset_header_dir = mc_unify_path (optarg); + break; + case 'r': + mcset_rc_dir = mc_unify_path (optarg); + break; + case 'a': + mcset_text_in_is_unicode = 0; + break; + case 'x': + if (*optarg != 0) + mcset_dbg_dir = mc_unify_path (optarg); + break; + case 'A': + mcset_bin_out_is_unicode = 0; + break; + case 'd': + mcset_out_values_are_decimal = 1; + break; + case 'u': + mcset_text_in_is_unicode = 1; + break; + case 'U': + mcset_bin_out_is_unicode = 1; + break; + case 'c': + mcset_custom_bit = 1; + break; + case 'n': + mcset_automatic_null_termination = 1; + break; + case 'o': + mcset_use_hresult = 1; + fatal ("option -o is not implemented until yet.\n"); + break; + case 'F': + target = optarg; + break; + case 'v': + verbose ++; + break; + case 'm': + mcset_max_message_length = strtol (optarg, (char **) NULL, 10); + break; + case 'C': + mcset_codepage_in = strtol (optarg, (char **) NULL, 10); + break; + case 'O': + mcset_codepage_out = strtol (optarg, (char **) NULL, 10); + break; + case '?': + case 'H': + usage (stdout, 0); + break; + case 'V': + print_version ("windmc"); + break; + + default: + usage (stderr, 1); + break; + } + } + if (input_filename == NULL && optind < argc) + { + input_filename = argv[optind]; + ++optind; + } + + set_endianess (NULL, target); + + if (input_filename == NULL) + { + fprintf (stderr, "Error: No input file was specified.\n"); + usage (stderr, 1); + } + mc_set_inputfile (input_filename); + + if (!probe_codepage (&mcset_codepage_in, &mcset_text_in_is_unicode, "codepage_in", 0)) + usage (stderr, 1); + if (mcset_codepage_out == 0) + mcset_codepage_out = 1252; + if (! unicode_is_valid_codepage (mcset_codepage_out)) + fatal ("Code page 0x%x is unknown.", (unsigned int) mcset_codepage_out); + if (mcset_codepage_out == CP_UTF16) + fatal ("UTF16 is no valid text output code page."); + if (verbose) + { + fprintf (stderr, "// Default target is %s and it is %s endian.\n", + def_target_arch, (target_is_bigendian ? "big" : "little")); + fprintf (stderr, "// Input codepage: 0x%x\n", (unsigned int) mcset_codepage_in); + fprintf (stderr, "// Output codepage: 0x%x\n", (unsigned int) mcset_codepage_out); + } + + if (argc != optind) + usage (stderr, 1); + + /* Initialize mcset_mc_basename. */ + { + const char *bn, *bn2; + char *hsz; + + bn = strrchr (input_filename, '/'); + bn2 = strrchr (input_filename, '\\'); + if (! bn) + bn = bn2; + if (bn && bn2 && bn < bn2) + bn = bn2; + if (! bn) + bn = input_filename; + else + bn++; + mcset_mc_basename = hsz = xstrdup (bn); + + /* Cut of right-hand extension. */ + if ((hsz = strrchr (hsz, '.')) != NULL) + *hsz = 0; + } + + /* Load the input file and do code page transformations to UTF16. */ + { + unichar *u; + rc_uint_type ul; + char *buff; + long flen; + FILE *fp = fopen (input_filename, "rb"); + + if (!fp) + fatal (_("unable to open file ,%s' for input.\n"), input_filename); + + fseek (fp, 0, SEEK_END); + flen = ftell (fp); + fseek (fp, 0, SEEK_SET); + buff = malloc (flen + 3); + memset (buff, 0, flen + 3); + fread (buff, 1, flen, fp); + fclose (fp); + if (mcset_text_in_is_unicode != 1) + { + unicode_from_codepage (&ul, &u, buff, mcset_codepage_in); + if (! u) + fatal ("Failed to convert input to UFT16\n"); + mc_set_content (u); + } + else + { + if ((flen & 1) != 0) + fatal (_("input file does not seems to be UFT16.\n")); + mc_set_content ((unichar *) buff); + } + free (buff); + } + + while (yyparse ()) + ; + + do_sorts (); + + h_fp = mc_create_path_text_file (mcset_header_dir, mcset_header_ext); + write_header (h_fp); + fclose (h_fp); + + h_fp = mc_create_path_text_file (mcset_rc_dir, ".rc"); + write_rc (h_fp); + fclose (h_fp); + + if (mcset_dbg_dir != NULL) + { + h_fp = mc_create_path_text_file (mcset_dbg_dir, ".dbg"); + write_dbg (h_fp); + fclose (h_fp); + } + write_bin (); + + if (mc_nodes_lang) + free (mc_nodes_lang); + if (mc_severity_codes) + free (mc_severity_codes); + if (mc_facility_codes) + free (mc_facility_codes); + + xexit (0); + return 0; +} diff --git a/binutils/windmc.h b/binutils/windmc.h new file mode 100644 index 000000000000..08a770626093 --- /dev/null +++ b/binutils/windmc.h @@ -0,0 +1,99 @@ +/* windmc.h -- header file for windmc program. + Copyright 2007 + Free Software Foundation, Inc. + Written by Kai Tietz, Onevision. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "ansidecl.h" + +/* This is the header file for the windmc program. It defines + structures and declares functions used within the program. */ + +#include "winduni.h" + +#ifndef WINDMC_HXX +#define WINDMC_HXX + +/* Global flag variables (set by windmc.c file. */ +extern int mcset_custom_bit; +extern int mcset_out_values_are_decimal; +extern rc_uint_type mcset_max_message_length; +extern unichar *mcset_msg_id_typedef; + +/* Lexer keyword definition and internal memory structures. */ + +typedef struct mc_keyword +{ + struct mc_keyword *next; + const char *group_name; + size_t len; + unichar *usz; + int rid; + rc_uint_type nval; + unichar *sval; + wind_language_t lang_info; +} mc_keyword; + +typedef struct mc_node_lang +{ + struct mc_node_lang *next; + rc_uint_type vid; + const mc_keyword *lang; + unichar *message; +} mc_node_lang; + +typedef struct mc_node +{ + struct mc_node *next; + unichar *user_text; + const mc_keyword *facility; + const mc_keyword *severity; + unichar *symbol; + rc_uint_type id; + rc_uint_type vid; + mc_node_lang *sub; +} mc_node; + +extern mc_node *mc_nodes; + +void mc_add_keyword (unichar *, int, const char *, rc_uint_type, unichar *); +const mc_keyword *enum_facility (int); +const mc_keyword *enum_severity (int); + +mc_node_lang *mc_add_node_lang (mc_node *, const mc_keyword *, rc_uint_type); +mc_node *mc_add_node (void); + +/* Standard yacc/flex stuff. */ +int yyerror (const char *, ...); +int yylex (void); +int yyparse (void); + +/* mclex.c */ +void mc_set_inputfile (const char *); +void mc_set_content (const unichar *); + +/* Lexer control variables. Used by mcparser.y file. */ +extern bfd_boolean mclex_want_nl; +extern bfd_boolean mclex_want_line; +extern bfd_boolean mclex_want_filename; + +void mc_fatal (const char *, ...); +void mc_warn (const char *, ...); + +#endif diff --git a/binutils/windres.c b/binutils/windres.c index 50af427d0f3c..da8e33f39ad8 100644 --- a/binutils/windres.c +++ b/binutils/windres.c @@ -1,7 +1,8 @@ /* windres.c -- a program to manipulate Windows resources - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -34,10 +35,7 @@ * The res2coff program, written by Pedro A. Aranda <paag@tid.es>. */ -#include "config.h" -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif +#include "sysdep.h" #include <assert.h> #include <time.h> #include "bfd.h" @@ -48,10 +46,20 @@ #include "obstack.h" #include "windres.h" +/* Defined in bfd/binary.c. Used to set architecture and machine of input + binary files. */ +extern enum bfd_architecture bfd_external_binary_architecture; +extern unsigned long bfd_external_machine; + /* Used by resrc.c at least. */ int verbose = 0; +int target_is_bigendian = 0; +const char *def_target_arch; + +static void set_endianess (bfd *, const char *); + /* An enumeration of format types. */ enum res_format @@ -109,15 +117,23 @@ static struct include_dir *include_dirs; /* Static functions. */ static void res_init (void); -static int extended_menuitems (const struct menuitem *); +static int extended_menuitems (const rc_menuitem *); static enum res_format format_from_name (const char *, int); static enum res_format format_from_filename (const char *, int); static void usage (FILE *, int); static int cmp_res_entry (const void *, const void *); -static struct res_directory *sort_resources (struct res_directory *); +static rc_res_directory *sort_resources (rc_res_directory *); static void reswr_init (void); static const char * quot (const char *); +static rc_uint_type target_get_8 (const void *, rc_uint_type); +static void target_put_8 (void *, rc_uint_type); +static rc_uint_type target_get_16 (const void *, rc_uint_type); +static void target_put_16 (void *, rc_uint_type); +static rc_uint_type target_get_32 (const void *, rc_uint_type); +static void target_put_32 (void *, rc_uint_type); + + /* When we are building a resource tree, we allocate everything onto an obstack, so that we can free it all at once if we want. */ @@ -139,9 +155,9 @@ res_init (void) /* Allocate space on the resource building obstack. */ void * -res_alloc (size_t bytes) +res_alloc (rc_uint_type bytes) { - return (void *) obstack_alloc (&res_obstack, bytes); + return (void *) obstack_alloc (&res_obstack, (size_t) bytes); } /* We also use an obstack to save memory used while writing out a set @@ -160,9 +176,9 @@ reswr_init (void) /* Allocate space on the resource writing obstack. */ void * -reswr_alloc (size_t bytes) +reswr_alloc (rc_uint_type bytes) { - return (void *) obstack_alloc (&reswr_obstack, bytes); + return (void *) obstack_alloc (&reswr_obstack, (size_t) bytes); } /* Open a file using the include directory search list. */ @@ -212,7 +228,7 @@ open_file_search (const char *filename, const char *mode, const char *errmsg, section. */ int -res_id_cmp (struct res_id a, struct res_id b) +res_id_cmp (rc_res_id a, rc_res_id b) { if (! a.named) { @@ -260,24 +276,23 @@ res_id_cmp (struct res_id a, struct res_id b) /* Print a resource ID. */ void -res_id_print (FILE *stream, struct res_id id, int quote) +res_id_print (FILE *stream, rc_res_id id, int quote) { if (! id.named) - fprintf (stream, "%lu", id.u.id); + fprintf (stream, "%u", (int) id.u.id); else { if (quote) - putc ('"', stream); + unicode_print_quoted (stream, id.u.n.name, id.u.n.length); + else unicode_print (stream, id.u.n.name, id.u.n.length); - if (quote) - putc ('"', stream); } } /* Print a list of resource ID's. */ void -res_ids_print (FILE *stream, int cids, const struct res_id *ids) +res_ids_print (FILE *stream, int cids, const rc_res_id *ids) { int i; @@ -292,43 +307,52 @@ res_ids_print (FILE *stream, int cids, const struct res_id *ids) /* Convert an ASCII string to a resource ID. */ void -res_string_to_id (struct res_id *res_id, const char *string) +res_string_to_id (rc_res_id *res_id, const char *string) { res_id->named = 1; unicode_from_ascii (&res_id->u.n.length, &res_id->u.n.name, string); } +/* Convert an unicode string to a resource ID. */ +void +res_unistring_to_id (rc_res_id *res_id, const unichar *u) +{ + res_id->named = 1; + res_id->u.n.length = unichar_len (u); + res_id->u.n.name = unichar_dup_uppercase (u); +} + /* Define a resource. The arguments are the resource tree, RESOURCES, and the location at which to put it in the tree, CIDS and IDS. - This returns a newly allocated res_resource structure, which the + This returns a newly allocated rc_res_resource structure, which the caller is expected to initialize. If DUPOK is non-zero, then if a resource with this ID exists, it is returned. Otherwise, a warning is issued, and a new resource is created replacing the existing one. */ -struct res_resource * -define_resource (struct res_directory **resources, int cids, - const struct res_id *ids, int dupok) +rc_res_resource * +define_resource (rc_res_directory **resources, int cids, + const rc_res_id *ids, int dupok) { - struct res_entry *re = NULL; + rc_res_entry *re = NULL; int i; assert (cids > 0); for (i = 0; i < cids; i++) { - struct res_entry **pp; + rc_res_entry **pp; if (*resources == NULL) { - static unsigned long timeval; + static unsigned int timeval; /* Use the same timestamp for every resource created in a single run. */ if (timeval == 0) timeval = time (NULL); - *resources = ((struct res_directory *) - res_alloc (sizeof **resources)); + *resources = ((rc_res_directory *) + res_alloc (sizeof (rc_res_directory))); (*resources)->characteristics = 0; (*resources)->time = timeval; (*resources)->major = 0; @@ -344,7 +368,7 @@ define_resource (struct res_directory **resources, int cids, re = *pp; else { - re = (struct res_entry *) res_alloc (sizeof *re); + re = (rc_res_entry *) res_alloc (sizeof (rc_res_entry)); re->next = NULL; re->id = ids[i]; if ((i + 1) < cids) @@ -393,9 +417,9 @@ define_resource (struct res_directory **resources, int cids, fprintf (stderr, _(": duplicate value\n")); } - re->u.res = ((struct res_resource *) - res_alloc (sizeof (struct res_resource))); - memset (re->u.res, 0, sizeof (struct res_resource)); + re->u.res = ((rc_res_resource *) + res_alloc (sizeof (rc_res_resource))); + memset (re->u.res, 0, sizeof (rc_res_resource)); re->u.res->type = RES_TYPE_UNINITIALIZED; return re->u.res; @@ -404,11 +428,11 @@ define_resource (struct res_directory **resources, int cids, /* Define a standard resource. This is a version of define_resource that just takes type, name, and language arguments. */ -struct res_resource * -define_standard_resource (struct res_directory **resources, int type, - struct res_id name, int language, int dupok) +rc_res_resource * +define_standard_resource (rc_res_directory **resources, int type, + rc_res_id name, rc_uint_type language, int dupok) { - struct res_id a[3]; + rc_res_id a[3]; a[0].named = 0; a[0].u.id = type; @@ -423,21 +447,21 @@ define_standard_resource (struct res_directory **resources, int type, static int cmp_res_entry (const void *p1, const void *p2) { - const struct res_entry **re1, **re2; + const rc_res_entry **re1, **re2; - re1 = (const struct res_entry **) p1; - re2 = (const struct res_entry **) p2; + re1 = (const rc_res_entry **) p1; + re2 = (const rc_res_entry **) p2; return res_id_cmp ((*re1)->id, (*re2)->id); } /* Sort the resources. */ -static struct res_directory * -sort_resources (struct res_directory *resdir) +static rc_res_directory * +sort_resources (rc_res_directory *resdir) { int c, i; - struct res_entry *re; - struct res_entry **a; + rc_res_entry *re; + rc_res_entry **a; if (resdir->entries == NULL) return resdir; @@ -448,12 +472,12 @@ sort_resources (struct res_directory *resdir) /* This is a recursive routine, so using xmalloc is probably better than alloca. */ - a = (struct res_entry **) xmalloc (c * sizeof (struct res_entry *)); + a = (rc_res_entry **) xmalloc (c * sizeof (rc_res_entry *)); for (i = 0, re = resdir->entries; re != NULL; re = re->next, i++) a[i] = re; - qsort (a, c, sizeof (struct res_entry *), cmp_res_entry); + qsort (a, c, sizeof (rc_res_entry *), cmp_res_entry); resdir->entries = a[0]; for (i = 0; i < c - 1; i++) @@ -475,9 +499,9 @@ sort_resources (struct res_directory *resdir) DIALOGEX. */ int -extended_dialog (const struct dialog *dialog) +extended_dialog (const rc_dialog *dialog) { - const struct dialog_control *c; + const rc_dialog_control *c; if (dialog->ex != NULL) return 1; @@ -492,15 +516,15 @@ extended_dialog (const struct dialog *dialog) /* Return whether MENUITEMS are a MENU or a MENUEX. */ int -extended_menu (const struct menu *menu) +extended_menu (const rc_menu *menu) { return extended_menuitems (menu->items); } static int -extended_menuitems (const struct menuitem *menuitems) +extended_menuitems (const rc_menuitem *menuitems) { - const struct menuitem *mi; + const rc_menuitem *mi; for (mi = menuitems; mi != NULL; mi = mi->next) { @@ -559,7 +583,7 @@ format_from_filename (const char *filename, int input) { const char *ext; FILE *e; - unsigned char b1, b2, b3, b4, b5; + bfd_byte b1, b2, b3, b4, b5; int magic; /* If we have an extension, see if we recognize it as implying a @@ -649,6 +673,7 @@ usage (FILE *stream, int status) -D --define <sym>[=<val>] Define SYM when preprocessing rc file\n\ -U --undefine <sym> Undefine SYM when preprocessing rc file\n\ -v --verbose Verbose - tells you what it's doing\n\ + -c --codepage=<codepage> Specify default codepage\n\ -l --language=<val> Set language when reading rc file\n\ --use-temp-file Use a temporary file instead of popen to read\n\ the preprocessor output\n\ @@ -669,7 +694,7 @@ No input-file is stdin, default rc. No output-file is stdout, default rc.\n")); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); @@ -686,7 +711,7 @@ quot (const char *string) const char *src; char *dest; - if ((buflen < slen * 2 + 2) || !buf) + if ((buflen < slen * 2 + 2) || ! buf) { buflen = slen * 2 + 2; if (buf) @@ -725,6 +750,7 @@ static const struct option long_options[] = {"define", required_argument, 0, 'D'}, {"undefine", required_argument, 0, 'U'}, {"verbose", no_argument, 0, 'v'}, + {"codepage", required_argument, 0, 'c'}, {"language", required_argument, 0, 'l'}, {"use-temp-file", no_argument, 0, OPTION_USE_TEMP_FILE}, {"no-use-temp-file", no_argument, 0, OPTION_NO_USE_TEMP_FILE}, @@ -753,7 +779,7 @@ main (int argc, char **argv) char *preprocargs; const char *quotedarg; int language; - struct res_directory *resources; + rc_res_directory *resources; int use_temp_file; #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) @@ -785,11 +811,25 @@ main (int argc, char **argv) language = 0x409; /* LANG_ENGLISH, SUBLANG_ENGLISH_US. */ use_temp_file = 0; - while ((c = getopt_long (argc, argv, "f:i:l:o:I:J:O:F:D:U:rhHvV", long_options, + while ((c = getopt_long (argc, argv, "c:f:i:l:o:I:J:O:F:D:U:rhHvV", long_options, (int *) 0)) != EOF) { switch (c) { + case 'c': + { + rc_uint_type ncp; + + if (optarg[0] == '0' && (optarg[1] == 'x' || optarg[1] == 'X')) + ncp = (rc_uint_type) strtol (optarg + 2, NULL, 16); + else + ncp = (rc_uint_type) strtol (optarg, NULL, 10); + if (ncp == CP_UTF16 || ! unicode_is_valid_codepage (ncp)) + fatal (_("invalid codepage specified.\n")); + wind_default_codepage = wind_current_codepage = ncp; + } + break; + case 'i': input_filename = optarg; break; @@ -863,7 +903,8 @@ main (int argc, char **argv) input_format_tmp = format_from_name (optarg, 0); if (input_format_tmp != RES_FORMAT_UNKNOWN) { - fprintf (stderr, _("Option -I is deprecated for setting the input format, please use -J instead.\n")); + fprintf (stderr, + _("Option -I is deprecated for setting the input format, please use -J instead.\n")); input_format = input_format_tmp; break; } @@ -963,6 +1004,8 @@ main (int argc, char **argv) output_format = format_from_filename (output_filename, 0); } + set_endianess (NULL, target); + /* Read the input file. */ switch (input_format) { @@ -1008,3 +1051,339 @@ main (int argc, char **argv) xexit (0); return 0; } + +static void set_endianess (bfd *abfd, const char *target) +{ + const bfd_target *target_vec; + + def_target_arch = NULL; + target_vec = bfd_find_target (target, abfd); + if (! target_vec) + fatal ("Can't detect target endianess and architecture."); + target_is_bigendian = ((target_vec->byteorder == BFD_ENDIAN_BIG) ? 1 : 0); + { + const char *tname = target_vec->name; + const char **arch = bfd_arch_list(); + if (arch && tname) + { + if (strchr (tname, '-') != NULL) + tname = strchr (tname, '-') + 1; + while (*arch != NULL) + { + const char *in_a = strstr (*arch, tname); + char end_ch = (in_a ? in_a[strlen(tname)] : 0); + if (in_a && (in_a == *arch || in_a[-1] == ':') + && end_ch == 0) + { + def_target_arch = *arch; + break; + } + arch++; + } + } + if (! def_target_arch) + fatal ("Can't detect architecture."); + } +} + +bfd * +windres_open_as_binary (const char *filename, int rdmode) +{ + bfd *abfd; + + abfd = (rdmode ? bfd_openr (filename, "binary") : bfd_openw (filename, "binary")); + if (! abfd) + fatal ("can't open `%s' for %s", filename, (rdmode ? "input" : "output")); + + if (rdmode && ! bfd_check_format (abfd, bfd_object)) + fatal ("can't open `%s' for input.", filename); + + return abfd; +} + +void +set_windres_bfd_endianess (windres_bfd *wrbfd, int is_bigendian) +{ + assert (!! wrbfd); + switch (WR_KIND(wrbfd)) + { + case WR_KIND_BFD_BIN_L: + if (is_bigendian) + WR_KIND(wrbfd) = WR_KIND_BFD_BIN_B; + break; + case WR_KIND_BFD_BIN_B: + if (! is_bigendian) + WR_KIND(wrbfd) = WR_KIND_BFD_BIN_L; + break; + default: + /* only binary bfd can be overriden. */ + abort (); + } +} + +void +set_windres_bfd (windres_bfd *wrbfd, bfd *abfd, asection *sec, rc_uint_type kind) +{ + assert (!! wrbfd); + switch (kind) + { + case WR_KIND_TARGET: + abfd = NULL; + sec = NULL; + break; + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_L: + case WR_KIND_BFD_BIN_B: + assert (!! abfd); + assert (!!sec); + break; + default: + abort (); + } + WR_KIND(wrbfd) = kind; + WR_BFD(wrbfd) = abfd; + WR_SECTION(wrbfd) = sec; +} + +void +set_windres_bfd_content(windres_bfd *wrbfd, const void *data, rc_uint_type off, + rc_uint_type length) +{ + if (WR_KIND(wrbfd) != WR_KIND_TARGET) + { + if (! bfd_set_section_contents (WR_BFD(wrbfd), WR_SECTION(wrbfd), data, off, length)) + bfd_fatal ("bfd_set_section_contents"); + } + else + abort (); +} + +void +get_windres_bfd_content(windres_bfd *wrbfd, void *data, rc_uint_type off, + rc_uint_type length) +{ + if (WR_KIND(wrbfd) != WR_KIND_TARGET) + { + if (! bfd_get_section_contents (WR_BFD(wrbfd), WR_SECTION(wrbfd), data, off, length)) + bfd_fatal ("bfd_get_section_contents"); + } + else + abort (); +} + +void +windres_put_8 (windres_bfd *wrbfd, void *p, rc_uint_type value) +{ + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + target_put_8 (p, value); + break; + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_L: + case WR_KIND_BFD_BIN_B: + bfd_put_8 (WR_BFD(wrbfd), value, p); + break; + default: + abort (); + } +} + +void +windres_put_16 (windres_bfd *wrbfd, void *data, rc_uint_type value) +{ + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + target_put_16 (data, value); + break; + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + bfd_put_16 (WR_BFD(wrbfd), value, data); + break; + case WR_KIND_BFD_BIN_L: + bfd_putl16 (value, data); + break; + default: + abort (); + } +} + +void +windres_put_32 (windres_bfd *wrbfd, void *data, rc_uint_type value) +{ + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + target_put_32 (data, value); + break; + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + bfd_put_32 (WR_BFD(wrbfd), value, data); + break; + case WR_KIND_BFD_BIN_L: + bfd_putl32 (value, data); + break; + default: + abort (); + } +} + +rc_uint_type +windres_get_8 (windres_bfd *wrbfd, const void *data, rc_uint_type length) +{ + if (length < 1) + fatal ("windres_get_8: unexpected eob."); + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + return target_get_8 (data, length); + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + case WR_KIND_BFD_BIN_L: + return bfd_get_8 (WR_BFD(wrbfd), data); + default: + abort (); + } + return 0; +} + +rc_uint_type +windres_get_16 (windres_bfd *wrbfd, const void *data, rc_uint_type length) +{ + if (length < 2) + fatal ("windres_get_16: unexpected eob."); + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + return target_get_16 (data, length); + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + return bfd_get_16 (WR_BFD(wrbfd), data); + case WR_KIND_BFD_BIN_L: + return bfd_getl16 (data); + default: + abort (); + } + return 0; +} + +rc_uint_type +windres_get_32 (windres_bfd *wrbfd, const void *data, rc_uint_type length) +{ + if (length < 4) + fatal ("windres_get_32: unexpected eob."); + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + return target_get_32 (data, length); + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + return bfd_get_32 (WR_BFD(wrbfd), data); + case WR_KIND_BFD_BIN_L: + return bfd_getl32 (data); + default: + abort (); + } + return 0; +} + +static rc_uint_type +target_get_8 (const void *p, rc_uint_type length) +{ + rc_uint_type ret; + + if (length < 1) + fatal ("Resource too small for getting 8-bit value."); + + ret = (rc_uint_type) *((const bfd_byte *) p); + return ret & 0xff; +} + +static rc_uint_type +target_get_16 (const void *p, rc_uint_type length) +{ + if (length < 2) + fatal ("Resource too small for getting 16-bit value."); + + if (target_is_bigendian) + return bfd_getb16 (p); + else + return bfd_getl16 (p); +} + +static rc_uint_type +target_get_32 (const void *p, rc_uint_type length) +{ + if (length < 4) + fatal ("Resource too small for getting 32-bit value."); + + if (target_is_bigendian) + return bfd_getb32 (p); + else + return bfd_getl32 (p); +} + +static void +target_put_8 (void *p, rc_uint_type value) +{ + assert (!! p); + *((bfd_byte *) p)=(bfd_byte) value; +} + +static void +target_put_16 (void *p, rc_uint_type value) +{ + assert (!! p); + + if (target_is_bigendian) + bfd_putb16 (value, p); + else + bfd_putl16 (value, p); +} + +static void +target_put_32 (void *p, rc_uint_type value) +{ + assert (!! p); + + if (target_is_bigendian) + bfd_putb32 (value, p); + else + bfd_putl32 (value, p); +} + +static int isInComment = 0; + +int wr_printcomment (FILE *e, const char *fmt, ...) +{ + va_list arg; + int r = 0; + + if (isInComment) + r += fprintf (e, "\n "); + else + fprintf (e, "/* "); + isInComment = 1; + if (fmt == NULL) + return r; + va_start (arg, fmt); + r += vfprintf (e, fmt, arg); + va_end (arg); + return r; +} + +int wr_print (FILE *e, const char *fmt, ...) +{ + va_list arg; + int r = 0; + if (isInComment) + r += fprintf (e, ". */\n"); + isInComment = 0; + if (! fmt) + return r; + va_start (arg, fmt); + r += vfprintf (e, fmt, arg); + va_end (arg); + return r; +} diff --git a/binutils/windres.h b/binutils/windres.h index 6a9dfa737973..d7494ec6a27c 100644 --- a/binutils/windres.h +++ b/binutils/windres.h @@ -1,7 +1,8 @@ /* windres.h -- header file for windres program. - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -26,771 +27,49 @@ structures and declares functions used within the program. */ #include "winduni.h" - -/* We represent resources internally as a tree, similar to the tree - used in the .rsrc section of a COFF file. The root is a - res_directory structure. */ - -struct res_directory -{ - /* Resource flags. According to the MS docs, this is currently - always zero. */ - unsigned long characteristics; - /* Time/date stamp. */ - unsigned long time; - /* Major version number. */ - unsigned short major; - /* Minor version number. */ - unsigned short minor; - /* Directory entries. */ - struct res_entry *entries; -}; - -/* A resource ID is stored in a res_id structure. */ - -struct res_id -{ - /* Non-zero if this entry has a name rather than an ID. */ - unsigned int named : 1; - union - { - /* If the named field is non-zero, this is the name. */ - struct - { - /* Length of the name. */ - int length; - /* Pointer to the name, which is a Unicode string. */ - unichar *name; - } n; - /* If the named field is zero, this is the ID. */ - unsigned long id; - } u; -}; - -/* Each entry in the tree is a res_entry structure. We mix - directories and resources because in a COFF file all entries in a - directory are sorted together, whether the entries are - subdirectories or resources. */ - -struct res_entry -{ - /* Next entry. */ - struct res_entry *next; - /* Resource ID. */ - struct res_id id; - /* Non-zero if this entry is a subdirectory rather than a leaf. */ - unsigned int subdir : 1; - union - { - /* If the subdir field is non-zero, this is a pointer to the - subdirectory. */ - struct res_directory *dir; - /* If the subdir field is zero, this is a pointer to the resource - data. */ - struct res_resource *res; - } u; -}; - -/* Types of resources. */ - -enum res_type -{ - RES_TYPE_UNINITIALIZED, - RES_TYPE_ACCELERATOR, - RES_TYPE_BITMAP, - RES_TYPE_CURSOR, - RES_TYPE_GROUP_CURSOR, - RES_TYPE_DIALOG, - RES_TYPE_FONT, - RES_TYPE_FONTDIR, - RES_TYPE_ICON, - RES_TYPE_GROUP_ICON, - RES_TYPE_MENU, - RES_TYPE_MESSAGETABLE, - RES_TYPE_RCDATA, - RES_TYPE_STRINGTABLE, - RES_TYPE_USERDATA, - RES_TYPE_VERSIONINFO -}; - -/* A res file and a COFF file store information differently. The - res_info structures holds data which in a res file is stored with - each resource, but in a COFF file is stored elsewhere. */ - -struct res_res_info -{ - /* Language. In a COFF file, the third level of the directory is - keyed by the language, so the language of a resource is defined - by its location in the resource tree. */ - unsigned short language; - /* Characteristics of the resource. Entirely user defined. In a - COFF file, the res_directory structure has a characteristics - field, but I don't know if it's related to the one in the res - file. */ - unsigned long characteristics; - /* Version of the resource. Entirely user defined. In a COFF file, - the res_directory structure has a characteristics field, but I - don't know if it's related to the one in the res file. */ - unsigned long version; - /* Memory flags. This is a combination of the MEMFLAG values - defined below. Most of these values are historical, and are not - meaningful for win32. I don't think there is any way to store - this information in a COFF file. */ - unsigned short memflags; -}; - -/* Each resource in a COFF file has some information which can does - not appear in a res file. */ - -struct res_coff_info -{ - /* The code page used for the data. I don't really know what this - should be. */ - unsigned long codepage; - /* A resource entry in a COFF file has a reserved field, which we - record here when reading a COFF file. When writing a COFF file, - we set this field to zero. */ - unsigned long reserved; -}; - -/* Resource data is stored in a res_resource structure. */ - -struct res_resource -{ - /* The type of resource. */ - enum res_type type; - /* The data for the resource. */ - union - { - struct - { - unsigned long length; - const unsigned char *data; - } data; - struct accelerator *acc; - struct cursor *cursor; - struct group_cursor *group_cursor; - struct dialog *dialog; - struct fontdir *fontdir; - struct group_icon *group_icon; - struct menu *menu; - struct rcdata_item *rcdata; - struct stringtable *stringtable; - struct rcdata_item *userdata; - struct versioninfo *versioninfo; - } u; - /* Information from a res file. */ - struct res_res_info res_info; - /* Information from a COFF file. */ - struct res_coff_info coff_info; -}; - -#define SUBLANG_SHIFT 10 - -/* Memory flags in the memflags field of a struct res_resource. */ - -#define MEMFLAG_MOVEABLE 0x10 -#define MEMFLAG_PURE 0x20 -#define MEMFLAG_PRELOAD 0x40 -#define MEMFLAG_DISCARDABLE 0x1000 - -/* Standard resource type codes. These are used in the ID field of a - res_entry structure. */ - -#define RT_CURSOR 1 -#define RT_BITMAP 2 -#define RT_ICON 3 -#define RT_MENU 4 -#define RT_DIALOG 5 -#define RT_STRING 6 -#define RT_FONTDIR 7 -#define RT_FONT 8 -#define RT_ACCELERATOR 9 -#define RT_RCDATA 10 -#define RT_MESSAGETABLE 11 -#define RT_GROUP_CURSOR 12 -#define RT_GROUP_ICON 14 -#define RT_VERSION 16 -#define RT_DLGINCLUDE 17 -#define RT_PLUGPLAY 19 -#define RT_VXD 20 -#define RT_ANICURSOR 21 -#define RT_ANIICON 22 - -/* An accelerator resource is a linked list of these structures. */ - -struct accelerator -{ - /* Next accelerator. */ - struct accelerator *next; - /* Flags. A combination of the ACC values defined below. */ - unsigned short flags; - /* Key value. */ - unsigned short key; - /* Resource ID. */ - unsigned short id; -}; - -/* Accelerator flags in the flags field of a struct accelerator. - These are the same values that appear in a res file. I hope. */ - -#define ACC_VIRTKEY 0x01 -#define ACC_NOINVERT 0x02 -#define ACC_SHIFT 0x04 -#define ACC_CONTROL 0x08 -#define ACC_ALT 0x10 -#define ACC_LAST 0x80 - -/* A cursor resource. */ - -struct cursor -{ - /* X coordinate of hotspot. */ - short xhotspot; - /* Y coordinate of hotspot. */ - short yhotspot; - /* Length of bitmap data. */ - unsigned long length; - /* Data. */ - const unsigned char *data; -}; - -/* A group_cursor resource is a list of group_cursor structures. */ - -struct group_cursor -{ - /* Next cursor in group. */ - struct group_cursor *next; - /* Width. */ - unsigned short width; - /* Height. */ - unsigned short height; - /* Planes. */ - unsigned short planes; - /* Bits per pixel. */ - unsigned short bits; - /* Number of bytes in cursor resource. */ - unsigned long bytes; - /* Index of cursor resource. */ - unsigned short index; -}; - -/* A dialog resource. */ - -struct dialog -{ - /* Basic window style. */ - unsigned long style; - /* Extended window style. */ - unsigned long exstyle; - /* X coordinate. */ - unsigned short x; - /* Y coordinate. */ - unsigned short y; - /* Width. */ - unsigned short width; - /* Height. */ - unsigned short height; - /* Menu name. */ - struct res_id menu; - /* Class name. */ - struct res_id class; - /* Caption. */ - unichar *caption; - /* Font point size. */ - unsigned short pointsize; - /* Font name. */ - unichar *font; - /* Extended information for a dialogex. */ - struct dialog_ex *ex; - /* Controls. */ - struct dialog_control *controls; -}; - -/* An extended dialog has additional information. */ - -struct dialog_ex -{ - /* Help ID. */ - unsigned long help; - /* Font weight. */ - unsigned short weight; - /* Whether the font is italic. */ - unsigned char italic; - /* Character set. */ - unsigned char charset; -}; - -/* Window style flags, from the winsup Defines.h header file. These - can appear in the style field of a struct dialog or a struct - dialog_control. */ - -#define CW_USEDEFAULT (0x80000000) -#define WS_BORDER (0x800000L) -#define WS_CAPTION (0xc00000L) -#define WS_CHILD (0x40000000L) -#define WS_CHILDWINDOW (0x40000000L) -#define WS_CLIPCHILDREN (0x2000000L) -#define WS_CLIPSIBLINGS (0x4000000L) -#define WS_DISABLED (0x8000000L) -#define WS_DLGFRAME (0x400000L) -#define WS_GROUP (0x20000L) -#define WS_HSCROLL (0x100000L) -#define WS_ICONIC (0x20000000L) -#define WS_MAXIMIZE (0x1000000L) -#define WS_MAXIMIZEBOX (0x10000L) -#define WS_MINIMIZE (0x20000000L) -#define WS_MINIMIZEBOX (0x20000L) -#define WS_OVERLAPPED (0L) -#define WS_OVERLAPPEDWINDOW (0xcf0000L) -#define WS_POPUP (0x80000000L) -#define WS_POPUPWINDOW (0x80880000L) -#define WS_SIZEBOX (0x40000L) -#define WS_SYSMENU (0x80000L) -#define WS_TABSTOP (0x10000L) -#define WS_THICKFRAME (0x40000L) -#define WS_TILED (0L) -#define WS_TILEDWINDOW (0xcf0000L) -#define WS_VISIBLE (0x10000000L) -#define WS_VSCROLL (0x200000L) -#define MDIS_ALLCHILDSTYLES (0x1) -#define BS_3STATE (0x5L) -#define BS_AUTO3STATE (0x6L) -#define BS_AUTOCHECKBOX (0x3L) -#define BS_AUTORADIOBUTTON (0x9L) -#define BS_BITMAP (0x80L) -#define BS_BOTTOM (0x800L) -#define BS_CENTER (0x300L) -#define BS_CHECKBOX (0x2L) -#define BS_DEFPUSHBUTTON (0x1L) -#define BS_GROUPBOX (0x7L) -#define BS_ICON (0x40L) -#define BS_LEFT (0x100L) -#define BS_LEFTTEXT (0x20L) -#define BS_MULTILINE (0x2000L) -#define BS_NOTIFY (0x4000L) -#define BS_OWNERDRAW (0xbL) -#define BS_PUSHBOX (0xcL) /* FIXME! What should this be? */ -#define BS_PUSHBUTTON (0L) -#define BS_PUSHLIKE (0x1000L) -#define BS_RADIOBUTTON (0x4L) -#define BS_RIGHT (0x200L) -#define BS_RIGHTBUTTON (0x20L) -#define BS_TEXT (0L) -#define BS_TOP (0x400L) -#define BS_USERBUTTON (0x8L) -#define BS_VCENTER (0xc00L) -#define CBS_AUTOHSCROLL (0x40L) -#define CBS_DISABLENOSCROLL (0x800L) -#define CBS_DROPDOWN (0x2L) -#define CBS_DROPDOWNLIST (0x3L) -#define CBS_HASSTRINGS (0x200L) -#define CBS_LOWERCASE (0x4000L) -#define CBS_NOINTEGRALHEIGHT (0x400L) -#define CBS_OEMCONVERT (0x80L) -#define CBS_OWNERDRAWFIXED (0x10L) -#define CBS_OWNERDRAWVARIABLE (0x20L) -#define CBS_SIMPLE (0x1L) -#define CBS_SORT (0x100L) -#define CBS_UPPERCASE (0x2000L) -#define ES_AUTOHSCROLL (0x80L) -#define ES_AUTOVSCROLL (0x40L) -#define ES_CENTER (0x1L) -#define ES_LEFT (0L) -#define ES_LOWERCASE (0x10L) -#define ES_MULTILINE (0x4L) -#define ES_NOHIDESEL (0x100L) -#define ES_NUMBER (0x2000L) -#define ES_OEMCONVERT (0x400L) -#define ES_PASSWORD (0x20L) -#define ES_READONLY (0x800L) -#define ES_RIGHT (0x2L) -#define ES_UPPERCASE (0x8L) -#define ES_WANTRETURN (0x1000L) -#define LBS_DISABLENOSCROLL (0x1000L) -#define LBS_EXTENDEDSEL (0x800L) -#define LBS_HASSTRINGS (0x40L) -#define LBS_MULTICOLUMN (0x200L) -#define LBS_MULTIPLESEL (0x8L) -#define LBS_NODATA (0x2000L) -#define LBS_NOINTEGRALHEIGHT (0x100L) -#define LBS_NOREDRAW (0x4L) -#define LBS_NOSEL (0x4000L) -#define LBS_NOTIFY (0x1L) -#define LBS_OWNERDRAWFIXED (0x10L) -#define LBS_OWNERDRAWVARIABLE (0x20L) -#define LBS_SORT (0x2L) -#define LBS_STANDARD (0xa00003L) -#define LBS_USETABSTOPS (0x80L) -#define LBS_WANTKEYBOARDINPUT (0x400L) -#define SBS_BOTTOMALIGN (0x4L) -#define SBS_HORZ (0L) -#define SBS_LEFTALIGN (0x2L) -#define SBS_RIGHTALIGN (0x4L) -#define SBS_SIZEBOX (0x8L) -#define SBS_SIZEBOXBOTTOMRIGHTALIGN (0x4L) -#define SBS_SIZEBOXTOPLEFTALIGN (0x2L) -#define SBS_SIZEGRIP (0x10L) -#define SBS_TOPALIGN (0x2L) -#define SBS_VERT (0x1L) -#define SS_BITMAP (0xeL) -#define SS_BLACKFRAME (0x7L) -#define SS_BLACKRECT (0x4L) -#define SS_CENTER (0x1L) -#define SS_CENTERIMAGE (0x200L) -#define SS_ENHMETAFILE (0xfL) -#define SS_ETCHEDFRAME (0x12L) -#define SS_ETCHEDHORZ (0x10L) -#define SS_ETCHEDVERT (0x11L) -#define SS_GRAYFRAME (0x8L) -#define SS_GRAYRECT (0x5L) -#define SS_ICON (0x3L) -#define SS_LEFT (0L) -#define SS_LEFTNOWORDWRAP (0xcL) -#define SS_NOPREFIX (0x80L) -#define SS_NOTIFY (0x100L) -#define SS_OWNERDRAW (0xdL) -#define SS_REALSIZEIMAGE (0x800L) -#define SS_RIGHT (0x2L) -#define SS_RIGHTJUST (0x400L) -#define SS_SIMPLE (0xbL) -#define SS_SUNKEN (0x1000L) -#define SS_USERITEM (0xaL) -#define SS_WHITEFRAME (0x9L) -#define SS_WHITERECT (0x6L) -#define DS_3DLOOK (0x4L) -#define DS_ABSALIGN (0x1L) -#define DS_CENTER (0x800L) -#define DS_CENTERMOUSE (0x1000L) -#define DS_CONTEXTHELP (0x2000L) -#define DS_CONTROL (0x400L) -#define DS_FIXEDSYS (0x8L) -#define DS_LOCALEDIT (0x20L) -#define DS_MODALFRAME (0x80L) -#define DS_NOFAILCREATE (0x10L) -#define DS_NOIDLEMSG (0x100L) -#define DS_SETFONT (0x40L) -#define DS_SETFOREGROUND (0x200L) -#define DS_SYSMODAL (0x2L) - -/* A dialog control. */ - -struct dialog_control -{ - /* Next control. */ - struct dialog_control *next; - /* ID. */ - unsigned short id; - /* Style. */ - unsigned long style; - /* Extended style. */ - unsigned long exstyle; - /* X coordinate. */ - unsigned short x; - /* Y coordinate. */ - unsigned short y; - /* Width. */ - unsigned short width; - /* Height. */ - unsigned short height; - /* Class name. */ - struct res_id class; - /* Associated text. */ - struct res_id text; - /* Extra data for the window procedure. */ - struct rcdata_item *data; - /* Help ID. Only used in an extended dialog. */ - unsigned long help; -}; - -/* Control classes. These can be used as the ID field in a struct - dialog_control. */ - -#define CTL_BUTTON 0x80 -#define CTL_EDIT 0x81 -#define CTL_STATIC 0x82 -#define CTL_LISTBOX 0x83 -#define CTL_SCROLLBAR 0x84 -#define CTL_COMBOBOX 0x85 - -/* A fontdir resource is a list of fontdir structures. */ - -struct fontdir -{ - struct fontdir *next; - /* Index of font entry. */ - short index; - /* Length of font information. */ - unsigned long length; - /* Font information. */ - const unsigned char *data; -}; - -/* A group_icon resource is a list of group_icon structures. */ - -struct group_icon -{ - /* Next icon in group. */ - struct group_icon *next; - /* Width. */ - unsigned char width; - /* Height. */ - unsigned char height; - /* Color count. */ - unsigned char colors; - /* Planes. */ - unsigned short planes; - /* Bits per pixel. */ - unsigned short bits; - /* Number of bytes in cursor resource. */ - unsigned long bytes; - /* Index of cursor resource. */ - unsigned short index; -}; - -/* A menu resource. */ - -struct menu -{ - /* List of menuitems. */ - struct menuitem *items; - /* Help ID. I don't think there is any way to set this in an rc - file, but it can appear in the binary format. */ - unsigned long help; -}; - -/* A menu resource is a list of menuitem structures. */ - -struct menuitem -{ - /* Next menuitem. */ - struct menuitem *next; - /* Type. In a normal menu, rather than a menuex, this is the flags - field. */ - unsigned long type; - /* State. This is only used in a menuex. */ - unsigned long state; - /* Id. */ - unsigned short id; - /* Unicode text. */ - unichar *text; - /* Popup menu items for a popup. */ - struct menuitem *popup; - /* Help ID. This is only used in a menuex. */ - unsigned long help; -}; - -/* Menu item flags. These can appear in the flags field of a struct - menuitem. */ - -#define MENUITEM_GRAYED 0x001 -#define MENUITEM_INACTIVE 0x002 -#define MENUITEM_BITMAP 0x004 -#define MENUITEM_OWNERDRAW 0x100 -#define MENUITEM_CHECKED 0x008 -#define MENUITEM_POPUP 0x010 -#define MENUITEM_MENUBARBREAK 0x020 -#define MENUITEM_MENUBREAK 0x040 -#define MENUITEM_ENDMENU 0x080 -#define MENUITEM_HELP 0x4000 - -/* An rcdata resource is a pointer to a list of rcdata_item - structures. */ - -struct rcdata_item -{ - /* Next data item. */ - struct rcdata_item *next; - /* Type of data. */ - enum - { - RCDATA_WORD, - RCDATA_DWORD, - RCDATA_STRING, - RCDATA_WSTRING, - RCDATA_BUFFER - } type; - union - { - unsigned int word; - unsigned long dword; - struct - { - unsigned long length; - const char *s; - } string; - struct - { - unsigned long length; - const unichar *w; - } wstring; - struct - { - unsigned long length; - const unsigned char *data; - } buffer; - } u; -}; - -/* A stringtable resource is a pointer to a stringtable structure. */ - -struct stringtable -{ - /* Each stringtable resource is a list of 16 unicode strings. */ - struct - { - /* Length of string. */ - int length; - /* String data if length > 0. */ - unichar *string; - } strings[16]; -}; - -/* A versioninfo resource points to a versioninfo structure. */ - -struct versioninfo -{ - /* Fixed version information. */ - struct fixed_versioninfo *fixed; - /* Variable version information. */ - struct ver_info *var; -}; - -/* The fixed portion of a versioninfo resource. */ - -struct fixed_versioninfo -{ - /* The file version, which is two 32 bit integers. */ - unsigned long file_version_ms; - unsigned long file_version_ls; - /* The product version, which is two 32 bit integers. */ - unsigned long product_version_ms; - unsigned long product_version_ls; - /* The file flags mask. */ - unsigned long file_flags_mask; - /* The file flags. */ - unsigned long file_flags; - /* The OS type. */ - unsigned long file_os; - /* The file type. */ - unsigned long file_type; - /* The file subtype. */ - unsigned long file_subtype; - /* The date, which in Windows is two 32 bit integers. */ - unsigned long file_date_ms; - unsigned long file_date_ls; -}; - -/* A list of variable version information. */ - -struct ver_info -{ - /* Next item. */ - struct ver_info *next; - /* Type of data. */ - enum { VERINFO_STRING, VERINFO_VAR } type; - union - { - /* StringFileInfo data. */ - struct - { - /* Language. */ - unichar *language; - /* Strings. */ - struct ver_stringinfo *strings; - } string; - /* VarFileInfo data. */ - struct - { - /* Key. */ - unichar *key; - /* Values. */ - struct ver_varinfo *var; - } var; - } u; -}; - -/* A list of string version information. */ - -struct ver_stringinfo -{ - /* Next string. */ - struct ver_stringinfo *next; - /* Key. */ - unichar *key; - /* Value. */ - unichar *value; -}; - -/* A list of variable version information. */ - -struct ver_varinfo -{ - /* Next item. */ - struct ver_varinfo *next; - /* Language ID. */ - unsigned short language; - /* Character set ID. */ - unsigned short charset; -}; - -/* This structure is used when converting resource information to - binary. */ - -struct bindata -{ - /* Next data. */ - struct bindata *next; - /* Length of data. */ - unsigned long length; - /* Data. */ - unsigned char *data; -}; +#include "windint.h" extern int verbose; /* Function declarations. */ -extern struct res_directory *read_rc_file - (const char *, const char *, const char *, int, int); -extern struct res_directory *read_res_file (const char *); -extern struct res_directory *read_coff_rsrc (const char *, const char *); -extern void write_rc_file (const char *, const struct res_directory *); -extern void write_res_file (const char *, const struct res_directory *); -extern void write_coff_file - (const char *, const char *, const struct res_directory *); +extern rc_res_directory *read_rc_file (const char *, const char *, const char *, int, int); +extern rc_res_directory *read_res_file (const char *); +extern rc_res_directory *read_coff_rsrc (const char *, const char *); +extern void write_rc_file (const char *, const rc_res_directory *); +extern void write_res_file (const char *, const rc_res_directory *); +extern void write_coff_file (const char *, const char *, const rc_res_directory *); -extern struct res_resource *bin_to_res - (struct res_id, const unsigned char *, unsigned long, int); -extern struct bindata *res_to_bin (const struct res_resource *, int); +extern rc_res_resource *bin_to_res (windres_bfd *, rc_res_id, const bfd_byte *, + rc_uint_type); +extern rc_uint_type res_to_bin (windres_bfd *, rc_uint_type, const rc_res_resource *); -extern FILE *open_file_search - (const char *, const char *, const char *, char **); +extern FILE *open_file_search (const char *, const char *, const char *, char **); -extern void *res_alloc (size_t); -extern void *reswr_alloc (size_t); +extern void *res_alloc (rc_uint_type); +extern void *reswr_alloc (rc_uint_type); /* Resource ID handling. */ -extern int res_id_cmp (struct res_id, struct res_id); -extern void res_id_print (FILE *, struct res_id, int); -extern void res_ids_print (FILE *, int, const struct res_id *); -extern void res_string_to_id (struct res_id *, const char *); +extern int res_id_cmp (rc_res_id, rc_res_id); +extern void res_id_print (FILE *, rc_res_id, int); +extern void res_ids_print (FILE *, int, const rc_res_id *); +extern void res_string_to_id (rc_res_id *, const char *); +extern void res_unistring_to_id (rc_res_id *, const unichar *); /* Manipulation of the resource tree. */ -extern struct res_resource *define_resource - (struct res_directory **, int, const struct res_id *, int); -extern struct res_resource *define_standard_resource - (struct res_directory **, int, struct res_id, int, int); +extern rc_res_resource *define_resource (rc_res_directory **, int, const rc_res_id *, + int); +extern rc_res_resource *define_standard_resource (rc_res_directory **, int, rc_res_id, + rc_uint_type, int); -extern int extended_dialog (const struct dialog *); -extern int extended_menu (const struct menu *); +extern int extended_dialog (const rc_dialog *); +extern int extended_menu (const rc_menu *); /* Communication between the rc file support and the parser and lexer. */ extern int yydebug; -extern FILE *yyin; extern char *rc_filename; extern int rc_lineno; @@ -803,52 +82,40 @@ extern void rcparse_discard_strings (void); extern void rcparse_rcdata (void); extern void rcparse_normal (void); -extern void define_accelerator - (struct res_id, const struct res_res_info *, struct accelerator *); -extern void define_bitmap - (struct res_id, const struct res_res_info *, const char *); -extern void define_cursor - (struct res_id, const struct res_res_info *, const char *); -extern void define_dialog - (struct res_id, const struct res_res_info *, const struct dialog *); -extern struct dialog_control *define_control - (const struct res_id, unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); -extern struct dialog_control *define_icon_control - (struct res_id, unsigned long, unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, struct rcdata_item *, struct dialog_ex *); -extern void define_font - (struct res_id, const struct res_res_info *, const char *); -extern void define_icon - (struct res_id, const struct res_res_info *, const char *); -extern void define_menu - (struct res_id, const struct res_res_info *, struct menuitem *); -extern struct menuitem *define_menuitem - (const char *, int, unsigned long, unsigned long, unsigned long, - struct menuitem *); -extern void define_messagetable - (struct res_id, const struct res_res_info *, const char *); -extern void define_rcdata - (struct res_id, const struct res_res_info *, struct rcdata_item *); -extern void define_rcdata_file - (struct res_id, const struct res_res_info *, const char *); -extern struct rcdata_item *define_rcdata_string - (const char *, unsigned long); -extern struct rcdata_item *define_rcdata_number (unsigned long, int); -extern void define_stringtable - (const struct res_res_info *, unsigned long, const char *); -extern void define_user_data - (struct res_id, struct res_id, const struct res_res_info *, - struct rcdata_item *); -extern void define_user_file - (struct res_id, struct res_id, const struct res_res_info *, const char *); -extern void define_versioninfo - (struct res_id, int, struct fixed_versioninfo *, struct ver_info *); -extern struct ver_info *append_ver_stringfileinfo - (struct ver_info *, const char *, struct ver_stringinfo *); -extern struct ver_info *append_ver_varfileinfo - (struct ver_info *, const char *, struct ver_varinfo *); -extern struct ver_stringinfo *append_verval - (struct ver_stringinfo *, const char *, const char *); -extern struct ver_varinfo *append_vertrans - (struct ver_varinfo *, unsigned long, unsigned long); +extern void define_accelerator (rc_res_id, const rc_res_res_info *, rc_accelerator *); +extern void define_bitmap (rc_res_id, const rc_res_res_info *, const char *); +extern void define_cursor (rc_res_id, const rc_res_res_info *, const char *); +extern void define_dialog (rc_res_id, const rc_res_res_info *, const rc_dialog *); +extern rc_dialog_control *define_control (const rc_res_id, rc_uint_type, rc_uint_type, + rc_uint_type, rc_uint_type, rc_uint_type, + const rc_res_id, rc_uint_type, rc_uint_type); +extern rc_dialog_control *define_icon_control (rc_res_id, rc_uint_type, rc_uint_type, + rc_uint_type, rc_uint_type, rc_uint_type, + rc_uint_type, rc_rcdata_item *, + rc_dialog_ex *); +extern void define_font (rc_res_id, const rc_res_res_info *, const char *); +extern void define_icon (rc_res_id, const rc_res_res_info *, const char *); +extern void define_menu (rc_res_id, const rc_res_res_info *, rc_menuitem *); +extern rc_menuitem *define_menuitem (const unichar *, rc_uint_type, rc_uint_type, + rc_uint_type, rc_uint_type, rc_menuitem *); +extern void define_messagetable (rc_res_id, const rc_res_res_info *, const char *); +extern void define_rcdata (rc_res_id, const rc_res_res_info *, rc_rcdata_item *); +extern void define_rcdata_file (rc_res_id, const rc_res_res_info *, const char *); +extern rc_rcdata_item *define_rcdata_string (const char *, rc_uint_type); +extern rc_rcdata_item *define_rcdata_unistring (const unichar *, rc_uint_type); +extern rc_rcdata_item *define_rcdata_number (rc_uint_type, int); +extern void define_stringtable (const rc_res_res_info *, rc_uint_type, const unichar *); +extern void define_user_data (rc_res_id, rc_res_id, const rc_res_res_info *, rc_rcdata_item *); +extern void define_toolbar (rc_res_id, rc_res_res_info *, rc_uint_type ,rc_uint_type ,rc_toolbar_item *); +extern void define_user_file (rc_res_id, rc_res_id, const rc_res_res_info *, const char *); +extern void define_versioninfo (rc_res_id, rc_uint_type, rc_fixed_versioninfo *, rc_ver_info *); +extern rc_ver_info *append_ver_stringfileinfo (rc_ver_info *, const char *, rc_ver_stringinfo *); +extern rc_ver_info *append_ver_varfileinfo (rc_ver_info *, const unichar *, rc_ver_varinfo *); +extern rc_ver_stringinfo *append_verval (rc_ver_stringinfo *, const unichar *, const unichar *); +extern rc_ver_varinfo *append_vertrans (rc_ver_varinfo *, rc_uint_type, rc_uint_type); + +extern bfd *windres_open_as_binary (const char *, int); + +extern int wr_printcomment (FILE *, const char *, ...); +extern int wr_print (FILE *, const char *, ...); +#define wr_print_flush(FP) wr_print ((FP),NULL) diff --git a/binutils/winduni.c b/binutils/winduni.c index b172b5e2196a..f1bd58acf3b7 100644 --- a/binutils/winduni.c +++ b/binutils/winduni.c @@ -1,6 +1,8 @@ /* winduni.c -- unicode support for the windres program. - Copyright 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright 1997, 1998, 2000, 2001, 2003, 2007 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -27,48 +29,178 @@ hosts, but that seems better than not really supporting unicode at all. */ +#include "sysdep.h" #include "bfd.h" +#include "libiberty.h" /* for xstrdup */ #include "bucomm.h" +/* Must be include before windows.h and winnls.h. */ +#if defined (_WIN32) || defined (__CYGWIN__) +#include <windows.h> +#include <winnls.h> +#endif #include "winduni.h" #include "safe-ctype.h" -#ifdef _WIN32 -#include <windows.h> +#if HAVE_ICONV_H +#include <iconv.h> #endif +static rc_uint_type wind_WideCharToMultiByte (rc_uint_type, const unichar *, char *, rc_uint_type); +static rc_uint_type wind_MultiByteToWideChar (rc_uint_type, const char *, unichar *, rc_uint_type); +static int unichar_isascii (const unichar *, rc_uint_type); + /* Convert an ASCII string to a unicode string. We just copy it, expanding chars to shorts, rather than doing something intelligent. */ + +#if !defined (_WIN32) && !defined (__CYGWIN__) -void -unicode_from_ascii (int *length, unichar **unicode, const char *ascii) +/* Codepages mapped. */ +static local_iconv_map codepages[] = { - int len; -#ifndef _WIN32 - const char *s; - unsigned short *w; - - len = strlen (ascii); - *unicode = ((unichar *) res_alloc ((len + 1) * sizeof (unichar))); - for (s = ascii, w = *unicode; *s != '\0'; s++, w++) - *w = *s & 0xff; - *w = 0; -#else - /* We use MultiByteToWideChar rather than strlen to get the unicode - string length to allow multibyte "ascii" chars. The value returned - by this function includes the trailing '\0'. */ - len = MultiByteToWideChar (CP_ACP, 0, ascii, -1, NULL, 0); - if (len) - { - *unicode = ((unichar *) res_alloc (len * sizeof (unichar))); - MultiByteToWideChar (CP_ACP, 0, ascii, -1, *unicode, len); - } - /* Discount the trailing '/0'. If MultiByteToWideChar failed, - this will set *length to -1. */ - len--; + { 0, "MS-ANSI" }, + { 1, "WINDOWS-1252" }, + { 437, "MS-ANSI" }, + { 737, "MS-GREEK" }, + { 775, "WINBALTRIM" }, + { 850, "MS-ANSI" }, + { 852, "MS-EE" }, + { 857, "MS-TURK" }, + { 862, "CP862" }, + { 864, "CP864" }, + { 866, "MS-CYRL" }, + { 874, "WINDOWS-874" }, + { 932, "CP932" }, + { 936, "CP936" }, + { 949, "CP949" }, + { 950, "CP950" }, + { 1250, "WINDOWS-1250" }, + { 1251, "WINDOWS-1251" }, + { 1252, "WINDOWS-1252" }, + { 1253, "WINDOWS-1253" }, + { 1254, "WINDOWS-1254" }, + { 1255, "WINDOWS-1255" }, + { 1256, "WINDOWS-1256" }, + { 1257, "WINDOWS-1257" }, + { 1258, "WINDOWS-1258" }, + { CP_UTF7, "UTF-7" }, + { CP_UTF8, "UTF-8" }, + { CP_UTF16, "UTF-16" }, + { (rc_uint_type) -1, NULL } +}; + +/* Languages supported. */ +static const wind_language_t languages[] = +{ + { 0x0000, 437, 1252, "Neutral", "Neutral" }, + { 0x0401, 864, 1256, "Arabic", "Saudi Arabia" }, { 0x0402, 866, 1251, "Bulgarian", "Bulgaria" }, + { 0x0403, 850, 1252, "Catalan", "Spain" }, { 0x0404, 950, 950, "Chinese", "Taiwan" }, + { 0x0405, 852, 1250, "Czech", "Czech Republic" }, { 0x0406, 850, 1252, "Danish", "Denmark" }, + { 0x0407, 850, 1252, "German", "Germany" }, { 0x0408, 737, 1253, "Greek", "Greece" }, + { 0x0409, 437, 1252, "English", "United States" }, { 0x040A, 850, 1252, "Spanish - Traditional Sort", "Spain" }, + { 0x040B, 850, 1252, "Finnish", "Finland" }, { 0x040C, 850, 1252, "French", "France" }, + { 0x040D, 862, 1255, "Hebrew", "Israel" }, { 0x040E, 852, 1250, "Hungarian", "Hungary" }, + { 0x040F, 850, 1252, "Icelandic", "Iceland" }, { 0x0410, 850, 1252, "Italian", "Italy" }, + { 0x0411, 932, 932, "Japanese", "Japan" }, { 0x0412, 949, 949, "Korean", "Korea (south)" }, + { 0x0413, 850, 1252, "Dutch", "Netherlands" }, { 0x0414, 850, 1252, "Norwegian (Bokmål)", "Norway" }, + { 0x0415, 852, 1250, "Polish", "Poland" }, { 0x0416, 850, 1252, "Portuguese", "Brazil" }, + { 0x0418, 852, 1250, "Romanian", "Romania" }, { 0x0419, 866, 1251, "Russian", "Russia" }, + { 0x041A, 852, 1250, "Croatian", "Croatia" }, { 0x041B, 852, 1250, "Slovak", "Slovakia" }, + { 0x041C, 852, 1250, "Albanian", "Albania" }, { 0x041D, 850, 1252, "Swedish", "Sweden" }, + { 0x041E, 874, 874, "Thai", "Thailand" }, { 0x041F, 857, 1254, "Turkish", "Turkey" }, + { 0x0421, 850, 1252, "Indonesian", "Indonesia" }, { 0x0422, 866, 1251, "Ukrainian", "Ukraine" }, + { 0x0423, 866, 1251, "Belarusian", "Belarus" }, { 0x0424, 852, 1250, "Slovene", "Slovenia" }, + { 0x0425, 775, 1257, "Estonian", "Estonia" }, { 0x0426, 775, 1257, "Latvian", "Latvia" }, + { 0x0427, 775, 1257, "Lithuanian", "Lithuania" }, + { 0x0429, 864, 1256, "Arabic", "Farsi" }, { 0x042A,1258, 1258, "Vietnamese", "Vietnam" }, + { 0x042D, 850, 1252, "Basque", "Spain" }, + { 0x042F, 866, 1251, "Macedonian", "Former Yugoslav Republic of Macedonia" }, + { 0x0436, 850, 1252, "Afrikaans", "South Africa" }, + { 0x0438, 850, 1252, "Faroese", "Faroe Islands" }, + { 0x043C, 437, 1252, "Irish", "Ireland" }, + { 0x043E, 850, 1252, "Malay", "Malaysia" }, + { 0x0801, 864, 1256, "Arabic", "Iraq" }, + { 0x0804, 936, 936, "Chinese (People's republic of China)", "People's republic of China" }, + { 0x0807, 850, 1252, "German", "Switzerland" }, + { 0x0809, 850, 1252, "English", "United Kingdom" }, { 0x080A, 850, 1252, "Spanish", "Mexico" }, + { 0x080C, 850, 1252, "French", "Belgium" }, + { 0x0810, 850, 1252, "Italian", "Switzerland" }, + { 0x0813, 850, 1252, "Dutch", "Belgium" }, { 0x0814, 850, 1252, "Norwegian (Nynorsk)", "Norway" }, + { 0x0816, 850, 1252, "Portuguese", "Portugal" }, + { 0x081A, 852, 1252, "Serbian (latin)", "Yugoslavia" }, + { 0x081D, 850, 1252, "Swedish (Finland)", "Finland" }, + { 0x0C01, 864, 1256, "Arabic", "Egypt" }, + { 0x0C04, 950, 950, "Chinese", "Hong Kong" }, + { 0x0C07, 850, 1252, "German", "Austria" }, + { 0x0C09, 850, 1252, "English", "Australia" }, { 0x0C0A, 850, 1252, "Spanish - International Sort", "Spain" }, + { 0x0C0C, 850, 1252, "French", "Canada"}, + { 0x0C1A, 855, 1251, "Serbian (Cyrillic)", "Serbia" }, + { 0x1001, 864, 1256, "Arabic", "Libya" }, + { 0x1004, 936, 936, "Chinese", "Singapore" }, + { 0x1007, 850, 1252, "German", "Luxembourg" }, + { 0x1009, 850, 1252, "English", "Canada" }, + { 0x100A, 850, 1252, "Spanish", "Guatemala" }, + { 0x100C, 850, 1252, "French", "Switzerland" }, + { 0x1401, 864, 1256, "Arabic", "Algeria" }, + { 0x1407, 850, 1252, "German", "Liechtenstein" }, + { 0x1409, 850, 1252, "English", "New Zealand" }, { 0x140A, 850, 1252, "Spanish", "Costa Rica" }, + { 0x140C, 850, 1252, "French", "Luxembourg" }, + { 0x1801, 864, 1256, "Arabic", "Morocco" }, + { 0x1809, 850, 1252, "English", "Ireland" }, { 0x180A, 850, 1252, "Spanish", "Panama" }, + { 0x180C, 850, 1252, "French", "Monaco" }, + { 0x1C01, 864, 1256, "Arabic", "Tunisia" }, + { 0x1C09, 437, 1252, "English", "South Africa" }, { 0x1C0A, 850, 1252, "Spanish", "Dominican Republic" }, + { 0x2001, 864, 1256, "Arabic", "Oman" }, + { 0x2009, 850, 1252, "English", "Jamaica" }, { 0x200A, 850, 1252, "Spanish", "Venezuela" }, + { 0x2401, 864, 1256, "Arabic", "Yemen" }, + { 0x2409, 850, 1252, "English", "Caribbean" }, { 0x240A, 850, 1252, "Spanish", "Colombia" }, + { 0x2801, 864, 1256, "Arabic", "Syria" }, + { 0x2809, 850, 1252, "English", "Belize" }, { 0x280A, 850, 1252, "Spanish", "Peru" }, + { 0x2C01, 864, 1256, "Arabic", "Jordan" }, + { 0x2C09, 437, 1252, "English", "Trinidad & Tobago" },{ 0x2C0A, 850, 1252, "Spanish", "Argentina" }, + { 0x3001, 864, 1256, "Arabic", "Lebanon" }, + { 0x3009, 437, 1252, "English", "Zimbabwe" }, { 0x300A, 850, 1252, "Spanish", "Ecuador" }, + { 0x3401, 864, 1256, "Arabic", "Kuwait" }, + { 0x3409, 437, 1252, "English", "Philippines" }, { 0x340A, 850, 1252, "Spanish", "Chile" }, + { 0x3801, 864, 1256, "Arabic", "United Arab Emirates" }, + { 0x380A, 850, 1252, "Spanish", "Uruguay" }, + { 0x3C01, 864, 1256, "Arabic", "Bahrain" }, + { 0x3C0A, 850, 1252, "Spanish", "Paraguay" }, + { 0x4001, 864, 1256, "Arabic", "Qatar" }, + { 0x400A, 850, 1252, "Spanish", "Bolivia" }, + { 0x440A, 850, 1252, "Spanish", "El Salvador" }, + { 0x480A, 850, 1252, "Spanish", "Honduras" }, + { 0x4C0A, 850, 1252, "Spanish", "Nicaragua" }, + { 0x500A, 850, 1252, "Spanish", "Puerto Rico" }, + { (unsigned) -1, 0, 0, NULL, NULL } +}; + #endif - if (length != NULL) - *length = len; +/* Specifies the default codepage to be used for unicode + transformations. By default this is CP_ACP. */ +rc_uint_type wind_default_codepage = CP_ACP; + +/* Specifies the currently used codepage for unicode + transformations. By default this is CP_ACP. */ +rc_uint_type wind_current_codepage = CP_ACP; + +/* Convert an ASCII string to a unicode string. We just copy it, + expanding chars to shorts, rather than doing something intelligent. */ + +void +unicode_from_ascii (rc_uint_type *length, unichar **unicode, const char *ascii) +{ + unicode_from_codepage (length, unicode, ascii, wind_current_codepage); +} + +/* Convert an unicode string to an ASCII string. We just copy it, + shrink shorts to chars, rather than doing something intelligent. + Shorts with not within the char range are replaced by '_'. */ + +void +ascii_from_unicode (rc_uint_type *length, const unichar *unicode, char **ascii) +{ + codepage_from_unicode (length, unicode, ascii, wind_current_codepage); } /* Print the unicode string UNICODE to the file E. LENGTH is the @@ -77,7 +209,7 @@ unicode_from_ascii (int *length, unichar **unicode, const char *ascii) some Windows function, probably WideCharToMultiByte. */ void -unicode_print (FILE *e, const unichar *unicode, int length) +unicode_print (FILE *e, const unichar *unicode, rc_uint_type length) { while (1) { @@ -85,12 +217,12 @@ unicode_print (FILE *e, const unichar *unicode, int length) if (length == 0) return; - if (length > 0) + if ((bfd_signed_vma) length > 0) --length; ch = *unicode; - if (ch == 0 && length < 0) + if (ch == 0 && (bfd_signed_vma) length < 0) return; ++unicode; @@ -98,7 +230,9 @@ unicode_print (FILE *e, const unichar *unicode, int length) if ((ch & 0x7f) == ch) { if (ch == '\\') - fputs ("\\", e); + fputs ("\\\\", e); + else if (ch == '"') + fputs ("\"\"", e); else if (ISPRINT (ch)) putc (ch, e); else @@ -142,6 +276,534 @@ unicode_print (FILE *e, const unichar *unicode, int length) else if ((ch & 0xff) == ch) fprintf (e, "\\%03o", (unsigned int) ch); else - fprintf (e, "\\x%x", (unsigned int) ch); + fprintf (e, "\\x%04x", (unsigned int) ch); + } +} + +/* Print a unicode string to a file. */ + +void +ascii_print (FILE *e, const char *s, rc_uint_type length) +{ + while (1) + { + char ch; + + if (length == 0) + return; + if ((bfd_signed_vma) length > 0) + --length; + + ch = *s; + + if (ch == 0 && (bfd_signed_vma) length < 0) + return; + + ++s; + + if ((ch & 0x7f) == ch) + { + if (ch == '\\') + fputs ("\\\\", e); + else if (ch == '"') + fputs ("\"\"", e); + else if (ISPRINT (ch)) + putc (ch, e); + else + { + switch (ch) + { + case ESCAPE_A: + fputs ("\\a", e); + break; + + case ESCAPE_B: + fputs ("\\b", e); + break; + + case ESCAPE_F: + fputs ("\\f", e); + break; + + case ESCAPE_N: + fputs ("\\n", e); + break; + + case ESCAPE_R: + fputs ("\\r", e); + break; + + case ESCAPE_T: + fputs ("\\t", e); + break; + + case ESCAPE_V: + fputs ("\\v", e); + break; + + default: + fprintf (e, "\\%03o", (unsigned int) ch); + break; + } + } + } + else + fprintf (e, "\\%03o", (unsigned int) ch & 0xff); + } +} + +rc_uint_type +unichar_len (const unichar *unicode) +{ + rc_uint_type r = 0; + + if (unicode) + while (unicode[r] != 0) + r++; + else + --r; + return r; +} + +unichar * +unichar_dup (const unichar *unicode) +{ + unichar *r; + int len; + + if (! unicode) + return NULL; + for (len = 0; unicode[len] != 0; ++len) + ; + ++len; + r = ((unichar *) res_alloc (len * sizeof (unichar))); + memcpy (r, unicode, len * sizeof (unichar)); + return r; +} + +unichar * +unichar_dup_uppercase (const unichar *u) +{ + unichar *r = unichar_dup (u); + int i; + + if (! r) + return NULL; + + for (i = 0; r[i] != 0; ++i) + { + if (r[i] >= 'a' && r[i] <= 'z') + r[i] &= 0xdf; + } + return r; +} + +static int +unichar_isascii (const unichar *u, rc_uint_type len) +{ + rc_uint_type i; + + if ((bfd_signed_vma) len < 0) + { + if (u) + len = (rc_uint_type) unichar_len (u); + else + len = 0; } + + for (i = 0; i < len; i++) + if ((u[i] & 0xff80) != 0) + return 0; + return 1; +} + +void +unicode_print_quoted (FILE *e, const unichar *u, rc_uint_type len) +{ + if (! unichar_isascii (u, len)) + fputc ('L', e); + fputc ('"', e); + unicode_print (e, u, len); + fputc ('"', e); +} + +int +unicode_is_valid_codepage (rc_uint_type cp) +{ + if ((cp & 0xffff) != cp) + return 0; + if (cp == CP_UTF16 || cp == CP_ACP) + return 1; + +#if !defined (_WIN32) && !defined (__CYGWIN__) + if (! wind_find_codepage_info (cp)) + return 0; + return 1; +#else + return !! IsValidCodePage ((UINT) cp); +#endif +} + +#if defined (_WIN32) || defined (__CYGWIN__) + +#define max_cp_string_len 6 + +static unsigned int +codepage_from_langid (unsigned short langid) +{ + char cp_string [max_cp_string_len]; + int c; + + memset (cp_string, 0, max_cp_string_len); + /* LOCALE_RETURN_NUMBER flag would avoid strtoul conversion, + but is unavailable on Win95. */ + c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), + LOCALE_IDEFAULTANSICODEPAGE, + cp_string, max_cp_string_len); + /* If codepage data for an LCID is not installed on users's system, + GetLocaleInfo returns an empty string. Fall back to system ANSI + default. */ + if (c == 0) + return CP_ACP; + return strtoul (cp_string, 0, 10); +} + +static unsigned int +wincodepage_from_langid (unsigned short langid) +{ + char cp_string [max_cp_string_len]; + int c; + + memset (cp_string, 0, max_cp_string_len); + /* LOCALE_RETURN_NUMBER flag would avoid strtoul conversion, + but is unavailable on Win95. */ + c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), + LOCALE_IDEFAULTCODEPAGE, + cp_string, max_cp_string_len); + /* If codepage data for an LCID is not installed on users's system, + GetLocaleInfo returns an empty string. Fall back to system ANSI + default. */ + if (c == 0) + return CP_OEM; + return strtoul (cp_string, 0, 10); +} + +static char * +lang_from_langid (unsigned short langid) +{ + char cp_string[261]; + int c; + + memset (cp_string, 0, 261); + c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), + LOCALE_SENGLANGUAGE, + cp_string, 260); + /* If codepage data for an LCID is not installed on users's system, + GetLocaleInfo returns an empty string. Fall back to system ANSI + default. */ + if (c == 0) + strcpy (cp_string, "Neutral"); + return xstrdup (cp_string); +} + +static char * +country_from_langid (unsigned short langid) +{ + char cp_string[261]; + int c; + + memset (cp_string, 0, 261); + c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), + LOCALE_SENGCOUNTRY, + cp_string, 260); + /* If codepage data for an LCID is not installed on users's system, + GetLocaleInfo returns an empty string. Fall back to system ANSI + default. */ + if (c == 0) + strcpy (cp_string, "Neutral"); + return xstrdup (cp_string); +} + +#endif + +const wind_language_t * +wind_find_language_by_id (unsigned id) +{ +#if !defined (_WIN32) && !defined (__CYGWIN__) + int i; + + if (! id) + return NULL; + for (i = 0; languages[i].id != (unsigned) -1 && languages[i].id != id; i++) + ; + if (languages[i].id == id) + return &languages[i]; + return NULL; +#else + static wind_language_t wl; + + wl.id = id; + wl.doscp = codepage_from_langid ((unsigned short) id); + wl.wincp = wincodepage_from_langid ((unsigned short) id); + wl.name = lang_from_langid ((unsigned short) id); + wl.country = country_from_langid ((unsigned short) id); + + return & wl; +#endif +} + +const local_iconv_map * +wind_find_codepage_info (unsigned cp) +{ +#if !defined (_WIN32) && !defined (__CYGWIN__) + int i; + + for (i = 0; codepages[i].codepage != (rc_uint_type) -1 && codepages[i].codepage != cp; i++) + ; + if (codepages[i].codepage == (rc_uint_type) -1) + return NULL; + return &codepages[i]; +#else + static local_iconv_map lim; + if (!unicode_is_valid_codepage (cp)) + return NULL; + lim.codepage = cp; + lim.iconv_name = ""; + return & lim; +#endif +} + +/* Convert an Codepage string to a unicode string. */ + +void +unicode_from_codepage (rc_uint_type *length, unichar **u, const char *src, rc_uint_type cp) +{ + rc_uint_type len; + + len = wind_MultiByteToWideChar (cp, src, NULL, 0); + if (len) + { + *u = ((unichar *) res_alloc (len)); + wind_MultiByteToWideChar (cp, src, *u, len); + } + /* Discount the trailing '/0'. If MultiByteToWideChar failed, + this will set *length to -1. */ + len -= sizeof (unichar); + + if (length != NULL) + *length = len / sizeof (unichar); +} + +/* Convert an unicode string to an codepage string. */ + +void +codepage_from_unicode (rc_uint_type *length, const unichar *unicode, char **ascii, rc_uint_type cp) +{ + rc_uint_type len; + + len = wind_WideCharToMultiByte (cp, unicode, NULL, 0); + if (len) + { + *ascii = (char *) res_alloc (len * sizeof (char)); + wind_WideCharToMultiByte (cp, unicode, *ascii, len); + } + /* Discount the trailing '/0'. If MultiByteToWideChar failed, + this will set *length to -1. */ + len--; + + if (length != NULL) + *length = len; +} + +#ifdef HAVE_ICONV_H +static int +iconv_onechar (iconv_t cd, const char *s, char *d, int d_len, const char **n_s, char **n_d) +{ + int i; + + for (i = 1; i <= 32; i++) + { + char *tmp_d = d; + const char *tmp_s = s; + size_t ret; + size_t s_left = (size_t) i; + size_t d_left = (size_t) d_len; + + ret = iconv (cd, & tmp_s, & s_left, & tmp_d, & d_left); + + if (ret != (size_t) -1) + { + *n_s = tmp_s; + *n_d = tmp_d; + return 0; + } + } + + return 1; +} + +static const char * +wind_iconv_cp (rc_uint_type cp) +{ + const local_iconv_map *lim = wind_find_codepage_info (cp); + + if (!lim) + return NULL; + return lim->iconv_name; +} +#endif /* HAVE_ICONV_H */ + +static rc_uint_type +wind_MultiByteToWideChar (rc_uint_type cp, const char *mb, + unichar *u, rc_uint_type u_len) +{ + rc_uint_type ret = 0; + +#if defined (_WIN32) || defined (__CYGWIN__) + ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED, + mb, -1, u, u_len); + /* Convert to bytes. */ + ret *= sizeof (unichar); + +#elif defined (HAVE_ICONV_H) + int first = 1; + char tmp[32]; + char *p_tmp; + const char *iconv_name = wind_iconv_cp (cp); + + if (!mb || !iconv_name) + return 0; + iconv_t cd = iconv_open ("UTF-16", iconv_name); + + while (1) + { + int iret; + const char *n_mb; + char *n_tmp; + + p_tmp = tmp; + iret = iconv_onechar (cd, (const char *) mb, p_tmp, 32, & n_mb, & n_tmp); + if (first) + { + first = 0; + continue; + } + if (!iret) + { + size_t l_tmp = (size_t) (n_tmp - p_tmp); + + if (u) + { + if ((size_t) u_len < l_tmp) + break; + memcpy (u, tmp, l_tmp); + u += l_tmp/2; + u_len -= l_tmp; + } + ret += l_tmp; + } + else + break; + if (tmp[0] == 0 && tmp[1] == 0) + break; + mb = n_mb; + } + iconv_close (cd); +#else + if (cp) + ret = 0; + ret = strlen (mb) + 1; + ret *= sizeof (unichar); + if (u != NULL && u_len != 0) + { + do + { + *u++ = ((unichar) *mb) & 0xff; + --u_len; mb++; + } + while (u_len != 0 && mb[-1] != 0); + } + if (u != NULL && u_len != 0) + *u = 0; +#endif + return ret; +} + +static rc_uint_type +wind_WideCharToMultiByte (rc_uint_type cp, const unichar *u, char *mb, rc_uint_type mb_len) +{ + rc_uint_type ret = 0; +#if defined (_WIN32) || defined (__CYGWIN__) + WINBOOL used_def = FALSE; + + ret = (rc_uint_type) WideCharToMultiByte (cp, 0, u, -1, mb, mb_len, + NULL, & used_def); +#elif defined (HAVE_ICONV_H) + int first = 1; + char tmp[32]; + char *p_tmp; + const char *iconv_name = wind_iconv_cp (cp); + + if (!u || !iconv_name) + return 0; + iconv_t cd = iconv_open (iconv_name, "UTF-16"); + + while (1) + { + int iret; + const char *n_u; + char *n_tmp; + + p_tmp = tmp; + iret = iconv_onechar (cd, (const char *) u, p_tmp, 32, &n_u, & n_tmp); + if (first) + { + first = 0; + continue; + } + if (!iret) + { + size_t l_tmp = (size_t) (n_tmp - p_tmp); + + if (mb) + { + if ((size_t) mb_len < l_tmp) + break; + memcpy (mb, tmp, l_tmp); + mb += l_tmp; + mb_len -= l_tmp; + } + ret += l_tmp; + } + else + break; + if (u[0] == 0) + break; + u = (const unichar *) n_u; + } + iconv_close (cd); +#else + if (cp) + ret = 0; + + while (u[ret] != 0) + ++ret; + + ++ret; + + if (mb) + { + while (*u != 0 && mb_len != 0) + { + if (u[0] == (u[0] & 0x7f)) + *mb++ = (char) u[0]; + else + *mb++ = '_'; + ++u; --mb_len; + } + if (mb_len != 0) + *mb = 0; + } +#endif + return ret; } diff --git a/binutils/winduni.h b/binutils/winduni.h index 71cd055a9daf..82c3022831a8 100644 --- a/binutils/winduni.h +++ b/binutils/winduni.h @@ -1,6 +1,8 @@ /* winduni.h -- header file for unicode support for windres program. - Copyright 1997, 1998, 2002 Free Software Foundation, Inc. + Copyright 1997, 1998, 2002, 2007 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -21,6 +23,9 @@ #include "ansidecl.h" +#ifndef WINDUNI_H +#define WINDUNI_H + /* This header file declares the types and functions we use for unicode support in windres. Our unicode support is very limited at present. @@ -30,31 +35,105 @@ that would conflict with the definitions of Windows macros we already have in windres.h. */ +/* Use bfd_size_type to ensure a sufficient number of bits. */ +#ifndef DEFINED_RC_UINT_TYPE +#define DEFINED_RC_UINT_TYPE +typedef bfd_size_type rc_uint_type; +#endif + /* We use this type to hold a unicode character. */ typedef unsigned short unichar; /* Escape character translations. */ -#define ESCAPE_A (007) -#define ESCAPE_B (010) -#define ESCAPE_F (014) -#define ESCAPE_N (012) -#define ESCAPE_R (015) -#define ESCAPE_T (011) -#define ESCAPE_V (013) +#define ESCAPE_A 007 +#define ESCAPE_B 010 +#define ESCAPE_F 014 +#define ESCAPE_N 012 +#define ESCAPE_R 015 +#define ESCAPE_T 011 +#define ESCAPE_V 013 /* Convert an ASCII string to a unicode string. */ +extern void unicode_from_ascii (rc_uint_type *, unichar **, const char *); + +/* Convert an unicode string to an ASCII string. */ +extern void ascii_from_unicode (rc_uint_type *, const unichar *, char **); + +/* Duplicate a unicode string by using res_alloc. */ +extern unichar *unichar_dup (const unichar *); + +/* Duplicate a unicode string by using res_alloc and make it uppercase. */ +extern unichar *unichar_dup_uppercase (const unichar *); -extern void unicode_from_ascii - PARAMS ((int *, unichar **, const char *)); +/* The count of unichar elements. */ +extern rc_uint_type unichar_len (const unichar *); /* Print a unicode string to a file. */ +extern void unicode_print (FILE *, const unichar *, rc_uint_type); + +/* Print a ascii string to a file. */ +extern void ascii_print (FILE *, const char *, rc_uint_type); + +/* Print a quoted unicode string to a file. */ +extern void unicode_print_quoted (FILE *, const unichar *, rc_uint_type); + +#ifndef CP_UTF8 +#define CP_UTF7 65000 /* UTF-7 translation. */ +#define CP_UTF8 65001 /* UTF-8 translation. */ +#endif + +#ifndef CP_UTF16 +#define CP_UTF16 65002 /* UTF-16 translation. */ +#endif + +#ifndef CP_ACP +#define CP_ACP 0 /* Default to ANSI code page. */ +#endif -extern void unicode_print PARAMS ((FILE *, const unichar *, int)); +#ifndef CP_OEM +#define CP_OEM 1 /* Default OEM code page. */ +#endif + +/* Specifies the default codepage to be used for unicode + transformations. By default this is CP_ACP. */ +extern rc_uint_type wind_default_codepage; + +/* Specifies the currently used codepage for unicode + transformations. By default this is CP_ACP. */ +extern rc_uint_type wind_current_codepage; + +typedef struct wind_language_t +{ + unsigned id; + unsigned doscp; + unsigned wincp; + const char *name; + const char *country; +} wind_language_t; + +extern const wind_language_t *wind_find_language_by_id (unsigned); +extern int unicode_is_valid_codepage (rc_uint_type); + +typedef struct local_iconv_map +{ + rc_uint_type codepage; + const char * iconv_name; +} local_iconv_map; + +extern const local_iconv_map *wind_find_codepage_info (unsigned); + +/* Convert an Codepage string to a unicode string. */ +extern void unicode_from_codepage (rc_uint_type *, unichar **, const char *, rc_uint_type); + +/* Convert an unicode string to an codepage string. */ +extern void codepage_from_unicode (rc_uint_type *, const unichar *, char **, rc_uint_type); /* Windres support routine called by unicode_from_ascii. This is both here and in windres.h. It should probably be in a separate header file, but it hardly seems worth it for one function. */ -extern PTR res_alloc PARAMS ((size_t)); +extern void * res_alloc (rc_uint_type); + +#endif diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c index 13f01dac725c..325047ea71e6 100644 --- a/binutils/wrstabs.c +++ b/binutils/wrstabs.c @@ -1,5 +1,5 @@ /* wrstabs.c -- Output stabs debugging information - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. @@ -23,13 +23,12 @@ /* This file contains code which writes out stabs debugging information. */ -#include <stdio.h> +#include "sysdep.h" #include <assert.h> - #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "safe-ctype.h" +#include "bucomm.h" #include "debug.h" #include "budbg.h" #include "aout/aout64.h" |